xiaohaizhao 1 년 전
부모
커밋
8dd930bd98
1개의 변경된 파일10개의 추가작업 그리고 5개의 파일을 삭제
  1. 10 5
      pages/index/collect/modules/custom.js

+ 10 - 5
pages/index/collect/modules/custom.js

@@ -7,8 +7,6 @@ Component({
   },
   methods: {
     onClick(item) {
-      console.log(item)
-      console.log(this.data.product)
       if (this.data.product != null && item.itemid == this.data.product.itemid) return this.setData({
         show: true
       })
@@ -35,9 +33,16 @@ Component({
           title: '定制方案获取失败',
           icon: "none"
         })
-        if (item.lengthschemeid) arr.push(s[0].data)
-        if (item.widthschemeid) arr.push(s[1].data)
-
+        if (item.lengthschemeid) {
+          let data = s[0].data;
+          if (item.length == 0) item.length = data.type == '可选' ? data.rowsdetail[0].num || 0 : data.min;
+          arr.push(data)
+        }
+        if (item.widthschemeid) {
+          let data = s[1].data;
+          if (item.width == 0) item.width = data.type == '可选' ? data.rowsdetail[0].num || 0 : data.min;
+          arr.push(data)
+        }
         this.setData({
           show: true,
           arr,