浏览代码

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

Your Name 3 年前
父节点
当前提交
65fbdaf604

+ 2
- 2
config/dev.js 查看文件

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    // HOST: '"https://xlk.njyz.tech"',
7
-    HOST: '"http://127.0.0.1:8081"',
6
+    HOST: '"https://xlk.njyz.tech"',
7
+    // HOST: '"http://127.0.0.1:8081"',
8
     WSS_HOST: '"ws://127.0.0.1:8081"',
8
     WSS_HOST: '"ws://127.0.0.1:8081"',
9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',

+ 1
- 1
project.config.json 查看文件

27
 			"outputPath": ""
27
 			"outputPath": ""
28
 		},
28
 		},
29
 		"useIsolateContext": true,
29
 		"useIsolateContext": true,
30
-		"useCompilerModule": false,
30
+		"useCompilerModule": true,
31
 		"userConfirmedUseCompilerModuleSwitch": false
31
 		"userConfirmedUseCompilerModuleSwitch": false
32
 	},
32
 	},
33
 	"compileType": "miniprogram",
33
 	"compileType": "miniprogram",

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

120
 export const API_RECOMENT_CLIENT = resolvePath('customer/new')
120
 export const API_RECOMENT_CLIENT = resolvePath('customer/new')
121
 export const API_CLIENT_PROGRESS = resolvePath('customer')
121
 export const API_CLIENT_PROGRESS = resolvePath('customer')
122
 export const API_TYPE_DATA = resolvePath('awesome/dict/recommendcustomer')
122
 export const API_TYPE_DATA = resolvePath('awesome/dict/recommendcustomer')
123
+export const API_USER_ADD_CUSTOMER = resolvePath('average/report')
123
 
124
 
124
 // channel
125
 // channel
125
 export const API_CHANNEL_REPORT = resolvePath('channel/report')
126
 export const API_CHANNEL_REPORT = resolvePath('channel/report')

+ 2
- 2
src/pages/mine/addCustomer/index.jsx 查看文件

4
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
 import { useSelector } from 'react-redux'
5
 import { useSelector } from 'react-redux'
6
 import { fetch } from '@/utils/request'
6
 import { fetch } from '@/utils/request'
7
-import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CUETOMER, API_RECOMENT_CLIENT, API_CHANNEL_REPORT } from '@/constants/api'
7
+import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CUETOMER, API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from '@/constants/api'
8
 import Taro from '@tarojs/taro'
8
 import Taro from '@tarojs/taro'
9
 import './index.scss'
9
 import './index.scss'
10
 
10
 
51
       if (type === 'consultant') { // 置业顾问
51
       if (type === 'consultant') { // 置业顾问
52
         url = API_REPORT_CUETOMER
52
         url = API_REPORT_CUETOMER
53
       } else if (type === 'customer') { // 普通客户
53
       } else if (type === 'customer') { // 普通客户
54
-        url = API_RECOMENT_CLIENT
54
+        url = API_USER_ADD_CUSTOMER
55
       } else { // 经纪人
55
       } else { // 经纪人
56
         url = API_CHANNEL_REPORT
56
         url = API_CHANNEL_REPORT
57
       }
57
       }

+ 49
- 34
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
-import './index.scss'
3
 import { ScrollView, Input, Picker } from '@tarojs/components'
2
 import { ScrollView, Input, Picker } from '@tarojs/components'
3
+import './index.scss'
4
 
4
 
