小程序优化
parent
296f427b28
commit
332e49782c
|
|
@ -78,6 +78,15 @@
|
|||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_app_is_limitedtimediscount.name}}<span class="am-form-group-label-tips">{{$data.common_app_is_limitedtimediscount.describe}}</span></label>
|
||||
<select name="{{$data.common_app_is_limitedtimediscount.only_tag}}" class="am-radius chosen-select c-p" data-validation-message="{{$data.common_app_is_limitedtimediscount.error_tips}}" required>
|
||||
{{foreach $common_is_text_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['common_app_is_limitedtimediscount']['value']) and $data['common_app_is_limitedtimediscount']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="nav_type" value="{{$nav_type}}" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
namespace app\api\controller;
|
||||
|
||||
use app\service\GoodsService;
|
||||
use app\service\GoodsCommentsService;
|
||||
|
||||
/**
|
||||
* 商品
|
||||
|
|
@ -97,6 +98,9 @@ class Goods extends Common
|
|||
$ret_favor = GoodsService::IsUserGoodsFavor(['goods_id'=>$goods_id, 'user'=>$this->user]);
|
||||
$ret['data'][0]['is_favor'] = ($ret_favor['code'] == 0) ? $ret_favor['data'] : 0;
|
||||
|
||||
// 商品评价总数
|
||||
$ret['data'][0]['comments_count'] = GoodsCommentsService::GoodsCommentsTotal(['goods_id'=>$goods_id, 'is_show'=>1]);
|
||||
|
||||
// 商品访问统计
|
||||
GoodsService::GoodsAccessCountInc(['goods_id'=>$goods_id]);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ class Index extends Common
|
|||
*/
|
||||
public function Index()
|
||||
{
|
||||
// 秒杀
|
||||
$common_app_is_limitedtimediscount = (int) MyC('common_app_is_limitedtimediscount');
|
||||
|
||||
// 返回数据
|
||||
$result = [
|
||||
'navigation' => AppHomeNavService::AppHomeNav(),
|
||||
'banner_list' => BannerService::Banner(),
|
||||
|
|
@ -54,14 +58,17 @@ class Index extends Common
|
|||
'common_app_is_enable_answer' => (int) MyC('common_app_is_enable_answer', 1),
|
||||
'common_app_is_header_nav_fixed' => (int) MyC('common_app_is_header_nav_fixed', 0),
|
||||
'common_app_is_online_service' => (int) MyC('common_app_is_online_service', 0),
|
||||
'common_app_is_limitedtimediscount' => $common_app_is_limitedtimediscount,
|
||||
];
|
||||
|
||||
// 秒杀
|
||||
$plugins_class = 'app\plugins\limitedtimediscount\service\Service';
|
||||
if(class_exists($plugins_class))
|
||||
if($common_app_is_limitedtimediscount == 1)
|
||||
{
|
||||
$ret = (new $plugins_class())->ApiHomeAd();
|
||||
$result['plugins_limitedtimediscount_data'] = $ret['data'];
|
||||
$ret = CallPluginsMethod('app\plugins\limitedtimediscount\service\Service', 'ApiHomeAd');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$result['plugins_limitedtimediscount_data'] = $ret['data'];
|
||||
}
|
||||
}
|
||||
|
||||
// 返回数据
|
||||
|
|
|
|||
|
|
@ -11,6 +11,24 @@
|
|||
|
||||
// 应用公共文件
|
||||
|
||||
/**
|
||||
* 调用插件方法 - 访问为静态
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-07-10T22:03:48+0800
|
||||
* @param [string] $plugins_class [类命名空间]
|
||||
* @param [string] $method [方法名称]
|
||||
*/
|
||||
function CallPluginsMethod($plugins_class, $method)
|
||||
{
|
||||
if(class_exists($plugins_class))
|
||||
{
|
||||
return $plugins_class::$method();
|
||||
}
|
||||
return DataReturn('类未定义', -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前是否小程序环境中
|
||||
* @author Devil
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ App({
|
|||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
request_url: 'http://tp5-dev.com/',
|
||||
request_url: 'http://test.shopxo.net/',
|
||||
//request_url: 'http://test.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
|
|
|
|||
|
|
@ -172,26 +172,52 @@
|
|||
right: 0;
|
||||
}
|
||||
.goods-base .goods-title {
|
||||
width: calc(100% - 100rpx);
|
||||
font-size: 32rpx;
|
||||
line-height: 44rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.goods-base .goods-share {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.goods-base .goods-share image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.goods-base .goods-share button {
|
||||
height: auto;
|
||||
font-size: 26rpx;
|
||||
border: 0;
|
||||
min-width: initial;
|
||||
height: auto;
|
||||
font-size: 26rpx;
|
||||
border: 0;
|
||||
min-width: initial;
|
||||
}
|
||||
.goods-base .goods-share view {
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.goods-base .goods-price {
|
||||
margin-top: 10rpx;
|
||||
padding-right: 160rpx;
|
||||
position: relative;
|
||||
max-height: 68rpx;
|
||||
margin-top: 10rpx;
|
||||
padding-right: 100rpx;
|
||||
position: relative;
|
||||
min-height: 80rpx;
|
||||
}
|
||||
.goods-base .goods-price .original-price {
|
||||
margin-top: 10rpx;
|
||||
margin-left: 0;
|
||||
}
|
||||
.goods-base .base-grid {
|
||||
margin-top: 15rpx;
|
||||
padding-top: 15rpx;
|
||||
border-top: 1px solid #f5f5f5;
|
||||
}
|
||||
.goods-base .base-grid view {
|
||||
width: calc(33.33% - 1px);
|
||||
}
|
||||
.goods-base .base-grid view:not(:last-child) {
|
||||
border-right: 1px solid #f5f5f5;
|
||||
}
|
||||
.goods-base .base-grid view .cr-main {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
.page {
|
||||
padding-bottom: 100rpx;
|
||||
|
|
|
|||
|
|
@ -17,21 +17,30 @@
|
|||
|
||||
<!-- 基础信息 -->
|
||||
<view class="goods-base bg-white">
|
||||
<view class="oh">
|
||||
<view class="goods-title fl multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
<view class="goods-share fr tc">
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
<view class="goods-price single-text">
|
||||
<view class="goods-share tc">
|
||||
<button type="default" size="mini" open-type="share" hover-class="none">
|
||||
<image src="/images/goods-detail-share-icon.png" mode="scaleToFill" class="dis-block" />
|
||||
<text class="dis-block cr-888">分享</text>
|
||||
<view class="cr-888">分享</view>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-price single-text">
|
||||
<text a:if="{{(show_field_price_text || null) != null}}" class="price-icon">{{show_field_price_text}}</text>
|
||||
<text class="sales-price">¥{{goods.price}}</text>
|
||||
<text a:if="{{(goods.original_price || null) != null}}" class="original-price">¥{{goods.original_price}}</text>
|
||||
<view class="cr-ccc sales">
|
||||
<text>销量 {{goods.sales_count}}</text>
|
||||
<view a:if="{{(goods.original_price || null) != null}}" class="original-price">¥{{goods.original_price}}</view>
|
||||
</view>
|
||||
<view class="base-grid oh">
|
||||
<view class="fl tc">
|
||||
<text class="cr-888">累计销量</text>
|
||||
<text class="cr-main">{{goods.sales_count}}</text>
|
||||
</view>
|
||||
<view class="fl tc">
|
||||
<text class="cr-888">浏览次数</text>
|
||||
<text class="cr-main">{{goods.access_count}}</text>
|
||||
</view>
|
||||
<view class="fl tc">
|
||||
<text class="cr-888">累计评论</text>
|
||||
<text class="cr-main">{{goods.comments_count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -99,4 +99,107 @@
|
|||
}
|
||||
.floor-list .goods-list .goods-base .sales-price {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 限时秒杀
|
||||
*/
|
||||
.limitedtimediscount {
|
||||
background: #fff;
|
||||
padding: 5rpx 10rpx 20rpx 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.limitedtimediscount .nav-title {
|
||||
overflow: hidden;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
.limitedtimediscount .nav-title .nav-icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
vertical-align: sub;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.limitedtimediscount .text-wrapper {
|
||||
color: #d2364c;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.limitedtimediscount .countdown {
|
||||
line-height: 50rpx;
|
||||
float: right;
|
||||
}
|
||||
.limitedtimediscount .countdown view {
|
||||
margin-right: 0;
|
||||
float: right;
|
||||
}
|
||||
.limitedtimediscount .countdown .timer-title {
|
||||
color: #666;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.limitedtimediscount .countdown .timer-hours {
|
||||
padding: 0 12rpx;
|
||||
-moz-border-radius: 8rpx;
|
||||
border-radius: 8rpx;
|
||||
background-color: #3A4145;
|
||||
color: #fff;
|
||||
min-width: 35rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.limitedtimediscount .countdown .ds {
|
||||
color: #4B5459;
|
||||
padding: 0 8rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.limitedtimediscount .goods-list {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .item {
|
||||
width: 460rpx;
|
||||
height: 605rpx;
|
||||
border: 1px solid #f5f5f5;
|
||||
background: white;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
.limitedtimediscount .goods-list .item:not(:last-child) {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.limitedtimediscount .goods-list .item image {
|
||||
width: 460rpx;
|
||||
height: 460rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .item .goods-base {
|
||||
padding: 0 10rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .goods-base .goods-title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .goods-base .goods-price {
|
||||
color: #f40;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .goods-base .goods-original-price {
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .goods-base button {
|
||||
background: #d2364c;
|
||||
border: 0;
|
||||
color: #fff;
|
||||
padding: 0 30rpx;
|
||||
line-height: 65rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 6rpx;
|
||||
position: absolute;
|
||||
right: 15rpx;
|
||||
bottom: 15rpx;
|
||||
}
|
||||
|
|
@ -12,16 +12,18 @@
|
|||
<view class="tips">{{common_shop_notice}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 组件 -->
|
||||
<view a:if="{{load_status == 1}}">
|
||||
<!-- 轮播 -->
|
||||
<component-slider data="{{banner_list}}" />
|
||||
<!-- 轮播 -->
|
||||
<component-slider data="{{banner_list}}" />
|
||||
|
||||
<!-- 导航 -->
|
||||
<component-icon-nav data="{{navigation}}" />
|
||||
<!-- 导航 -->
|
||||
<component-icon-nav data="{{navigation}}" />
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view a:if="{{common_app_is_limitedtimediscount == 1}}">
|
||||
<import src="/pages/lib/limitedtimediscount/content.axml" />
|
||||
<template is="limitedtimediscount" data="{{plugins_limitedtimediscount_data: plugins_limitedtimediscount_data, plugins_limitedtimediscount_is_show_time: plugins_limitedtimediscount_is_show_time, plugins_limitedtimediscount_timer_title: plugins_limitedtimediscount_timer_title}}"></template>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 楼层数据 -->
|
||||
<block a:if="{{data_list.length > 0}}">
|
||||
<view a:for="{{data_list}}" a:for-item="floor" class="floor spacing-mb">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
load_status: 0,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_list: [],
|
||||
|
|
@ -10,7 +11,12 @@ Page({
|
|||
common_app_is_enable_search: 1,
|
||||
common_app_is_enable_answer: 1,
|
||||
common_app_is_header_nav_fixed: 0,
|
||||
load_status: 0,
|
||||
|
||||
// 限时秒杀插件
|
||||
common_app_is_limitedtimediscount : 0,
|
||||
plugins_limitedtimediscount_data: null,
|
||||
plugins_limitedtimediscount_timer_title: '距离结束',
|
||||
plugins_limitedtimediscount_is_show_time: true,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
|
|
@ -40,6 +46,7 @@ Page({
|
|||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_bottom_line_status: true,
|
||||
banner_list: data.banner_list || [],
|
||||
navigation: data.navigation || [],
|
||||
data_list: data.data_list || [],
|
||||
|
|
@ -48,8 +55,15 @@ Page({
|
|||
common_app_is_enable_answer: data.common_app_is_enable_answer,
|
||||
common_app_is_header_nav_fixed: data.common_app_is_header_nav_fixed,
|
||||
data_list_loding_status: data.data_list.length == 0 ? 0 : 3,
|
||||
data_bottom_line_status: true,
|
||||
common_app_is_limitedtimediscount: data.common_app_is_limitedtimediscount || 0,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
});
|
||||
|
||||
// 限时秒杀倒计时
|
||||
if (this.data.common_app_is_limitedtimediscount == 1 && this.data.plugins_limitedtimediscount_data != null)
|
||||
{
|
||||
this.plugins_limitedtimediscount_countdown();
|
||||
}
|
||||
} else {
|
||||
self.setData({
|
||||
data_list_loding_status: 0,
|
||||
|
|
@ -97,6 +111,54 @@ Page({
|
|||
this.init();
|
||||
},
|
||||
|
||||
// 显示秒杀插件-倒计时
|
||||
plugins_limitedtimediscount_countdown() {
|
||||
var hours = this.data.plugins_limitedtimediscount_data.time.hours || 0;
|
||||
var minutes = this.data.plugins_limitedtimediscount_data.time.minutes || 0;
|
||||
var seconds = this.data.plugins_limitedtimediscount_data.time.seconds || 0;
|
||||
var self = this;
|
||||
if (hours > 0 || minutes > 0 || seconds > 0) {
|
||||
// 秒
|
||||
var timer = setInterval(function () {
|
||||
if (seconds <= 0) {
|
||||
if (minutes > 0) {
|
||||
minutes--;
|
||||
seconds = 59;
|
||||
} else if (hours > 0) {
|
||||
hours--;
|
||||
minutes = 59;
|
||||
seconds = 59;
|
||||
}
|
||||
} else {
|
||||
seconds--;
|
||||
}
|
||||
|
||||
self.setData({
|
||||
'plugins_limitedtimediscount_data.time.hours': (hours < 10) ? 0 + hours : hours,
|
||||
'plugins_limitedtimediscount_data.time.minutes': (minutes < 10) ? 0 + minutes : minutes,
|
||||
'plugins_limitedtimediscount_data.time.seconds': (seconds < 10) ? 0 + seconds : seconds,
|
||||
});
|
||||
|
||||
if (hours <= 0 && minutes <= 0 && seconds <= 0) {
|
||||
// 停止时间
|
||||
clearInterval(timer);
|
||||
|
||||
// 活动已结束
|
||||
self.setData({
|
||||
plugins_limitedtimediscount_timer_title: '活动已结束',
|
||||
plugins_limitedtimediscount_is_show_time: false,
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
// 活动已结束
|
||||
self.setData({
|
||||
plugins_limitedtimediscount_timer_title: '活动已结束',
|
||||
plugins_limitedtimediscount_is_show_time: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<template name="limitedtimediscount">
|
||||
<view a:if="{{plugins_limitedtimediscount_data.goods.length > 0}}" class="limitedtimediscount">
|
||||
<view class="nav-title">
|
||||
<image class="nav-icon" src="/pages/lib/limitedtimediscount/nav-icon.png" mode="aspectFit"></image>
|
||||
<text class="text-wrapper">限时秒杀</text>
|
||||
<view class="countdown">
|
||||
<block a:if="{{plugins_limitedtimediscount_is_show_time}}">
|
||||
<view class="timer-hours seconds">{{plugins_limitedtimediscount_data.time.seconds}}</view>
|
||||
<view class="ds">:</view>
|
||||
<view class="timer-hours minutes">{{plugins_limitedtimediscount_data.time.minutes}}</view>
|
||||
<view class="ds">:</view>
|
||||
<view class="timer-hours hours">{{plugins_limitedtimediscount_data.time.hours}}</view>
|
||||
</block>
|
||||
<view class="timer-title">{{plugins_limitedtimediscount_timer_title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-list">
|
||||
<scroll-view scroll-x>
|
||||
<view a:for="{{plugins_limitedtimediscount_data.goods}}" class="item">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
|
||||
<image class="dis-block" src="{{item.images}}" mode="aspectFit"></image>
|
||||
<view class="goods-base">
|
||||
<view class="goods-title single-text">{{item.title}}</view>
|
||||
<view class="goods-price single-text">¥{{item.price}}</view>
|
||||
<view a:if="{{(item.original_price || null) != null}}" class="goods-original-price single-text">¥{{item.original_price}}</view>
|
||||
<button size="mini">抢购</button>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
|
|
@ -28,19 +28,28 @@
|
|||
|
||||
<!-- 基础信息 -->
|
||||
<view class="goods-base bg-white">
|
||||
<view class="oh">
|
||||
<view class="goods-title fl multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
<view class="goods-share fr tc" bindtap="popup_share_event">
|
||||
<image src="/images/goods-detail-share-icon.png" mode="scaleToFill" class="dis-block" />
|
||||
<text class="dis-block cr-888">分享</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
<view class="goods-price single-text">
|
||||
<view class="goods-share tc" bindtap="popup_share_event">
|
||||
<image src="/images/goods-detail-share-icon.png" mode="scaleToFill" class="dis-block" />
|
||||
<view class="cr-888">分享</view>
|
||||
</view>
|
||||
<text wx:if="{{(show_field_price_text || null) != null}}" class="price-icon">{{show_field_price_text}}</text>
|
||||
<text class="sales-price">¥{{goods.price}}</text>
|
||||
<text wx:if="{{(goods.original_price || null) != null}}" class="original-price">¥{{goods.original_price}}</text>
|
||||
<view class="cr-ccc sales">
|
||||
<text>销量 {{goods.sales_count}}</text>
|
||||
<view wx:if="{{(goods.original_price || null) != null}}" class="original-price">¥{{goods.original_price}}</view>
|
||||
</view>
|
||||
<view class="base-grid oh">
|
||||
<view class="fl tc">
|
||||
<text class="cr-888">累计销量</text>
|
||||
<text class="cr-main">{{goods.sales_count}}</text>
|
||||
</view>
|
||||
<view class="fl tc">
|
||||
<text class="cr-888">浏览次数</text>
|
||||
<text class="cr-main">{{goods.access_count}}</text>
|
||||
</view>
|
||||
<view class="fl tc">
|
||||
<text class="cr-888">累计评论</text>
|
||||
<text class="cr-main">{{goods.comments_count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -182,6 +191,6 @@
|
|||
|
||||
<!-- 在线客服 -->
|
||||
<view wx:if="{{common_app_is_online_service == 1}}">
|
||||
<import src="/pages/common/online_service.wxml" />
|
||||
<import src="/pages/lib/online-service/content.wxml" />
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
|
@ -174,32 +174,50 @@
|
|||
.goods-base button {
|
||||
background: #fff;
|
||||
}
|
||||
.goods-base .goods-price .sales {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.goods-base .goods-title {
|
||||
width: calc(100% - 100rpx);
|
||||
font-size: 32rpx;
|
||||
line-height: 44rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.goods-base .goods-share {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 0 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-base .goods-share image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.goods-base .goods-share view {
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.goods-base .goods-price {
|
||||
margin-top: 10rpx;
|
||||
padding-right: 160rpx;
|
||||
position: relative;
|
||||
margin-top: 10rpx;
|
||||
padding-right: 100rpx;
|
||||
position: relative;
|
||||
min-height: 80rpx;
|
||||
}
|
||||
.goods-base .goods-price .original-price {
|
||||
margin-top: 8rpx;
|
||||
margin-left: 0;
|
||||
}
|
||||
.goods-base .base-grid {
|
||||
margin-top: 15rpx;
|
||||
padding-top: 15rpx;
|
||||
border-top: 1px solid #f5f5f5;
|
||||
}
|
||||
.goods-base .base-grid view {
|
||||
width: calc(33.33% - 1px);
|
||||
}
|
||||
.goods-base .base-grid view:not(:last-child) {
|
||||
border-right: 1px solid #f5f5f5;
|
||||
}
|
||||
.goods-base .base-grid view .cr-main {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
.page {
|
||||
padding-bottom: 100rpx;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ Page({
|
|||
common_app_is_online_service: 0,
|
||||
|
||||
// 限时秒杀插件
|
||||
plugins_limitedtimediscount_data: [],
|
||||
common_app_is_limitedtimediscount : 0,
|
||||
plugins_limitedtimediscount_data: null,
|
||||
plugins_limitedtimediscount_timer_title: '距离结束',
|
||||
plugins_limitedtimediscount_is_show_time: true,
|
||||
},
|
||||
|
|
@ -55,11 +56,15 @@ Page({
|
|||
common_app_is_header_nav_fixed: data.common_app_is_header_nav_fixed,
|
||||
data_list_loding_status: data.data_list.length == 0 ? 0 : 3,
|
||||
common_app_is_online_service: data.common_app_is_online_service || 0,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || [],
|
||||
common_app_is_limitedtimediscount: data.common_app_is_limitedtimediscount || 0,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
});
|
||||
|
||||
|
||||
// 限时秒杀倒计时
|
||||
this.plugins_limitedtimediscount_countdown();
|
||||
if (this.data.common_app_is_limitedtimediscount == 1 && this.data.plugins_limitedtimediscount_data != null)
|
||||
{
|
||||
this.plugins_limitedtimediscount_countdown();
|
||||
}
|
||||
} else {
|
||||
self.setData({
|
||||
data_list_loding_status: 0,
|
||||
|
|
|
|||
|
|
@ -19,36 +19,9 @@
|
|||
<component-icon-nav prop-data="{{navigation}}"></component-icon-nav>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view wx:if="{{plugins_limitedtimediscount_data.goods.length > 0}}" class="limitedtimediscount">
|
||||
<view class="nav-title">
|
||||
<image class="nav-icon" src="/images/limitedtimediscount-nav-icon.png" mode="aspectFit"></image>
|
||||
<text class="text-wrapper">限时秒杀</text>
|
||||
<view class="countdown">
|
||||
<block wx:if="{{plugins_limitedtimediscount_is_show_time}}">
|
||||
<view class="timer-hours seconds">{{plugins_limitedtimediscount_data.time.seconds}}</view>
|
||||
<view class="ds">:</view>
|
||||
<view class="timer-hours minutes">{{plugins_limitedtimediscount_data.time.minutes}}</view>
|
||||
<view class="ds">:</view>
|
||||
<view class="timer-hours hours">{{plugins_limitedtimediscount_data.time.hours}}</view>
|
||||
</block>
|
||||
<view class="timer-title">{{plugins_limitedtimediscount_timer_title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-list">
|
||||
<scroll-view scroll-x>
|
||||
<view wx:for="{{plugins_limitedtimediscount_data.goods}}" wx:key="key" class="item">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
|
||||
<image class="dis-block" src="{{item.images}}" mode="aspectFit"></image>
|
||||
<view class="goods-base">
|
||||
<view class="goods-title single-text">{{item.title}}</view>
|
||||
<view class="goods-price single-text">¥{{item.price}}</view>
|
||||
<view wx:if="{{(item.original_price || null) != null}}" class="goods-original-price single-text">¥{{item.original_price}}</view>
|
||||
<button size="mini">抢购</button>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view wx:if="{{common_app_is_limitedtimediscount == 1}}">
|
||||
<import src="/pages/lib/limitedtimediscount/content.wxml" />
|
||||
<template is="limitedtimediscount" data="{{plugins_limitedtimediscount_data: plugins_limitedtimediscount_data, plugins_limitedtimediscount_is_show_time: plugins_limitedtimediscount_is_show_time, plugins_limitedtimediscount_timer_title: plugins_limitedtimediscount_timer_title}}"></template>
|
||||
</view>
|
||||
|
||||
<!-- 楼层数据 -->
|
||||
|
|
@ -104,7 +77,7 @@
|
|||
|
||||
<!-- 在线客服 -->
|
||||
<view wx:if="{{common_app_is_online_service == 1}}">
|
||||
<import src="/pages/common/online_service.wxml" />
|
||||
<import src="/pages/lib/online-service/content.wxml" />
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@
|
|||
.limitedtimediscount .nav-title .nav-icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
vertical-align: top;
|
||||
vertical-align: sub;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.limitedtimediscount .text-wrapper {
|
||||
|
|
@ -184,6 +184,7 @@
|
|||
}
|
||||
.limitedtimediscount .goods-list .goods-base .goods-title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.limitedtimediscount .goods-list .goods-base .goods-price {
|
||||
color: #f40;
|
||||
|
|
@ -200,7 +201,7 @@
|
|||
border: 0;
|
||||
color: #fff;
|
||||
padding: 0 30rpx;
|
||||
line-height: 50rpx;
|
||||
line-height: 65rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 6rpx;
|
||||
position: absolute;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<template name="limitedtimediscount">
|
||||
<view wx:if="{{plugins_limitedtimediscount_data.goods.length > 0}}" class="limitedtimediscount">
|
||||
<view class="nav-title">
|
||||
<image class="nav-icon" src="/pages/lib/limitedtimediscount/nav-icon.png" mode="aspectFit"></image>
|
||||
<text class="text-wrapper">限时秒杀</text>
|
||||
<view class="countdown">
|
||||
<block wx:if="{{plugins_limitedtimediscount_is_show_time}}">
|
||||
<view class="timer-hours seconds">{{plugins_limitedtimediscount_data.time.seconds}}</view>
|
||||
<view class="ds">:</view>
|
||||
<view class="timer-hours minutes">{{plugins_limitedtimediscount_data.time.minutes}}</view>
|
||||
<view class="ds">:</view>
|
||||
<view class="timer-hours hours">{{plugins_limitedtimediscount_data.time.hours}}</view>
|
||||
</block>
|
||||
<view class="timer-title">{{plugins_limitedtimediscount_timer_title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-list">
|
||||
<scroll-view scroll-x>
|
||||
<view wx:for="{{plugins_limitedtimediscount_data.goods}}" wx:key="key" class="item">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
|
||||
<image class="dis-block" src="{{item.images}}" mode="aspectFit"></image>
|
||||
<view class="goods-base">
|
||||
<view class="goods-title single-text">{{item.title}}</view>
|
||||
<view class="goods-price single-text">¥{{item.price}}</view>
|
||||
<view wx:if="{{(item.original_price || null) != null}}" class="goods-original-price single-text">¥{{item.original_price}}</view>
|
||||
<button size="mini">抢购</button>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
|
|
@ -1,5 +1,5 @@
|
|||
<template name="online_service">
|
||||
<button open-type="contact" class="common-online-service">
|
||||
<image src="/images/default-online-service-icon.png"></image>
|
||||
<image src="/pages/lib/online-service/icon.png"></image>
|
||||
</button>
|
||||
</template>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
|
@ -79,7 +79,7 @@
|
|||
|
||||
<!-- 在线客服 -->
|
||||
<view wx:if="{{common_app_is_online_service == 1}}">
|
||||
<import src="/pages/common/online_service.wxml" />
|
||||
<import src="/pages/lib/online-service/content.wxml" />
|
||||
<template is="online_service"></template>
|
||||
</view>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue