周立森 5 jaren geleden
bovenliggende
commit
218cc64562

+ 1
- 1
project.config.json Bestand weergeven

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

+ 4
- 1
src/components/achieveAvatar/index.js Bestand weergeven

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

+ 6
- 5
src/pages/activity/detail/assemble.js Bestand weergeven

@@ -73,10 +73,9 @@ export default class Detail extends Component {
73 73
     ready.queue(() => {
74 74
       // 必须授权电话
75 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,10 +141,12 @@ export default class Detail extends Component {
142 141
   // 调起授权头像
143 142
   toggleGrantAvatar = () => {
144 143
     const { userInfo: { person: { avatarurl } } } = this.props
145
-    if (!avatarurl) {
144
+
145
+    if (!avatarurl || avatarurl.indexOf('wx.qlogo.cn') === -1) {
146 146
       this.setState({ grantAvatarVisible: true })
147 147
       return false
148 148
     }
149
+
149 150
     console.log(avatarurl,"avatarurl")
150 151
     console.log(this.props.userInfo,"this.props")
151 152
     return true
@@ -534,7 +535,7 @@ export default class Detail extends Component {
534 535
         }
535 536
         {
536 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 540
         <BackHomeBtn></BackHomeBtn>
540 541
         {

+ 8
- 6
src/pages/activity/detail/assistance.js Bestand weergeven

@@ -72,10 +72,10 @@ export default class Detail extends Component {
72 72
     ready.queue(() => {
73 73
       // 必须授权电话
74 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,6 +127,7 @@ export default class Detail extends Component {
127 127
   // 调起授权电话
128 128
   toggleGrantPhone = () => {
129 129
     const { userInfo: { person: { phone, tel } } } = this.props
130
+    
130 131
     if (!phone && !tel) {
131 132
       this.setState({ grantPhoneVisible: true })
132 133
       return false
@@ -140,12 +141,13 @@ export default class Detail extends Component {
140 141
   // 调起授权头像
141 142
   toggleGrantAvatar = () => {
142 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 147
       this.setState({ grantAvatarVisible: true })
145 148
       return false
146 149
     }
147 150
     console.log(avatarurl,"avatarurl")
148
-    console.log(this.props.userInfo,"this.props")
149 151
     return true
150 152
   }
151 153
 
@@ -518,7 +520,7 @@ export default class Detail extends Component {
518 520
         }
519 521
         {
520 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 525
         <BackHomeBtn></BackHomeBtn>
524 526
         {

+ 28
- 29
src/pages/card/index.js Bestand weergeven

@@ -1,15 +1,13 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import './index.scss'
3
-
4 3
 import Notice from '@components/Notice'
5 4
 import Poster from './poster'
6 5
 import ProjectItem from '../project/item'
7 6
 import BackHomeBtn from '@components/BackHomeBtn'
8 7
 import getUserPhone from '@utils/getUserPhone'
9
-import AchievePhone from '@components/achievePhone'
10 8
 import ready from '@utils/ready'
9
+import AchievePhone from '@components/achievePhone'
11 10
 import { sceneInShare } from '@utils/tools'
12
-
13 11
 import { ROLE_CODE } from '@constants/user'
14 12
 import { addCardUv, addCardShareNum, favorCard, cancelFavorCard } from '@services/card'
15 13
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
@@ -44,7 +42,8 @@ export default class Index extends Component {
44 42
 
45 43
   componentWillMount() {
46 44
     ready.queue(() => {
47
-
45
+      // const router = Taro.getStorageSync('router')
46
+      // const id = this.$router.params.id || router.query.id || '4604a792d575eb8187711625bd88832c'
48 47
       // 分享场景需要先授权手机, 再授权头像
49 48
       const options = wx.getLaunchOptionsSync()
50 49
       if (sceneInShare(options.scene)) {
@@ -54,6 +53,7 @@ export default class Index extends Component {
54 53
           return
55 54
         }
56 55
 
56
+
57 57
         this.setState({
58 58
           grantPhoneVisible: true,
59 59
         })
@@ -62,7 +62,6 @@ export default class Index extends Component {
62 62
       this.initPageData()
63 63
     })
64 64
   }
65
-
66 65
   initPageData() {
67 66
     const router = Taro.getStorageSync('router')
68 67
     const id = this.$router.params.id || router.query.id
@@ -87,6 +86,7 @@ export default class Index extends Component {
87 86
     this.handleModalConfirm(tel || phone)
88 87
   }
89 88
 
89
+
90 90
   componentWillUnmount() {
91 91
     const { recordId } = this.state
92 92
     recordId && updatePoint(recordId)
@@ -118,6 +118,7 @@ export default class Index extends Component {
118 118
           recordId: res1.recordId
119 119
         })
120 120
         console.log('个人主页')
121
+        console.log(this.props, "this.props-=====!!")
121 122
       })
122 123
     })
123 124
   }
@@ -354,12 +355,11 @@ export default class Index extends Component {
354 355
       cardInfo: { id, projects = [] },
355 356
       userInfo: { person: { phone, tel, personType, avatarurl } }
356 357
     } = this.props
357
-
358 358
     if (personType === ROLE_CODE['CONSULTANT']) {
359 359
       return
360 360
     }
361
-
362 361
     const buildingId = projects[0]
362
+
363 363
     const realPhone = phoneNumber || phone || tel
364 364
 
365 365
     // TODO:
@@ -370,25 +370,26 @@ export default class Index extends Component {
370 370
         buildingId,
371 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 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,7 +440,6 @@ export default class Index extends Component {
439 440
       modalStatus: false
440 441
     })
441 442
   }
442
-  
443 443
   handleAuthPhoneSuccess = (phone) => {
444 444
     const { person = {} } = this.props.userInfo || {}
445 445
     if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
@@ -453,20 +453,19 @@ export default class Index extends Component {
453 453
   }
454 454
 
455 455
   handeAuthPhoneFail = () => {
456
-    Taro.showToast({ 
456
+    Taro.showToast({
457 457
       title: '未授权手机号无法成为报备客户',
458 458
       icon: 'none'
459
-     })
459
+    })
460 460
   }
461
-
462 461
   render() {
463 462
     const { makePosterStatus, posterData, modalStatus, grantPhoneVisible } = this.state
464 463
     const { userInfo, cardInfo, projectDetail } = this.props
465 464
     const { person: { personType, personId, phone, tel } } = userInfo
466 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 469
     const isSelf = personId === id
471 470
 
472 471
     const isConsultant = personType === ROLE_CODE['CONSULTANT']
@@ -475,11 +474,11 @@ export default class Index extends Component {
475 474
     // const visibleConfirmModal = modalStatus && !isReport && !isSelf && (personType === ROLE_CODE['DRIFT'] || personType === ROLE_CODE['CUSTOMER'])
476 475
     const visibleConfirmModal = modalStatus && !isReport && !isSelf
477 476
     const showAuthPhone = grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone
478
-
479 477
     return (
480 478
       <Block>
481 479
         {/* 生成海报 */}
482 480
         {makePosterStatus && (<Poster data={posterData} toggle={this.toggleVisiblePoster}></Poster>)}
481
+
483 482
         {
484 483
           showAuthPhone &&
485 484
           <AchievePhone user={userInfo.person} onCancel={this.handeAuthPhoneFail} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>

+ 1
- 1
src/pages/card/poster.js Bestand weergeven

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

+ 52
- 15
src/pages/project/detail/poster.js Bestand weergeven

@@ -38,9 +38,44 @@ export default class Index extends Component {
38 38
     const { data } = this.props
39 39
     const { basicConfig } = this.state
40 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 77
         x: 30,
43
-        y: 740,
78
+        y: 660,
44 79
         text: data.buildingName,
45 80
         fontSize: 36,
46 81
         color: 'black',
@@ -52,10 +87,10 @@ export default class Index extends Component {
52 87
         zIndex: 999
53 88
       },{
54 89
         x: 30,
55
-        y: 820,
90
+        y: 746,
56 91
         text: data.price ? '约'+data.price+'元/m²' : '待定',
57 92
         fontSize: 36,
58
-        color: 'red',
93
+        color: '#FF2744',
59 94
         baseLine: 'middle',
60 95
         lineNum: 2,
61 96
         lineHeight: 48,
@@ -65,12 +100,12 @@ export default class Index extends Component {
65 100
       },
66 101
       {
67 102
         x: 30,
68
-        y: 890,
103
+        y: 830,
69 104
         text: data.posterDescription,
70 105
         fontSize: 28,
71 106
         color: '#999',
72 107
         baseLine: 'middle',
73
-        lineNum: 1,
108
+        lineNum: 2,
74 109
         lineHeight: 48,
75 110
         // textAlign: 'center',
76 111
         width: 560,
@@ -103,14 +138,14 @@ export default class Index extends Component {
103 138
         y: 1070,
104 139
         text: data.miniAppName,
105 140
         fontSize: 34,
106
-        color: 'red',
141
+        color: '#000',
107 142
         baseLine: 'middle',
108 143
         lineHeight: 48,
109 144
         width: (data.miniAppName || '').length * 30 + 60,
110 145
         zIndex: 11
111 146
       },
112 147
       {
113
-        x: (data.miniAppName || '').length * 30 + 130,
148
+        x: (data.miniAppName || '').length * 30 + 120,
114 149
         y: 1070,
115 150
         text: '项目详情',
116 151
         fontSize: 26,
@@ -126,7 +161,7 @@ export default class Index extends Component {
126 161
       {
127 162
         url: data.poster,
128 163
         width: 640,
129
-        height: 670,
164
+        height: 512,
130 165
         y: 0,
131 166
         x: 0
132 167
       },
@@ -140,11 +175,11 @@ export default class Index extends Component {
140 175
       },
141 176
       {
142 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 183
         zIndex: 999
149 184
       }
150 185
     ]
@@ -152,9 +187,9 @@ export default class Index extends Component {
152 187
     const blocks = [
153 188
       {
154 189
         x: 0,
155
-        y: 966,
190
+        y: 953,
156 191
         width: 640,
157
-        height: 160,
192
+        height: 186,
158 193
         backgroundColor: 'rgba(248,248,248,1)',
159 194
         zIndex: 1
160 195
       }
@@ -235,11 +270,13 @@ export default class Index extends Component {
235 270
       <Block>
236 271
         {
237 272
           this.state.canvasStatus && (
273
+            <View style="10rpx 0px 30rpx #dcdcdc">
238 274
             <TaroCanvasDrawer
239 275
               config={this.state.config}
240 276
               onCreateSuccess={this.onCreateSuccess}
241 277
               onCreateFail={this.onCreateFail}
242 278
             />
279
+            </View>
243 280
           )
244 281
         }
245 282
         {

+ 2
- 0
src/pages/project/detail/poster.scss Bestand weergeven

@@ -45,8 +45,10 @@
45 45
 
46 46
       .result-img {
47 47
         height: 60vh;
48
+        width: 406px;
48 49
         display: block;
49 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 Bestand weergeven

@@ -35,11 +35,11 @@ export default class Index extends Component {
35 35
           </View>
36 36
           <View className='item'>
37 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 39
           </View>
40 40
           <View className='item'>
41 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 43
           </View>
44 44
           <View className='item'>
45 45
             <Text className='txt left-txt'>开盘日期</Text>
@@ -83,7 +83,7 @@ export default class Index extends Component {
83 83
           </View>
84 84
           <View className='item'>
85 85
             <Text className='txt left-txt'>项目说明</Text>
86
-            <Text className='txt right-txt'>{'暂无'}</Text>
86
+            <Text className='txt right-txt'>{projectDetail.dynamic || '暂无'}</Text>
87 87
           </View>
88 88
         </View>
89 89
       </View >

+ 2
- 1
src/pages/project/map/index.js Bestand weergeven

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

+ 14
- 0
src/utils/tools.js Bestand weergeven

@@ -42,6 +42,20 @@ export function resizeImage(img, size) {
42 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 60
  * 解析 queryString   a=b&c=d  ==> { a:b, c:d }
47 61
  * @param {*} queryString