[baozhangchao] 2 years ago
parent
commit
b37cb189ea

+ 2
- 1
.eslintrc.js View File

@@ -2,6 +2,7 @@ module.exports = {
2 2
   "extends": ["taro/react"],
3 3
   "rules": {
4 4
     "react/jsx-uses-react": "off",
5
-    "react/react-in-jsx-scope": "off"
5
+    "react/react-in-jsx-scope": "off",
6
+    "import/first": ['error', 'DISABLE-absolute-first']
6 7
   }
7 8
 }

+ 2
- 2
config/dev.js View File

@@ -4,8 +4,8 @@ module.exports = {
4 4
   },
5 5
   defineConstants: {
6 6
     // HOST: '"https://xlk.njyz.tech"',
7
-    HOST: '"https://www.newhousehold.cn"',
8
-    // HOST: '"http://192.168.89.147:8081"',
7
+    // HOST: '"https://www.newhousehold.cn"',
8
+    HOST: '"http://192.168.89.147:8081"',
9 9
 
10 10
     // WSS_HOST: '"wss://www.newhousehold.cn"',
11 11
     WSS_HOST: '"wss://xlk.njyz.tech"',

+ 29
- 1
project.config.json View File

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "miniapp",
4 4
 	"description": "",
5
-	"appid": "wxc96058d57e77f373",
5
+	"appid": "wxe44244d1a5ea3364",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,
@@ -91,6 +91,34 @@
91 91
 					"pathName": "pages/index/buildingDetail/index",
92 92
 					"query": "id=bf5d766943cfcc6b5814317340c8eefc",
93 93
 					"scene": null
94
+				},
95
+				{
96
+					"id": 5,
97
+					"name": "经纪人",
98
+					"pathName": "subpackages/pages/borker/agentRule/index",
99
+					"query": "",
100
+					"scene": null
101
+				},
102
+				{
103
+					"id": 6,
104
+					"name": "佣金规则",
105
+					"pathName": "subpackages/pages/borker/agreement/index",
106
+					"query": "",
107
+					"scene": null
108
+				},
109
+				{
110
+					"id": 7,
111
+					"name": "我的邀请",
112
+					"pathName": "subpackages/pages/borker/invitation/index",
113
+					"query": "",
114
+					"scene": null
115
+				},
116
+				{
117
+					"id": 8,
118
+					"name": "邀请列表",
119
+					"pathName": "subpackages/pages/borker/invitationlist/index",
120
+					"query": "",
121
+					"scene": null
94 122
 				}
95 123
 			]
96 124
 		}

+ 9
- 0
src/constants/borker.js View File

@@ -0,0 +1,9 @@
1
+import { resolvePath } from "./api";
2
+
3
+// 全民经纪人
4
+
5
+// 佣金规则
6
+export const API_BK_AGREEMENT = resolvePath('bkAgreement')
7
+
8
+// 经纪人规则
9
+export const API_BK_AGENT_RULE = resolvePath('bkAgentRule')

+ 31
- 4
src/routes.js View File

@@ -417,17 +417,44 @@ const routes = [
417 417
     pkg: 'main',
418 418
     type: 'other',
419 419
   },
420
-
420
+  {
421
+    name: '经纪人',
422
+    page: 'pages/borker/agentRule/index',
423
+    pkg: 'subpackages',
424
+    type: 'other',
425
+    auth: ['phone', 'avatar'],
426
+  },
427
+  {
428
+    name: '佣金规则',
429
+    page: 'pages/borker/agreement/index',
430
+    pkg: 'subpackages',
431
+    type: 'other',
432
+    auth: ['phone', 'avatar'],
433
+  },
434
+  {
435
+    name: '我的邀请',
436
+    page: 'pages/borker/invitation/index',
437
+    pkg: 'subpackages',
438
+    type: 'other',
439
+    auth: ['phone', 'avatar'],
440
+  },
441
+  {
442
+    name: '邀请列表',
443
+    page: 'pages/borker/invitationlist/index',
444
+    pkg: 'subpackages',
445
+    type: 'other',
446
+    auth: ['phone', 'avatar'],
447
+  }
421 448
 ]
422 449
 
423 450
 /**
424 451
  * 获取 app pages 列表
425 452
  */
