mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-06-07 02:12:25 +08:00
小程序支持销售记录提示
This commit is contained in:
@ -102,6 +102,7 @@ textarea {
|
||||
.dis-none { display: none; }
|
||||
.dis-block { display: block; }
|
||||
.dis-inline { display: inline; }
|
||||
.va-m { vertical-align: middle; }
|
||||
|
||||
.cr-main { color: #d2364c; }
|
||||
.cr-666 { color: #666; }
|
||||
@ -499,6 +500,25 @@ button[disabled].bg-primary {
|
||||
/**
|
||||
* 公共样式
|
||||
*/
|
||||
.margin-xs {
|
||||
margin: 5rpx;
|
||||
}
|
||||
.margin-sm {
|
||||
margin: 10rpx;
|
||||
}
|
||||
.margin, .margin-default {
|
||||
margin: 15rpx;
|
||||
}
|
||||
.margin-lg {
|
||||
margin: 20rpx;
|
||||
}
|
||||
.margin-xl {
|
||||
margin: 25rpx;
|
||||
}
|
||||
.margin-xxl {
|
||||
margin: 30rpx;
|
||||
}
|
||||
|
||||
.margin-top-xs {
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
@ -576,6 +596,25 @@ button[disabled].bg-primary {
|
||||
}
|
||||
|
||||
|
||||
.padding-xs {
|
||||
padding: 5rpx;
|
||||
}
|
||||
.padding-sm {
|
||||
padding: 10rpx;
|
||||
}
|
||||
.padding, .padding-default {
|
||||
padding: 15rpx;
|
||||
}
|
||||
.padding-lg {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.padding-xl {
|
||||
padding: 25rpx;
|
||||
}
|
||||
.padding-xxl {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.padding-top-xs {
|
||||
padding-top: 5rpx;
|
||||
}
|
||||
|
||||
@ -442,4 +442,65 @@
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买记录 - 插件
|
||||
*/
|
||||
.plugins-salerecords-tips,
|
||||
.plugins-salerecords-tips-top-left,
|
||||
.plugins-salerecords-tips-top-right,
|
||||
.plugins-salerecords-tips-bottom-left,
|
||||
.plugins-salerecords-tips-bottom-right,
|
||||
.plugins-salerecords-tips-top-center,
|
||||
.plugins-salerecords-tips-bottom-center {
|
||||
position: fixed;
|
||||
left: calc(50% - 170rpx);
|
||||
top: 50%;
|
||||
background: rgb(0 0 0 / 60%);
|
||||
border-radius: 60rpx;
|
||||
padding: 8rpx 20rpx;
|
||||
color: #fff;
|
||||
z-index: 110;
|
||||
-webkit-box-shadow: 0 8px 10px rgb(0 0 0 / 20%);
|
||||
-moz-box-shadow: 0 8px 10px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 8px 10px rgb(0 0 0 / 20%);
|
||||
}
|
||||
.plugins-salerecords-tips image ,
|
||||
.plugins-salerecords-tips-top-left image ,
|
||||
.plugins-salerecords-tips-top-right image ,
|
||||
.plugins-salerecords-tips-bottom-left image ,
|
||||
.plugins-salerecords-tips-bottom-right image,
|
||||
.plugins-salerecords-tips-top-center image,
|
||||
.plugins-salerecords-tips-bottom-center image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.plugins-salerecords-tips-top-left {
|
||||
left: 5%;
|
||||
top: 5%;
|
||||
}
|
||||
.plugins-salerecords-tips-top-right {
|
||||
right: 5%;
|
||||
top: 5%;
|
||||
left: auto;
|
||||
}
|
||||
.plugins-salerecords-tips-bottom-left {
|
||||
left: 5%;
|
||||
bottom: 10%;
|
||||
top: auto;
|
||||
}
|
||||
.plugins-salerecords-tips-bottom-right {
|
||||
right: 5%;
|
||||
bottom: 10%;
|
||||
left: auto;
|
||||
top: auto;
|
||||
}
|
||||
.plugins-salerecords-tips-top-center {
|
||||
top: 5%;
|
||||
}
|
||||
.plugins-salerecords-tips-bottom-center {
|
||||
bottom: 10%;
|
||||
top: auto;
|
||||
}
|
||||
@ -53,6 +53,12 @@ Page({
|
||||
plugins_coupon_data: null,
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
|
||||
// 购买记录
|
||||
plugins_salerecords_data: null,
|
||||
plugins_salerecords_timer: null,
|
||||
plugins_salerecords_tips_content: null,
|
||||
plugins_salerecords_tips_ent: '',
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
@ -144,6 +150,8 @@ Page({
|
||||
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
quick_nav_cart_count: data.common_cart_total || 0,
|
||||
|
||||
plugins_salerecords_data: ((data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0) ? null : data.plugins_salerecords_data,
|
||||
});
|
||||
|
||||
// 限时秒杀倒计时
|
||||
@ -158,6 +166,9 @@ Page({
|
||||
// 不能选择规格处理
|
||||
this.goods_specifications_choose_handle_dont(0);
|
||||
|
||||
// 购买记录提示
|
||||
this.plugins_salerecords_tips_handle();
|
||||
|
||||
// 页面信息设置
|
||||
this.set_page_info();
|
||||
} else {
|
||||
@ -690,10 +701,50 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
// 购买记录提示处理
|
||||
plugins_salerecords_tips_handle() {
|
||||
// 销毁之前的任务
|
||||
clearInterval(this.data.plugins_salerecords_timer);
|
||||
|
||||
// 是否存在数据
|
||||
var data = this.data.plugins_salerecords_data || null;
|
||||
if(data != null && (data.data || null) != null && data.data.length > 0)
|
||||
{
|
||||
var self = this;
|
||||
var base = data.base || null;
|
||||
var location = (base == null || (base.goods_detail_tips_location || null) == null) ? '' : '-'+base.goods_detail_tips_location;
|
||||
var pause = (base == null ? 5 : (base.goods_detail_time_pause || 5))*1000;
|
||||
var interval = (base == null ? 10 : (base.goods_detail_time_interval || 10))*1000;
|
||||
var index = 0;
|
||||
var list = data.data;
|
||||
var count = list.length;
|
||||
var timer = setInterval(function()
|
||||
{
|
||||
self.setData({plugins_salerecords_tips_content: list[index]});
|
||||
setTimeout(function()
|
||||
{
|
||||
self.setData({plugins_salerecords_tips_content: null});
|
||||
}, pause);
|
||||
|
||||
// 索引处理
|
||||
index++;
|
||||
if(index >= count)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
}, interval);
|
||||
self.setData({
|
||||
plugins_salerecords_timer: timer,
|
||||
plugins_salerecords_tips_ent: location
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面销毁时执行
|
||||
onUnload: function () {
|
||||
clearInterval(this.data.plugins_limitedtimediscount_timer);
|
||||
clearInterval(this.data.plugins_limitedtimediscount_timers);
|
||||
clearInterval(this.data.plugins_salerecords_timer);
|
||||
},
|
||||
|
||||
// 优惠劵领取事件
|
||||
|
||||
@ -238,6 +238,12 @@
|
||||
<button class="goods-popup-submit bg-main" type="default" catchtap="goods_buy_confirm_event" hover-class="none">确定</button>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 购买记录 -->
|
||||
<view s-if="(plugins_salerecords_tips_content || null) != null" class="plugins-salerecords-tips{{plugins_salerecords_tips_ent}}">
|
||||
<image mode="widthFix" src="{{plugins_salerecords_tips_content.user.avatar}}" class="va-m br" />
|
||||
<text class="margin-left-sm">{{plugins_salerecords_tips_content.tips}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view s-if="goods == null">
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
/*
|
||||
* 限时秒杀 - 插件
|
||||
*/
|
||||
.limitedtimediscount {
|
||||
.limitedtimediscount {
|
||||
background: #fff;
|
||||
padding: 5rpx 10rpx 20rpx 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
@ -200,4 +200,22 @@
|
||||
position: absolute;
|
||||
right: 15rpx;
|
||||
bottom: 15rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购买记录 - 插件
|
||||
*/
|
||||
.plugins-salerecords image {
|
||||
width: 50rpx !important;
|
||||
height: 50rpx !important;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.plugins-salerecords .item-content {
|
||||
width: 24%;
|
||||
}
|
||||
.plugins-salerecords .item-content:nth-child(1) {
|
||||
width: 36%;
|
||||
}
|
||||
.plugins-salerecords .item-content:nth-child(2) {
|
||||
width: 40%;
|
||||
}
|
||||
@ -22,6 +22,9 @@ Page({
|
||||
plugins_limitedtimediscount_timer_title: '距离结束',
|
||||
plugins_limitedtimediscount_is_show_time: true,
|
||||
plugins_limitedtimediscount_timer: null,
|
||||
|
||||
// 购买记录插件
|
||||
plugins_salerecords_data: null,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
@ -77,6 +80,7 @@ Page({
|
||||
data_list_loding_status: data.data_list.length == 0 ? 0 : 3,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
plugins_limitedtimediscount_is_valid: ((data.plugins_limitedtimediscount_data || null) != null && (data.plugins_limitedtimediscount_data.is_valid || 0) == 1) ? 1 : 0,
|
||||
plugins_salerecords_data: ((data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0) ? null : data.plugins_salerecords_data,
|
||||
});
|
||||
|
||||
// 导航购物车处理
|
||||
|
||||
@ -59,6 +59,29 @@
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 底部购买记录 -->
|
||||
<view s-if="(plugins_salerecords_data || null) != null && (plugins_salerecords_data.data || null) != null && plugins_salerecords_data.data.length > 0" class="spacing-mb plugins-salerecords bg-white">
|
||||
<view class="spacing-nav-title br-b">
|
||||
<text class="line"></text>
|
||||
<text class="text-wrapper">{{plugins_salerecords_data.base.home_bottom_title || '最新购买'}}</text>
|
||||
</view>
|
||||
<view s-for="item, index in plugins_salerecords_data.data" s-key="key" class="item oh br-b padding-sm">
|
||||
<view class="item-content single-text fl">
|
||||
<image mode="widthFix" src="{{item.user.avatar}}" class="va-m br" />
|
||||
<text class="margin-left-sm">{{item.user.user_name_view}}</text>
|
||||
<text s-if="(item.user.province || null) != null"> - {{item.user.province}}</text>
|
||||
</view>
|
||||
<view class="item-content fl">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none" class="single-text">
|
||||
<image mode="widthFix" src="{{item.images}}" class="va-m br" />
|
||||
<text class="margin-left-sm">{{item.title}}</text>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="item-content single-text fr tr padding-top-xs">{{item.add_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view s-if="data_list.length == 0">
|
||||
<import src="/pages/common/nodata.swan" />
|
||||
<template is="nodata" data="{{{status: data_list_loding_status}}}"></template>
|
||||
|
||||
Reference in New Issue
Block a user