周立森 5 년 전
부모
커밋
218cc64562

+ 1
- 1
project.config.json 파일 보기

2
 	"miniprogramRoot": "dist/",
2
 	"miniprogramRoot": "dist/",
3
 	"projectname": "mini-chengjiao",
3
 	"projectname": "mini-chengjiao",
4
 	"description": "知与行联调",
4
 	"description": "知与行联调",
5
-	"appid": "wxda1f84b79b3edeb3",
5
+	"appid": "wxd9ee3a9480a4e544",
6
 	"setting": {
6
 	"setting": {
7
 		"urlCheck": false,
7
 		"urlCheck": false,
8
 		"es6": false,
8
 		"es6": false,

+ 4
- 1
src/components/achieveAvatar/index.js 파일 보기

38
           this.props.onSuccess();
38
           this.props.onSuccess();
39
         })
39
         })
40
       },
40
       },
41
-      fail: () => {
41
+      fail: (err) => {
42
+        console.error(err)
43
+
42
         Taro.showToast({
44
         Taro.showToast({
43
           title: '获取用户信息失败',
45
           title: '获取用户信息失败',
44
           icon: 'none'
46
           icon: 'none'
82
   }
84
   }
83
   render() {
85
   render() {
84
     const { user = {} } = this.props
86
     const { user = {} } = this.props
87
+    console.log('---------renderMaskBanner--------')
85
 
88
 
86
     return (
89
     return (
87
       <Block>
90
       <Block>

+ 6
- 5
src/pages/activity/detail/assemble.js 파일 보기

73
     ready.queue(() => {
73
     ready.queue(() => {
74
       // 必须授权电话
74
       // 必须授权电话
75
       if (this.toggleGrantPhone()) {
75
       if (this.toggleGrantPhone()) {
76
-        if (this.toggleGrantAvatar()) {
77
-          this.initPageData()
78
-        }
76
+        this.toggleGrantAvatar()
79
       }
77
       }
78
+      this.initPageData()
80
     })
79
     })
81
   }
80
   }
82
 
81
 
142
   // 调起授权头像
141
   // 调起授权头像
143
   toggleGrantAvatar = () => {
142
   toggleGrantAvatar = () => {
144
     const { userInfo: { person: { avatarurl } } } = this.props
143
     const { userInfo: { person: { avatarurl } } } = this.props
145
-    if (!avatarurl) {
144
+
145
+    if (!avatarurl || avatarurl.indexOf('wx.qlogo.cn') === -1) {
146
       this.setState({ grantAvatarVisible: true })
146
       this.setState({ grantAvatarVisible: true })
147
       return false
147
       return false
148
     }
148
     }
149
+
149
     console.log(avatarurl,"avatarurl")
150
     console.log(avatarurl,"avatarurl")
150
     console.log(this.props.userInfo,"this.props")
151
     console.log(this.props.userInfo,"this.props")
151
     return true
152
     return true
534
         }
535
         }
535
         {
536
         {
536
           grantAvatarVisible &&
537
           grantAvatarVisible &&
537
-          <AchieveAvatar user={userInfo.person} onSuccess={this.initPageData} ></AchieveAvatar>
538
+          <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
538
         }
539
         }
539
         <BackHomeBtn></BackHomeBtn>
540
         <BackHomeBtn></BackHomeBtn>
540
         {
541
         {

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

72
     ready.queue(() => {
72
     ready.queue(() => {
73
       // 必须授权电话
73
       // 必须授权电话
74
       if (this.toggleGrantPhone()) {
74
       if (this.toggleGrantPhone()) {
75
-        if (this.toggleGrantAvatar()) {
76
-          this.initPageData()
77
-        }
75
+        this.toggleGrantAvatar()
78
       }
76
       }
77
+      
78
+      this.initPageData()
79
     })
79
     })
80
   }
80
   }
81
 
81
 
127
   // 调起授权电话
127
   // 调起授权电话
128
   toggleGrantPhone = () => {
128
   toggleGrantPhone = () => {
129
     const { userInfo: { person: { phone, tel } } } = this.props
129
     const { userInfo: { person: { phone, tel } } } = this.props
130
+    
130
     if (!phone && !tel) {
131
     if (!phone && !tel) {
131
       this.setState({ grantPhoneVisible: true })
132
       this.setState({ grantPhoneVisible: true })
132
       return false
133
       return false
140
   // 调起授权头像
141
   // 调起授权头像
141
   toggleGrantAvatar = () => {
142
   toggleGrantAvatar = () => {
142
     const { userInfo: { person: { avatarurl } } } = this.props
143
     const { userInfo: { person: { avatarurl } } } = this.props
143
-    if (!avatarurl) {
144
+
145
+    if (!avatarurl || avatarurl.indexOf('wx.qlogo.cn') === -1) {
146
+      console.log(this.props.userInfo,"this.props")
144
       this.setState({ grantAvatarVisible: true })
147
       this.setState({ grantAvatarVisible: true })
145
       return false
148
       return false
146
     }
149
     }
147
     console.log(avatarurl,"avatarurl")
150
     console.log(avatarurl,"avatarurl")
148
-    console.log(this.props.userInfo,"this.props")
149
     return true
151
     return true
150
   }
152
   }
151
 
153
 
518
         }
520
         }
519
         {
521
         {
520
           grantAvatarVisible &&
522
           grantAvatarVisible &&
521
-          <AchieveAvatar user={userInfo.person} onSuccess={this.initPageData} ></AchieveAvatar>
523
+          <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
522
         }
524
         }
523
         <BackHomeBtn></BackHomeBtn>
525
         <BackHomeBtn></BackHomeBtn>
524
         {
526
         {

+ 28
- 29
src/pages/card/index.js 파일 보기

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,address } = 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
471
 
470
 
472
     const isConsultant = personType === ROLE_CODE['CONSULTANT']
471
     const isConsultant = personType === ROLE_CODE['CONSULTANT']
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>

+ 1
- 1
src/pages/card/poster.js 파일 보기

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',

+ 52
- 15
src/pages/project/detail/poster.js 파일 보기

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 파일 보기

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 파일 보기

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 >

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

129
       longitude,
129
       longitude,
130
       name: buildingName,
130
       name: buildingName,
131
       address,
131
       address,
132
-      scale: 18
132
+      scale: 12,
133
     })
133
     })
134
   }
134
   }
135
   // onShareAppMessage = () => {
135
   // onShareAppMessage = () => {
153
           markers={markers}
153
           markers={markers}
154
           show-location
154
           show-location
155
           include-points={points}
155
           include-points={points}
156
+          scale={12}
156
           onCallouttap={this.showProject.bind(this)}
157
           onCallouttap={this.showProject.bind(this)}
157
         >
158
         >
158
         </Map>
159
         </Map>

+ 14
- 0
src/utils/tools.js 파일 보기

42
   return img
42
   return img
43
 }
43
 }
44
 
44
 
45
+/**
46
+ * 压缩图片 80%, 最大宽度 750
47
+ * @param {*} img 
48
+ */
49
+export function transferImage(img) {
50
+  if (!img) return img
51
+
52
+  if (img.indexOf('https://estateagents.oss-cn-shanghai.aliyuncs.com') === 0) {
53
+    return `${img}?x-oss-process=image/resize,m_lfit,w_750/quality,Q_80`
54
+  }
55
+
56
+  return img
57
+}
58
+
45
 /**
59
 /**
46
  * 解析 queryString   a=b&c=d  ==> { a:b, c:d }
60
  * 解析 queryString   a=b&c=d  ==> { a:b, c:d }
47
  * @param {*} queryString 
61
  * @param {*} queryString