|
@@ -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>
|