Bläddra i källkod

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

张延森 5 år sedan
förälder
incheckning
e30702413d

+ 8
- 3
src/pages/activity/detail/assemble.js Visa fil

@@ -84,8 +84,6 @@ export default class Detail extends Component {
84 84
         this.toggleGrantAvatar()
85 85
       }
86 86
       this.initPageData()
87
-      // Taro.setStorageSync('router', { query: {} })
88
-      // console.log(Taro.getStorageSync('router'),"hhhhhhhhhhhhhhhhhhhhhh")
89 87
     })
90 88
   }
91 89
 
@@ -93,7 +91,14 @@ export default class Detail extends Component {
93 91
     this.stopTicker()
94 92
     this.state.pointRecordId && updatePoint(this.state.pointRecordId)
95 93
 
96
-    Taro.setStorageSync('router', { query: {} })
94
+    const router = Taro.getStorageSync('router')
95
+    Taro.setStorageSync('router', {
96
+      ...router,
97
+      query: {
98
+        ...router.query,
99
+        consultant: undefined,
100
+      }
101
+    })
97 102
   }
98 103
 
99 104
   componentDidShow() {

+ 10
- 3
src/pages/activity/detail/assistance.js Visa fil

@@ -93,7 +93,14 @@ export default class Detail extends Component {
93 93
     this.stopTicker()
94 94
     this.state.pointRecordId && updatePoint(this.state.pointRecordId)
95 95
 
96
-    Taro.setStorageSync('router', { query: {} })
96
+    const router = Taro.getStorageSync('router')
97
+    Taro.setStorageSync('router', {
98
+      ...router,
99
+      query: {
100
+        ...router.query,
101
+        consultant: undefined,
102
+      }
103
+    })
97 104
   }
98 105
 
99 106
   componentDidShow() {
@@ -480,7 +487,7 @@ export default class Detail extends Component {
480 487
 
481 488
       },
482 489
       complete() {
483
-        
490
+
484 491
         // 必须授权头像
485 492
         if (that.toggleGrantAvatar()) {
486 493
           const detail = that.state.detail
@@ -520,7 +527,7 @@ export default class Detail extends Component {
520 527
   }
521 528
 
522 529
   // 请求好友助力
523
-  askForHelp = () => {    
530
+  askForHelp = () => {
524 531
     // 必须授权头像
525 532
     if (this.toggleGrantAvatar()) {
526 533
       const initiateDetail = this.state.initiateDetail

+ 8
- 1
src/pages/activity/detail/index.js Visa fil

@@ -79,7 +79,14 @@ export default class Detail extends Component {
79 79
     const { recordId } = this.state
80 80
     recordId && updatePoint(recordId)
81 81
 
82
-    Taro.setStorageSync('router', { query: {} })
82
+    const router = Taro.getStorageSync('router')
83
+    Taro.setStorageSync('router', {
84
+      ...router,
85
+      query: {
86
+        ...router.query,
87
+        consultant: undefined,
88
+      }
89
+    })
83 90
   }
84 91
 
85 92
   componentWillReceiveProps() {

+ 67
- 64
src/pages/news/detail/index.js Visa fil

@@ -86,7 +86,14 @@ export default class NewsDetail extends Component {
86 86
     const { recordId } = this.state
87 87
     recordId && updatePoint(recordId)
88 88
 
89
-    Taro.setStorageSync('router', { query: {} })
89
+    const router = Taro.getStorageSync('router')
90
+    Taro.setStorageSync('router', {
91
+      ...router,
92
+      query: {
93
+        ...router.query,
94
+        consultant: undefined,
95
+      }
96
+    })
90 97
   }
91 98
   
92 99
   // 报备客户
@@ -221,7 +228,7 @@ export default class NewsDetail extends Component {
221 228
         })
222 229
         console.info('资讯详情')
223 230
       })
224
-    
231
+
225 232
       this.setState({
226 233
         detail: res,
227 234
         loaded: true,
@@ -308,72 +315,68 @@ export default class NewsDetail extends Component {
308 315
       console.info('生成资讯详情海报')
309 316
     })
310 317
   }
311
-  renderNews() {
318
+
319
+  render() {
312 320
     const { detail, loaded, isSaved, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
313 321
     const { userInfo: { person: { personId, nickname, name } } } = this.props
314 322
     return (
315
-      <Block>
316
-        {/* 生成海报 */}
317
-        {posterVisible && (<Poster data={posterData} toggle={this.handleTogglePoster}></Poster>)}
318
-        {
319
-          loaded && (
320
-            <Block>
321
-              <ScrollView className="detail" scrollY>
322
-                <View class="detail-title">{detail.newsName}</View>
323
-                <View className="detail-stat">
324
-                  <View className='left-icon'>
325
-                    <View className='eye-num'><Text className="iconfont icon-eye"></Text>{detail.pvNum || 0}</View>
326
-                    {/* <View><Text className="iconfont icon-fenxiang1"></Text>{detail.shareNum || 0}</View> */}
327
-                    <View className='fenx'><Image src={require('@assets/person/fenxiang.png')} className='fenxiang1-img'></Image>{detail.shareNum || 0}</View>
323
+      <authorizationComponent>
324
+        <Block>
325
+          {/* 生成海报 */}
326
+          {posterVisible && (<Poster data={posterData} toggle={this.handleTogglePoster}></Poster>)}
327
+          {
328
+            loaded && (
329
+              <Block>
330
+                <ScrollView className="detail" scrollY>
331
+                  <View class="detail-title">{detail.newsName}</View>
332
+                  <View className="detail-stat">
333
+                    <View className='left-icon'>
334
+                      <View className='eye-num'><Text className="iconfont icon-eye"></Text>{detail.pvNum || 0}</View>
335
+                      {/* <View><Text className="iconfont icon-fenxiang1"></Text>{detail.shareNum || 0}</View> */}
336
+                      <View className='fenx'><Image src={require('@assets/person/fenxiang.png')} className='fenxiang1-img'></Image>{detail.shareNum || 0}</View>
337
+                    </View>
338
+                    <View>{dayjs(detail.createDate).format('YYYY-MM-DD')}</View>
339
+                  </View>
340
+                  {/* <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={transferImage(detail.newsImg)}></Image> */}
341
+                  <View className="detail-con">
342
+                    {/* <richText nodes={detail.newsDetail} ></richText> */}
343
+                    <import src='../../../components/wxParse/wxParse.wxml' />
344
+                    <template is='wxParse' data='{{wxParseData:article.nodes}}' />
345
+                  </View>
346
+                </ScrollView>
347
+                <Notice></Notice>
348
+                <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
349
+                {
350
+                  consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={personId} name={name || nickname} data={consultData}></Consultant>
351
+                }
352
+                <View className="bot-nav flex">
353
+                  <View className='btn poster-btn' style={{ display: posterShow }} onClick={() => { this.handleTogglePoster(true) }}>
354
+                    {/* <Text className="iconfont icon-xiazai"></Text> */}
355
+                    <Image src={require('@assets/news/tupian.png')} className='poster-img'></Image>
356
+                    <Text className="txt">海报</Text>
357
+                  </View>
358
+                  <Button className="btn share-btn" open-type="share">
359
+                    {/* <Text className="icon-fenxiang iconfont"></Text> */}
360
+                    <Image src={require('@assets/news/fasong.png')} className='fenxiang-img'></Image>
361
+                    <Text className="txt">分享</Text>
362
+                  </Button>
363
+                  <View className="btn collection-btn" onClick={this.handleFavor}>
364
+                    {
365
+                      isSaved ? (
366
+                        <Text className="iconfont icon-shoucang saved"></Text>
367
+                      ) : (
368
+                          <Text className="iconfont icon-shoucang1"></Text>
369
+                        )
370
+                    }
371
+                    <Text className="txt">收藏</Text>
328 372
                   </View>
329
-                  <View>{dayjs(detail.createDate).format('YYYY-MM-DD')}</View>
330
-                </View>
331
-                {/* <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={transferImage(detail.newsImg)}></Image> */}
332
-                <View className="detail-con">
333
-                  <import src='../../../components/wxParse/wxParse.wxml' />
334
-                  <template is='wxParse' data='{{wxParseData:article.nodes}}' />
335
-                </View>
336
-              </ScrollView>
337
-              <Notice></Notice>
338
-              <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
339
-              {
340
-                consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={personId} name={name || nickname} data={consultData}></Consultant>
341
-              }
342
-              <View className="bot-nav flex">
343
-                <View className='btn poster-btn' style={{ display: posterShow }} onClick={() => { this.handleTogglePoster(true) }}>
344
-                  {/* <Text className="iconfont icon-xiazai"></Text> */}
345
-                  <Image src={require('@assets/news/tupian.png')} className='poster-img'></Image>
346
-                  <Text className="txt">海报</Text>
347
-                </View>
348
-                <Button className="btn share-btn" open-type="share">
349
-                  {/* <Text className="icon-fenxiang iconfont"></Text> */}
350
-                  <Image src={require('@assets/news/fasong.png')} className='fenxiang-img'></Image>
351
-                  <Text className="txt">分享</Text>
352
-                </Button>
353
-                <View className="btn collection-btn" onClick={this.handleFavor}>
354
-                  {
355
-                    isSaved ? (
356
-                      <Text className="iconfont icon-shoucang saved"></Text>
357
-                    ) : (
358
-                        <Text className="iconfont icon-shoucang1"></Text>
359
-                      )
360
-                  }
361
-                  <Text className="txt">收藏</Text>
362
-                </View>
363 373
 
364
-              </View>
365
-            </Block>
366
-          )
367
-        }
368
-      </Block>
369
-    );
370
-  }
371
-  
372
-  render(){
373
-  	return (
374
-  		<authorizationComponent>
375
-  			{this.renderNews()}
376
-  		</authorizationComponent>
377
-  	)
374
+                </View>
375
+              </Block>
376
+            )
377
+          }
378
+        </Block>
379
+      </authorizationComponent>
380
+    )
378 381
   }
379 382
 }

+ 8
- 1
src/pages/project/detail/index.js Visa fil

@@ -105,7 +105,14 @@ export default class Index extends Component {
105 105
     const { recordId } = this.state
106 106
     recordId && updatePoint(recordId)
107 107
 
108
-    Taro.setStorageSync('router', { query: {} })
108
+    const router = Taro.getStorageSync('router')
109
+    Taro.setStorageSync('router', {
110
+      ...router,
111
+      query: {
112
+        ...router.query,
113
+        consultant: undefined,
114
+      }
115
+    })
109 116
   }
110 117
 
111 118
   componentWillReceiveProps() {