|
@@ -44,17 +44,18 @@ Page({
|
|
|
clearInterval(this.data.timer);
|
|
clearInterval(this.data.timer);
|
|
|
},
|
|
},
|
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
|
- clearInterval(this.data.timer);
|
|
|
|
|
// this.getCartList();
|
|
// this.getCartList();
|
|
|
},
|
|
},
|
|
|
onShow: function () {
|
|
onShow: function () {
|
|
|
- clearInterval(this.data.timer);
|
|
|
|
|
this.getCartList();
|
|
this.getCartList();
|
|
|
this.setData({submitlock: false});
|
|
this.setData({submitlock: false});
|
|
|
this.setData({selectedall: false});
|
|
this.setData({selectedall: false});
|
|
|
- this.getCartListAndSelected();
|
|
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
|
+ this.getCartListAndSelected();
|
|
|
|
|
+ },50);
|
|
|
},
|
|
},
|
|
|
getCartList:function(){
|
|
getCartList:function(){
|
|
|
|
|
+ clearInterval(this.data.timer);
|
|
|
console.log('getCartList')
|
|
console.log('getCartList')
|
|
|
var that = this
|
|
var that = this
|
|
|
var url = 'v1/cart/list'
|
|
var url = 'v1/cart/list'
|
|
@@ -153,6 +154,9 @@ Page({
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
|
|
+ that.setData({submitlock: false});
|
|
|
|
|
+ that.setData({selectedall: false});
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
} else if (sm.cancel) {
|
|
} else if (sm.cancel) {
|
|
@@ -181,6 +185,9 @@ Page({
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
|
|
+ that.setData({submitlock: false});
|
|
|
|
|
+ that.setData({selectedall: false});
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
} else if (sm.cancel) {
|
|
} else if (sm.cancel) {
|
|
@@ -225,6 +232,9 @@ Page({
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
this.getCartList();
|
|
this.getCartList();
|
|
|
|
|
+ that.setData({submitlock: false});
|
|
|
|
|
+ that.setData({selectedall: false});
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
},
|
|
},
|
|
|
itemselected:function(e){
|
|
itemselected:function(e){
|
|
|
console.log(this)
|
|
console.log(this)
|
|
@@ -310,6 +320,9 @@ Page({
|
|
|
console.log('mulChangeState',res)
|
|
console.log('mulChangeState',res)
|
|
|
if(res.data.result){
|
|
if(res.data.result){
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
|
|
+ that.setData({submitlock: false});
|
|
|
|
|
+ that.setData({selectedall: false});
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
@@ -389,6 +402,9 @@ Page({
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
that.getCartList();
|
|
that.getCartList();
|
|
|
|
|
+ that.setData({submitlock: false});
|
|
|
|
|
+ that.setData({selectedall: false});
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
}
|
|
}
|
|
|
_request.$post(url, params, success);
|
|
_request.$post(url, params, success);
|
|
|
} else if (sm.cancel) {
|
|
} else if (sm.cancel) {
|
|
@@ -474,10 +490,31 @@ Page({
|
|
|
|
|
|
|
|
}else{
|
|
}else{
|
|
|
that.setData({
|
|
that.setData({
|
|
|
- ['seckillruntimearr['+index+']']:'秒杀已结束,左滑商品从购物车删除'
|
|
|
|
|
|
|
+ ['seckillruntimearr['+index+']']:'秒杀已结束'
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ var url = "/v1/cart/mult_delele";
|
|
|
|
|
+ var params = {
|
|
|
|
|
+ ids:that.data.cartList[index].id
|
|
|
|
|
+ }
|
|
|
|
|
+ var success = function (res) {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ if(res.data.result){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ clearInterval(that.data.timer);
|
|
|
|
|
+ that.getCartList();
|
|
|
|
|
+ that.setData({submitlock: false});
|
|
|
|
|
+ that.setData({selectedall: false});
|
|
|
|
|
+ that.getCartListAndSelected();
|
|
|
|
|
+ }
|
|
|
|
|
+ _request.$post(url, params, success);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ ['seckillruntimearr['+index+']']:''
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|