Browse Source

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

Your Name 3 years ago
parent
commit
5463547e7c

+ 36
- 3
src/pages/index/mortgageCalculation/components/ShangYe/index.jsx View File

4
 
4
 
5
 export default function ShangYe () {
5
 export default function ShangYe () {
6
 
6
 
7
+  // 商贷年限
7
   const [Years, setYears] = useState([])
8
   const [Years, setYears] = useState([])
8
-  const [CurrentYearsName, setCurrentYearsName] = useState('30年')
9
-  const [CurrentYearsId, setCurrentYearsId] = useState(30)
9
+  const [CurrentYears, setCurrentYears] = useState({})
10
+  
11
+  // 利率方式
12
+  const [InterestTypes] = useState([
13
+    { name: '按LPR', id: 1 },
14
+    { name: '按旧版基准利率', id: 2 }
15
+  ])
16
+  const [CurrentInterestTypes, setCurrentInterestTypes] = useState(InterestTypes[0])
17
+
18
+  let BusinessInterestTypes1 = [ // 按照LPR
19
+    {name: '', id: 1}
20
+  ]
21
+  const BusinessInterestTypes2 = [ // 按照旧版基准利率
22
+  ]
23
+  const [BusinessInterestTypes] = useState(BusinessInterestTypes1)
24
+  const [CurrentBusinessInterest, setCurrentBusinessInterest] = useState(BusinessInterestTypes[0])
10
 
25
 
11
   useEffect(() => {
26
   useEffect(() => {
12
     if (!Years.length) {
27
     if (!Years.length) {
15
         Arr.push({ name: `${n}年`, id: n })
30
         Arr.push({ name: `${n}年`, id: n })
16
       }
31
       }
17
       setYears(Arr)
32
       setYears(Arr)
33
+    } else {
34
+      setCurrentYears(Years[0])
18
     }
35
     }
19
   }, [Years])
36
   }, [Years])
20
 
37
 
39
       <view className='flex-h'>
56
       <view className='flex-h'>
40
         <text>商贷年限</text>
57
         <text>商贷年限</text>
41
         <view className='flex-item'>
58
         <view className='flex-item'>
42
-          <picker value={0} range-key='name' range={Years}>{CurrentYearsName}</picker>
59
+          <picker value={0} range-key='name' range={Years}>{CurrentYears.name}</picker>
60
+        </view>
61
+        <text className='iconfont icon-jiantouright'></text>
62
+      </view>
63
+
64
+      <view className='flex-h'>
65
+        <text>利率方式</text>
66
+        <view className='flex-item'>
67
+          <picker value={0} range-key='name' range={InterestTypes}>{CurrentInterestTypes.name}</picker>
68
+        </view>
69
+        <text className='iconfont icon-jiantouright'></text>
70
+      </view>
71
+
72
+      <view className='flex-h'>
73
+        <text>商贷利率</text>
74
+        <view className='flex-item'>
75
+          <picker value={0} range-key='name' range={BusinessInterestTypes}>{CurrentBusinessInterest.name}</picker>
43
         </view>
76
         </view>
44
         <text className='iconfont icon-jiantouright'></text>
77
         <text className='iconfont icon-jiantouright'></text>
45
       </view>
78
       </view>

+ 1
- 1
src/pages/index/mortgageCalculation/index.jsx View File

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
 import { ScrollView } from '@tarojs/components'
3
 import { ScrollView } from '@tarojs/components'
4
-import ShangYe from './components/ShangYe/index'
5
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
+import ShangYe from './components/ShangYe/index'
6
 import './index.scss'
6
 import './index.scss'
7
 
7
 
