Bläddra i källkod

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

张延森 5 år sedan
förälder
incheckning
b42a57bdc9

+ 5
- 5
src/pages/agent/index.js Visa fil

@@ -6,7 +6,7 @@ import Poster from './poster'
6 6
 import { agentCurrent } from '@services/agent'
7 7
 import BackHomeBtn from '@components/BackHomeBtn'
8 8
 import { getMiniQrcode } from '@services/common'
9
-const topImg ='https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/index/top.jpg'
9
+const topImg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/index/top.jpg'
10 10
 @connect(state => state.user, { ...actions })
11 11
 
12 12
 export default class Index extends Component {
@@ -38,7 +38,7 @@ export default class Index extends Component {
38 38
 
39 39
   }
40 40
   onShareAppMessage = () => {
41
-    const { agent: { nickname,personId,agentCode } } = this.state
41
+    const { agent: { nickname, personId, agentCode } } = this.state
42 42
     return {
43 43
       title: `${nickname}邀请你成为经纪人`,
44 44
       path: `/pages/agent/become/index?id=${personId}&from=share&recommender=${personId}&agentCode=${agentCode}`,//分享地址
@@ -53,7 +53,7 @@ export default class Index extends Component {
53 53
         return
54 54
       }
55 55
       const { userInfo: { person } } = this.props
56
-      const { agent: { avatarurl, phone, agentCode },qrcode } = this.state
56
+      const { agent: { avatarurl, phone, agentCode }, qrcode } = this.state
57 57
       let data = {
58 58
         codeImg: qrcode,
59 59
         avatarurl: avatarurl,//访问者头像
@@ -81,7 +81,7 @@ export default class Index extends Component {
81 81
     }
82 82
   }
83 83
   render() {
84
-    const { posterVisible, posterData, posterShow, agent,qrcode } = this.state
84
+    const { posterVisible, posterData, posterShow, agent, qrcode } = this.state
85 85
     return (
86 86
       <Block>
87 87
         {/* 生成海报 */}
@@ -91,7 +91,7 @@ export default class Index extends Component {
91 91
           <View className='agent_info'>
92 92
             <Image src={agent.avatarurl} className='agent_avatar'></Image>
93 93
             <View className='agent_info-center'>
94
-              <View>手机号:<Text className='agent_info-tel'>{agent.phone}</Text></View>
94
+              <View>手机号:<Text className='agent_info-tel'>{agent.tel || agent.phone}</Text></View>
95 95
               <View>我的推荐码:<Text className='agent_info-code'>{agent.agentCode}</Text></View>
96 96
             </View>
97 97
             <Image src={qrcode} className='agent_code'></Image>

+ 6
- 4
src/pages/agent/recommend/index.js Visa fil

@@ -12,7 +12,7 @@ export default class Index extends Component {
12 12
     navigationBarTitleText: '新增客户'
13 13
   }
14 14
   state = {
15
-    name: '',//客户姓名
15
+    name: '',//客户姓名 
16 16
     sex: '',//性别
17 17
     phone: '',//电话
18 18
     floor: '',//楼盘
@@ -61,11 +61,13 @@ export default class Index extends Component {
61 61
   componentWillMount() {
62 62
     // const defaultHouseVal = Taro.getStorageSync('targetHouse')
63 63
 
64
-    const { type,cityId } = this.$router.params
65
-    console.log(this.$router.params,"cityId")
64
+    const { type } = this.$router.params
65
+   
66 66
     this.setState({
67
-      reType: type
67
+      reType: type,
68
+      sex: '',
68 69
     }, () => {
70
+      console.log(this.state.sex, "sex")
69 71
       console.log('buildingName' + this.props.proList.records[0].buildingName)
70 72
       if (this.state.reType != 'index') {
71 73
         this.setState({

+ 8
- 6
src/pages/im/index.js Visa fil

@@ -375,7 +375,13 @@ export default class Chat extends Component {
375 375
     // 发送消息
376 376
     socket.sendNotice(payload, res => {
377 377
       console.log('发送成功')
378
+
378 379
       this.appendData(payload)
380
+      this.setState({
381
+        inputText: '',
382
+        imageFile: '',
383
+        msgList: list
384
+      }, this.toBottom)
379 385
     })
380 386
   }
381 387
 
@@ -398,11 +404,7 @@ export default class Chat extends Component {
398 404
         list: [data]
399 405
       })
400 406
     }
401
-    this.setState({
402
-      inputText: '',
403
-      imageFile: '',
404
-      msgList: list
405
-    }, this.toBottom)
407
+ 
406 408
     this.setState({
407 409
       inputText: '',
408 410
       imageFile: '',
@@ -574,7 +576,7 @@ export default class Chat extends Component {
574 576
           <View className="import-top">
575 577
             <Input
576 578
               className="import-top__input"
577
-              cursor-spacing={0}
579
+              cursor-spacing={6}
578 580
               value={inputText}
579 581
               onInput={this.bindTextInput}
580 582
               onConfirm={this.bindInputConfirm}

+ 20
- 6
src/pages/person/personDetail/editDetail/index.js Visa fil

@@ -98,12 +98,26 @@ export default class editDetail extends Component {
98 98
         this.Alert('请输入渠道码')
99 99
         return;
100 100
       }
101
-
102 101
     }
103
-    becomeChannel({
104
-      personType: this.state.personType,//经纪人类型
105
-      channelCode: this.state.channelCode//渠道码
106
-    }).then((data) => {
102
+
103
+    if (this.state.personType == 'channel agent' || this.state.personType == 'estate agent') {
104
+      becomeChannel({
105
+        personType: this.state.personType,//经纪人类型
106
+        channelCode: this.state.channelCode//渠道码
107
+      }).then((data) => {
108
+        const playload = {
109
+          name: this.state.name,
110
+          avatar: avatar,
111
+          phone: this.state.phone
112
+        }
113
+        editAgent(playload).then(res => {
114
+          Taro.switchTab({
115
+            url: '/pages/person/index'
116
+          })
117
+        })
118
+
119
+      })
120
+    } else {
107 121
       const playload = {
108 122
         name: this.state.name,
109 123
         avatar: avatar,
@@ -114,7 +128,7 @@ export default class editDetail extends Component {
114 128
           url: '/pages/person/index'
115 129
         })
116 130
       })
117
-    })
131
+    }
118 132
   }
119 133
   Alert(content, title) {
120 134
     title = title ? title : "温馨提示";

+ 27
- 21
src/pages/person/profile/index.js Visa fil

@@ -20,7 +20,7 @@ export default class Profile extends Component {
20 20
     documentTitle: '',
21 21
     verfyList: [], // 审核列表
22 22
     descVisible: false,
23
-    showWhich: true,
23
+
24 24
 
25 25
   }
26 26
 
@@ -33,18 +33,20 @@ export default class Profile extends Component {
33 33
     getVerifyList().then(res => {
34 34
       this.setState({
35 35
         verfyList: res || []
36
-      }, () => {
37
-        if (this.state.verfyList.length == 0) {
38
-          this.setState({
39
-            showWhich: true
40
-          })
41
-        } else {
42
-          this.setState({
43
-            showWhich: false
44
-          })
45
-        }
36
+      },
37
+      //  () => {
38
+      //   if (this.state.verfyList.length == 0) {
39
+      //     this.setState({
40
+      //       showWhich: true
41
+      //     })
42
+      //   } else {
43
+      //     this.setState({
44
+      //       showWhich: false
45
+      //     })
46
+      //   }
46 47
 
47
-      })
48
+      // }
49
+    )
48 50
       Taro.hideLoading()
49 51
     }).catch((err) => {
50 52
       Taro.hideLoading()
@@ -59,12 +61,16 @@ export default class Profile extends Component {
59 61
   bindAlbumClick(e) {
60 62
     this.setState({
61 63
       descVisible: true,
62
-      showWhich: false
64
+      // showWhich: false
63 65
     })
64 66
     e.stopPropagation()
65
-    Taro.showLoading({
66
-      title: '上传中',
67
+    this.setState({
68
+      descVisible: true,
69
+      // showWhich: false
67 70
     })
71
+    // Taro.showLoading({
72
+    //   title: '上传中',
73
+    // })
68 74
     Taro.chooseImage({
69 75
       sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
70 76
       sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
@@ -82,9 +88,9 @@ export default class Profile extends Component {
82 88
           })
83 89
         })
84 90
       },
85
-      complete: res => {
86
-        Taro.hideLoading()
87
-      }
91
+      // complete: res => {
92
+      //   Taro.hideLoading()
93
+      // }
88 94
     })
89 95
   }
90 96
   // 删除图片
@@ -192,13 +198,13 @@ export default class Profile extends Component {
192 198
 
193 199
 
194 200
   render() {
195
-    const { imgList, documentTitle, verfyList, descVisible, showWhich } = this.state
201
+    const { imgList, documentTitle, verfyList, descVisible } = this.state
196 202
 
197 203
     return (
198 204
       <View className="profile-page" style={`background: url(${profileBg}) no-repeat top;background-size: 100% 100%;`}>
199 205
         <ScrollView scrollY scrollWithAnimation style="height: 100vh">
200 206
 
201
-          {(!verfyList.length && showWhich) &&
207
+          {(!verfyList.length && !descVisible) &&
202 208
             <View className="up-images">
203 209
               {this.renderUpImages()}
204 210
 
@@ -210,7 +216,7 @@ export default class Profile extends Component {
210 216
               </View>
211 217
             </View>
212 218
           }
213
-          {(verfyList.length || !showWhich) &&
219
+          {(verfyList.length||descVisible) &&
214 220
             <View>
215 221
 
216 222
               {descVisible &&

+ 5
- 0
src/utils/im.js Visa fil

@@ -138,7 +138,12 @@ class IMManager {
138 138
           console.log('socket发送成功')
139 139
         },
140 140
         fail(err) {
141
+
141 142
           console.log(err, '发送失败了')
143
+          Taro.showToast({
144
+            title: '发送失败',
145
+            icon: 'none'
146
+          })
142 147
         }
143 148
       })
144 149
     } else {