소스 검색

修改

选项类型定制选项仅一个选项直接选中
xiaohaizhao 1 년 전
부모
커밋
325546b3b5
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  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);