Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_front_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
fns_front_2
Commits
5c200d41
Commit
5c200d41
authored
Sep 28, 2021
by
Zhang Xiaojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:贷款-最大额度请求
parent
fdd39ac7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
58 deletions
+97
-58
index.vue
src/components/Loan/LoanHotSwipe/index.vue
+31
-31
index.ts
src/service/LoanProductService/index.ts
+16
-3
index.vue
src/views/withMenu/Loan/index.vue
+50
-24
No files found.
src/components/Loan/LoanHotSwipe/index.vue
View file @
5c200d41
<
template
>
<
template
>
<
van-swipe
class=
"my-swipe"
indicator-color=
"#3E4FAF
"
>
<
Skeleton
:row=
"3"
:loading=
"skeLoading
"
>
<van-swipe
-item
<van-swipe
class=
"my-swipe"
indicator-color=
"#3E4FAF"
style=
"marginTop:20px"
>
class=
"flex justify-center swpiItem"
<van-swipe-item
v-for=
"item in hotProductList
"
class=
"flex justify-center swpiItem
"
:key=
"item.value
"
v-for=
"item in hotProductList
"
>
:key=
"item.value"
<Skeleton
:row=
"3"
:loading=
"skeLoading"
>
>
<LoanHotCard
<LoanHotCard
:inst_name=
"item.inst_name"
:inst_name=
"item.inst_name"
:product_name=
"item.product_name"
:product_name=
"item.product_name"
:rate_lower=
"item.rate_lower"
:rate_lower=
"item.rate_lower"
:max_date=
"item.max_date"
:max_date=
"item.max_date"
:max_amount=
"item.max_amount"
:max_amount=
"item.max_amount"
:uuid=
"item.uuid"
:uuid=
"item.uuid"
/>
/>
</Skeleton
>
</van-swipe-item
>
</van-swipe
-item
>
</van-swipe>
</
van-swipe
>
</
Skeleton
>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
}
from
"vue"
;
import
{
ref
}
from
"vue"
;
...
@@ -28,7 +28,7 @@ import {
...
@@ -28,7 +28,7 @@ import {
import
{
onMounted
,
PropType
,
reactive
,
watch
}
from
"@vue/runtime-core"
;
import
{
onMounted
,
PropType
,
reactive
,
watch
}
from
"@vue/runtime-core"
;
import
{
eLoanMode
}
from
"@/views/withMenu/Loan/types"
;
import
{
eLoanMode
}
from
"@/views/withMenu/Loan/types"
;
import
{
hotProduct
}
from
"./type"
;
import
{
hotProduct
}
from
"./type"
;
import
{
Skeleton
}
from
"vant"
import
{
Skeleton
}
from
"vant"
;
const
props
=
defineProps
({
const
props
=
defineProps
({
loanMode
:
{
loanMode
:
{
...
@@ -37,28 +37,28 @@ const props = defineProps({
...
@@ -37,28 +37,28 @@ const props = defineProps({
},
},
});
});
let
skeLoading
=
ref
(
false
)
let
skeLoading
=
ref
(
true
);
let
hotProductList
:
Array
<
hotProduct
>
=
reactive
([]);
let
hotProductList
:
Array
<
hotProduct
>
=
reactive
([]);
watch
(
props
,
(
newV
,
oldV
)
=>
{
watch
(
props
,
(
newV
,
oldV
)
=>
{
console
.
log
(
props
.
loanMode
);
console
.
log
(
props
.
loanMode
);
hotProductList
=
[]
hotProductList
=
[];
fetchList
()
fetchList
()
;
})
})
;
onMounted
(()
=>
{
onMounted
(()
=>
{
fetchList
()
fetchList
()
;
});
});
const
fetchList
=
()
=>
{
const
fetchList
=
()
=>
{
skeLoading
.
value
=
true
skeLoading
.
value
=
true
;
queryLoanProductList
({
queryLoanProductList
({
limit
:
3
,
limit
:
3
,
loan_type
:
props
.
loanMode
!
,
loan_type
:
props
.
loanMode
!
,
offset
:
0
,
offset
:
0
,
}).
then
((
ret
)
=>
{
}).
then
((
ret
)
=>
{
if
(
ret
.
code
===
200
)
{
if
(
ret
.
code
===
200
)
{
skeLoading
.
value
=
false
skeLoading
.
value
=
false
;
ret
.
data
.
uuid
.
map
((
uuid
)
=>
{
ret
.
data
.
uuid
.
map
((
uuid
)
=>
{
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
const
{
rate_lower
,
max_amount
,
max_date
,
inst_name
,
product_name
}
=
const
{
rate_lower
,
max_amount
,
max_date
,
inst_name
,
product_name
}
=
...
@@ -69,13 +69,13 @@ const fetchList = ()=>{
...
@@ -69,13 +69,13 @@ const fetchList = ()=>{
max_date
,
max_date
,
inst_name
,
inst_name
,
product_name
,
product_name
,
uuid
uuid
,
});
});
});
});
});
});
}
}
});
});
}
}
;
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
...
...
src/service/LoanProductService/index.ts
View file @
5c200d41
...
@@ -2,6 +2,8 @@ import baseAxios from '../index'
...
@@ -2,6 +2,8 @@ import baseAxios from '../index'
import
{
eLoanMode
}
from
'@/views/withMenu/Loan/types'
import
{
eLoanMode
}
from
'@/views/withMenu/Loan/types'
import
{
iLoanProdcutItem
}
from
"./type"
import
{
iLoanProdcutItem
}
from
"./type"
const
prefix
=
'/loan/query'
export
function
queryLoanProductList
(
data
:
{
export
function
queryLoanProductList
(
data
:
{
limit
:
number
,
limit
:
number
,
loan_type
:
eLoanMode
loan_type
:
eLoanMode
...
@@ -12,7 +14,7 @@ export function queryLoanProductList(data: {
...
@@ -12,7 +14,7 @@ export function queryLoanProductList(data: {
uuid
:
string
[],
uuid
:
string
[],
total
:
number
total
:
number
}
>
({
}
>
({
url
:
'/loan/query
/list'
,
url
:
prefix
+
'
/list'
,
method
:
'POST'
,
method
:
'POST'
,
data
data
})
})
...
@@ -20,7 +22,7 @@ export function queryLoanProductList(data: {
...
@@ -20,7 +22,7 @@ export function queryLoanProductList(data: {
export
function
queryLoanProductInfo
(
data
:
{
uuid
:
string
})
{
export
function
queryLoanProductInfo
(
data
:
{
uuid
:
string
})
{
return
baseAxios
<
iLoanProdcutItem
>
({
return
baseAxios
<
iLoanProdcutItem
>
({
url
:
'/loan/query
/info'
,
url
:
prefix
+
'
/info'
,
method
:
'GET'
,
method
:
'GET'
,
params
:
data
params
:
data
})
})
...
@@ -54,11 +56,22 @@ export function queryDirectLoanReq(data: {
...
@@ -54,11 +56,22 @@ export function queryDirectLoanReq(data: {
items
:
iLoanProdcutItem
[]
items
:
iLoanProdcutItem
[]
total
:
number
total
:
number
}
>
({
}
>
({
url
:
'/loan/query
/direct/list'
,
url
:
prefix
+
'
/direct/list'
,
method
:
'POST'
,
method
:
'POST'
,
data
,
data
,
})
})
}
}
export
function
queryLimit
()
{
return
baseAxios
<
{
en_max_amount
:
string
,
en_rate_lower
:
string
,
max_amount
:
string
,
}
>
({
url
:
prefix
+
'/max_limit'
,
method
:
'GET'
,
})
}
src/views/withMenu/Loan/index.vue
View file @
5c200d41
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
</span>
</span>
</div>
</div>
<span
class=
"word27"
>
¥
</span>
<span
class=
"word27"
>
¥
</span>
<span
class=
"txt14"
>
1,000,000
</span>
<span
class=
"txt14"
>
{{
limit
.
max_amount
}}
</span>
</div>
</div>
</div>
</div>
<div
class=
"outer55"
v-else-if=
"eLoanMode.company === mode"
>
<div
class=
"outer55"
v-else-if=
"eLoanMode.company === mode"
>
...
@@ -48,10 +48,10 @@
...
@@ -48,10 +48,10 @@
</div>
</div>
<div
class=
"outer7 flex-row"
>
<div
class=
"outer7 flex-row"
>
<span
class=
"info15"
>
¥
</span>
<span
class=
"info15"
>
¥
</span>
<span
class=
"txt10"
>
1,000,000
</span>
<span
class=
"txt10"
>
{{
limit
.
en_max_amount
}}
</span>
</div>
</div>
<div
class=
"outer8 flex-row"
>
<div
class=
"outer8 flex-row"
>
<span
class=
"word33"
>
年利率最低
4.35
%
</span>
<span
class=
"word33"
>
年利率最低
{{
limit
.
en_rate_lower
}}
%
</span>
<div
class=
"main22 flex-col"
></div>
<div
class=
"main22 flex-col"
></div>
<span
class=
"word34"
>
分秒必批
</span>
<span
class=
"word34"
>
分秒必批
</span>
<div
class=
"main22 flex-col"
></div>
<div
class=
"main22 flex-col"
></div>
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
title=
"贷款精选"
title=
"贷款精选"
@
seeMore=
"$router.push(
{ name: 'LoanList', params: { mode: mode } })"
@
seeMore=
"$router.push(
{ name: 'LoanList', params: { mode: mode } })"
/>
/>
<Skeleton
:row=
"3"
:loading=
"skeLoading"
>
<Skeleton
:row=
"3"
:loading=
"skeLoading"
style=
"marginTop:20px"
>
<LoanCard
<LoanCard
v-for=
"item in allProductList"
v-for=
"item in allProductList"
:key=
"item.value"
:key=
"item.value"
...
@@ -84,24 +84,24 @@
...
@@ -84,24 +84,24 @@
</Skeleton>
</Skeleton>
<!-- 精彩活动 -->
<!-- 精彩活动 -->
<template
v-if=
"eLoanMode.personal === mode"
>
<template
v-if=
"eLoanMode.personal === mode"
>
<group-title
<group-title
class=
"mt-7"
class=
"mt-7"
title=
"精彩活动"
title=
"精彩活动"
@
click=
"$router.push(
{ name: 'ActivityList' })"
@
click=
"$router.push(
{ name: 'ActivityList' })"
/>
<Skeleton
:loading=
"skeLoading"
:row=
"3"
class=
"mt-2"
>
<img
class=
"mx-5 mt-5 rounded-lg"
:src=
"src"
alt
@
click=
"
$router.push(
{
name: 'ActivityDetail',
params: { uuid: uuid },
})
"
/>
/>
</Skeleton>
<Skeleton
:loading=
"skeLoading"
:row=
"3"
class=
"mt-2"
>
<img
class=
"mx-5 mt-5 rounded-lg"
:src=
"src"
alt
@
click=
"
$router.push(
{
name: 'ActivityDetail',
params: { uuid: uuid },
})
"
/>
</Skeleton>
</
template
>
</
template
>
<!-- 贷款资讯 -->
<!-- 贷款资讯 -->
<GroupTitle
<GroupTitle
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
defineComponent
,
ref
}
from
"vue"
;
import
{
defineComponent
,
ref
,
toRefs
}
from
"vue"
;
import
{
eLoanMode
}
from
"./types"
;
import
{
eLoanMode
}
from
"./types"
;
import
LoanHotCard
from
"@/components/Loan/LoanHotCard/index.vue"
;
import
LoanHotCard
from
"@/components/Loan/LoanHotCard/index.vue"
;
import
LoanHotSwipe
from
"@/components/Loan/LoanHotSwipe/index.vue"
;
import
LoanHotSwipe
from
"@/components/Loan/LoanHotSwipe/index.vue"
;
...
@@ -131,6 +131,7 @@ import { Skeleton } from "vant";
...
@@ -131,6 +131,7 @@ import { Skeleton } from "vant";
import
{
import
{
queryLoanProductList
,
queryLoanProductList
,
queryLoanProductInfo
,
queryLoanProductInfo
,
queryLimit
,
}
from
"@/service/LoanProductService"
;
}
from
"@/service/LoanProductService"
;
const
mode
=
ref
(
eLoanMode
.
personal
);
const
mode
=
ref
(
eLoanMode
.
personal
);
...
@@ -141,7 +142,14 @@ const setMode = (v: eLoanMode) => {
...
@@ -141,7 +142,14 @@ const setMode = (v: eLoanMode) => {
let
allProductList
:
Array
<
simpleItemInfo
>
=
reactive
([]);
let
allProductList
:
Array
<
simpleItemInfo
>
=
reactive
([]);
const
src
=
ref
(
""
);
const
src
=
ref
(
""
);
const
uuid
=
ref
(
""
);
const
uuid
=
ref
(
""
);
const
hotNews
=
ref
([])
const
hotNews
=
ref
([]);
const
limit
=
reactive
({
en_max_amount
:
""
,
en_rate_lower
:
""
,
max_amount
:
""
,
state
:
false
,
});
watch
(
mode
,
()
=>
{
watch
(
mode
,
()
=>
{
allProductList
=
[];
allProductList
=
[];
fetchList
();
fetchList
();
...
@@ -154,7 +162,7 @@ const getNews = () => {
...
@@ -154,7 +162,7 @@ const getNews = () => {
}).
then
((
res
:
any
)
=>
{
}).
then
((
res
:
any
)
=>
{
hotNews
.
value
=
res
.
data
.
items
;
hotNews
.
value
=
res
.
data
.
items
;
});
});
}
}
;
const
fetchActivityList
=
()
=>
{
const
fetchActivityList
=
()
=>
{
skeLoading
.
value
=
true
;
skeLoading
.
value
=
true
;
...
@@ -193,7 +201,25 @@ const fetchList = () => {
...
@@ -193,7 +201,25 @@ const fetchList = () => {
}
}
});
});
};
};
const
formatLimit
=
(
limit
:
string
):
string
=>
{
return
Number
(
limit
+
'0000'
).
toLocaleString
()
}
const
fetchLimit
=
()
=>
{
limit
.
state
=
true
;
queryLimit
().
then
((
ret
)
=>
{
if
(
ret
.
code
==
200
)
{
const
data
=
ret
.
data
;
limit
.
max_amount
=
formatLimit
(
data
.
max_amount
);
limit
.
en_max_amount
=
formatLimit
(
data
.
en_max_amount
);
limit
.
en_rate_lower
=
data
.
en_rate_lower
;
}
});
};
onMounted
(()
=>
{
onMounted
(()
=>
{
fetchLimit
();
fetchList
();
fetchList
();
fetchActivityList
();
fetchActivityList
();
getNews
();
getNews
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment