diff --git a/packageA/pages/distribution/myteam/myteam.js b/packageA/pages/distribution/myteam/myteam.js
index 39bc012..582a165 100644
--- a/packageA/pages/distribution/myteam/myteam.js
+++ b/packageA/pages/distribution/myteam/myteam.js
@@ -83,6 +83,7 @@ Page({
store_id: app.globalData.setting.stoid,
user_id: app.globalData.user_id,
level: 1,
+ isall: 1,
});
};
@@ -149,6 +150,7 @@ Page({
store_id: app.globalData.setting.stoid,
user_id: app.globalData.user_id,
level: th.data.currentTabIndex + 1,
+ isall: 1
});
},
@@ -176,6 +178,7 @@ Page({
store_id: app.globalData.setting.stoid,
user_id: app.globalData.user_id,
level: currentIndex + 1,
+ isall: 1
});
},
diff --git a/packageA/pages/distribution/myteam/myteam.wxml b/packageA/pages/distribution/myteam/myteam.wxml
index 1493a50..4674ed7 100644
--- a/packageA/pages/distribution/myteam/myteam.wxml
+++ b/packageA/pages/distribution/myteam/myteam.wxml
@@ -9,7 +9,11 @@
- {{item.nickname}}
+
+ {{item.nickname}}
+ 分销会员
+ 普通会员
+
{{filter.format_time(item.reg_time)}}
diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js
index 546becc..0c8e2ef 100644
--- a/packageA/pages/prom_list/prom_list.js
+++ b/packageA/pages/prom_list/prom_list.js
@@ -40,7 +40,8 @@ Page({
g_buy_num: null,
sele_collocation:null,
- room_id:0, //房间号
+ room_id:0, //房间号
+ is_coupon: 1, //搭配促销禁用
},
//------初始化加载----------
@@ -164,163 +165,189 @@ Page({
var ee=this,th=ee,that=ee;
var gid = this.data.gid,i = getApp().request;
ee.data.g_buy_num = new Map();
- this.wait_for_store_config();
- setTimeout(function(){
- i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
- failRollback: !0,
- success: function(t) {
- if (t.data.code == 0) {
- if (t.data.data.is_on_sale != 1) {
- wx.showModal({
- title: '商品已经下架',
- showCancel: !1,
- complete: function() {
- wx.navigateBack();
- }
- });
- }
-
- var timestamp = Date.parse(new Date());
- timestamp = timestamp / 1000;
- if (t.data.data.on_time > timestamp) {
- wx.showModal({
- title: '商品还未上架',
- showCancel: !1,
- complete: function() {
- wx.navigateBack();
- }
- });
- }
-
- if (t.data.data.down_time > 0) {
- if (t.data.data.down_time < timestamp) {
- wx.showModal({
- title: '商品已经到期下架',
- showCancel: !1,
- complete: function() {
- wx.navigateBack();
- }
- });
- }
- }
-
- t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
- var txt = (t.data.data.shop_price / t.data.data.market_price * 10).toFixed(2);
- t.data.data['disc'] = txt;
-
- if (t.data.data.original_img.indexOf(o.imghost) == -1)
- t.data.data.original_img = o.imghost + t.data.data.original_img;
- if (t.data.data.goods_content == null) t.data.data.goods_content = "";
-
- //计算商品的规格
- var gg = "";
- if(t.data.data.goods_spec=="null" || t.data.data.goods_spec==null) t.data.data.goods_spec="";
- if(t.data.data.goods_color=="null" || t.data.data.goods_color==null) t.data.data.goods_color="";
-
- if (t.data.data.goods_spec != "" && t.data.data.goods_color != "") {
- gg = t.data.data.goods_spec + "/" + t.data.data.goods_color;
- } else if (t.data.data.goods_spec != "" || t.data.data.goods_color != "") {
- gg = t.data.data.goods_spec + t.data.data.goods_color;
- } else {
- gg = "规格1";
- }
- t.data.data.gg = gg;
-
-
- //--看一下有没有开启等级卡---
- if(ee.data.rank_switch){
- //---回调卡的列表---
- th.getPlusCardType(function(ob){
- var user = getApp().globalData.userInfo;
- if(user){
- if(user.card_field && user['card_expiredate']){
- var str = user['card_expiredate'].replace(/-/g, '/');
- var end = new Date(str);
- end = Date.parse(end) / 1000;
- var now = ut.gettimestamp();
- //--- 判断是等级会员,且在有效期范围内 ---
- if(user.card_field && now5) card_name=card_name.substring(0,5);
- th.setData({card_field:user.card_field,card_name:card_name});
- if(t.data.data[user.card_field]>0) t.data.data.shop_price=t.data.data[user.card_field];
- }
- }
- }
- ee.setData({ data: t.data.data, });
- })
- }else{
- ee.setData({ data: t.data.data, });
- }
-
- if(!ee.data.collocationList){
- /*---获取活动的重表---*/
- //调用接口判断订单优惠,
- getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+ee.data.gid+"/2", {}).then(res => {
- if(res.data.code==0){
- var r_data=res.data.data;
- th.loop_promise(0,r_data.collocationList,function(){
- ee.setData({
- collocationGoods:r_data.collocationPromList,
- collocationList:r_data.collocationList,
- })
- })
- }
- })
- }
-
- //获取统一条形码,普通商品和优惠促销的商品
- if ( t.data.data.prom_type == 5){
- //默认门店要拿下门店库存
- if(that.data.sales_rules==2 && that.data.is_newsales_rules){
- //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存
- getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){
- if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){
- var lock=0,plist=null;
- //先读取门店的lock,采用链式写法,少用await
- getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
- data:{store_id:os.stoid,wareId:ee.data.data.goods_id,storageId:that.data.fir_def_store.pickup_id,pageSize:1000}
- }).then(res=>{
- if(res.data.code==0 && res.data.data.total>0){
- for(var i in res.data.data.pageData)
- lock+=res.data.data.pageData[i].outQty
- }
- //---通过接口获取门店的线下库存信息--
- return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
- data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid,pageSize:2000}
- })
- }).then(res=>{
- if(res.data.code==0 && res.data.data.total>0){
- plist=res.data.data.pageData[0];
- }
- if(plist && plist.CanOutQty-lock>0){
- that.data.fir_def_store.CanOutQty=plist.CanOutQty-lock;
- }else{
- that.data.fir_def_store.CanOutQty=0;
- }
- //--给门店赋值线下库存--
- th.setData({def_pick_store:that.data.fir_def_store});
- //获取门店
- ee.get_sto();
- })
- }else{
- //--获取门店--
- ee.get_sto();
- }
- })
- }else{
- //获取门店
- ee.get_sto();
- }
-
- }
- else {
- return getApp().my_warnning("商品没有搭配购的活动",0,th)
- }
- }
- }
- });
- },1000)
+ this.wait_for_store_config();
+ clearTimeout(ot);
+ var ot = setTimeout(function () {
+ i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
+ failRollback: !0,
+ success: function (t) {
+ if (t.data.code == 0) {
+ if (t.data.data.is_on_sale != 1) {
+ wx.showModal({
+ title: '商品已经下架',
+ showCancel: !1,
+ complete: function () {
+ wx.navigateBack();
+ }
+ });
+ }
+
+ var timestamp = Date.parse(new Date());
+ timestamp = timestamp / 1000;
+ if (t.data.data.on_time > timestamp) {
+ wx.showModal({
+ title: '商品还未上架',
+ showCancel: !1,
+ complete: function () {
+ wx.navigateBack();
+ }
+ });
+ }
+
+ if (t.data.data.down_time > 0) {
+ if (t.data.data.down_time < timestamp) {
+ wx.showModal({
+ title: '商品已经到期下架',
+ showCancel: !1,
+ complete: function () {
+ wx.navigateBack();
+ }
+ });
+ }
+ }
+
+ t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
+ var txt = (t.data.data.shop_price / t.data.data.market_price * 10).toFixed(2);
+ t.data.data['disc'] = txt;
+
+ if (t.data.data.original_img.indexOf(o.imghost) == -1)
+ t.data.data.original_img = o.imghost + t.data.data.original_img;
+ if (t.data.data.goods_content == null) t.data.data.goods_content = "";
+
+ //计算商品的规格
+ var gg = "";
+ if (t.data.data.goods_spec == "null" || t.data.data.goods_spec == null) t.data.data.goods_spec = "";
+ if (t.data.data.goods_color == "null" || t.data.data.goods_color == null) t.data.data.goods_color = "";
+
+ if (t.data.data.goods_spec != "" && t.data.data.goods_color != "") {
+ gg = t.data.data.goods_spec + "/" + t.data.data.goods_color;
+ } else if (t.data.data.goods_spec != "" || t.data.data.goods_color != "") {
+ gg = t.data.data.goods_spec + t.data.data.goods_color;
+ } else {
+ gg = "规格1";
+ }
+ t.data.data.gg = gg;
+
+
+ //--看一下有没有开启等级卡---
+ if (ee.data.rank_switch) {
+ //---回调卡的列表---
+ th.getPlusCardType(function (ob) {
+ var user = getApp().globalData.userInfo;
+ if (user) {
+ if (user.card_field && user['card_expiredate']) {
+ var str = user['card_expiredate'].replace(/-/g, '/');
+ var end = new Date(str);
+ end = Date.parse(end) / 1000;
+ var now = ut.gettimestamp();
+ //--- 判断是等级会员,且在有效期范围内 ---
+ if (user.card_field && now < end) {
+ var card_name = ob.name_map.get(user.card_field);
+ if (card_name && card_name.length > 5) card_name = card_name.substring(0, 5);
+ th.setData({
+ card_field: user.card_field,
+ card_name: card_name
+ });
+ if (t.data.data[user.card_field] > 0) t.data.data.shop_price = t.data.data[user.card_field];
+ }
+ }
+ }
+ ee.setData({
+ data: t.data.data,
+ });
+ })
+ } else {
+ ee.setData({
+ data: t.data.data,
+ });
+ }
+
+ if (!ee.data.collocationList) {
+ /*---获取活动的重表---*/
+ //调用接口判断订单优惠,
+ getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2", {}).then(res => {
+ if (res.data.code == 0) {
+ var r_data = res.data.data;
+
+ th.data.is_coupon = r_data.collocationPromList.is_coupon;
+
+
+ th.loop_promise(0, r_data.collocationList, function () {
+ // 设置搭配购是否使用优惠卷
+ ee.setData({
+ collocationGoods: r_data.collocationPromList,
+ collocationList: r_data.collocationList,
+ })
+ })
+ }
+ })
+ }
+
+ //获取统一条形码,普通商品和优惠促销的商品
+ if (t.data.data.prom_type == 5) {
+ //默认门店要拿下门店库存
+ if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
+ //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存
+ getApp().waitfor2(that, "wait_for_user_store", "fir_def_store", function () {
+ if (th.data.fir_def_store && th.data.fir_def_store.pickup_id) {
+ var lock = 0,
+ plist = null;
+ //先读取门店的lock,采用链式写法,少用await
+ getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
+ data: {
+ store_id: os.stoid,
+ wareId: ee.data.data.goods_id,
+ storageId: that.data.fir_def_store.pickup_id,
+ pageSize: 1000
+ }
+ }).then(res => {
+ if (res.data.code == 0 && res.data.data.total > 0) {
+ for (var i in res.data.data.pageData)
+ lock += res.data.data.pageData[i].outQty
+ }
+ //---通过接口获取门店的线下库存信息--
+ return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
+ data: {
+ storageNos: that.data.fir_def_store.pickup_no,
+ wareIds: encodeURIComponent(th.data.data.erpwareid),
+ storeId: os.stoid,
+ pageSize: 2000
+ }
+ })
+ }).then(res => {
+ if (res.data.code == 0 && res.data.data.total > 0) {
+ plist = res.data.data.pageData[0];
+ }
+ if (plist && plist.CanOutQty - lock > 0) {
+ that.data.fir_def_store.CanOutQty = plist.CanOutQty - lock;
+ } else {
+ that.data.fir_def_store.CanOutQty = 0;
+ }
+ //--给门店赋值线下库存--
+ th.setData({
+ def_pick_store: that.data.fir_def_store
+ });
+ //获取门店
+ ee.get_sto();
+ })
+ } else {
+ //--获取门店--
+ ee.get_sto();
+ }
+ })
+ } else {
+ //获取门店
+ ee.get_sto();
+ }
+
+ } else {
+ return getApp().my_warnning("商品没有搭配购的活动", 0, th)
+ }
+ }
+ }
+ });
+ clearTimeout(ot);
+ }, 1000)
},
onUnload: function() {},
@@ -507,6 +534,8 @@ Page({
newd['pick_dis'] = th.data.sto_sele_distr;
newd["collocation_goods"]=th.data.sele_collocation;
+ newd["is_coupon"] = th.data.is_coupon;
+
th.buyNow(newd);
},
diff --git a/packageB/pages/zuhegou/list/g_filter.wxs b/packageB/pages/zuhegou/list/g_filter.wxs
index 9719e7d..0015aca 100644
--- a/packageB/pages/zuhegou/list/g_filter.wxs
+++ b/packageB/pages/zuhegou/list/g_filter.wxs
@@ -20,10 +20,19 @@ var g_filters = {
var tnow=getDate();
if(t1>=tnow) return 1;
return 0;
- }
+ },
+ goToUrl: function(type, id, name) {
+ if (type == 1) {
+ return "/packageB/pages/zuhegou/index/index?id="+id+"&title="+name
+ } else {
+ return "/packageB/pages/zuhegou/preIndex/index?id="+id+"&title="+name
+ }
+ },
+
}
module.exports = {
has_char: g_filters.has_char,
beg_time: g_filters.beg_time,
end_time: g_filters.end_time,
+ goToUrl: g_filters.goToUrl,
}
\ No newline at end of file
diff --git a/packageB/pages/zuhegou/list/list.js b/packageB/pages/zuhegou/list/list.js
index ce87de3..3060968 100644
--- a/packageB/pages/zuhegou/list/list.js
+++ b/packageB/pages/zuhegou/list/list.js
@@ -90,16 +90,17 @@ Page({
//----倒计时函数-----
countDown() {
+
if(!this.data.is_timer) return false;
var th=this;
// 获取当前时间,同时得到活动结束时间数组
- let newTime =ut.gettimestamp();
- var endTimeList = this.data.goodlist;
- if(endTimeList==null) return null
+ let newTime = ut.gettimestamp();
+ var endTimeList = th.data.goodlist;
+ if(endTimeList == null) return null;
// 对结束时间进行处理渲染到页面
for (var i = 0; i < endTimeList.length;i++){
var o = endTimeList[i];
- var endTime = o.end_time;
+ var endTime = o.start_time;
if(th.data.type==0) endTime = o.start_time;
let obj = null;
// 如果活动未结束,对时间进行处理
@@ -122,23 +123,36 @@ Page({
}
},
+ // 请求活动列表
async requestSalelist() {
//--没有更多就不调用--
if(!this.data.ismore) return false;
-
- var e = this,th=e, i = "/api/weshop/prom/zhbuy/page?is_end=0&timetype=1&page=" + e.data.currentPage;
+ var e = this,
+ th = e,
+ i = "/api/weshop/prom/zhbuy/page?is_end=0&timetype=" + this.data.type + "&page=" + e.data.currentPage;
// var plist=null,alllist=th.data.goodlist;
// if(!alllist) alllist=[];
- let {goodlist}=this.data;
+ let {goodlist} = this.data;
const {data:res}=await getApp().request.promiseGet(i,{
isShowLoading:1,
- data:{store_id:os.stoid,user_id:getApp().globalData.user_id}
+ data:{
+ store_id: os.stoid,
+ user_id: getApp().globalData.user_id
+ }
})
if(res.code==0 && res.data.pageData.length>0){
if(res.data.page>1){
- goodlist=goodlist.concat(res.data.pageData)
+ th.data.goodlist = goodlist.concat(res.data.pageData)
}else{
- goodlist=res.data.pageData;
+ th.data.goodlist = res.data.pageData;
+ }
+
+ if (th.data.type == 0) {
+ clearInterval(ot);
+ var ot = setInterval(function () {
+ th.countDown();
+ }, 1000);
+
}
}else{
@@ -146,14 +160,21 @@ Page({
th.data.ismore=0;
}
e.data.currentPage++;
- th.setData({goodlist,isshow:1});
+ th.setData({
+ goodlist: th.data.goodlist,
+ isshow: 1
+ });
},
+
onPullDownRefresh: function() {
this.reloadGoodList();
},
+
reloadGoodList: function() {
- this.data.goodlist = null, this.data.currentPage = 1, this.requestSalelist();
+ this.data.goodlist = null;
+ this.data.currentPage = 1;
+ this.requestSalelist();
},
onReachBottom: function() {
@@ -162,9 +183,16 @@ Page({
//点击tab事件
tip:function(e) {
- var a=e.currentTarget.dataset.ty,th=this;th.data.ismore=1;
- this.setData({type:a,goodlist:null});
+ var a = e.currentTarget.dataset.ty,
+ th = this;
+ th.data.type = a;
+ th.data.ismore = 1;
+ this.setData({
+ type:a,
+ goodlist: null
+ });
this.reloadGoodList();
+
},
diff --git a/packageB/pages/zuhegou/list/list.wxml b/packageB/pages/zuhegou/list/list.wxml
index 2f54385..f58b305 100644
--- a/packageB/pages/zuhegou/list/list.wxml
+++ b/packageB/pages/zuhegou/list/list.wxml
@@ -31,18 +31,26 @@
-
+
+
-
+
{{item.name}}
组合数量: {{item.zhbuyqty}}
活动时间: {{filters.format_time(item.start_time) + '至' + filters.format_time(item.end_time)}}
+
+ 剩余:
+ {{item.djs.day}}天
+ {{item.djs.hou}}时
+ {{item.djs.min}}分
+ {{item.djs.sec}}秒
+
¥
{{item.zhprice}}
@@ -53,7 +61,24 @@
- 没有相关内容
+
+没有相关内容
+
+
+
+
+
+
+
diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js
index 59e95d2..14e3197 100644
--- a/packageC/pages/group_list/group_list.js
+++ b/packageC/pages/group_list/group_list.js
@@ -9,7 +9,8 @@ Page({
* 页面的初始数据
*/
data: {
- // type:1,
+ url: a.imghost,
+ type:1,
// goodlist: null,
isLogin: false,
@@ -51,13 +52,13 @@ Page({
isLogin: true,
});
-
+ let typeVal = this.data.type;
let url = '/api/weshop/goods/groupBuy/page';
let data = {
store_id: app.globalData.setting.stoid,
is_show: 1,
is_end: 0,
- timetype:1
+ timetype: typeVal
};
this.setData({
@@ -72,21 +73,48 @@ Page({
});
});
- this.data.is_timer=1;
+ this.data.is_timer = 1;
};
-
//设置全局定时器
+ clearInterval(this.data.timer);
this.data.timer = setInterval(function () {
- self.countDown();
- },1000);
-
+ self.countDown();
+ }, 1000);
};
},
+ // 底部按钮切换
+ tip: function(e) {
+ // 1进行中 0预热
+ let typeValue = e.currentTarget.dataset.ty;
+ this.data.type = typeValue;
+ let url = '/api/weshop/goods/groupBuy/page';
+ let data = {
+ store_id: app.globalData.setting.stoid,
+ is_show: 1,
+ is_end: 0,
+ timetype: typeValue
+ };
+
+ this.getData(true, url, data).then(function() {
+ self.setData({
+ currentData: data,
+ });
+
+ });
+
+
+ this.setData({
+ list: null,
+ type: typeValue,
+ });
+
+ },
+
/**
* 生命周期函数--监听页面隐藏
*/
@@ -210,7 +238,7 @@ Page({
// 对结束时间进行处理渲染到页面
for(var i = 0; i < endTimeList.length; i++) {
var o = endTimeList[i];
- var endTime = o.end_time;
+ var endTime = this.data.type == 1?o.end_time:o.start_time;
// if(th.data.type==0) endTime = o.start_time;
let obj = null;
// 如果活动未结束,对时间进行处理
diff --git a/packageC/pages/group_list/group_list.wxml b/packageC/pages/group_list/group_list.wxml
index f64f2b4..55ab6c2 100644
--- a/packageC/pages/group_list/group_list.wxml
+++ b/packageC/pages/group_list/group_list.wxml
@@ -9,8 +9,13 @@
{{item.title}}
- {{item.rebate}}折
- {{item.price}}
+
+ {{item.rebate}}折
+ {{item.rebate}}折
+
+ {{item.price}}
+ {{item.price}}
+
{{item.market_price}}
@@ -19,15 +24,32 @@
已售{{item.buy_num+item.virtual_num}}件
{{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒
- 去团购
+
+
+ 去团购
+ 即将开始
+
+
-
-
+
—— 已经到底啦 ——
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packageC/pages/group_list/group_list.wxss b/packageC/pages/group_list/group_list.wxss
index 8c38c5c..6770daf 100644
--- a/packageC/pages/group_list/group_list.wxss
+++ b/packageC/pages/group_list/group_list.wxss
@@ -55,4 +55,83 @@ page {
text-align: center;
/* margin-top: 10rpx; */
color: #ccc;
+}
+
+.xc-seckill-bottom{
+ position: fixed;
+bottom: 0rpx;
+width: 100%;
+
+}
+
+.xc-bottom{
+ width: 45rpx;
+ height: 45rpx;
+ margin-right: 13rpx;
+}
+.xc-border-right{
+ border-right: 4rpx solid #eee;
+
+}
+
+.kill-time .theader .timeac {
+ font-size: 32rpx; height:100%; width: 50%;
+ color: #333; background-color: #fff;
+
+}
+
+.kill-time .theader{
+ display: flex; margin: 0 auto; align-items: center;
+ height: 100rpx;
+
+}
+
+.kill-time {
+ text-align: center;
+ justify-content: space-around;
+ align-items: center;
+ height: 101rpx;
+ border-bottom: 1px solid #ddd;
+ border-top: 1px solid #ddd;
+ background-color: #f6f6f6;
+}
+.kill-time .theader{
+ display: flex; margin: 0 auto; align-items: center;
+ height: 100rpx;
+
+}
+.kill-time .theader .timeac {
+ font-size: 32rpx; height:100%; width: 50%;
+ color: #333; background-color: #fff;
+
+}
+/* .kill-time .theader .timeac.left{border-top-left-radius: 86rpx; border-bottom-left-radius: 86rpx;}
+.kill-time .theader .timeac.right{border-top-right-radius: 86rpx; border-bottom-right-radius: 86rpx;} */
+.kill-time .theader .timeac.active{color: #c4182e}
+
+.kill-item {
+ display: flex;
+ justify-content: space-between;
+ background-color: #fff;
+ padding: 20rpx;
+ margin-bottom: 20rpx;
+ border-radius: 10rpx;
+ /* height: 249rpx; */
+ align-items: center;
+}
+
+.kill-pic {
+ width: 215rpx;
+ height: 215rpx;
+}
+
+.kill-cont {
+ width: 465rpx;
+ margin-left:20rpx;
+ margin-right: 5rpx;
+}
+
+.blue_c {
+ color: #059de5;
+
}
\ No newline at end of file
diff --git a/packageC/pages/presell/list/list.js b/packageC/pages/presell/list/list.js
index 3125e78..0667eff 100644
--- a/packageC/pages/presell/list/list.js
+++ b/packageC/pages/presell/list/list.js
@@ -11,6 +11,7 @@ Page({
isshow: 0,
ad_data: null,
max_sw_height: 200,
+ type: 1,
},
//------初始化加载----------
@@ -117,7 +118,7 @@ Page({
store_id: os.stoid,
page: this.data.page,
pageSize: 10,
- timetype: 1,
+ timetype: self.data.type,
isuse:1
}
if(getApp().globalData.userInfo){
@@ -131,7 +132,6 @@ Page({
getApp().request.get("/api/weshop/marketing/marketingPresellList/page", {
data: req,
success: function (res) {
- console.log(res);
self.data.loading = 0;
if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
var list = self.data.goodlist ? self.data.goodlist : [];
@@ -145,17 +145,92 @@ Page({
if (arr.length < 10) {
self.setData({no_more: 1})
}
+
+ // 预热活动设置倒计时
+ if (self.data.type == 0) {
+ clearInterval(self.data.timer);
+ self.data.timer = setInterval(function () {
+ self.countDown();
+ }, 1000);
+
+ }
} else {
self.setData({no_more: 1})
}
self.setData({is_get: 1})
-
+
}
})
},
+
+
go_index:function () {
getApp().goto("/pages/index/index/index");
- }
+ },
+
+
+ tip: function(e){
+ // 获取模板Data数据 1进行中 0预热中
+ var typeValue = e.currentTarget.dataset.ty;
+ // 初始化数据
+ this.data.type = typeValue;
+ this.data.loading = 0;
+ this.data.no_more = 0;
+ this.data.page = 1;
+ this.data.goodlist = [];
+ var goodslist = this.data.goodlist;
+ // 设置模板Data数据
+ this.setData({
+ type: typeValue,
+ goodlist: goodslist,
+ });
+ // 请求接口数据
+ this.get_list();
+ },
+
+ //----倒计时函数-----
+ countDown() {
+ var th=this;
+ // 获取当前时间,同时得到活动结束时间数组
+ let newTime = ut.gettimestamp();
+ var endTimeList = this.data.goodlist;
+ if(endTimeList==null) return null
+ // 对结束时间进行处理渲染到页面
+ for (var i = 0; i < endTimeList.length; i++){
+ var o = endTimeList[i];
+ var endTime = o.start_time;
+ let obj = null;
+ // 如果活动未结束,对时间进行处理
+ if (endTime - newTime > 0){
+ let time = (endTime - newTime);
+ // 获取天、时、分、秒
+ let day = parseInt(time / (60 * 60 * 24));
+ let hou = parseInt(time % (60 * 60 * 24) / 3600);
+ let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+ let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+ obj = {
+ day: this.timeFormat(day),
+ hou: this.timeFormat(hou),
+ min: this.timeFormat(min),
+ sec: this.timeFormat(sec),
+ hide: 1
+ }
+ }else{
+ //活动已结束,全部设置为'00'
+ obj = {
+ day: '00',
+ hou: '00',
+ min: '00',
+ sec: '00'
+ }
+ }
+ var txt ="goodlist["+i+"].djs";
+ th.setData({ [txt]: obj});
+ }
+ },
+
+
+
});
diff --git a/packageC/pages/presell/list/list.wxml b/packageC/pages/presell/list/list.wxml
index 7af0bb6..7cfe9ff 100644
--- a/packageC/pages/presell/list/list.wxml
+++ b/packageC/pages/presell/list/list.wxml
@@ -37,7 +37,7 @@
-
+
已预售{{filters.toFix((item.buy_goodnum+item.virtual_qty)/(item.presell_sumqty+item.virtual_qty)*100,0)}}%
@@ -45,32 +45,56 @@
库存还剩{{item.presell_sumqty-item.buy_goodnum}}件
-
-
+
-
+
+ 剩余:
+ {{item.djs.day}}天
+ {{item.djs.hou}}时
+ {{item.djs.min}}分
+ {{item.djs.sec}}秒
+
+
¥{{item.presell_price}}
{{item.price}}
零售价¥{{item.market_price}}
-
- 去抢购
+ 去抢购
+ 即将开始
+
-
-
- 去首页逛逛
-
- -- 没有更多 --
+
+
+
+ -- 没有更多 --
+
+
+
+
+
+
+
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index 3e22280..1846baf 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -175,7 +175,10 @@ Page({
//----------子页返回父页触发----------
onShow: function () {
var th = this;
- th.setData({show_submit: 0}); //让提交先掩藏
+ th.setData({
+ show_submit: 0,
+
+ }); //让提交先掩藏
th.data.g_cart_q_time = null;
if (th.data.isclose == 0) {
@@ -328,6 +331,7 @@ Page({
typeof func == "function" && func();
})
},
+
//------获取会员信息-----先获取用户信息,在进行下一步---
get_info: function (func) {
var user_id = t.globalData.user_id;
@@ -831,6 +835,8 @@ Page({
get_buy_goods: function (e) {
var th = this;
var gg = to.get_b_now();
+
+
//--------如果goods_id一样,就是要立即购买-----
if (e == gg.goods_id) {
a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, {
@@ -978,6 +984,11 @@ Page({
} else {
//--看是不是搭配促销--
if (gg.prom_type == 5) {
+
+ th.setData({
+ 'is_coupon': gg.is_coupon
+ });
+
t.data.data.prom_id = gg.prom_id;
t.data.data.prom_type = 5;
if (gg.room_id) {
@@ -3591,6 +3602,7 @@ Page({
if (th.data.is_b_now == 1) {
th.setData({index: m_wind, is_express: m_wind});
} else {
+ clearInterval(ui);
var ui = setInterval(function () {
if (th.data.cartlist) {
var c_arr = th.data.cartlist;
diff --git a/pages/cart/cart2/cart2.wxml b/pages/cart/cart2/cart2.wxml
index e9bb202..b3e0d46 100644
--- a/pages/cart/cart2/cart2.wxml
+++ b/pages/cart/cart2/cart2.wxml
@@ -343,11 +343,12 @@
+
{{order.store_prom}}
-
+
优惠券 {{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index d5c8dec..c6b12d9 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -3105,8 +3105,8 @@ Page({
//--------检查是否活动,活动是否开始,或者是否结束-------
async check_prom(gid, prom_type, prom_id) {
- console.log('check_prom');
- var ee = this,th = ee;
+ var ee = this,
+ th = ee;
var user_id=getApp().globalData.user_id;
if(!user_id) user_id=0;
@@ -3118,6 +3118,7 @@ Page({
}
if(prom_type==2){
+
//-------判断团购活动是否抢光---------
await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
1: 1
@@ -3129,11 +3130,12 @@ Page({
});
//拿取价格并且判断时间--
getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gid+"/"+ prom_id, {
- success: function (t) {
- if (t.data.code != 0) {
- ee.get_normal(gid);
- return false;
- }
+ success: function (t) {
+ if (t.data.code != 0) {
+ ee.get_normal(gid);
+ return false;
+ }
+
//----已经结束-----
if (t.data.data.is_end == 1) {
ee.get_normal(gid);
@@ -3141,17 +3143,18 @@ Page({
}
//----已经过期-----
var now = ut.gettimestamp();
- if (t.data.data.end_time < now || t.data.data.start_time>now) {
+ // if (t.data.data.end_time < now || t.data.data.start_time > now) {
+ if (t.data.data.end_time < now) {
ee.get_normal(gid);
return false;
}
-
+
/*-- 还没有开始预热的也不显示 --*/
if (t.data.data.show_time > now) {
ee.get_normal(gid);
return false;
}
-
+
var t_gd = ee.data.data;
var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");