Browse Source

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

张延森 5 years ago
parent
commit
5068d4f7c2

+ 2
- 2
config/dev.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
-    // HOST: '"http://192.168.0.238:8080"',
13
-    // WSS_HOST: '"ws://192.168.0.238:8080"',
12
+    // HOST: '"http://192.168.0.84:8080"',
13
+    // WSS_HOST: '"ws://192.168.0.84:8080"',
14
   },
14
   },
15
   weapp: {},
15
   weapp: {},
16
   h5: {}
16
   h5: {}

+ 28
- 29
src/pages/card/index.js View File

1
 import Taro, { Component } from '@tarojs/taro'
1
 import Taro, { Component } from '@tarojs/taro'
2
 import './index.scss'
2
 import './index.scss'
3
-
4
 import Notice from '@components/Notice'
3
 import Notice from '@components/Notice'
5
 import Poster from './poster'
4
 import Poster from './poster'
6
 import ProjectItem from '../project/item'
5
 import ProjectItem from '../project/item'
7
 import BackHomeBtn from '@components/BackHomeBtn'
6
 import BackHomeBtn from '@components/BackHomeBtn'
8
 import getUserPhone from '@utils/getUserPhone'
7
 import getUserPhone from '@utils/getUserPhone'
9
-import AchievePhone from '@components/achievePhone'
10
 import ready from '@utils/ready'
8
 import ready from '@utils/ready'
9
+import AchievePhone from '@components/achievePhone'
11
 import { sceneInShare } from '@utils/tools'
10
 import { sceneInShare } from '@utils/tools'
12
-
13
 import { ROLE_CODE } from '@constants/user'
11
 import { ROLE_CODE } from '@constants/user'
14
 import { addCardUv, addCardShareNum, favorCard, cancelFavorCard } from '@services/card'
12
 import { addCardUv, addCardShareNum, favorCard, cancelFavorCard } from '@services/card'
15
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
13
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
44
 
42
 
45
   componentWillMount() {
43
   componentWillMount() {
46
     ready.queue(() => {
44
     ready.queue(() => {
47
-
45
+      // const router = Taro.getStorageSync('router')
46
+      // const id = this.$router.params.id || router.query.id || '4604a792d575eb8187711625bd88832c'
48
       // 分享场景需要先授权手机, 再授权头像
47
       // 分享场景需要先授权手机, 再授权头像
49
       const options = wx.getLaunchOptionsSync()
48
       const options = wx.getLaunchOptionsSync()
50
       if (sceneInShare(options.scene)) {
49
       if (sceneInShare(options.scene)) {
54
           return
53
           return
55
         }
54
         }
56
 
55
 
56
+
57
         this.setState({
57
         this.setState({
58
           grantPhoneVisible: true,
58
           grantPhoneVisible: true,
59
         })
59
         })
62
       this.initPageData()
62
       this.initPageData()
63
     })
63
     })
64
   }
64
   }
65
-
66
   initPageData() {
65
   initPageData() {
67
     const router = Taro.getStorageSync('router')
66
     const router = Taro.getStorageSync('router')
68
     const id = this.$router.params.id || router.query.id
67
     const id = this.$router.params.id || router.query.id
87
     this.handleModalConfirm(tel || phone)
86
     this.handleModalConfirm(tel || phone)
88
   }
87
   }
89
 
88
 
89
+
90
   componentWillUnmount() {
90
   componentWillUnmount() {
91
     const { recordId } = this.state
91
     const { recordId } = this.state
92
     recordId && updatePoint(recordId)
92
     recordId && updatePoint(recordId)
118
           recordId: res1.recordId
118
           recordId: res1.recordId
119
         })
119
         })
120
         console.log('个人主页')
120
         console.log('个人主页')
121
+        console.log(this.props, "this.props-=====!!")
121
       })
122
       })
122
     })
123
     })
123
   }
124
   }
354
       cardInfo: { id, projects = [] },
355
       cardInfo: { id, projects = [] },
355
       userInfo: { person: { phone, tel, personType, avatarurl } }
356
       userInfo: { person: { phone, tel, personType, avatarurl } }
356
     } = this.props
357
     } = this.props
357
-
358
     if (personType === ROLE_CODE['CONSULTANT']) {
358
     if (personType === ROLE_CODE['CONSULTANT']) {
359
       return
359
       return
360
     }
360
     }
361
-
362
     const buildingId = projects[0]
361
     const buildingId = projects[0]
362
+
363
     const realPhone = phoneNumber || phone || tel
363
     const realPhone = phoneNumber || phone || tel
364
 
364
 
365
     // TODO:
