Procházet zdrojové kódy

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

Your Name před 3 roky
rodič
revize
5463547e7c

+ 36
- 3
src/pages/index/mortgageCalculation/components/ShangYe/index.jsx Zobrazit soubor

@@ -4,9 +4,24 @@ import './index.scss'
4 4
 
5 5
 export default function ShangYe () {
6 6
 
7
+  // 商贷年限
7 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 26
   useEffect(() => {
12 27
     if (!Years.length) {
@@ -15,6 +30,8 @@ export default function ShangYe () {
15 30
         Arr.push({ name: `${n}年`, id: n })
16 31
       }
17 32
       setYears(Arr)
33
+    } else {
34
+      setCurrentYears(Years[0])
18 35
     }
19 36
   }, [Years])
20 37
 
@@ -39,7 +56,23 @@ export default function ShangYe () {
39 56
       <view className='flex-h'>
40 57
         <text>商贷年限</text>
41 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 76
         </view>
44 77
         <text className='iconfont icon-jiantouright'></text>
45 78
       </view>

+ 1
- 1
src/pages/index/mortgageCalculation/index.jsx Zobrazit soubor

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

+ 24
- 7
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx Zobrazit soubor

@@ -9,10 +9,12 @@ export default function EditUserDetailBasicInfo (props) {
9 9
   const { Data = {}, close = () => { }, CustomerId = null } = props
10 10
 
11 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 18
   const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
17 19
   const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
18 20
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
@@ -40,12 +42,17 @@ export default function EditUserDetailBasicInfo (props) {
40 42
     let resData = FormData
41 43
     if (key === 'age') {
42 44
       resData[key] = AgeRange[e.detail.value]
45
+      setAge(AgeRange[e.detail.value])
43 46
     } else if (key === 'householdIncome') {
44 47
       resData[key] = IncomeRange[e.detail.value]
48
+      setHouseholdIncome(IncomeRange[e.detail.value])
45 49
     } else if (key === 'estimatedPurchaseTime') {
46 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 56
     setFormData(resData)
50 57
   }
51 58
 
@@ -87,6 +94,16 @@ export default function EditUserDetailBasicInfo (props) {
87 94
             </view>
88 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 107
           <text>家庭住址</text>
91 108
           <view className='FormLine flex-h'>
92 109
             <view className='flex-item'>
@@ -105,7 +122,7 @@ export default function EditUserDetailBasicInfo (props) {
105 122
           <view className='FormLine flex-h'>
106 123
             <view className='flex-item'>
107 124
               <Picker onChange={PickerChange.bind(this, 'age')} value={null} range={AgeRange}>
108
-                <text>{FormData.age || '请选择'}</text>
125
+                <text>{Age || '请选择'}</text>
109 126
               </Picker>
110 127
             </view>
111 128
             <text className='iconfont icon-jiantoudown'></text>
@@ -122,7 +139,7 @@ export default function EditUserDetailBasicInfo (props) {
122 139
           <view className='FormLine flex-h'>
123 140
             <view className='flex-item'>
124 141
               <Picker onChange={PickerChange.bind(this, 'householdIncome')} value={null} range={IncomeRange}>
125
-                <text>{FormData.householdIncome || '请选择'}</text>
142
+                <text>{HouseholdIncome || '请选择'}</text>
126 143
               </Picker>
127 144
             </view>
128 145
             <text className='iconfont icon-jiantoudown'></text>
@@ -153,7 +170,7 @@ export default function EditUserDetailBasicInfo (props) {
153 170
           <view className='FormLine flex-h'>
154 171
             <view className='flex-item'>
155 172
               <Picker onChange={PickerChange.bind(this, 'estimatedPurchaseTime')} value={null} range={BuyTimeRange}>
156
-                <text>{FormData.estimatedPurchaseTime || '请选择'}</text>
173
+                <text>{EstimatedPurchaseTime || '请选择'}</text>
157 174
               </Picker>
158 175
             </view>
159 176
             <text className='iconfont icon-jiantoudown'></text>

+ 1
- 1
src/pages/mine/components/UserDetailFollowRecord/index.jsx Zobrazit soubor

@@ -65,7 +65,7 @@ export default function UserDetailFollowRecord (props) {
65 65
               PageList.map((item, index) => (
66 66
                 <view className='flex-h' key={`Item-${index}`}>
67 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 69
                   </view>
70 70
                   <view className='Line'>
71 71
                     <view></view>

+ 17
- 4
src/pages/mine/customerDetail/index.jsx Zobrazit soubor

@@ -4,7 +4,7 @@ import withLayout from '@/layout'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import { Image, Textarea } from '@tarojs/components'
6 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 8
 import { getCustomerDetail, addFollowRecord } from '@/services/person'
9 9
 import { getImgURL } from '@/utils/image'
10 10
 import { BIZ_STATUS } from '@/constants/user'
@@ -15,7 +15,7 @@ import UserDetailActivityInfo from '../components/UserDetailActivityInfo/index'
15 15
 import UserDetailFollowRecord from '../components/UserDetailFollowRecord/index'
16 16
 
17 17
 export default withLayout((props) => {
18
-  const { router, person } = props
18
+  const { router } = props
19 19
   const { id : CustomerId,  } = router.params
20 20
 
21 21
   const [custBaseInfo, setCustBaseInfo] = useState({})
@@ -60,7 +60,7 @@ export default withLayout((props) => {
60 60
       customerSex: CustomerInfo.sex,
61 61
       customerId: CustomerId,
62 62
     }
63
-    addFollowRecord(payload).then((res) => {
63
+    addFollowRecord(payload).then(() => {
64 64
       Taro.showToast({
65 65
         title: '添加跟进成功',
66 66
         icon: 'none'
@@ -91,6 +91,19 @@ export default withLayout((props) => {
91 91
     }
92 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 108
   return (
96 109
     <view className='Page customerDetail flex-v'>
@@ -110,7 +123,7 @@ export default withLayout((props) => {
110 123
                   </view>
111 124
                   <text>{custBaseInfo.phone}</text>
112 125
                 </view>
113
-                <text className='iconfont icon-liaotian'></text>
126
+                <text className='iconfont icon-liaotian' onClick={ToChat}></text>
114 127
                 <text className='iconfont icon-dianhua' onClick={() => { Taro.makePhoneCall({ phoneNumber: custBaseInfo.phone }) }}></text>
115 128
               </view>
116 129
             </view>