Sfoglia il codice sorgente

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into dev

张延森 5 anni fa
parent
commit
849bb8b634

+ 1
- 1
config/prod.js Vedi File

@@ -9,7 +9,7 @@ module.exports = {
9 9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 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 14
   weapp: {},
15 15
   h5: {}

+ 25
- 15
src/pages/activity/detail/index.js Vedi File

@@ -12,6 +12,7 @@ import { getQrCodeParams } from '@utils/qrcode'
12 12
 import { getCardDetail } from '@services/card'
13 13
 import { ROLE_CODE } from '@constants/user'
14 14
 import Consultant from '@components/consultant'
15
+import AuthorizationComponent from '@components/authorizationComponent'
15 16
 import {
16 17
   addActivityShareNum,
17 18
   signupActivity,
@@ -87,9 +88,29 @@ export default class Detail extends Component {
87 88
     const consultant = this.$router.params.consultant || router.query.consultant
88 89
     const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
89 90
     const recommender = this.$router.params.recommender || router.query.recommender || ""
91
+
90 92
     queryActivityDetail(id).then(res => {
91 93
       Taro.hideLoading()
92 94
       const { isSaved, isSign } = res
95
+
96
+      savePoint({
97
+        event: 'detail',
98
+        eventType: 'activity',
99
+        propertyName: '活动详情',
100
+        buildingId: res.buildingId,
101
+        targetId: res.dynamicId,
102
+        consultantId: consultantId,
103
+        sharePersonId: recommender,
104
+        data: '{}'
105
+      }).then(res1 => {
106
+        this.setState({
107
+          recordId: res1.recordId
108
+        })
109
+        console.log('活动详情')
110
+      }).catch(err => {
111
+        console.log(err, "err")
112
+      })
113
+
93 114
       this.setState({
94 115
         detail: res,
95 116
         isSaved,
@@ -107,21 +128,7 @@ export default class Detail extends Component {
107 128
       })
108 129
       WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
109 130
 
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
-      })
131
+
125 132
     })
126 133
 
127 134
     if (consultant) {
@@ -177,6 +184,7 @@ export default class Detail extends Component {
177 184
     })
178 185
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
179 186
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: title, shareContentImg: imgUrl };
187
+    console.log(`/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`)
180 188
     return {
181 189
       title: shareData.shareContentTitle,
182 190
       path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址
@@ -383,6 +391,7 @@ export default class Detail extends Component {
383 391
     const { userInfo: { person: { phone, personId, nickname, name } } } = this.props
384 392
     return (
385 393
       <Block>
394
+        <AuthorizationComponent>
386 395
         {/* 生成海报 */}
387 396
         {posterVisible && (<Poster data={posterData} toggle={this.togglePosterStatus}></Poster>)}
388 397
 
@@ -495,6 +504,7 @@ export default class Detail extends Component {
495 504
             </View>
496 505
           )
497 506
         }
507
+      </AuthorizationComponent>
498 508
       </Block>
499 509
     )
500 510
   }

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

@@ -140,7 +140,7 @@ export default class NewsDetail extends Component {
140 140
     })
141 141
   }
142 142
 
143
-  currentPageAndParams () {
143
+  currentPageAndParams() {
144 144
     const { detail: { newsId } } = this.state
145 145
     const { userInfo: { person: { personId, personType, userId } } } = this.props
146 146
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
@@ -206,20 +206,6 @@ export default class NewsDetail extends Component {
206 206
     Taro.showLoading()
207 207
     queryNewsDetail(newsId).then(res => {
208 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 210
       savePoint({
225 211
         event: 'detail',
@@ -236,6 +222,22 @@ export default class NewsDetail extends Component {
236 222
         })
237 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 243
     if (consultant) {

+ 5
- 5
src/pages/project/banner/index.js Vedi File

@@ -3,7 +3,7 @@ import { View, Swiper, SwiperItem, Image } from '@tarojs/components'
3 3
 // import { cdn } from '@constants/api'
4 4
 import './index.scss'
5 5
 import emptyImg from '@assets/empty.png'
6
-import { transferImage} from '@utils/tools'
6
+import { transferImage } from '@utils/tools'
7 7
 
8 8
 export default class SwiperBanner extends Component {
9 9
   static defaultProps = {
@@ -16,7 +16,7 @@ export default class SwiperBanner extends Component {
16 16
 
17 17
   }
18 18
 
19
-  changeCurrent (event) {
19
+  changeCurrent(event) {
20 20
     // const { isChange } = this.props
21 21
     const current = event.detail.current
22 22
 
@@ -25,15 +25,15 @@ export default class SwiperBanner extends Component {
25 25
     //    this.props.onChange(current)
26 26
     // } 
27 27
 
28
-  this.props.onChange &&  this.props.onChange(current)
28
+    this.props.onChange && this.props.onChange(current)
29 29
 
30 30
 
31 31
   }
32 32
 
33
-  onBannerClick (item) {
33
+  onBannerClick(item) {
34 34
     this.props.onClick(item)
35 35
   }
36
-  render () {
36
+  render() {
37 37
     const { list, style, indicatorDots, current } = this.props
38 38
 
39 39
     // console.log('banner', list)

+ 13
- 9
src/pages/project/index.js Vedi File

@@ -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,12 +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
-    })
136
+    this.getIndexShareInfo()
133 137
     if (this.props.curCity.id) {
134 138
       ready.queue(() => {
135 139
         // Taro.hideTabBar()
@@ -613,13 +617,13 @@ export default class Index extends Component {
613 617
               <View className="section section-top" style={{ marginTop: 0, paddingTop: 0 }}>
614 618
                 <View
615 619
                   style={{
616
-                    height: '500rpx', position: 'relative'
620
+                    height: '464rpx', position: 'relative'
617 621
                   }}>
618 622
                   {
619 623
                     this.state.visBanner && (
620 624
                       <Banner
621 625
                         style={{
622
-                          height: '500rpx'
626
+                          height: '464rpx'
623 627
                         }}
624 628
                         indicatorDots={false}
625 629
                         list={this.state.bannerList}