365
     // TODO:
370
         buildingId,
370
         buildingId,
371
         phone: realPhone
371
         phone: realPhone
372
       }
372
       }
373
+      const { cardInfo, userInfo: { person } } = this.props
374
+      if (person.personId != cardInfo.id) {
375
+        reportClient(payload).then(res => {
376
+          this.hideModal()
377
+          this.setState({ bound: true })
378
+          if (res !== 'bound') {
379
+            Taro.showToast({
380
+              title: '恭喜您绑定成功'
381
+            })
382
+          }
383
+        }).catch(err => {
384
+          console.error(err)
385
+          this.setState({ bound: true })
373
 
386
 
374
-      reportClient(payload).then(res => {
375
-        this.hideModal()
376
-        this.setState({ bound: true })
377
-
378
-        if (res !== 'bound') {
379
           Taro.showToast({
387
           Taro.showToast({
380
-            title: '恭喜您绑定成功'
388
+            title: err.message || err,
389
+            icon: 'none'
381
           })
390
           })
382
-        }
383
-      }).catch(err => {
384
-        console.error(err)
385
-        this.setState({ bound: true })
386
-
387
-        Taro.showToast({
388
-          title: err.message || err,
389
-          icon: 'none'
390
         })
391
         })
391
-      })
392
+      }
392
 
393
 
393
     }
394
     }
394
   }
395
   }
439
       modalStatus: false
440
       modalStatus: false
440
     })
441
     })
441
   }
442
   }
442
-  
443
   handleAuthPhoneSuccess = (phone) => {
443
   handleAuthPhoneSuccess = (phone) => {
444
     const { person = {} } = this.props.userInfo || {}
444
     const { person = {} } = this.props.userInfo || {}
445
     if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
445
     if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
453
   }
453
   }
454
 
454
 
455
   handeAuthPhoneFail = () => {
455
   handeAuthPhoneFail = () => {
456
-    Taro.showToast({ 
456
+    Taro.showToast({
457
       title: '未授权手机号无法成为报备客户',
457
       title: '未授权手机号无法成为报备客户',
458
       icon: 'none'
458
       icon: 'none'
459
-     })
459
+    })
460
   }
460
   }
