xiaohaizhao 1 rok temu
rodzic
commit
f5ecbbc609

+ 18 - 16
pages/index/market/modules/list/index.js

@@ -20,22 +20,24 @@ Component({
   },
   lifetimes: {
     attached: function () {
-      try {
-        const {
-          formName,
-          appName
-        } = this.data.authName;
-        let privacyFieldC = wx.getStorageSync('auth')[appName].forms[formName].formcols.map(v => v.title);
-        this.setData({
-          privacyFieldC
-        })
-        console.log("privacyFieldC", privacyFieldC)
-      } catch (error) {
-        console.error("查询隐私字段", error)
-        this.setData({
-          privacyFieldC: []
-        })
-      }
+      setTimeout(() => {
+        try {
+          const {
+            formName,
+            appName
+          } = this.data.authName;
+          let privacyFieldC = wx.getStorageSync('auth')[appName].forms[formName].formcols.map(v => v.title);
+          this.setData({
+            privacyFieldC
+          })
+          console.log("privacyFieldC", privacyFieldC)
+        } catch (error) {
+          console.error("查询隐私字段", error)
+          this.setData({
+            privacyFieldC: []
+          })
+        }
+      }, 1000)
     }
   },
   methods: {

+ 1 - 1
utils/FormatTheAttachment.js

@@ -17,7 +17,7 @@ function fileList(list) {
         list[i].cover = `/static/image/file/unknown.png`
         const suffix = list[i].postfix.toLowerCase();
         if (suffix != "folder") {
-            for (var key in suffixList) {
+            for (let key in suffixList) {
                 if (suffixList[key].some(value => value == suffix)) {
                     list[i].fileType = key;
                     if (key == 'image') {