8
 export default withLayout(() => {
8
 export default withLayout(() => {

+ 24
- 7
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx View File

9
   const { Data = {}, close = () => { }, CustomerId = null } = props
9
   const { Data = {}, close = () => { }, CustomerId = null } = props
10
 
10
 
11
   const [FormData, setFormData] = useState({ ...Data })
11
   const [FormData, setFormData] = useState({ ...Data })
12
-  const [Age, setAge] = useState(null)
13
-  const [HouseholdIncome, setHouseholdIncome] = useState(null)
14
-  const [EstimatedPurchaseTime, setEstimatedPurchaseTime] = useState(null)
12
+  const [Sex, setSex] = useState(Data?.sex - 0 === 1 ? '男' : '女')
13
+  const [Age, setAge] = useState(Data?.age || null)
14
+  const [HouseholdIncome, setHouseholdIncome] = useState(Data?.householdIncome || null)
15
+  const [EstimatedPurchaseTime, setEstimatedPurchaseTime] = useState(Data?.estimatedPurchaseTime || null)
15
 
16
 
17
+  const [SexList] = useState(['男', '女'])
16
   const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
18
   const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
17
   const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
19
   const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
18
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
20
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
40
     let resData = FormData
42
     let resData = FormData
41
     if (key === 'age') {
43
     if (key === 'age') {
42
       resData[key] = AgeRange[e.detail.value]
44
       resData[key] = AgeRange[e.detail.value]
45
+      setAge(AgeRange[e.detail.value])
43
     } else if (key === 'householdIncome') {
46
     } else if (key === 'householdIncome') {
44
       resData[key] = IncomeRange[e.detail.value]
47
       resData[key] = IncomeRange[e.detail.value]
48
+      setHouseholdIncome(IncomeRange[e.detail.value])
45
     } else if (key === 'estimatedPurchaseTime') {
49
     } else if (key === 'estimatedPurchaseTime') {
46
       resData[key] = BuyTimeRange[e.detail.value]
50
       resData[key] = BuyTimeRange[e.detail.value]
51
+      setEstimatedPurchaseTime(BuyTimeRange[e.detail.value])
52
+    } else if (key === 'sex') {
53
+      resData[key] = SexList[e.detail.value] === '男' ? 1 : 2
54
+      setSex(SexList[e.detail.value])
47
     }
55
     }
48
-    console.log(resData)
49
     setFormData(resData)
56
     setFormData(resData)
50
   }
57
   }
51
 
58
 
87
             </view>
94
             </view>
88
           </view>
95
           </view>
89
 
96
 
97
+          <text>性别</text>
98
+          <view className='FormLine flex-h'>
99
+            <view className='flex-item'>
100
+              <Picker onChange={PickerChange.bind(this, 'sex')} value={null} range={SexList}>
101
+                <text>{Sex || '请选择'}</text>
102
+              </Picker>
103
+            </view>
104
+            <text className='iconfont icon-jiantoudown'></text>
105
+          </view>
106
+
90
           <text>家庭住址</text>
107
           <text>家庭住址</text>
91
           <view className='FormLine flex-h'>
108
           <view className='FormLine flex-h'>
92
             <view className='flex-item'>
109
             <view className='flex-item'>
105
           <view className='FormLine flex-h'>
122
           <view className='FormLine flex-h'>
106
             <view className='flex-item'>
123
             <view className='flex-item'>
107
               <Picker onChange={PickerChange.bind(this, 'age')} value={null} range={AgeRange}>
124
               <Picker onChange={PickerChange.bind(this, 'age')} value={null} range={AgeRange}>
108
-                <text>{FormData.age || '请选择'}</text>
125
+                <text>{Age || '请选择'}</text>
109
               </Picker>
126
               </Picker>
110
             </view>
127
             </view>
111
             <text className='iconfont icon-jiantoudown'></text>
128
             <text className='iconfont icon-jiantoudown'></text>
122
           <view className='FormLine flex-h'>
139
           <view className='FormLine flex-h'>
123
             <view className='flex-item'>
140
             <view className='flex-item'>
124
               <Picker onChange={PickerChange.bind(this, 'householdIncome')} value={null} range={IncomeRange}>
141
               <Picker onChange={PickerChange.bind(this, 'householdIncome')} value={null} range={IncomeRange}>
125
-                <text>{FormData.householdIncome || '请选择'}</text>
142
+                <text>{HouseholdIncome || '请选择'}</text>
126
               </Picker>
143
               </Picker>
127
             </view>
144
             </view>
128
             <text className='iconfont icon-jiantoudown'></text>
145
             <text className='iconfont icon-jiantoudown'></text>
153
           <view className='FormLine flex-h'>
170
           <view className='FormLine flex-h'>
154
             <view className='flex-item'>
171
             <view className='flex-item'>
155
               <Picker onChange={PickerChange.bind(this, 'estimatedPurchaseTime')} value={null} range={BuyTimeRange}>
172
               <Picker onChange={PickerChange.bind(this, 'estimatedPurchaseTime')} value={null} range={BuyTimeRange}>
156
-                <text>{FormData.estimatedPurchaseTime || '请选择'}</text>
173
+                <text>{EstimatedPurchaseTime || '请选择'}</text>
157
               </Picker>
174
               </Picker>
158
             </view>
175
             </view>
159
             <text className='iconfont icon-jiantoudown'></text>
176
             <text className='iconfont icon-jiantoudown'></text>

+ 1
- 1
src/pages/mine/components/UserDetailFollowRecord/index.jsx View File

65
               PageList.map((item, index) => (
65
               PageList.map((item, index) => (
66
                 <view className='flex-h' key={`Item-${index}`}>
66
                 <view className='flex-h' key={`Item-${index}`}>
67
                   <view className='flex-item'>
67
                   <view className='flex-item'>
68
-                    <text>{formatDate(item.createDate, 'YYYY年MM月DD日 HH:mm:ss')}</text>
68
+                    <text>{formatDate(item.createDate, 'yyyy年MM月dd日 hh:mm:ss')}</text>
69
                   </view>
69
                   </view>
70
                   <view className='Line'>
70
                   <view className='Line'>
71
                     <view></view>
71
                     <view></view>

+ 17
- 4
src/pages/mine/customerDetail/index.jsx View File

4
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
 import { Image, Textarea } from '@tarojs/components'
5
 import { Image, Textarea } from '@tarojs/components'
6
 import { fetch } from '@/utils/request'
6
 import { fetch } from '@/utils/request'
7
-import { API_GET_CUSTOMER_INFO, API_FOLLOW_LIST } from '@/constants/api'
7
+import { API_GET_CUSTOMER_INFO } from '@/constants/api'
8
 import { getCustomerDetail, addFollowRecord } from '@/services/person'
8
 import { getCustomerDetail, addFollowRecord } from '@/services/person'
9
 import { getImgURL } from '@/utils/image'
9
 import { getImgURL } from '@/utils/image'
10
 import { BIZ_STATUS } from '@/constants/user'
10
 import { BIZ_STATUS } from '@/constants/user'
15
 import UserDetailFollowRecord from '../components/UserDetailFollowRecord/index'
15
 import UserDetailFollowRecord from '../components/UserDetailFollowRecord/index'
16
 
16
 
17
 export default withLayout((props) => {
17
 export default withLayout((props) => {
18
-  const { router, person } = props
18
+  const { router } = props
19
   const { id : CustomerId,  } = router.params
19
   const { id : CustomerId,  } = router.params
20
 
20
 
21
   const [custBaseInfo, setCustBaseInfo] = useState({})
21
   const [custBaseInfo, setCustBaseInfo] = useState({})
60
       customerSex: CustomerInfo.sex,
60
       customerSex: CustomerInfo.sex,
61
       customerId: CustomerId,
61
       customerId: CustomerId,
62
     }
62
     }
63
-    addFollowRecord(payload).then((res) => {
63
+    addFollowRecord(payload).then(() => {
64
       Taro.showToast({
64
       Taro.showToast({
65
         title: '添加跟进成功',
65
         title: '添加跟进成功',
66
         icon: 'none'
66
         icon: 'none'
91
     }
91
     }
92
   }, [CustomerId])
92
   }, [CustomerId])
93
 
93
 
94
+  const ToChat = () => {
95
+    if(CustomerInfo.personId) {
96
+      Taro.navigateTo({
97
+        url: `/pages/chat/chatDetail/index?friend=${CustomerInfo.personId}`
98
+      })
99
+    } else {
100
+      Taro.showToast({
101
+        title: '当前人员未登录本小程序',
102
+        icon: 'none'
103
+      })
104
+    }
105
+  }
106
+
94
 
107
 
95
   return (
108
   return (
96
     <view className='Page customerDetail flex-v'>
109
     <view className='Page customerDetail flex-v'>
110
                   </view>
123
                   </view>
111
                   <text>{custBaseInfo.phone}</text>
124
                   <text>{custBaseInfo.phone}</text>
112
                 </view>
125
                 </view>
113
-                <text className='iconfont icon-liaotian'></text>
126
+                <text className='iconfont icon-liaotian' onClick={ToChat}></text>
114
                 <text className='iconfont icon-dianhua' onClick={() => { Taro.makePhoneCall({ phoneNumber: custBaseInfo.phone }) }}></text>
127
                 <text className='iconfont icon-dianhua' onClick={() => { Taro.makePhoneCall({ phoneNumber: custBaseInfo.phone }) }}></text>
115
               </view>
128
               </view>
116
             </view>
129
             </view>