|
@@ -96,14 +96,17 @@ Page({
|
|
|
this.getDetail();
|
|
|
},
|
|
|
clickBut() {
|
|
|
- wx.showToast({
|
|
|
+ this.data.detail.tradefield.length >= 2 ? wx.showToast({
|
|
|
title: '请选择加入产品领域',
|
|
|
icon: "none",
|
|
|
duration: 3000
|
|
|
- })
|
|
|
+ }) : this.handleStorage(0);
|
|
|
},
|
|
|
- /* 加入购物车 */
|
|
|
+ /* 选择领域 */
|
|
|
storage(e) {
|
|
|
+ this.handleStorage(e.detail.value)
|
|
|
+ },
|
|
|
+ handleStorage(index) {
|
|
|
let detail = this.data.detail;
|
|
|
_Http.basic({
|
|
|
"id": 20220924095102,
|
|
@@ -112,7 +115,7 @@ Page({
|
|
|
"itemid": detail.itemid, //货品id
|
|
|
"qty": 1, //数量
|
|
|
"itemno": this.data.itemno, //货品编号
|
|
|
- tradefield: detail.tradefield[e.detail.value].tradefield
|
|
|
+ tradefield: detail.tradefield[index].tradefield
|
|
|
},
|
|
|
}).then(res => {
|
|
|
console.log("加入购物车", res)
|