diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js
index e949f67..14e3197 100644
--- a/packageC/pages/group_list/group_list.js
+++ b/packageC/pages/group_list/group_list.js
@@ -52,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({
@@ -73,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,
+ });
+
+ },
+
/**
* 生命周期函数--监听页面隐藏
*/
@@ -211,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 a652211..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,30 +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 aed06aa..6770daf 100644
--- a/packageC/pages/group_list/group_list.wxss
+++ b/packageC/pages/group_list/group_list.wxss
@@ -129,4 +129,9 @@ width: 100%;
width: 465rpx;
margin-left:20rpx;
margin-right: 5rpx;
+}
+
+.blue_c {
+ color: #059de5;
+
}
\ No newline at end of file
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index cc37be2..1222ad8 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -3098,7 +3098,8 @@ Page({
//--------检查是否活动,活动是否开始,或者是否结束-------
async check_prom(gid, prom_type, prom_id) {
- var ee = this,th = ee;
+ var ee = this,
+ th = ee;
var user_id=getApp().globalData.user_id;
if(!user_id) user_id=0;
@@ -3110,6 +3111,7 @@ Page({
}
if(prom_type==2){
+
//-------判断团购活动是否抢光---------
await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
1: 1
@@ -3121,11 +3123,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);
@@ -3133,17 +3136,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");