Browse Source

修改

选项类型定制选项仅一个选项直接选中
xiaohaizhao 9 tháng trước cách đây
mục cha
commit
325546b3b5
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      pages/index/collect/modules/customMade/index.js

+ 6 - 2
pages/index/collect/modules/customMade/index.js

@@ -23,9 +23,13 @@ Component({
     init(data, prefix = '') {
       return new Promise((resolve) => {
         getCustomItems(data, prefix).then(list => {
-          console.log("list", list)
           this.setData({
-            list
+            list: list.map(v => {
+              if (v.type == '可选' && v.rowsdetail.length == 1) {
+                v.value = v.rowsdetail[0].num
+              }
+              return v
+            })
           });
           this.getResult();
           resolve(list.length);