fangmingyue 2 年之前
父節點
當前提交
5bf7ce80da

+ 8
- 0
config/dev.js 查看文件

@@ -3,10 +3,18 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
+<<<<<<< HEAD
6 7
     // HOST: '"https://xlk.njyz.tech"',
7 8
     // HOST: '"https://www.newhousehold.cn"',
8 9
     HOST: '"http://192.168.89.147:8081"',
9 10
 
11
+=======
12
+    HOST: '"https://xlk.njyz.tech"',
13
+    // HOST: '"https://www.newhousehold.cn"',
14
+    // HOST: '"http://192.168.89.147:8081"',
15
+    // HOST: '"http://localhost:8081"',
16
+   
17
+>>>>>>> 081381f11d051ff0fcc56e6285fe77388694e23c
10 18
     // WSS_HOST: '"wss://www.newhousehold.cn"',
11 19
     WSS_HOST: '"wss://xlk.njyz.tech"',
12 20
     OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',

+ 1
- 0
src/constants/user.js 查看文件

@@ -16,6 +16,7 @@ export const ROLE_CODE = {
16 16
   DRIFT: 'drift', // 游客
17 17
   CUSTOMER: 'customer', // 客户
18 18
   MARKETING: 'marketing', // 驻场
19
+  BORKER: 'borker', // 全民经纪人(新联家)
19 20
 }
20 21
 
21 22
 // 客户流转状态

+ 53
- 0
src/pages/index/components/NewestNnews/index.jsx 查看文件

@@ -0,0 +1,53 @@
1
+import { useState, useEffect } from "react";
2
+import { useSelector } from "react-redux";
3
+import Taro from "@tarojs/taro";
4
+import { queryActivityList } from "@/services/activity";
5
+import { Swiper, SwiperItem, Block } from "@tarojs/components";
6
+import "@/assets/css/iconfont.css";
7
+import "./index.scss";
8
+
9
+export default function HotRecommend(props) {
10
+  const { change = () => {} } = props;
11
+  const city = useSelector((state) => state.city);
12
+  const [CurrentId, setCurrentId] = useState("dymic");
13
+  const [list, setList] = useState([[], []]);
14
+  const [CurrentContentInfo, setCurrentContentInfo] = useState({});
15
+
16
+  useEffect(() => {
17
+    if (city.curCity.name) {
18
+      GetRecommendActivity();
19
+    }
20
+  }, [city]);
21
+
22
+  const GetRecommendActivity = () => {
23
+    // queryActivityList({ home: 1, cityId: city.curCity.id, type: 'dymic' }).then((res) => {
24
+    //   const resArr = res.records || []
25
+    //   queryActivityList({ home: 1, cityId: city.curCity.id, type: 'house' }).then((subRes) => {
26
+    //     const subResArr = subRes.records || []
27
+    //     setList([resArr || [], subResArr || []])
28
+    //     change(resArr.length || subResArr.length)
29
+    //   })
30
+    // })
31
+  };
32
+
33
+  return (
34
+    <view className="components NewestNnews">
35
+      <view className="content">
36
+        <view className="icon">
37
+          <text className="iconfont icon-shoucang"></text>
38
+        </view>
39
+        <view className="newstype">成交喜报</view>
40
+        <view className="newstext">
41
+          <text
42
+            className="looptext"
43
+            style={{ animation: "10s loop linear infinite normal" }}
44
+          >
45
+            <text>2222222222222222233333333333333333333333</text>
46
+            <text>9999999996666666666666665555555555555544</text>
47
+            <text>5548888888888888888777773333333333333222</text>
48
+          </text>
49
+        </view>
50
+      </view>
51
+    </view>
52
+  );
53
+}

+ 63
- 0
src/pages/index/components/NewestNnews/index.scss 查看文件