5
 export default function EditUserDetailBasicInfo (props) {
5
 export default function EditUserDetailBasicInfo (props) {
6
   const { Data = {}, close = () => { } } = props
6
   const { Data = {}, close = () => { } } = props
7
 
7
 
8
   const [FormData, setFormData] = useState({ ...Data })
8
   const [FormData, setFormData] = useState({ ...Data })
9
 
9
 
10
-  const [SexList] = useState([
11
-    {name: '男', id: 1},
12
-    {name: '女', id: 2}
13
-  ])
14
   const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
10
   const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
15
   const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
11
   const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
16
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
12
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
13
+  const [CanSubmit, setCanSubmit] = useState(false)
14
+
15
+  useEffect(() => {
16
+    if(CanSubmit) {
17
+      setCanSubmit(false)
18
+      console.log(FormData)
19
+      close()
20
+    }
21
+  }, [CanSubmit])
22
+
23
+  const PickerChange = (key, e) => {
24
+    let resData = FormData
25
+    if (key === 'age') {
26
+      resData[key] = AgeRange[e.detail.value]
27
+    } else if(key === 'householdIncome') {
28
+      resData[key] = IncomeRange[e.detail.value]
29
+    } else if(key === 'estimatedPurchaseTime') {
30
+      resData[key] = BuyTimeRange[e.detail.value]
31
+    }
32
+    setFormData(resData)
33
+  }
17
 
34
 
18
-  const PickerChange = (e, type) => {
35
+  const InputChange = (key, e) => {
36
+    let resData = FormData
37
+    resData[key] = e.detail.value
38
+    setFormData(resData)
39
+  }
19
 
40
 
41
+  const Submit = () => {
42
+    if(!CanSubmit) {
43
+      setCanSubmit(true)
44
+    }
20
   }
45
   }
21
 
46
 
22
   return (
47
   return (
27
           <text>姓名</text>
52
           <text>姓名</text>
28
           <view className='FormLine flex-h'>
53
           <view className='FormLine flex-h'>
29
             <view className='flex-item'>
54
             <view className='flex-item'>
30
-              <Input placeholder='请输入姓名'></Input>
55
+              <Input placeholder='请输入姓名' onInput={InputChange.bind(this, 'name')}></Input>
31
             </view>
56
             </view>
32
           </view>
57
           </view>
33
 
58
 
34
           <text>昵称</text>
59
           <text>昵称</text>
35
           <view className='FormLine flex-h'>
60
           <view className='FormLine flex-h'>
36
             <view className='flex-item'>
61
             <view className='flex-item'>
37
-              <Input placeholder='请输入昵称'></Input>
62
+              <Input placeholder='请输入昵称' onInput={InputChange.bind(this, 'nickname')}></Input>
38
             </view>
63
             </view>
39
           </view>
64
           </view>
40
 
65
 
41
           <text>手机号码</text>
66
           <text>手机号码</text>
42
           <view className='FormLine flex-h'>
67
           <view className='FormLine flex-h'>
43
             <view className='flex-item'>
68
             <view className='flex-item'>
44
-              <Input placeholder='请输入手机号码'></Input>
45
-            </view>
46
-          </view>
47
-
48
-          <text>性别</text>
49
-          <view className='FormLine flex-h'>
50
-            <view className='flex-item'>
51
-              <Picker range-key='name' onChange={PickerChange.bind(this, 'sex')} value={0} range={SexList}>
52
-                <text>请选择</text>
53
-              </Picker>
69
+              <Input placeholder='请输入手机号码' onInput={InputChange.bind(this, 'phone')}></Input>
54
             </view>
70
             </view>
55
-            <text className='iconfont icon-jiantoudown'></text>
56
           </view>
71
           </view>
57
 
72
 
58
           <text>家庭住址</text>
73
           <text>家庭住址</text>
59
           <view className='FormLine flex-h'>
74
           <view className='FormLine flex-h'>
60
             <view className='flex-item'>
75
             <view className='flex-item'>
61
-              <Input placeholder='请输入家庭住址'></Input>
76
+              <Input placeholder='请输入家庭住址' onInput={InputChange.bind(this, 'homeAddress')}></Input>
62
             </view>
77
             </view>
63
           </view>
78
           </view>
64
 
79
 
65
           <text>工作地址</text>
80
           <text>工作地址</text>
66
           <view className='FormLine flex-h'>
81
           <view className='FormLine flex-h'>
67
             <view className='flex-item'>
82
             <view className='flex-item'>
68
-              <Input placeholder='请输入工作地址'></Input>
83
+              <Input placeholder='请输入工作地址' onInput={InputChange.bind(this, 'firmAddress')}></Input>
69
             </view>
84
             </view>
70
           </view>
85
           </view>
71
 
86
 
72
           <text>年龄段</text>
87
           <text>年龄段</text>
73
           <view className='FormLine flex-h'>
88
           <view className='FormLine flex-h'>
74
             <view className='flex-item'>
89
             <view className='flex-item'>
75
-              <Picker onChange={PickerChange.bind(this, 'age')} value={0} range={AgeRange}>
90
+              <Picker onChange={PickerChange.bind(this, 'age')} value={null} range={AgeRange}>
76
                 <text>请选择</text>
91
                 <text>请选择</text>
77
               </Picker>
92
               </Picker>
78
             </view>
93
             </view>
82
           <text>职业</text>
97
           <text>职业</text>
83
           <view className='FormLine flex-h'>
98
           <view className='FormLine flex-h'>
84
             <view className='flex-item'>
99
             <view className='flex-item'>
85
-              <Input placeholder='请输入职业'></Input>
100
+              <Input placeholder='请输入职业' onInput={InputChange.bind(this, 'career')}></Input>
86
             </view>
101
             </view>
87
           </view>
102
           </view>
88
 
103
 
89
           <text>家庭年收入范围</text>
104
           <text>家庭年收入范围</text>
90
           <view className='FormLine flex-h'>
105
           <view className='FormLine flex-h'>
91
             <view className='flex-item'>
106
             <view className='flex-item'>
92
-              <Picker onChange={PickerChange.bind(this, 'income')} value={0} range={IncomeRange}>
107
+              <Picker onChange={PickerChange.bind(this, 'householdIncome')} value={null} range={IncomeRange}>
93
                 <text>请选择</text>
108
                 <text>请选择</text>
94
               </Picker>
109
               </Picker>
95
             </view>
110
             </view>
99
           <text>家庭成员数</text>
114
           <text>家庭成员数</text>
100
           <view className='FormLine flex-h'>
115
           <view className='FormLine flex-h'>
101
             <view className='flex-item'>
116
             <view className='flex-item'>
102
-              <Input placeholder='请输入家庭成员数'></Input>
117
+              <Input placeholder='请输入家庭成员数' onInput={InputChange.bind(this, 'familyNumber')}></Input>
103
             </view>
118
             </view>
104
           </view>
119
           </view>
105
 
120
 
106
           <text>已有房产数</text>
121
           <text>已有房产数</text>
107
           <view className='FormLine flex-h'>
122
           <view className='FormLine flex-h'>
108
             <view className='flex-item'>
123
             <view className='flex-item'>
109
-              <Input placeholder='请输入已有房产数'></Input>
124
+              <Input placeholder='请输入已有房产数' onInput={InputChange.bind(this, 'houseNumber')}></Input>
110
             </view>
125
             </view>
111
           </view>
126
           </view>
112
 
127
 
113
           <text>已有车辆数</text>
128
           <text>已有车辆数</text>
114
           <view className='FormLine flex-h'>
129
           <view className='FormLine flex-h'>
115
             <view className='flex-item'>
130
             <view className='flex-item'>
116
-              <Input placeholder='请输入已有车辆数'></Input>
131
+              <Input placeholder='请输入已有车辆数' onInput={InputChange.bind(this, 'carNumber')}></Input>
117
             </view>
132
             </view>
118
           </view>
133
           </view>
119
 
134
 
120
           <text>预计购房时间</text>
135
           <text>预计购房时间</text>
121
           <view className='FormLine flex-h'>
136
           <view className='FormLine flex-h'>
122
             <view className='flex-item'>
137
             <view className='flex-item'>
123
-              <Picker onChange={PickerChange.bind(this, 'time')} value={0} range={BuyTimeRange}>
138
+              <Picker onChange={PickerChange.bind(this, 'estimatedPurchaseTime')} value={null} range={BuyTimeRange}>
124
                 <text>请选择</text>
139
                 <text>请选择</text>
125
               </Picker>
140
               </Picker>
126
             </view>
141
             </view>
130
           <text>客户咨询重点</text>
145
           <text>客户咨询重点</text>
131
           <view className='FormLine flex-h'>
146
           <view className='FormLine flex-h'>
132
             <view className='flex-item'>
147
             <view className='flex-item'>
133
-              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
148
+              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等' onInput={InputChange.bind(this, 'consultation')}></Input>
134
             </view>
149
             </view>
135
           </view>
150
           </view>
136
 
151
 
137
           <text>购房动机</text>
152
           <text>购房动机</text>
138
           <view className='FormLine flex-h'>
153
           <view className='FormLine flex-h'>
139
             <view className='flex-item'>
154
             <view className='flex-item'>
140
-              <Input placeholder='请填写 如结婚、养老、二孩、改善、学区、投资等'></Input>
155
+              <Input placeholder='请填写 如结婚、养老、二孩、改善、学区、投资等' onInput={InputChange.bind(this, 'motivation')}></Input>
141
             </view>
156
             </view>
142
           </view>
157
           </view>
143
 
158
 
144
           <text>客户抗性分析</text>
159
           <text>客户抗性分析</text>
145
           <view className='FormLine flex-h'>
160
           <view className='FormLine flex-h'>
146
             <view className='flex-item'>
161
             <view className='flex-item'>
147
-              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
162
+              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等' onInput={InputChange.bind(this, 'resistanceAnalysis')}></Input>
148
             </view>
163
             </view>
149
           </view>
164
           </view>
150
 
165
 
151
           <text>客户对项目认可点</text>
166
           <text>客户对项目认可点</text>
152
           <view className='FormLine flex-h'>
167
           <view className='FormLine flex-h'>
153
             <view className='flex-item'>
168
             <view className='flex-item'>
154
-              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等'></Input>
169
+              <Input placeholder='请填写  如:地段、交通、社区配套、户型、价格等' onInput={InputChange.bind(this, 'approval')}></Input>
155
             </view>
170
             </view>
156
           </view>
171
           </view>
157
 
172
 
158
           <text>备注</text>
173
           <text>备注</text>
159
           <view className='FormLine flex-h'>
174
           <view className='FormLine flex-h'>
160
             <view className='flex-item'>
175
             <view className='flex-item'>
161
-              <Input placeholder='补充说明(选填)'></Input>
176
+              <Input placeholder='补充说明(选填)' onInput={InputChange.bind(this, 'remark')}></Input>
162
             </view>
177
             </view>
163
           </view>
178
           </view>
164
 
179
 
165
           <view className='Btn'>
180
           <view className='Btn'>
166
-            <text onClick={close}>提交</text>
181
+            <text onClick={Submit}>提交</text>
167
           </view>
182
           </view>
168
 
183
 
169
         </view>
184
         </view>

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

29
     setShowLogin(false)
29
     setShowLogin(false)
30
     if (user?.userInfo?.person?.personId) {
30
     if (user?.userInfo?.person?.personId) {
31
       const person = user.userInfo.person
31
       const person = user.userInfo.person
32
-      setUserRole(person.personType === 'customer' || person.personType === 'drift' ? 1 : person.personType === 'estate agent' ? 2 : person.personType === 'Realty Consultant' ? 3 : 4)
32
+      setUserRole(person.personType === 'customer' || person.personType === 'drift' ? 1 : person.personType === 'estate agent' || person.personType === 'channel agent' ? 2 : person.personType === 'Realty Consultant' ? 3 : 4)
33
     }
33
     }
34
   }, [user])
34
   }, [user])
35
 
35