张延森 5 년 전
부모
커밋
67ba6ffc7d

+ 18
- 9
src/pages/activity/detail/assemble.js 파일 보기

@@ -11,6 +11,7 @@ import dayjs from 'dayjs'
11 11
 // import getUserPhone from '@utils/getUserPhone'
12 12
 import ready from '@utils/ready'
13 13
 import { getDownloadURL, times, formateLeftTime, getCanvasConfig, transferImage } from '@utils/tools'
14
+import { getQrCodeParams } from '@utils/qrcode'
14 15
 import {
15 16
   getGroupDetail,
16 17
   createGroupActivity,
@@ -95,18 +96,26 @@ export default class Detail extends Component {
95 96
   // 初始化页面数据
96 97
   initPageData = () => {
97 98
     if (!this.state.detail.groupActivityId) {
98
-      let id = this.$router.params.id
99
-      let recordId = this.$router.params.recordId
99
+      const router = Taro.getStorageSync('router')
100
+      let id = this.$router.params.id || router.query.id
101
+      let recordId = this.$router.params.recordId || router.query.recordId
100 102
 
101 103
       if (!id) {
102
-        const router = Taro.getStorageSync('router')
103
-        id = router.query.id
104
-        recordId = router.query.recordId
104
+        getQrCodeParams(this.$router.params.scene).then(res => {
105
+          this.setState({ id: res.id, recordId: res.recordId }, () => {
106
+            this.loadDetail()
107
+          })
108
+        }).catch(err => {
109
+          Taro.showToast({
110
+            title: '没有找到活动',
111
+            icon: 'none'
112
+          })
113
+        })
114
+      } else {
115
+        this.setState({ id, recordId }, () => {
116
+          this.loadDetail()
117
+        })
105 118
       }
106
-
107
-      this.setState({ id, recordId }, () => {
108
-        this.loadDetail()
109
-      })
110 119
     }
111 120
   }
112 121
 

+ 18
- 8
src/pages/activity/detail/assistance.js 파일 보기

@@ -11,6 +11,7 @@ import dayjs from 'dayjs'
11 11
 // import getUserPhone from '@utils/getUserPhone'
12 12
 import ready from '@utils/ready'
13 13
 import { getDownloadURL, times, formateLeftTime, getCanvasConfig, transferImage } from '@utils/tools'
14
+import { getQrCodeParams } from '@utils/qrcode'
14 15
 import {
15 16
   getHelpDetail,
16 17
   createHelpActivity,
@@ -95,18 +96,27 @@ export default class Detail extends Component {
95 96
   // 初始化页面数据
96 97
   initPageData = () => {
97 98
     if (!this.state.detail.helpActivityId) {
98
-      let id = this.$router.params.id
99
-      let initiateId = this.$router.params.initiateId
99
+      const router = Taro.getStorageSync('router')
100
+      let id = this.$router.params.id || router.query.id
101
+      let initiateId = this.$router.params.initiateId || router.query.initiateId
100 102
 
101 103
       if (!id) {
102
-        const router = Taro.getStorageSync('router')
103
-        id = router.query.id
104
-        initiateId = router.query.initiateId
104
+        getQrCodeParams(this.$router.params.scene).then(res => {
105
+          this.setState({ id: res.id, initiateId: res.initiateId }, () => {
106
+            this.loadDetail()
107
+          })
108
+        }).catch(err => {
109
+          Taro.showToast({
110
+            title: '没有找到活动',
111
+            icon: 'none'
112
+          })
113
+        })
114
+      } else {
115
+        this.setState({ id, initiateId }, () => {
116
+          this.loadDetail()
117
+        })
105 118
       }
106 119
 
107
-      this.setState({ id, initiateId }, () => {
108
-        this.loadDetail()
109
-      })
110 120
     }
111 121
   }
112 122
 

+ 20
- 4
src/pages/activity/detail/index.js 파일 보기

@@ -8,6 +8,7 @@ import WxParse from '@components/wxParse/wxParse'
8 8
 import getUserPhone from '@utils/getUserPhone'
9 9
 import ready from '@utils/ready'
10 10
 import { getDownloadURL, times, transferImage } from '@utils/tools'
11
+import { getQrCodeParams } from '@utils/qrcode'
11 12
 import {
12 13
   addActivityShareNum,
13 14
   signupActivity,
@@ -47,10 +48,25 @@ export default class Detail extends Component {
47 48
   componentWillMount() {
48 49
     ready.queue(() => {
49 50
       const router = Taro.getStorageSync('router')
50
-      const id = this.$router.params.id || router.query.id || '2fe920719b8b0db50011441462e647ad'
51
-      this.setState({ id }, () => {
52
-        this.loadDetail()
53
-      })
51
+      // const id = this.$router.params.id || router.query.id || '2fe920719b8b0db50011441462e647ad'
52
+
53
+      const id = this.$router.params.id || router.query.id
54
+      if (!id) {
55
+        getQrCodeParams(this.$router.params.scene).then(res => {
56
+          this.setState({ id: res.id }, () => {
57
+            this.loadDetail()
58
+          })
59
+        }).catch(err => {
60
+          Taro.showToast({
61
+            title: '没有找到活动',
62
+            icon: 'none'
63
+          })
64
+        })
65
+      } else {
66
+        this.setState({ id }, () => {
67
+          this.loadDetail()
68
+        })
69
+      }
54 70
     })
55 71
   }
56 72
   componentWillUnmount() {

+ 13
- 40
src/pages/card/index.js 파일 보기

@@ -36,14 +36,11 @@ export default class Index extends Component {
36 36
     recordId: null,
37 37
     isSave: false,
38 38
     bound: false,
39
-    modalStatus: false,
40 39
     grantPhoneVisible: false, // 授权手机弹框
41 40
   }
42 41
 
43 42
   componentWillMount() {
44 43
     ready.queue(() => {
45
-      // const router = Taro.getStorageSync('router')
46
-      // const id = this.$router.params.id || router.query.id || '4604a792d575eb8187711625bd88832c'
47 44
       // 分享场景需要先授权手机, 再授权头像
48 45
       const options = wx.getLaunchOptionsSync()
49 46
       if (sceneInShare(options.scene)) {
@@ -66,19 +63,20 @@ export default class Index extends Component {
66 63
     const router = Taro.getStorageSync('router')
67 64
     const id = this.$router.params.id || router.query.id
68 65
 
69
-    if (router.query.id) {
70
-      this.setState({
71
-        cardId: id,
72
-        modalStatus: true
73
-      }, this.loadCardDetail)
66
+    if (!id) {
67
+      getQrCodeParams(this.$router.params.scene).then(res => {
68
+        this.setState({ cardId: res.id }, this.loadCardDetail)
69
+        addCardUv(res.id)
70
+      }).catch(err => {
71
+        Taro.showToast({
72
+          title: '没有找到卡片',
73
+          icon: 'none'
74
+        })
75
+      })
74 76
     } else {
75
-      this.setState({
76
-        cardId: id,
77
-        modalStatus: false
78
-      }, this.loadCardDetail)
77
+      this.setState({ cardId: id }, this.loadCardDetail)
78
+      addCardUv(id)
79 79
     }
80
-
81
-    addCardUv(id)
82 80
   }
83 81
 
84 82
   componentWillReceiveProps(nextProps) {
@@ -377,7 +375,6 @@ export default class Index extends Component {
377 375
       const { cardInfo, userInfo: { person } } = this.props
378 376
       if (person.personId != cardInfo.id) {
379 377
         reportClient(payload).then(res => {
380
-          this.hideModal()
381 378
           this.setState({ bound: true })
382 379
           if (res !== 'bound') {
383 380
             Taro.showToast({
@@ -439,11 +436,6 @@ export default class Index extends Component {
439 436
     }
440 437
   }
441 438
 
442
-  hideModal() {
443
-    this.setState({
444
-      modalStatus: false
445
-    })
446
-  }
447 439
   handleAuthPhoneSuccess = (phone) => {
448 440
     const { person = {} } = this.props.userInfo || {}
449 441
     if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
@@ -463,7 +455,7 @@ export default class Index extends Component {
463 455
     })
464 456
   }
465 457
   render() {
466
-    const { makePosterStatus, posterData, modalStatus, grantPhoneVisible } = this.state
458
+    const { makePosterStatus, posterData, grantPhoneVisible } = this.state
467 459
     const { userInfo, cardInfo, projectDetail } = this.props
468 460
     const { person: { personType, personId, phone, tel } } = userInfo
469 461
     const { unReadNum, picture, visitors, id, isReport } = cardInfo
@@ -475,8 +467,6 @@ export default class Index extends Component {
475 467
     const isConsultant = personType === ROLE_CODE['CONSULTANT']
476 468
     const hadPhone = (phone || tel) ? true : false  // nb
477 469
     const visibleChatBtn = !isConsultant && !isSelf
478
-    // const visibleConfirmModal = modalStatus && !isReport && !isSelf && (personType === ROLE_CODE['DRIFT'] || personType === ROLE_CODE['CUSTOMER'])
479
-    const visibleConfirmModal = modalStatus && !isReport && !isSelf
480 470
     const showAuthPhone = grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone
481 471
     return (
482 472
       <Block>
@@ -487,23 +477,6 @@ export default class Index extends Component {
487 477
           showAuthPhone &&
488 478
           <AchievePhone user={userInfo.person} onCancel={this.handeAuthPhoneFail} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
489 479
         }
490
-        {
491
-          // !showAuthPhone && visibleConfirmModal && (
492
-          //   <View className="modal">
493
-          //     <View className="modal-mask" onClick={this.hideModal}></View>
494
-          //     <View className="modal-body">
495
-          //       <View className="modal-body__con">请确认是否成为他的客户?</View>
496
-          //       {
497
-          //         hadPhone ? (
498
-          //           <Button onClick={this.handleModalConfirm} className='modal-body__btn'>确认</Button>
499
-          //         ) : (
500
-          //             <Button open-type="getPhoneNumber" onGetphonenumber={this.handleGetPhone} className='modal-body__btn'>确认</Button>
501
-          //           )
502
-          //       }
503
-          //     </View>
504
-          //   </View>
505
-          // )
506
-        }
507 480
 
508 481
         {this.state.loaded && (
509 482
           <View className='mycard'>

+ 20
- 5
src/pages/news/detail/index.js 파일 보기

@@ -8,6 +8,7 @@ import BackHomeBtn from '@components/BackHomeBtn'
8 8
 import Notice from '@components/Notice'
9 9
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
10 10
 import { getDownloadURL, transferImage } from '@utils/tools'
11
+import { getQrCodeParams } from '@utils/qrcode'
11 12
 import {
12 13
   addNewsUv,
13 14
   favorNews,
@@ -41,12 +42,26 @@ export default class NewsDetail extends Component {
41 42
       console.info('news-1:', router)
42 43
       console.info('news-2:', this.$router)
43 44
 
44
-      const newsId = this.$router.params.id || router.query.id || '16'
45
+      const newsId = this.$router.params.id || router.query.id
45 46
 
46
-      this.setState({ newsId }, () => {
47
-        this.loadDetail()
48
-        addNewsUv(newsId)
49
-      })
47
+      if (!newsId) {
48
+        getQrCodeParams(this.$router.params.scene).then(res => {
49
+          this.setState({ newsId: res.id }, () => {
50
+            this.loadDetail()
51
+            addNewsUv(res.id)
52
+          })
53
+        }).catch(err => {
54
+          Taro.showToast({
55
+            title: '没有找到资讯',
56
+            icon: 'none'
57
+          })
58
+        })
59
+      } else {
60
+        this.setState({ newsId }, () => {
61
+          this.loadDetail()
62
+          addNewsUv(newsId)
63
+        })
64
+      }
50 65
     })
51 66
   }
52 67
 

+ 2
- 0
src/pages/project/index.js 파일 보기

@@ -60,6 +60,8 @@ export default class Index extends Component {
60 60
       this.loadOpenScreenBanner()
61 61
       this.getLocation()
62 62
 
63
+      Taro.setNavigationBarTitle({ title: this.props.userInfo.miniApp.name })
64
+
63 65
       savePoint({
64 66
         event: 'index',
65 67
         eventType: 'main',