周立森 5 年之前
父節點
當前提交
cfac7c0b4d
共有 3 個檔案被更改,包括 26 行新增19 行删除
  1. 2
    2
      config/dev.js
  2. 3
    3
      src/pages/card/index.js
  3. 21
    14
      src/pages/checkin/index.js

+ 2
- 2
config/dev.js 查看文件

@@ -9,8 +9,8 @@ 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
-    HOST: '"http://192.168.0.72:8080"',
13
-    WSS_HOST: '"ws://192.168.0.72:8080"',
12
+    HOST: '"http://192.168.0.238:8080"',
13
+    WSS_HOST: '"ws://192.168.0.238:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 3
- 3
src/pages/card/index.js 查看文件

@@ -464,9 +464,9 @@ export default class Index extends Component {
464 464
     const { userInfo, cardInfo, projectDetail } = this.props
465 465
     const { person: { personType, personId, phone, tel } } = userInfo
466 466
     const { unReadNum, picture, visitors, id, isReport } = cardInfo
467
-    const { buildingId } = projectDetail
467
+    const { buildingId,address } = projectDetail
468 468
 
469
-    const visitorList = visitors ? visitors.slice(0, 5) : []
469
+  const visitorList = visitors ? visitors.slice(0, 5) : []
470 470
     const isSelf = personId === id
471 471
 
472 472
     const isConsultant = personType === ROLE_CODE['CONSULTANT']
@@ -592,7 +592,7 @@ export default class Index extends Component {
592 592
                   </View>
593 593
                   <View className='detailed__add' onClick={this.getLocation}>
594 594
                     <View className='detailed__add__txt'>
595
-                      <Text className='add__txt' space='emsp'>地址 </Text> {cardInfo.address}
595
+                      <Text className='add__txt' space='emsp'>地址 </Text> {address}
596 596
                     </View>
597 597
                     <Text className='iconfont icon-daohangdizhi add__img'></Text>
598 598
                   </View>

+ 21
- 14
src/pages/checkin/index.js 查看文件

@@ -17,22 +17,28 @@ export default class checkin extends Component {
17 17
 
18 18
   componentWillMount () {
19 19
     const router = Taro.getStorageSync('router')
20
-    console.log('router---',router)
21
-    console.log('props---',this.props)
22
-    const { id, type } = parseQueryString(router.query.params)
23
-    console.log('props---',id)
20
+    console.log('router---', parseQueryString)
21
+    console.log(router)
22
+    // const id = router.query.paramsId
23
+    // const type = router.query.type || ''
24
+
25
+    const { id = router.query.paramsId, type = router.query.type || '' } = parseQueryString(router.query.params)
26
+    console.log(id, 'id-----')
24 27
     this.setState({ id, type })
25 28
     this.getcheckinDetails(id, type)
29
+
30
+
26 31
   }
27 32
   // dynamicId
28 33
   getcheckinDetails (id, type) {
29 34
     Taro.showLoading()
30 35
 
31 36
     checkinDetails(id, type).then(res => {
37
+      console.log('data:', res)
32 38
       Taro.hideLoading()
33 39
       this.setState({
34 40
         data: res,
35
-      })      
41
+      })
36 42
     })
37 43
   }
38 44
 
@@ -44,7 +50,7 @@ export default class checkin extends Component {
44 50
 
45 51
       // TODO: 需要依据 type 跳转
46 52
       Taro.navigateTo({
47
-        url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,      
53
+        url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,
48 54
       })
49 55
 
50 56
     }).catch((err) => {
@@ -66,7 +72,8 @@ export default class checkin extends Component {
66 72
 
67 73
   render () {
68 74
     const { dynamic = {}, enlist = {}, person = {} } = this.state.data || {}
69
-
75
+    const {  activityStatus   } =  dynamic  || {}
76
+    console.log(enlist, 'enlist')
70 77
     return (
71 78
       <View className="checkin" style="width:100vw;height:100vh;" >
72 79
 
@@ -106,16 +113,16 @@ export default class checkin extends Component {
106 113
           {/* {console.log(data.person.status)} */}
107 114
         </View>}
108 115
         {enlist.enlistId == null && <View className="unregistered">
109
-        {dynamic.activityStatus === 1 && <View style="text-align: center;color:#666666">
110
-          活动未开始
116
+          {activityStatus === 1 && <View style="text-align: center;color:#666666">
117
+            活动未开始
111 118
         </View>
112 119
           }
113
-          {dynamic.activityStatus === 2 && <View style="text-align: center;color:#666666">
114
-          活动已结束
120
+          {activityStatus === 2 && <View style="text-align: center;color:#666666">
121
+            活动已结束
115 122
         </View>
116 123
           }
117 124
 
118
-          {!dynamic.activityStatus && 
125
+          {!activityStatus &&
119 126
             <View>
120 127
               <View>
121 128
                 <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
@@ -127,9 +134,9 @@ export default class checkin extends Component {
127 134
 
128 135
               <AtButton type='primary' className="toactivebutton" onClick={() => { this.toactivity(dynamic.dynamicId) }}>立即前往</AtButton>
129 136
             </View>
130
-          }        
137
+          }
131 138
         </View>
132
-      }
139
+        }
133 140
       </View>
134 141
 
135 142
     );