Browse Source

savepoint

xujing 5 years ago
parent
commit
d03a8360d5
3 changed files with 40 additions and 31 deletions
  1. 1
    1
      config/prod.js
  2. 22
    15
      src/pages/activity/detail/index.js
  3. 17
    15
      src/pages/news/detail/index.js

+ 1
- 1
config/prod.js View File

9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10
     // HOST: '"https://lt.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    Version:'V3.5.5_2019-12-24'
12
+    Version:'V3.5.5_2019-12-25'
13
   },
13
   },
14
   weapp: {},
14
   weapp: {},
15
   h5: {}
15
   h5: {}

+ 22
- 15
src/pages/activity/detail/index.js View File

87
     const consultant = this.$router.params.consultant || router.query.consultant
87
     const consultant = this.$router.params.consultant || router.query.consultant
88
     const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
88
     const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
89
     const recommender = this.$router.params.recommender || router.query.recommender || ""
89
     const recommender = this.$router.params.recommender || router.query.recommender || ""
90
+
90
     queryActivityDetail(id).then(res => {
91
     queryActivityDetail(id).then(res => {
91
       Taro.hideLoading()
92
       Taro.hideLoading()
92
       const { isSaved, isSign } = res
93
       const { isSaved, isSign } = res
94
+
95
+      savePoint({
96
+        event: 'detail',
97
+        eventType: 'activity',
98
+        propertyName: '活动详情',
99
+        buildingId: res.buildingId,
100
+        targetId: res.dynamicId,
101
+        consultantId: consultantId,
102
+        sharePersonId: recommender,
103
+        data: '{}'
104
+      }).then(res1 => {
105
+        this.setState({
106
+          recordId: res1.recordId
107
+        })
108
+        console.log('活动详情')
109
+      }).catch(err => {
110
+        console.log(err, "err")
111
+      })
112
+
93
       this.setState({
113
       this.setState({
94
         detail: res,
114
         detail: res,
95
         isSaved,
115
         isSaved,
107
       })
127
       })
108
       WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
128
       WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
109
 
129
 
110
-      savePoint({
111
-        event: 'detail',
112
-        eventType: 'activity',
113
-        propertyName: '活动详情',
114
-        buildingId: res.buildingId,
115
-        targetId: res.dynamicId,
116
-        consultantId: consultantId,
117
-        sharePersonId: recommender,
118
-        data: '{}'
119
-      }).then(res1 => {
120
-        this.setState({
121
-          recordId: res1.recordId
122
-        })
123
-        console.log('活动详情')
124
-      })
130
+
125
     })
131
     })
126
 
132
 
127
     if (consultant) {
133
     if (consultant) {
177
     })
183
     })
178
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
184
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
179
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: title, shareContentImg: imgUrl };
185
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: title, shareContentImg: imgUrl };
186
+    console.log(`/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`)
180
     return {
187
     return {
181
       title: shareData.shareContentTitle,
188
       title: shareData.shareContentTitle,
182
       path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址
189
       path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址

+ 17
- 15
src/pages/news/detail/index.js View File

140
     })
140
     })
141
   }
141
   }
142
 
142
 
143
-  currentPageAndParams () {
143
+  currentPageAndParams() {
144
     const { detail: { newsId } } = this.state
144
     const { detail: { newsId } } = this.state
145
     const { userInfo: { person: { personId, personType, userId } } } = this.props
145
     const { userInfo: { person: { personId, personType, userId } } } = this.props
146
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
146
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
206
     Taro.showLoading()
206
     Taro.showLoading()
207
     queryNewsDetail(newsId).then(res => {
207
     queryNewsDetail(newsId).then(res => {
208
       Taro.hideLoading()
208
       Taro.hideLoading()
209
-      this.setState({
210
-        detail: res,
211
-        loaded: true,
212
-        isSaved: res.isSave
213
-      }, () => {
214
-        const { detail } = this.state
215
-        if (detail.posters && detail.posters.length && detail.posters[0].posterImg) {
216
-          this.setState({
217
-            posterShow: 'flex'
218
-          })
219
-        }
220
-      })
221
-
222
-      WxParse.wxParse('article', 'html', res.newsDetail, this.$scope, 0)
223
       // 埋点
209
       // 埋点
224
       savePoint({
210
       savePoint({
225
         event: 'detail',
211
         event: 'detail',
236
         })
222
         })
237
         console.info('资讯详情')
223
         console.info('资讯详情')
238
       })
224
       })
225
+    
226
+      this.setState({
227
+        detail: res,
228
+        loaded: true,
229
+        isSaved: res.isSave
230
+      }, () => {
231
+        const { detail } = this.state
232
+        if (detail.posters && detail.posters.length && detail.posters[0].posterImg) {
233
+          this.setState({
234
+            posterShow: 'flex'
235
+          })
236
+        }
237
+      })
238
+
239
+      WxParse.wxParse('article', 'html', res.newsDetail, this.$scope, 0)
240
+
239
     })
241
     })
240
 
242
 
241
     if (consultant) {
243
     if (consultant) {