1002884655 3 年 前
コミット
e51c81e21a
共有6 個のファイルを変更した56 個の追加40 個の削除を含む
  1. 2
    2
      config/dev.js
  2. 1
    1
      project.config.json
  3. 1
    0
      src/constants/api.js
  4. 2
    2
      src/pages/mine/addCustomer/index.jsx
  5. 49
    34
      src/pages/mine/components/EditUserDetailBasicInfo/index.jsx
  6. 1
    1
      src/pages/mine/index.jsx

+ 2
- 2
config/dev.js ファイルの表示

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 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 8
     WSS_HOST: '"ws://127.0.0.1:8081"',
9 9
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10 10
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',

+ 1
- 1
project.config.json ファイルの表示

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

+ 1
- 0
src/constants/api.js ファイルの表示

@@ -120,6 +120,7 @@ export const API_CLIENT_LIST = resolvePath('customer/recommend/mine')
120 120
 export const API_RECOMENT_CLIENT = resolvePath('customer/new')
121 121
 export const API_CLIENT_PROGRESS = resolvePath('customer')
122 122
 export const API_TYPE_DATA = resolvePath('awesome/dict/recommendcustomer')
123
+export const API_USER_ADD_CUSTOMER = resolvePath('average/report')
123 124
 
124 125
 // channel
125 126
 export const API_CHANNEL_REPORT = resolvePath('channel/report')

+ 2
- 2
src/pages/mine/addCustomer/index.jsx ファイルの表示

@@ -4,7 +4,7 @@ import { ScrollView, Input, Image, Picker, Block } from '@tarojs/components'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import { useSelector } from 'react-redux'
6 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 8
 import Taro from '@tarojs/taro'
9 9
 import './index.scss'
10 10
 
@@ -51,7 +51,7 @@ export default withLayout((props) => {
51 51
       if (type === 'consultant') { // 置业顾问
52 52
         url = API_REPORT_CUETOMER
53 53
       } else if (type === 'customer') { // 普通客户
54
-        url = API_RECOMENT_CLIENT
54
+        url = API_USER_ADD_CUSTOMER
55 55
       } else { // 经纪人
56 56
         url = API_CHANNEL_REPORT
57 57
       }

+ 49
- 34
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx ファイルの表示

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

+ 1
- 1
src/pages/mine/index.jsx ファイルの表示

@@ -29,7 +29,7 @@ export default withLayout(() => {
29 29
     setShowLogin(false)
30 30
     if (user?.userInfo?.person?.personId) {
31 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 34
   }, [user])
35 35