xujing 5 lat temu
rodzic
commit
734fb33887
1 zmienionych plików z 11 dodań i 10 usunięć
  1. 11
    10
      src/pages/project/index.js

+ 11
- 10
src/pages/project/index.js Wyświetl plik

@@ -97,6 +97,7 @@ export default class Index extends Component {
97 97
 
98 98
       Taro.hideTabBar()
99 99
       this.getLocation()
100
+      this.getIndexShareInfo()
100 101
 
101 102
       Taro.setNavigationBarTitle({ title: this.props.userInfo.miniApp.name })
102 103
 
@@ -113,7 +114,15 @@ export default class Index extends Component {
113 114
       })
114 115
     })
115 116
   }
116
-
117
+  getIndexShareInfo() {
118
+    getIndexShare().then(res => {
119
+      this.setState({
120
+        shareImg: (res || {}).imgUrl,
121
+        imgDocument: (res || {}).imgDocument,
122
+      })
123
+      console.log(res, '首页分享信息')
124
+    })
125
+  }
117 126
 
118 127
   toChatList() {
119 128
     // const { dispatch } = getStore()
@@ -124,15 +133,7 @@ export default class Index extends Component {
124 133
   }
125 134
   componentDidShow() {
126 135
 
127
-    getIndexShare().then(res => {
128
-      this.setState({
129
-        shareImg: (res || {}).imgUrl,
130
-        imgDocument: (res || {}).imgDocument,
131
-      })
132
-      console.log(res, '首页分享信息')
133
-    }).catch(err => {
134
-      console.log(err, '首页分享err信息')
135
-    })
136
+    this.getIndexShareInfo()
136 137
     if (this.props.curCity.id) {
137 138
       ready.queue(() => {
138 139
         // Taro.hideTabBar()