@@ -0,0 +1,63 @@
1
+.components.NewestNnews {
2
+  position: relative;
3
+  overflow: visible;
4
+  padding: 0 30px;
5
+  margin-top: 40px;
6
+
7
+  .content {
8
+    box-sizing: border-box;
9
+    padding: 13px 20px;
10
+    // height: 166px;
11
+    position: relative;
12
+    // overflow: hidden;
13
+
14
+    background: rgba(25, 60, 131, 0.08);
15
+
16
+    border-radius: 8px;
17
+    font-size: 28px;
18
+    display: flex;
19
+    .icon {
20
+      width: 50px;
21
+      > text {
22
+        font-size: 44px;
23
+      }
24
+    }
25
+    .newstype{
26
+      width: 150px;
27
+    }
28
+    .newstext {
29
+      overflow: hidden;
30
+      width: 500px;
31
+      .looptext {
32
+        display: inline-block;
33
+         text {
34
+          margin-right: 10px;
35
+        }
36
+      }
37
+    }
38
+  }
39
+}
40
+
41
+@keyframes loop {
42
+  0% {
43
+    transform: translateX(350px);
44
+    -webkit-transform: translateX(350px);
45
+  }
46
+
47
+  100% {
48
+    transform: translateX(-100%);
49
+    -webkit-transform: translateX(-100%);
50
+  }
51
+}
52
+
53
+@-webkit-keyframes loop {
54
+  0% {
55
+    transform: translateX(300px);
56
+    -webkit-transform: translateX(300px);
57
+  }
58
+
59
+  100% {
60
+    transform: translateX(-100%);
61
+    -webkit-transform: translateX(-100%);
62
+  }
63
+}

+ 13
- 1
src/pages/index/index.jsx 查看文件

@@ -17,6 +17,7 @@ import Location from './components/Location/index'
17 17
 import Banner from './components/Banner/index'
18 18
 import Menu from './components/Menu/index'
19 19
 import HotRecommend from './components/HotRecommend/index'
20
+import NewestNnews from './components/NewestNnews/index'
20 21
 import LiveSale from './components/LiveSale/index'
21 22
 import ColumnTitle from './components/ColumnTitle/index'
22 23
 import useIndexShareContent from './useIndexShareContent'
