|
|
@@ -174,7 +174,6 @@ Page({
|
|
|
console.log('cbox',cbox)
|
|
|
that.setData({
|
|
|
productSize: val.data,
|
|
|
- canpay:false,
|
|
|
checkbox:cbox
|
|
|
});
|
|
|
}
|
|
|
@@ -348,6 +347,21 @@ Page({
|
|
|
pay: function (e) {
|
|
|
_handle.setFormId(e)
|
|
|
var that = this
|
|
|
+
|
|
|
+ //规格
|
|
|
+ let cflag = true;
|
|
|
+ for(let i in that.data.checkbox){
|
|
|
+ if(that.data[that.data.checkbox[i]] == 0) cflag = false;
|
|
|
+ }
|
|
|
+ if(!cflag){
|
|
|
+ wx.showToast({
|
|
|
+ title: '请先选择商品规格~',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
var url = "v1/product/" + that.data.productId + "/order/" + that.data.count
|
|
|
var params = {}
|
|
|
var success = function (res) {
|
|
|
@@ -373,6 +387,19 @@ Page({
|
|
|
},
|
|
|
addCart:function(){
|
|
|
var that = this;
|
|
|
+ //规格
|
|
|
+ let cflag = true;
|
|
|
+ for(let i in that.data.checkbox){
|
|
|
+ if(that.data[that.data.checkbox[i]] == 0) cflag = false;
|
|
|
+ }
|
|
|
+ if(!cflag){
|
|
|
+ wx.showToast({
|
|
|
+ title: '请先选择商品规格~',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
console.log('that.data.productId',that.data.productId)
|
|
|
var url = "v1/cart/" + that.data.productId + "/" + that.data.count
|
|
|
var params = {}
|