|
@@ -47,11 +47,12 @@ Page({
|
|
|
// this.getCartList();
|
|
// this.getCartList();
|
|
|
},
|
|
},
|
|
|
onShow: function () {
|
|
onShow: function () {
|
|
|
|
|
+ var that = this;
|
|
|
this.getCartList();
|
|
this.getCartList();
|
|
|
this.setData({submitlock: false});
|
|
this.setData({submitlock: false});
|
|
|
this.setData({selectedall: false});
|
|
this.setData({selectedall: false});
|
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
|
- this.getCartListAndSelected();
|
|
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
},50);
|
|
},50);
|
|
|
},
|
|
},
|
|
|
getCartList:function(){
|
|
getCartList:function(){
|
|
@@ -156,7 +157,7 @@ Page({
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
that.setData({submitlock: false});
|
|
that.setData({submitlock: false});
|
|
|
that.setData({selectedall: false});
|
|
that.setData({selectedall: false});
|
|
|
- that.getCartListAndSelected();
|
|
|
|
|
|
|
+ // that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
} else if (sm.cancel) {
|
|
} else if (sm.cancel) {
|
|
@@ -187,7 +188,7 @@ Page({
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
that.setData({submitlock: false});
|
|
that.setData({submitlock: false});
|
|
|
that.setData({selectedall: false});
|
|
that.setData({selectedall: false});
|
|
|
- that.getCartListAndSelected();
|
|
|
|
|
|
|
+ // that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
} else if (sm.cancel) {
|
|
} else if (sm.cancel) {
|
|
@@ -231,7 +232,7 @@ Page({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
- this.getCartList();
|
|
|
|
|
|
|
+ // this.getCartList();
|
|
|
that.setData({submitlock: false});
|
|
that.setData({submitlock: false});
|
|
|
that.setData({selectedall: false});
|
|
that.setData({selectedall: false});
|
|
|
that.getCartListAndSelected();
|
|
that.getCartListAndSelected();
|
|
@@ -248,11 +249,21 @@ Page({
|
|
|
['cartList[' + index + '].IsBuy']: !bool
|
|
['cartList[' + index + '].IsBuy']: !bool
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
- wx.showToast({
|
|
|
|
|
- title: '当前商品秒杀已结束或尚未开始~',
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- duration: 2000
|
|
|
|
|
- })
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(Date.parse(Date.parse(new Date()) / 1000 > this.data.cartList[index].seckill_end)){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '当前商品秒杀已结束~',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ })
|
|
|
|
|
+ }else{
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '当前商品秒杀尚未开始~',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.checkSelected();
|
|
this.checkSelected();
|
|
@@ -322,7 +333,7 @@ Page({
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
that.setData({submitlock: false});
|
|
that.setData({submitlock: false});
|
|
|
that.setData({selectedall: false});
|
|
that.setData({selectedall: false});
|
|
|
- that.getCartListAndSelected();
|
|
|
|
|
|
|
+ // that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
@@ -404,7 +415,7 @@ Page({
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
that.setData({submitlock: false});
|
|
that.setData({submitlock: false});
|
|
|
that.setData({selectedall: false});
|
|
that.setData({selectedall: false});
|
|
|
- that.getCartListAndSelected();
|
|
|
|
|
|
|
+ // that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
} else if (sm.cancel) {
|
|
} else if (sm.cancel) {
|
|
@@ -506,7 +517,7 @@ Page({
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
that.setData({submitlock: false});
|
|
that.setData({submitlock: false});
|
|
|
that.setData({selectedall: false});
|
|
that.setData({selectedall: false});
|
|
|
- that.getCartListAndSelected();
|
|
|
|
|
|
|
+ // that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
}
|
|
}
|