426
-function getPages() {
453
+function getPages () {
427 454
   const grp = routes.reduce((g, r) => {
428 455
     const { pkg, page } = r
429 456
     const pg = g[pkg] || []
430
-    
457
+
431 458
     return Object.assign(g, {
432 459
       [`${pkg}`]: pg.concat(page),
433 460
     })
@@ -439,7 +466,7 @@ function getPages() {
439 466
       root: key,
440 467
       pages: grp[key],
441 468
     })
442
-  }),[])
469
+  }), [])
443 470
 
444 471
 
445 472
   return {

+ 12
- 0
src/services/borker.js View File

@@ -0,0 +1,12 @@
1
+import { fetch } from '@/utils/request'
2
+
3
+import {
4
+  API_BK_AGREEMENT,
5
+} from '@/constants/borker'
6
+
7
+
8
+/**
9
+ * 获取佣金数据
10
+ * @param {*} id
11
+ */
12
+export const queryBkAgreement = (payload) => fetch({ url: `${API_BK_AGREEMENT}`, payload })

+ 4
- 0
src/subpackages/pages/borker/agentRule/index.config.js View File

@@ -0,0 +1,4 @@
1
+export default {
2
+  navigationBarTitleText: '全名经纪人',
3
+  disableScroll: false
4
+}

+ 21
- 0
src/subpackages/pages/borker/agentRule/index.jsx View File

@@ -0,0 +1,21 @@
1
+import withLayout from '@/layout'
2
+import { ScrollView, View, Image, Text, RichText } from '@tarojs/components'
3
+import './index.scss'
4
+
5
+const defaultRuleImage = 'https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E5%85%A8%E6%B0%91%E7%BB%8F%E7%BA%AA%E4%BA%BA.png'
6
+export default withLayout(() => {
7
+  const value = '<p>一、给钱</p ><p>二、还是给钱</p ><p>三、就问你要不要?<br/></p>';
8
+  return (
9
+    <ScrollView className='Page borker-page' style={{ height: '100vh' }} scrollY>
10
+      <Image mode='heightFix' className='img-set' src={defaultRuleImage} />
11
+      <View className='borker-padding'>
12
+        <View>
13
+          <Text>邀请奖励说明</Text>
14
+          <View>
15
+            <RichText nodes={value}></RichText>
16
+          </View>
17
+        </View>
18
+      </View>
19
+    </ScrollView>
20
+  )
21
+})

+ 26
- 0
src/subpackages/pages/borker/agentRule/index.scss View File

@@ -0,0 +1,26 @@
1
+.Page.borker-page{
2
+  .img-set{
3
+     width: 100vw;
4
+     display:block;
5
+    }
6
+  .borker-padding{
7
+    background-color: #49A8C1;
8
+    padding: 6rpx 30rpx 24rpx 30rpx;
9
+    >view{
10
+      padding: 39rpx 48rpx 80rpx 42rpx;
11
+      font-size: 34rpx;
12
+      border-radius: 40rpx;
13
+      background-color: #FFF;
14
+      >text{
15
+        font-family: DengXian;
16
+        font-weight: 400;
17
+        color: #333333;
18
+        margin: 60rpx 194rpx 0 201rpx;
19
+      }
20
+      >view{
21
+        margin-top: 39rpx;
22
+      }
23
+    }
24
+  }
25
+}
26
+

+ 3
- 0
src/subpackages/pages/borker/agreement/index.config.js View File

@@ -0,0 +1,3 @@
1
+export default {
2
+  navigationBarTitleText: '佣金规则'
3
+}

+ 40
- 0
src/subpackages/pages/borker/agreement/index.jsx View File

@@ -0,0 +1,40 @@
1
+import withLayout from '@/layout'
2
+import Taro from '@tarojs/taro'
3
+import { ScrollView, View, RichText } from '@tarojs/components'
4
+import { useEffect, useState } from 'react'
5
+import { queryBkAgreement } from "@/services/borker";
6
+
7
+import './index.scss'
8
+
9
+export default withLayout((props) => {
10
+  const { buildingId } = props.router.params;
11
+
12
+  const [data, setData] = useState({})
13
+
14
+  const getDetail = (params) => {
15
+    Taro.showLoading();
16
+
17
+    queryBkAgreement(params).then((res) => {
18
+
19
+      setData(res.records[0]);
20
+      Taro.hideLoading();
21
+    });
22
+  };
23
+
24
+  useEffect(() => {
25
+    if (buildingId) {
26
+      getDetail({ buildingId });
27
+    }
28
+  }, [buildingId])
29
+
30
+  return (
31
+    <ScrollView className='Page commission' scrollY>
32
+      <View className='agreement-wrapper'>
33
+        <View className='agreement-wrapper-content'>
34
+          <View className='agreement-wrapper-title'>佣金规则</View>
35
+          <RichText nodes={data.content}></RichText>
36
+        </View>
37
+      </View>
38
+    </ScrollView>
39
+  )
40
+})

+ 26
- 0
src/subpackages/pages/borker/agreement/index.scss View File

@@ -0,0 +1,26 @@
1
+.agreement-wrapper {
2
+  height: 100%;
3
+  background-color: #FF7F5F;
4
+  background-image: url(https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E4%BD%A3%E9%87%91%E8%A7%84%E5%88%991.png), url(https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E4%BD%A3%E9%87%91%E8%A7%84%E5%88%992.png);
5
+  background-size: contain, contain;
6
+  background-position: center top, center bottom;
7
+  background-repeat: no-repeat, no-repeat;
8
+  padding-top: 350rpx;
9
+  box-sizing: border-box;
10
+
11
+  &-title {
12
+    text-align: center;
13
+    font-weight: bold;
14
+    font-size: 34rpx;
15
+    margin-bottom: 2em;
16
+  }
17
+
18
+  &-content {
19
+    background-color: #FFF;
20
+    border-radius: 40px;
21
+    width: calc(100% - 4em);
22
+    margin: 0 2em;
23
+    padding: 2em;
24
+    box-sizing: border-box;    
25
+  }
26
+}

+ 3
- 0
src/subpackages/pages/borker/index.config.js View File

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

+ 29
- 0
src/subpackages/pages/borker/invitation/BottomAction.jsx View File

@@ -0,0 +1,29 @@
1
+
2
+import { Button, View, Navigator } from '@tarojs/components'
3
+
4
+import './index.scss'
5
+
6
+export default (props) => {
7
+
8
+  return (
9
+    <View className='invitation-bottom'>
10
+      <View className='Btn'>
11
+        <Button>海报分享</Button>
12
+      </View>
13
+      <View className='Btn'>
14
+        <Button className='default'>链接转发</Button>
15
+      </View>
16
+      <View className='invitation-bottom-links'>
17
+        <View>
18
+          <Navigator url=''>邀请规则</Navigator>
19
+        </View>
20
+        <View>
21
+          <Navigator url=''>我的邀请</Navigator>
22
+        </View>
23
+        <View>
24
+          <Navigator url=''>邀请排行</Navigator>
25
+        </View>
26
+      </View>
27
+    </View>
28
+  )
29
+}

+ 3
- 0
src/subpackages/pages/borker/invitation/index.config.js View File

@@ -0,0 +1,3 @@
1
+export default {
2
+  navigationBarTitleText: '我的邀请'
3
+}

+ 17
- 0
src/subpackages/pages/borker/invitation/index.jsx View File

@@ -0,0 +1,17 @@
1
+import withLayout from '@/layout'
2
+import { Image, View } from '@tarojs/components'
3
+import './index.scss'
4
+
5
+
6
+import BottomAction from './BottomAction'
7
+
8
+const defaultImage = 'https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E6%B5%B7%E6%8A%A5.png'
9
+
10
+export default withLayout(() => {
11
+  return (
12
+    <View className='invitation-iframe'>
13
+      <Image className='invitation-img' mode='widthFix' src={defaultImage} />
14
+      <BottomAction />
15
+    </View>
16
+  )
17
+})

+ 61
- 0
src/subpackages/pages/borker/invitation/index.scss View File

@@ -0,0 +1,61 @@
1
+.invitation-iframe{
2
+  display: inline-block;
3
+  position: relative;
4
+  .invitation-img{
5
+    position: absolute;
6
+    width: 100vw;
7
+  }
8
+  
9
+  .invitation-bottom {
10
+    width: 100%;
11
+    position: fixed;
12
+    bottom: 0;
13
+    z-index: 2;
14
+    padding: 0 40rpx 90rpx 40rpx;
15
+    box-sizing: border-box;
16
+
17
+    &-links {
18
+      margin-top: 60rpx;
19
+      display: flex;
20
+      justify-content: space-between;
21
+      font-size: 32px;
22
+      color: #193C83;
23
+      
24
+      & > view {
25
+        text-align: center;
26
+        flex: 1;
27
+
28
+        & + view {
29
+          border-left: 1rpx solid rgba(25, 60, 131, 0.2);
30
+        }
31
+      }
32
+    }
33
+  }
34
+
35
+  
36
+  .Btn {
37
+    position: relative;
38
+    overflow: hidden;
39
+
40
+    & + .Btn {
41
+      margin-top: 40rpx;
42
+    }
43
+    
44
+    .default {
45
+      border: 2px solid #193C83;
46
+      background: #FFF;
47
+      color: #193c83;
48
+    }
49
+
50
+    > button {
51
+      display: block;
52
+      text-align: center;
53
+      font-size: 32px;
54
+      line-height: 92px;
55
+      background: #193c83;
56
+      color: #fff;
57
+      font-weight: bold;
58
+      border-radius: 92px;
59
+    }
60
+  }
61
+}

+ 5
- 0
src/subpackages/pages/borker/invitationlist/index.config.js View File

@@ -0,0 +1,5 @@
1
+export default {
2
+  navigationBarTitleText: '邀请列表',
3
+  navigationBarBackgroundColor: '#4A2FA0',
4
+  navigationBarTextStyle: 'white'
5
+}

+ 26
- 0
src/subpackages/pages/borker/invitationlist/index.jsx View File

@@ -0,0 +1,26 @@
1
+import withLayout from '@/layout'
2
+import Taro from '@tarojs/taro'
3
+import { View, Image, Text } from '@tarojs/components'
4
+
5
+import './index.scss'
6
+
7
+export default withLayout(() => {
8
+  const img1 = 'https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E9%82%80%E8%AF%B7%E5%A5%96%E5%8A%B1.png';
9
+  const img2 = 'https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E9%82%80%E8%AF%B7%E6%B3%A8%E5%86%8C%E6%A6%9C.png';
10
+  const defaultRuleImage = 'https://xlk-assets.oss-cn-shanghai.aliyuncs.com/miniapp/borker/%E5%85%A8%E6%B0%91%E7%BB%8F%E7%BA%AA%E4%BA%BA.png'
11
+  return (
12
+    <View className='invitationlist-background'>
13
+      <View className='invitationlist-font'>总邀请人数</View><View className='invitationlist-font-right'><Image className='invitationlist-img' mode='widthFix' src={img1} />邀请奖励</View>
14
+      <View className='invitationlist-background-2'>
15
+        <View className='invitationlist-font-tl'>240</View><View className='invitationlist-font-right-t'><Image className='invitationlist-img' mode='widthFix' src={img2} />邀请注册榜</View>
16
+      </View>
17
+      <View className='invitationlist-view-1'>更新时间:&nbsp;<View className='invitationlist-view'>2022-07-22</View>&nbsp;<View className='invitationlist-view'>12:00:00</View></View>
18
+      <View className='invitationlist-view-list'>
19
+        <View className='invitationlist-img-frame'><Image className='invitationlist-img-head' src={defaultRuleImage} /></View>
20
+        <View className='invitationlist-view-list-ifr'><Text className='invitationlist-text-1'>阿三三</Text><Text className='invitationlist-text'>0</Text><Text className='invitationlist-text'>0</Text><Text className='invitationlist-time'>2022/07/26</Text></View>
21
+        <View className='invitationlist-view-list-ifr-t'><Text className='invitationlist-text-t1'>16787659987</Text><Text className='invitationlist-text-t'>客户(组)</Text><Text className='invitationlist-text-t'>成交(组)</Text><Text className='invitationlist-time-t'>12:00</Text></View>
22
+        <View className='invitationlist-border'></View>
23
+      </View>
24
+    </View>
25
+  )
26
+})

+ 135
- 0
src/subpackages/pages/borker/invitationlist/index.scss View File

@@ -0,0 +1,135 @@
1
+.invitationlist-background{
2
+  height: 100%;
3
+  display: inline-block;
4
+  background-color: #4A2FA0;
5
+  padding-top: 80rpx;
6
+  box-sizing: border-box;
7
+  .invitationlist-font{
8
+    letter-spacing:4rpx;
9
+    padding-left: 60rpx;
10
+    box-sizing: border-box;
11
+    display: inline-block;
12
+    font-size: 28px;
13
+    color: #FFF;
14
+  }
15
+  .invitationlist-img{
16
+    width: 28rpx;
17
+    margin-right:16rpx;
18
+    display: inline-block;
19
+  }
20
+  .invitationlist-font-right{
21
+    letter-spacing:4rpx;
22
+    margin-right: 60rpx;
23
+    float: right;
24
+    font-size: 28px;
25
+    color: #FFF;
26
+  }
27
+  .invitationlist-background-2{
28
+    display: inline-block;
29
+    padding: 44rpx 0 80rpx 0;
30
+    box-sizing: border-box;
31
+    width: 100%;
32
+    .invitationlist-font-tl{
33
+      letter-spacing:2rpx;
34
+      padding-left: 60rpx;
35
+      box-sizing: border-box;
36
+      display: inline-block;
37
+      color: #FFF;
38
+      font-size: 48px;
39
+    }
40
+    .invitationlist-font-right-t{
41
+      letter-spacing:4rpx;
42
+      margin-right: 30rpx;
43
+      float: right;
44
+      color: #FFF;
45
+      font-size: 28px;
46
+    }
47
+  }
48
+  .invitationlist-view-1{
49
+    letter-spacing:4rpx;
50
+    padding-left: 60rpx;
51
+    box-sizing: border-box;
52
+    display: inline-block;
53
+    font-size: 20rpx;
54
+    color: #FFF;
55
+    .invitationlist-view{
56
+      letter-spacing:4rpx;
57
+      display: inline-block;
58
+      font-size: 20rpx;
59
+      color: #FFF;
60
+    }
61
+  }
62
+  .invitationlist-view-list{
63
+    height: 150rpx;
64
+    width: 100%;
65
+    display: inline-block;
66
+    margin-top: 52rpx;
67
+    border-radius: 40rpx 40rpx 0 0;
68
+    background-color: #FFF;
69
+    padding: 20rpx 30rpx 0;
70
+    box-sizing: border-box;
71
+    border-bottom: 1rpx solid rgba(25, 60, 131, 0.2);
72
+    .invitationlist-img-frame{
73
+      margin: 30rpx 14rpx 0 2rpx;
74
+      width: 66rpx;
75
+      height: 66rpx;
76
+      border-radius: 50%;
77
+      display: inline-block;
78
+    .invitationlist-img-head{
79
+      border-radius: 50%;
80
+      width: 66rpx;
81
+      height: 66rpx;
82
+      display: inline-block;
83
+    }
84
+  }
85
+    .invitationlist-view-list-ifr{
86
+      position: relative;
87
+      bottom: 44rpx;
88
+      display: inline-block;
89
+      width: 600rpx;
90
+      .invitationlist-text{
91
+        padding-right: 100rpx;
92
+        box-sizing: border-box;
93
+        font-size: 28rpx;
94
+      }
95
+      .invitationlist-text-1{
96
+        padding-right: 170rpx;
97
+        box-sizing: border-box;
98
+        font-size: 28rpx;
99
+      }
100
+      .invitationlist-time{
101
+        font-size: 20rpx;
102
+      }
103
+    }
104
+    .invitationlist-view-list-ifr-t{
105
+       position: relative;
106
+       left: 80rpx;
107
+       bottom: 50rpx;
108
+      display: inline-block;
109
+      width: 600rpx;
110
+      .invitationlist-text-t{
111
+        padding-right: 30rpx;
112
+        box-sizing: border-box;
113
+        font-size: 20rpx;
114
+        color: #666;
115
+      }
116
+      .invitationlist-text-t1{
117
+        padding-right: 74rpx;
118
+        box-sizing: border-box;
119
+        font-size: 24rpx;
120
+      }
121
+      .invitationlist-time-t{
122
+        padding-left: 26rpx;
123
+        box-sizing: border-box;
124
+        font-size: 20rpx;
125
+      }
126
+    }
127
+    .invitationlist-border{
128
+      position: relative;
129
+      bottom: 20rpx;
130
+      width: 690rpx;
131
+      border-bottom: 1rpx solid rgba(25, 60, 131, 0.2);
132
+    }
133
+  }
134
+  
135
+}