@@ -33,6 +34,7 @@ export default withLayout((props) => {
33 34
   const [BannerList, setBannerList] = useState([])
34 35
   const [ProjectList, setProjectList] = useState([])
35 36
   const [ShowHotRecommend, setShowHotRecommend] = useState(false)
37
+  const [ShowNewestNnews, setShowNewestNnews] = useState(false)
36 38
   const [ShowLive, setShowLive] = useState(false)
37 39
   const shareContent = useIndexShareContent(miniApp, paramsRef, router)
38 40
   
@@ -57,7 +59,11 @@ export default withLayout((props) => {
57 59
   const HotRecommendChange = (e) => {
58 60
     setShowHotRecommend(e)
59 61
   }
60
-
62
+  
63
+  const NewestNnewsChange = (e) => {
64
+    setShowNewestNnews(e)
65
+  }
66
+  
61 67
   const LiveChange = (e) => {
62 68
     setShowLive(e)
63 69
   }
@@ -111,6 +117,12 @@ export default withLayout((props) => {
111 117
             <Menu></Menu>
112 118
           </view>
113 119
 
120
+           {/* 最新动态 */}
121
+           <view className='NewestNnews' style={{display: ShowNewestNnews ? 'block' : 'block'}}>
122
+            {/* <ColumnTitle Name='热门推荐' Icon='icon-shoucang'></ColumnTitle> */}
123
+            <NewestNnews change={NewestNnewsChange}></NewestNnews>
124
+          </view>
125
+          
114 126
           {/* 热门推荐 */}
115 127
           <view className='HotRecommend' style={{display: ShowHotRecommend ? 'block' : 'none'}}>
116 128
             <ColumnTitle Name='热门推荐' Icon='icon-shoucang'></ColumnTitle>

+ 3
- 0
src/pages/index/index.scss 查看文件

@@ -38,6 +38,9 @@
38 38
         position: relative;
39 39
         overflow: hidden;
40 40
       }
41
+      >.NewestNnews {
42
+        margin-top: -20px;
43
+      }
41 44
       >.HotRecommend {
42 45
         margin-top: -20px;
43 46
       }

+ 27
- 5
src/pages/mine/index.jsx 查看文件

@@ -29,13 +29,13 @@ export default withLayout(() => {
29 29
     if (user?.userInfo?.person?.personId) {
30 30
       console.log(city)
31 31
       const person = user.userInfo.person
32
-      setUserRole(person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : person.personType === ROLE_CODE.MARKETING ? 4 : 1)
32
+      setUserRole(person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : person.personType === ROLE_CODE.MARKETING ? 4 :ROLE_CODE.BORKER ? 5 : 1)
33 33
     }
34 34
   }, [user])
35 35
 
36 36
   useEffect(() => {
37 37
     if (UserRole !== null) {
38
-      setMenuList(UserRole === 1 ? MineMenuList.User : UserRole === 2 ? MineMenuList.Broker : UserRole === 3 ? MineMenuList.Adviser : MineMenuList.Resident)
38
+      setMenuList(UserRole === 1 ? MineMenuList.User : UserRole === 2 ? MineMenuList.Broker : UserRole === 3 ? MineMenuList.Adviser : UserRole === 5? MineMenuList.Broker: MineMenuList.Resident)
39 39
     }
40 40
   }, [UserRole])
41 41
 
@@ -81,11 +81,33 @@ export default withLayout(() => {
81 81
                   <view>
82 82
                     <text>{user?.userInfo?.person?.nickname}</text>
83 83
                     <view>
84
-                      <text className='iconfont icon-bianji' onClick={() => { Taro.navigateTo({ url: `/pages/mine/userInfo/index` }) }}></text>
85
-                      <text onClick={() => { Taro.navigateTo({ url: `/pages/mine/userInfo/index` }) }}>个人信息资料修改</text>
84
+                      <text className='iconfont icon-bianji' onClick={() => {  
85
+                        if (UserRole === 5) {
86
+                            Taro.navigateTo({
87
+                              url: `/subpackages/pages/borker/toBeBorker/index`,
88
+                            });
89
+                          } else {
90
+                            Taro.navigateTo({
91
+                              url: `/pages/mine/userInfo/index`,
92
+                            });
93
+                          }
94
+                        }}
95
+                      ></text>
96
+                      <text onClick={() => {
97
+                          if (UserRole === 5) {
98
+                            Taro.navigateTo({
99
+                              url: `/subpackages/pages/borker/toBeBorker/index`,
100
+                            });
101
+                          } else {
102
+                            Taro.navigateTo({
103
+                              url: `/pages/mine/userInfo/index`,
104
+                            });
105
+                          }
106
+                        }}
107
+                      >个人信息资料修改</text>
86 108
                     </view>
87 109
                   </view>
88
-                  <text className='Role'>{UserRole === 1 ? '客户' : UserRole === 2 ? '合伙人' : UserRole === 3 ? '置业顾问' : '驻场管理'}</text>
110
+                  <text className='Role'>{UserRole === 1 ? '客户' : UserRole === 2 ? '合伙人' : UserRole === 3 ? '置业顾问' :UserRole === 5 ?'全民经纪人' :'驻场管理'}</text>
89 111
                   {/* <text className='New'>NEW</text> */}
90 112
                   <Image mode='heightFix' src={require('@/assets/mine-icon35.png')} className='New'></Image>
91 113
                 </view>

+ 21
- 11
src/pages/mine/tabData.js 查看文件

@@ -19,27 +19,37 @@ const MineMenuList = {
19 19
     [
20 20
       { name: '成为驻场管理', icon: require('@/assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' },
21 21
       { name: '成为置业顾问', icon: require('@/assets/mine-icon4.png'), router: 'propertyConsultant' },
22
-      { name: '成为合伙人', icon: require('@/assets/mine-icon2.png'), router: '/pages/mine/toBeAgent/index' }
22
+      { name: '成为合伙人', icon: require('@/assets/mine-icon2.png'), router: '/pages/mine/toBeAgent/index' },
23
+      { name: '成为全民经纪人', icon: require('@/assets/mine-icon2.png'), router: '/subpackages/pages/borker/toBeBorker/index' }
23 24
     ]
24 25
   ],
25 26
   Broker: [ // 经纪人
26 27
     [
27
-      { name: '报备客户', icon: require('@/assets/mine-icon1.png'), router: '/pages/mine/addCustomer/index?type=estateAgent' },
28
-      { name: '合作渠道', icon: require('@/assets/mine-icon3.png'), router: '/subpackages/pages/channel/partnerChannel/index' }
28
+      { name: '我的钱包', icon: require('@/assets/mine-icon1.png'), router: '/pages/mine/addCustomer/index?type=estateAgent' },
29
+      { name: '我的客户', icon: require('@/assets/mine-icon1.png'), router: '/pages/mine/addCustomer/index?type=estateAgent' },
30
+      { name: '我的资料', icon: require('@/assets/mine-icon1.png'), router: '/pages/mine/addCustomer/index?type=estateAgent' },
31
+      { name: '我的消息', icon: require('@/assets/mine-icon1.png'), router: '/pages/mine/addCustomer/index?type=estateAgent' },
32
+      { name: '我邀请的全民经纪人', icon: require('@/assets/mine-icon1.png'), router: '/pages/mine/addCustomer/index?type=estateAgent' },
29 33
     ],
30 34
     [
31
-      { name: '我的推荐', icon: require('@/assets/mine-icon15.png'), router: '/pages/mine/myCustomer/index' },
32
-      { name: '我的分享', icon: require('@/assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
33
-      { name: '我的活动', icon: require('@/assets/mine-icon10.png'), router: '/pages/mine/myActivity/index' },
34
-      { name: '我的课堂', icon: require('@/assets/mine-icon12.png'), router: '/pages/mine/myCourse/index' },
35
-      { name: '我的收藏', icon: require('@/assets/mine-icon13.png'), router: '/pages/mine/myCollect/index' }
36
-    ],
37
-    [
38
-      { name: '成为驻场管理', icon: require('@/assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' },
35
+
39 36
       { name: '房贷计算器', icon: require('@/assets/mine-icon4.png'), router: '/pages/mine/mortgageCalc/index' },
40 37
       { name: '购房百科', icon: require('@/assets/mine-icon2.png'), router: '/pages/index/encyclopediasOfBuyHouse/index' },
41 38
       { name: '意见反馈', icon: require('@/assets/mine-icon16.png'), router: '/pages/mine/feedBack/index' }
42 39
     ]
40
+    // [
41
+    //   { name: '我的推荐', icon: require('@/assets/mine-icon15.png'), router: '/pages/mine/myCustomer/index' },
42
+    //   { name: '我的分享', icon: require('@/assets/mine-icon9.png'), router: '/pages/mine/myShare/index' },
43
+    //   { name: '我的活动', icon: require('@/assets/mine-icon10.png'), router: '/pages/mine/myActivity/index' },
44
+    //   { name: '我的课堂', icon: require('@/assets/mine-icon12.png'), router: '/pages/mine/myCourse/index' },
45
+    //   { name: '我的收藏', icon: require('@/assets/mine-icon13.png'), router: '/pages/mine/myCollect/index' }
46
+    // ],
47
+    // [
48
+    //   { name: '成为驻场管理', icon: require('@/assets/mine-icon8.png'), router: '/pages/mine/toBeManager/index' },
49
+    //   { name: '房贷计算器', icon: require('@/assets/mine-icon4.png'), router: '/pages/mine/mortgageCalc/index' },
50
+    //   { name: '购房百科', icon: require('@/assets/mine-icon2.png'), router: '/pages/index/encyclopediasOfBuyHouse/index' },
51
+    //   { name: '意见反馈', icon: require('@/assets/mine-icon16.png'), router: '/pages/mine/feedBack/index' }
52
+    // ]
43 53
   ],
44 54
   Adviser: [ // 置业顾问
45 55
     [

+ 9
- 0
src/routes.js 查看文件

@@ -418,6 +418,7 @@ const routes = [
418 418
     type: 'other',
419 419
   },
420 420
   {
421
+<<<<<<< HEAD
421 422
     name: '经纪人',
422 423
     page: 'pages/borker/agentRule/index',
423 424
     pkg: 'subpackages',
@@ -445,6 +446,14 @@ const routes = [
445 446
     type: 'other',
446 447
     auth: ['phone', 'avatar'],
447 448
   }
449
+=======
450
+    name: '全民经纪人',
451
+    page: 'pages/borker/toBeBorker/index',
452
+    pkg: 'subpackages',
453
+    type: 'other',
454
+  },
455
+  
456
+>>>>>>> 081381f11d051ff0fcc56e6285fe77388694e23c
448 457
 ]
449 458
 
450 459
 /**

+ 22
- 0
src/subpackages/pages/borker/components/CardItem/index.jsx 查看文件

@@ -0,0 +1,22 @@
1
+import { useState, useEffect } from "react";
2
+import Taro from "@tarojs/taro";
3
+
4
+import "./index.scss";
5
+
6
+export default (props) => {
7
+  const { title,addCard } = props;
8
+
9
+  return (
10
+    <view className="CardItem">
11
+      <view>
12
+        <text>{title}</text>
13
+        <view className="FormLine flex-h">
14
+          <view className="flex-item">12321312312</view>
15
+        </view>
16
+        <view className="FormLine flex-additem-h">
17
+          <view className="flex-additem" onClick={()=>addCard()} >添加证件</view>
18
+        </view>
19
+      </view>
20
+    </view>
21
+  );
22
+};

+ 95
- 0
src/subpackages/pages/borker/components/CardItem/index.scss 查看文件

@@ -0,0 +1,95 @@
1
+.CardItem {
2
+  background: #f4f4f4;
3
+  display: grid;
4
+  > view {
5
+    background: #fff;
6
+margin-top: 20px;
7
+    > text {
8
+      font-size: 34px;
9
+      font-weight: bold;
10
+
11
+      color: #333;
12
+      display: block;
13
+      text-indent: 40px;
14
+      margin-top: 30px;
15
+    }
16
+    > .flex-h {
17
+      box-sizing: border-box;
18
+      padding: 20px 40px;
19
+      border-bottom: 2px solid rgba(0, 0, 0, 0.12);
20
+      margin-top: 10px;
21
+      align-items: center;
22
+      > view {
23
+        > .Icon {
24
+          width: 92px;
25
+          height: 92px;
26
+          position: relative;
27
+          overflow: hidden;
28
+          border-radius: 100%;
29
+          background: #eee;
30
+          > image {
31
+            width: 100%;
32
+            height: 100%;
33
+          }
34
+        }
35
+        > input {
36
+          display: block;
37
+          width: 100%;
38
+          background: none;
39
+          font-size: 26px;
40
+          line-height: 40px;
41
+          height: 40px;
42
+        }
43
+        > textarea {
44
+          font-size: 26px;
45
+          display: block;
46
+          width: 100%;
47
+        }
48
+        > text {
49
+          display: block;
50
+          width: 100%;
51
+          background: none;
52
+          font-size: 26px;
53
+          line-height: 40px;
54
+          height: 40px;
55
+        }
56
+      }
57
+      >.flex-additem{
58
+        text-align: center;
59
+      }
60
+      > text {
61
+        font-size: 30px;
62
+      }
63
+    }
64
+
65
+    > .flex-additem-h {
66
+      box-sizing: border-box;
67
+      padding: 20px 40px;
68
+
69
+      margin-top: 10px;
70
+      align-items: center;
71
+      > view {
72
+        > .Icon {
73
+          width: 92px;
74
+          height: 92px;
75
+          position: relative;
76
+          overflow: hidden;
77
+          border-radius: 100%;
78
+          background: #eee;
79
+          > image {
80
+            width: 100%;
81
+            height: 100%;
82
+          }
83
+        }
84
+      
85
+      
86
+      }
87
+      >.flex-additem{
88
+        text-align: center;
89
+      }
90
+      > text {
91
+        font-size: 30px;
92
+      }
93
+    }
94
+  }
95
+}

+ 52
- 0
src/subpackages/pages/borker/toBeBorker/AddBankCard/index.jsx 查看文件

@@ -0,0 +1,52 @@
1
+import { useState, useEffect } from "react";
2
+import Taro from "@tarojs/taro";
3
+import { ScrollView, Input, Image, Block, Textarea } from '@tarojs/components'
4
+import "./index.scss";
5
+
6
+export default (props) => {
7
+  const { title,onChanel } = props;
8
+
9
+  const [FormData, setFormData] = useState({
10
+    name: '',
11
+    phone: '',
12
+    description: ''
13
+  })
14
+
15
+  const FormChange = (key, e) => {
16
+    let Data = { ...FormData }
17
+    Data[key] = e.detail.value
18
+    setFormData(Data)
19
+  }
20
+
21
+  return (
22
+    <view className="AddIdentityCard">
23
+    
24
+
25
+          <text>持卡人</text>
26
+          <view className='FormLine flex-h'>
27
+            <view className='flex-item'>
28
+              <Input placeholder='请输入用户名' value={FormData.name} onInput={FormChange.bind(this, 'name')}></Input>
29
+            </view>
30
+          </view>
31
+
32
+          <text>开户行</text>
33
+          <view className='FormLine flex-h'>
34
+            <view className='flex-item'>
35
+              <Input placeholder='请输入开户行' value={FormData.phone} onInput={FormChange.bind(this, 'phone')}></Input>
36
+            </view>
37
+          </view>
38
+
39
+          <text>银行卡号</text>
40
+          <view className='FormLine flex-h'>
41
+            <view className='flex-item'>
42
+              <Input placeholder='请输入银行卡号' value={FormData.phone} onInput={FormChange.bind(this, 'phone')}></Input>
43
+            </view>
44
+          </view>
45
+
46
+          <view className='Btn'>
47
+          <text >确定</text>
48
+          <text onClick={()=>onChanel()} >取消</text>
49
+        </view>
50
+    </view>
51
+  );
52
+};

+ 86
- 0
src/subpackages/pages/borker/toBeBorker/AddBankCard/index.scss 查看文件

@@ -0,0 +1,86 @@
1
+.AddIdentityCard {
2
+  width: 100vw;
3
+  height: 100vh;
4
+  // position: relative;
5
+  background: #ffffff;
6
+  position: absolute;
7
+  left: 0;
8
+  top: 0;
9
+  z-index: 10 ;
10
+  > text {
11
+    font-size: 34px;
12
+    font-weight: bold;
13
+    color: #333;
14
+    display: block;
15
+    text-indent: 40px;
16
+    margin-top: 30px;
17
+  }
18
+  > .flex-h {
19
+    padding: 20px 40px;
20
+    border-bottom: 2px solid rgba(0, 0, 0, 0.12);
21
+    margin-top: 10px;
22
+    align-items: center;
23
+    > view {
24
+      > .Icon {
25
+        width: 92px;
26
+        height: 92px;
27
+        position: relative;
28
+        overflow: hidden;
29
+        border-radius: 100%;
30
+        background: #eee;
31
+        > image {
32
+          width: 100%;
33
+          height: 100%;
34
+        }
35
+      }
36
+      > input {
37
+        display: block;
38
+        width: 100%;
39
+        background: none;
40
+        font-size: 26px;
41
+        line-height: 40px;
42
+        height: 40px;
43
+      }
44
+      > textarea {
45
+        font-size: 26px;
46
+        display: block;
47
+        width: 100%;
48
+      }
49
+      > text {
50
+        display: block;
51
+        width: 100%;
52
+        background: none;
53
+        font-size: 26px;
54
+        line-height: 40px;
55
+        height: 40px;
56
+      }
57
+    }
58
+    > text {
59
+      font-size: 30px;
60
+    }
61
+  }
62
+
63
+  .Btn {
64
+    padding: 0 40px;
65
+    position: absolute;
66
+    box-sizing: border-box;
67
+    width: 100vw;
68
+    left: 0;
69
+    bottom:20px;
70
+    z-index: 2;
71
+    margin-top: 20px;
72
+    display: flex;
73
+    justify-content: space-between;
74
+    >text {
75
+      display: block;
76
+      text-align: center;
77
+      font-size: 32px;
78
+      line-height: 92px;
79
+      background: #193C83;
80
+      color: #fff;
81
+      font-weight: bold;
82
+      border-radius: 92px;
83
+      width: 320px;
84
+    }
85
+  }
86
+}

+ 3
- 0
src/subpackages/pages/borker/toBeBorker/index.config.js 查看文件

@@ -0,0 +1,3 @@
1
+export default {
2
+  navigationBarTitleText: '全民经纪人'
3
+}

+ 145
- 0
src/subpackages/pages/borker/toBeBorker/index.jsx 查看文件

@@ -0,0 +1,145 @@
1
+import { useState, useEffect } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import { useSelector } from 'react-redux'
4
+import withLayout from '@/layout'
5
+import { ScrollView, Input, Image, Block, Textarea } from '@tarojs/components'
6
+import { getImgURL } from '@/utils/image'
7
+import { fetch, uploadFiles } from '@/utils/request'
8
+import { UPDATE_USER_INFO, ROLE_CODE } from '@/constants/user'
9
+import { API_EDIT_AGENT, API_UPDATE_PHOTO } from '@/constants/api'
10
+import store from '@/store'
11
+import CardItem from '../components/CardItem'
12
+import AddBankCard from './AddBankCard'
13
+
14
+import '@/assets/css/iconfont.css'
15
+import './index.scss'
16
+
17
+export default withLayout(() => {
18
+
19
+  const { dispatch } = store
20
+
21
+  const user = useSelector(state => state.user)
22
+  const [UserInfo, setUserInfo] = useState({})
23
+  const [UserRole, setUserRole] = useState(null) // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理 5-
24
+  const [FormData, setFormData] = useState({
25
+    name: '',
26
+    phone: '',
27
+    description: ''
28
+  })
29
+  const [showAddIdentityCard, setShowAddIdentityCard] = useState(false)
30
+  
31
+
32
+  useEffect(() => {
33
+    if (user?.userInfo?.person?.personId) {
34
+      const person = user.userInfo.person
35
+      setUserRole(person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : person.personType === ROLE_CODE.MARKETING ? 4 : 1)
36
+    }
37
+  }, [user])
38
+
39
+  useEffect(() => {
40
+    setUserInfo(user?.userInfo?.person)
41
+    setFormData({ name: user?.userInfo?.person.name, phone: user?.userInfo?.person.phone, description: user?.userInfo?.person.description })
42
+  }, [user])
43
+
44
+  const Save = () => {
45
+    let params = ''
46
+    if(UserRole === 3) {
47
+      params = `name=${FormData.name}&phone=${FormData.phone}&description=${FormData.description}`
48
+    } else {
49
+      params = `name=${FormData.name}&phone=${FormData.phone}`
50
+    }
51
+    fetch({ url: `${API_EDIT_AGENT}?${params}`, method: 'put' }).then(() => {
52
+      Taro.showToast({
53
+        title: '修改成功',
54
+        icon: 'none'
55
+      })
56
+      dispatch({ type: UPDATE_USER_INFO, payload: { name: FormData.name, phone: FormData.phone, description: FormData.description } })
57
+      // login({ path: '', scene: '' })
58
+    })
59
+  }
60
+
61
+  const FormChange = (key, e) => {
62
+    let Data = { ...FormData }
63
+    Data[key] = e.detail.value
64
+    setFormData(Data)
65
+  }
66
+
67
+  const ToUploadImg = () => {
68
+    if (UserRole - 0 === 3) {
69
+      Taro.chooseImage({
70
+        count: 1,
71
+        success: function (res) {
72
+          if (res.errMsg === 'chooseImage:ok') {
73
+            Taro.showToast({ title: '正在上传...', icon: 'loading', mask: true, duration: 10000 })
74
+            uploadFiles(res.tempFilePaths).then((subRes) => {
75
+              fetch({ url: API_UPDATE_PHOTO, payload: { photoUrl: subRes[0] }, method: 'put' }).then(() => {
76
+                Taro.hideToast()
77
+                Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
78
+                dispatch({ type: UPDATE_USER_INFO, payload: { userPhoto: subRes[0] } })
79
+              })
80
+            })
81
+          }
82
+        }
83
+      })
84
+    }
85
+  }
86
+
87
+  return (
88
+    <view className='Page UserInfo'>
89
+
90
+      <ScrollView scroll-y>
91
+        <view className='PageContent'>
92
+
93
+          <text>头像</text>
94
+          <view className='FormLine flex-h' onClick={ToUploadImg}>
95
+            <view className='flex-item'>
96
+              <view className='Icon'>
97
+                <Image mode='aspectFill' src={getImgURL(UserInfo.userPhoto || UserInfo.avatarurl)}></Image>
98
+              </view>
99
+            </view>
100
+            {/* <text className='iconfont icon-jiantouright'></text> */}
101
+          </view>
102
+
103
+          <text>用户名</text>
104
+          <view className='FormLine flex-h'>
105
+            <view className='flex-item'>
106
+              <Input placeholder='请输入用户名' value={FormData.name} onInput={FormChange.bind(this, 'name')}></Input>
107
+            </view>
108
+          </view>
109
+
110
+          <text>手机号码</text>
111
+          <view className='FormLine flex-h'>
112
+            <view className='flex-item'>
113
+              <Input placeholder='请输入手机号码' value={FormData.phone} onInput={FormChange.bind(this, 'phone')}></Input>
114
+            </view>
115
+          </view>
116
+
117
+          <text>证件号码</text>
118
+          <view className='FormLine flex-h'>
119
+            <view className='flex-item'>
120
+              <Input placeholder='请输入证件号码' value={FormData.phone} onInput={FormChange.bind(this, 'phone')}></Input>
121
+            </view>
122
+          </view>
123
+
124
+
125
+          <CardItem title='银行卡号' addCard={()=>setShowAddIdentityCard(true)}></CardItem>
126
+          {/* <text>证件号码</text>
127
+          <view className='FormLine flex-h'>
128
+            <view className='flex-item'>
129
+              <Input placeholder='请输入手机号码' value={FormData.phone} onInput={FormChange.bind(this, 'phone')}></Input>
130
+            </view>
131
+          </view> */}
132
+
133
+        </view>
134
+
135
+        <view className='Btn'>
136
+          <text onClick={Save}>保存</text>
137
+        </view>
138
+      </ScrollView>
139
+
140
+
141
+{showAddIdentityCard&&  <AddBankCard onChange={(e)=>console.log(e)} onChanel={()=>setShowAddIdentityCard(false)}></AddBankCard>}
142
+
143
+    </view>
144
+  )
145
+})

+ 86
- 0
src/subpackages/pages/borker/toBeBorker/index.scss 查看文件

@@ -0,0 +1,86 @@
1
+.Page.UserInfo {
2
+  background: #fff;
3
+  height: 100vh;
4
+  width: 100%;
5
+  > scroll-view {
6
+    width: 100%;
7
+    height: 100%;
8
+    display: flex;
9
+    .PageContent {
10
+      position: relative;
11
+      overflow: hidden;
12
+      min-height: calc(100vh - 100px);
13
+      z-index: 1;
14
+      padding-bottom: 100px;
15
+      > text {
16
+        font-size: 34px;
17
+        font-weight: bold;
18
+        color: #333;
19
+        display: block;
20
+        text-indent: 40px;
21
+        margin-top: 30px;
22
+      }
23
+      > .flex-h {
24
+        padding: 20px 40px;
25
+        border-bottom: 2px solid rgba(0, 0, 0, 0.12);
26
+        margin-top: 10px;
27
+        align-items: center;
28
+        >view {
29
+          >.Icon {
30
+            width: 92px;
31
+            height: 92px;
32
+            position: relative;
33
+            overflow: hidden;
34
+            border-radius: 100%;
35
+            background: #eee;
36
+            >image {
37
+              width: 100%;
38
+              height: 100%;
39
+            }
40
+          }
41
+          > input {
42
+            display: block;
43
+            width: 100%;
44
+            background: none;
45
+            font-size: 26px;
46
+            line-height: 40px;
47
+            height: 40px;
48
+          }
49
+          >textarea {
50
+            font-size: 26px;
51
+            display: block;
52
+            width: 100%;
53
+          }
54
+          >text {
55
+            display: block;
56
+            width: 100%;
57
+            background: none;
58
+            font-size: 26px;
59
+            line-height: 40px;
60
+            height: 40px;
61
+          }
62
+        }
63
+        >text {
64
+          font-size: 30px;
65
+        }
66
+      }
67
+    }
68
+    .Btn {
69
+      padding: 0 40px;
70
+      position: relative;
71
+      overflow: hidden;
72
+      z-index: 2;
73
+      margin-top: 20px;
74
+      >text {
75
+        display: block;
76
+        text-align: center;
77
+        font-size: 32px;
78
+        line-height: 92px;
79
+        background: #193C83;
80
+        color: #fff;
81
+        font-weight: bold;
82
+        border-radius: 92px;
83
+      }
84
+    }
85
+  }
86
+}