461
-
462
   render() {
461
   render() {
463
     const { makePosterStatus, posterData, modalStatus, grantPhoneVisible } = this.state
462
     const { makePosterStatus, posterData, modalStatus, grantPhoneVisible } = this.state
464
     const { userInfo, cardInfo, projectDetail } = this.props
463
     const { userInfo, cardInfo, projectDetail } = this.props
465
     const { person: { personType, personId, phone, tel } } = userInfo
464
     const { person: { personType, personId, phone, tel } } = userInfo
466
     const { unReadNum, picture, visitors, id, isReport } = cardInfo
465
     const { unReadNum, picture, visitors, id, isReport } = cardInfo
467
-    const { buildingId } = projectDetail
466
+    const { buildingId, address } = projectDetail
468
 
467
 
469
     const visitorList = visitors ? visitors.slice(0, 5) : []
468
     const visitorList = visitors ? visitors.slice(0, 5) : []
470
     const isSelf = personId === id
469
     const isSelf = personId === id
475
     // const visibleConfirmModal = modalStatus && !isReport && !isSelf && (personType === ROLE_CODE['DRIFT'] || personType === ROLE_CODE['CUSTOMER'])
474
     // const visibleConfirmModal = modalStatus && !isReport && !isSelf && (personType === ROLE_CODE['DRIFT'] || personType === ROLE_CODE['CUSTOMER'])
476
     const visibleConfirmModal = modalStatus && !isReport && !isSelf
475
     const visibleConfirmModal = modalStatus && !isReport && !isSelf
477
     const showAuthPhone = grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone
476
     const showAuthPhone = grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone
478
-
479
     return (
477
     return (
480
       <Block>
478
       <Block>
481
         {/* 生成海报 */}
479
         {/* 生成海报 */}
482
         {makePosterStatus && (<Poster data={posterData} toggle={this.toggleVisiblePoster}></Poster>)}
480
         {makePosterStatus && (<Poster data={posterData} toggle={this.toggleVisiblePoster}></Poster>)}
481
+
483
         {
482
         {
484
           showAuthPhone &&
483
           showAuthPhone &&
485
           <AchievePhone user={userInfo.person} onCancel={this.handeAuthPhoneFail} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
484
           <AchievePhone user={userInfo.person} onCancel={this.handeAuthPhoneFail} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
592
                   </View>
591
                   </View>
593
                   <View className='detailed__add' onClick={this.getLocation}>
592
                   <View className='detailed__add' onClick={this.getLocation}>
594
                     <View className='detailed__add__txt'>
593
                     <View className='detailed__add__txt'>
595
-                      <Text className='add__txt' space='emsp'>地址 </Text> {cardInfo.address}
594
+                      <Text className='add__txt' space='emsp'>地址 </Text> {address}
596
                     </View>
595
                     </View>
597
                     <Text className='iconfont icon-daohangdizhi add__img'></Text>
596
                     <Text className='iconfont icon-daohangdizhi add__img'></Text>
598
                   </View>
597
                   </View>

+ 1
- 1
src/pages/card/poster.js View File

129
       {
129
       {
130
         x: (data.miniAppName || '').length * 30 + 200,
130
         x: (data.miniAppName || '').length * 30 + 200,
131
         y: 755,
131
         y: 755,
132
-        text: '查看主页',
132
+        text: '查看',
133
         fontSize: 26,
133
         fontSize: 26,
134
         color: '#999',
134
         color: '#999',
135
         baseLine: 'middle',
135
         baseLine: 'middle',

+ 24
- 15
src/pages/checkin/index.js View File

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

+ 52
- 15
src/pages/project/detail/poster.js View File

38
     const { data } = this.props
38
     const { data } = this.props
39
     const { basicConfig } = this.state
39
     const { basicConfig } = this.state
40
     const texts = [
40
     const texts = [
41
+      {
42
+        x: 180,
43
+        y: 540,
44
+        text: data.nickname,
45
+        fontSize: 29,
46
+        color: '#000',
47
+        baseLine: 'middle',
48
+        lineHeight: 48,
49
+        overFlow:'hidden',
50
+        width: 240,
51
+        zIndex: 999
52
+      },
53
+      {
54
+        x: 180,
55
+        y: 580,
56
+        text: '邀请您查看详情',
57
+        fontSize: 29,
58
+        color: '#888',
59
+        baseLine: 'middle',
60
+        lineHeight: 48,
61
+        // textAlign: 'left',
62
+        width: 260,
63
+        zIndex: 999
64
+      },
65
+      {
66
+        x: 480,
67
+        y: 540,
68
+        text: dayjs(data.createDate).format('YYYY-MM-DD') || '',
69
+        fontSize: 25,
70
+        color: '#888',
71
+        baseLine: 'middle',
72
+        lineHeight: 48,
73
+        width: 200,
74
+        zIndex: 999
75
+      },
41
       {
76
       {
42
         x: 30,
77
         x: 30,
43
-        y: 740,
78
+        y: 660,
44
         text: data.buildingName,
79
         text: data.buildingName,
45
         fontSize: 36,
80
         fontSize: 36,
46
         color: 'black',
81
         color: 'black',
52
         zIndex: 999
87
         zIndex: 999
53
       },{
88
       },{
54
         x: 30,
89
         x: 30,
55
-        y: 820,
90
+        y: 746,
56
         text: data.price ? '约'+data.price+'元/m²' : '待定',
91
         text: data.price ? '约'+data.price+'元/m²' : '待定',
57
         fontSize: 36,
92
         fontSize: 36,
58
-        color: 'red',
93
+        color: '#FF2744',
59
         baseLine: 'middle',
94
         baseLine: 'middle',
60
         lineNum: 2,
95
         lineNum: 2,
61
         lineHeight: 48,
96
         lineHeight: 48,
65
       },
100
       },
66
       {
101
       {
67
         x: 30,
102
         x: 30,
68
-        y: 890,
103
+        y: 830,
69
         text: data.posterDescription,
104
         text: data.posterDescription,
70
         fontSize: 28,
105
         fontSize: 28,
71
         color: '#999',
106
         color: '#999',
72
         baseLine: 'middle',
107
         baseLine: 'middle',
73
-        lineNum: 1,
108
+        lineNum: 2,
74
         lineHeight: 48,
109
         lineHeight: 48,
75
         // textAlign: 'center',
110
         // textAlign: 'center',
76
         width: 560,
111
         width: 560,
103
         y: 1070,
138
         y: 1070,
104
         text: data.miniAppName,
139
         text: data.miniAppName,
105
         fontSize: 34,
140
         fontSize: 34,
106
-        color: 'red',
141
+        color: '#000',
107
         baseLine: 'middle',
142
         baseLine: 'middle',
108
         lineHeight: 48,
143
         lineHeight: 48,
109
         width: (data.miniAppName || '').length * 30 + 60,
144
         width: (data.miniAppName || '').length * 30 + 60,
110
         zIndex: 11
145
         zIndex: 11
111
       },
146
       },
112
       {
147
       {
113
-        x: (data.miniAppName || '').length * 30 + 130,
148
+        x: (data.miniAppName || '').length * 30 + 120,
114
         y: 1070,
149
         y: 1070,
115
         text: '项目详情',
150
         text: '项目详情',
116
         fontSize: 26,
151
         fontSize: 26,
126
       {
161
       {
127
         url: data.poster,
162
         url: data.poster,
128
         width: 640,
163
         width: 640,
129
-        height: 670,
164
+        height: 512,
130
         y: 0,
165
         y: 0,
131
         x: 0
166
         x: 0
132
       },
167
       },
140
       },
175
       },
141
       {
176
       {
142
         url: data.avatarurl || require('@assets/default-avatar.png'),
177
         url: data.avatarurl || require('@assets/default-avatar.png'),
143
-        width: 130,
144
-        height: 130,
145
-        y: 550,
146
-        x: 20,
147
-        borderRadius: 130,
178
+        width: 120,
179
+        height: 120,
180
+        y: 452,
181
+        x: 40,
182
+        borderRadius: 120,
148
         zIndex: 999
183
         zIndex: 999
149
       }
184
       }
150
     ]
185
     ]
152
     const blocks = [
187
     const blocks = [
153
       {
188
       {
154
         x: 0,
189
         x: 0,
155
-        y: 966,
190
+        y: 953,
156
         width: 640,
191
         width: 640,
157
-        height: 160,
192
+        height: 186,
158
         backgroundColor: 'rgba(248,248,248,1)',
193
         backgroundColor: 'rgba(248,248,248,1)',
159
         zIndex: 1
194
         zIndex: 1
160
       }
195
       }
235
       <Block>
270
       <Block>
236
         {
271
         {
237
           this.state.canvasStatus && (
272
           this.state.canvasStatus && (
273
+            <View style="10rpx 0px 30rpx #dcdcdc">
238
             <TaroCanvasDrawer
274
             <TaroCanvasDrawer
239
               config={this.state.config}
275
               config={this.state.config}
240
               onCreateSuccess={this.onCreateSuccess}
276
               onCreateSuccess={this.onCreateSuccess}
241
               onCreateFail={this.onCreateFail}
277
               onCreateFail={this.onCreateFail}
242
             />
278
             />
279
+            </View>
243
           )
280
           )
244
         }
281
         }
245
         {
282
         {

+ 2
- 0
src/pages/project/detail/poster.scss View File

45
 
45
 
46
       .result-img {
46
       .result-img {
47
         height: 60vh;
47
         height: 60vh;
48
+        width: 406px;
48
         display: block;
49
         display: block;
49
         margin: 0 auto;
50
         margin: 0 auto;
51
+        box-shadow:10px 0px 30px #dcdcdc;
50
       }
52
       }
51
     }
53
     }
52
   }
54
   }

+ 3
- 3
src/pages/project/floor/index.js View File

35
           </View>
35
           </View>
36
           <View className='item'>
36
           <View className='item'>
37
             <Text className='txt left-txt'>均价</Text>
37
             <Text className='txt left-txt'>均价</Text>
38
-            <Text className='txt right-txt'>{projectDetail.price ? projectDetail.price :'待定'}</Text>
38
+            <Text className='txt right-txt'>{projectDetail.price ? projectDetail.price : '待定'}</Text>
39
           </View>
39
           </View>
40
           <View className='item'>
40
           <View className='item'>
41
             <Text className='txt left-txt'>销售状态</Text>
41
             <Text className='txt left-txt'>销售状态</Text>
42
-            <Text className='txt right-txt'>{projectDetail.marketStatus ? projectDetail.marketStatus :'待定'}</Text>
42
+            <Text className='txt right-txt'>{projectDetail.marketStatus ? projectDetail.marketStatus : '待定'}</Text>
43
           </View>
43
           </View>
44
           <View className='item'>
44
           <View className='item'>
45
             <Text className='txt left-txt'>开盘日期</Text>
45
             <Text className='txt left-txt'>开盘日期</Text>
83
           </View>
83
           </View>
84
           <View className='item'>
84
           <View className='item'>
85
             <Text className='txt left-txt'>项目说明</Text>
85
             <Text className='txt left-txt'>项目说明</Text>
86
-            <Text className='txt right-txt'>{'暂无'}</Text>
86
+            <Text className='txt right-txt'>{projectDetail.dynamic || '暂无'}</Text>
87
           </View>
87
           </View>
88
         </View>
88
         </View>
89
       </View >
89
       </View >