...
|
...
|
@@ -129,22 +129,7 @@ Component({ |
|
|
},
|
|
|
|
|
|
bindPlus() {
|
|
|
if (!this.data.colorSelected) {
|
|
|
if (this.data.pickerData.view.goodsList.length) {
|
|
|
this.data.pickerData.view.goodsList.map((value, index, array) => {
|
|
|
if (value.selected) {
|
|
|
this.setData({colorSelected: true})
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
this.triggerEvent('errorToast', {
|
|
|
title: '请选择颜色',
|
|
|
titleClassName: 'wetoast-title',
|
|
|
duration: 1000
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
this.checkColor();
|
|
|
|
|
|
if (!this.data.selectedSKU) {
|
|
|
this.triggerEvent('errorToast', {
|
...
|
...
|
@@ -184,13 +169,34 @@ Component({ |
|
|
this.setData({pickerData});
|
|
|
},
|
|
|
goPayment() {
|
|
|
this.checkColor();
|
|
|
this.triggerEvent('goPayment', this.data)
|
|
|
},
|
|
|
addShopCart() {
|
|
|
this.checkColor();
|
|
|
this.triggerEvent('addShopCart', this.data)
|
|
|
},
|
|
|
chooseSizeColorCompleted() {
|
|
|
this.triggerEvent('chooseSizeColorCompleted', this.data)
|
|
|
this.checkColor();
|
|
|
this.triggerEvent('chooseSizeColorCompleted', this.data)
|
|
|
},
|
|
|
checkColor() {
|
|
|
if (!this.data.colorSelected) {
|
|
|
if (this.data.pickerData.view.goodsList.length) {
|
|
|
this.data.pickerData.view.goodsList.map((value, index, array) => {
|
|
|
if (value.selected) {
|
|
|
this.setData({colorSelected: true})
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
this.triggerEvent('errorToast', {
|
|
|
title: '请选择颜色',
|
|
|
titleClassName: 'wetoast-title',
|
|
|
duration: 1000
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|