diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 32ff65a..4b2e251 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -21,6 +21,9 @@ let self = null; Page({ data: { + type: 0, + a_btn_type: true, //测试底部按钮显示 + start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始) color_type: 0, //线条控制 color_type_one: 0, @@ -2379,13 +2382,30 @@ Page({ countDown(time, prom_st) { if (!this.data.is_timer) return false; var th = this; + var {presellForm:{start_time,show_time,end_time},presellForm} = this.data; // 获取当前时间,同时得到活动结束时间数组 var endTime = time; var newTime = ut.gettimestamp(); // 对结束时间进行处理渲染到页面 var obj = null; - // 如果活动未结束,对时间进行处理 - if (endTime - newTime > 0) { + var type = 0; + + if ( show_time && newTime>=show_time && newTime 0) { + // 如果活动未结束,对时间进行处理 var time = (endTime - newTime); // 获取天、时、分、秒 var day = parseInt(time / (60 * 60 * 24)); @@ -2398,8 +2418,8 @@ Page({ min: this.timeFormat(min), sec: this.timeFormat(sec) } + type = 1 } else { - //活动已结束,全部设置为'00' obj = { day: '00', @@ -2407,19 +2427,20 @@ Page({ min: '00', sec: '00' } + th.setData({ prom_time_text: '活动已经结束:', - prom_st: 3 + prom_st: 3, + djs: obj, + type: 2 }) - th.setData({ - djs: obj - }); - return false; + return false; } th.setData({ - djs: obj + djs: obj, + type: type }); setTimeout(function () { th.countDown(endTime) @@ -4716,6 +4737,7 @@ Page({ presell_id: presell_id, goods_id: th.data.gid } + console.log('获取预售从表') //------获取预售从表---------- await getApp().request.promiseGet(url, { data: rd @@ -4730,6 +4752,7 @@ Page({ }) } else { + console.log('获取预售从表', 'pre_id', th.data.pre_id) //------获取预售从表---------- await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => { if (res.data.code == 0 && res.data.data) { @@ -4798,12 +4821,13 @@ Page({ } if (act_data.start_time > ut.gettimestamp()) { - wx.showToast({ title: "活动还未开始", icon: 'none', duration: 3000 }); - setTimeout(function () { - ut.wx_back(); - }, 2000) - gnext = 0; - return false; + // wx.showToast({ title: "活动还未开始", icon: 'none', duration: 3000 }); + // setTimeout(function () { + // ut.wx_back(); + // }, 2000) + // gnext = 0; + th.setData({ show: true }); + // return false; } th.setData({ @@ -4838,11 +4862,12 @@ Page({ } }) if (!pre_arr) { - wx.showToast({ title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000 }); - setTimeout(function () { - ut.wx_back(); - }, 2000) - return false; + // wx.showToast({ title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000 }); + // setTimeout(function () { + // ut.wx_back(); + // }, 2000) + th.setData({ show: true }); + // return false; } if (func) { func(); diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.wxml b/packageC/pages/presell/goodsInfo/goodsInfo.wxml index 9c34892..fda086f 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.wxml +++ b/packageC/pages/presell/goodsInfo/goodsInfo.wxml @@ -74,7 +74,8 @@ - + + 预售价 @@ -88,28 +89,28 @@ - 距活动结束还有 + 距活动{{type==0?'开始':'结束'}}还有 - + {{djs.day}} - + - + {{djs.hou}} - - + + {{djs.min}} - - + + {{djs.sec}} - + @@ -128,11 +129,11 @@ - 尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}} + 尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}} - 总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件 + 总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件 限购:{{presellList.vip_butyqty}}件 限购:不限 已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件 @@ -209,7 +210,7 @@ - + @@ -219,7 +220,7 @@ {{item.is_anonymous!=1?item.username:'匿名'}} - + @@ -434,7 +435,7 @@ {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}} - + @@ -450,12 +451,12 @@ - + - + @@ -474,7 +475,7 @@ 店家回复: - + {{r_item.content}} @@ -529,7 +530,8 @@ - + 即将开始 + {{filters.format_time(presellForm.end_time,2)}} 预售结束 @@ -721,7 +723,7 @@ {{sec_sto.name}}