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
d6be2004
Commit
d6be2004
authored
Oct 12, 2021
by
Zhang Xiaojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
贷款产品store
parent
8e5beb98
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
32 deletions
+84
-32
index.vue
src/components/Loan/LoanHotSwipe/index.vue
+4
-0
loanModeStore.ts
src/store/loanModeStore.ts
+15
-0
loanSearchResultStore.ts
src/store/loanSearchResultStore.ts
+11
-0
index.vue
src/views/LoanList/index.vue
+20
-13
index.vue
src/views/withMenu/Home/index.vue
+10
-7
index.vue
src/views/withMenu/Loan/index.vue
+24
-12
No files found.
src/components/Loan/LoanHotSwipe/index.vue
View file @
d6be2004
...
@@ -62,6 +62,8 @@ const fetchList = () => {
...
@@ -62,6 +62,8 @@ const fetchList = () => {
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
const
{
rate_lower
,
max_amount
,
max_date
,
inst_name
,
product_name
,
product_status
}
=
const
{
rate_lower
,
max_amount
,
max_date
,
inst_name
,
product_name
,
product_status
}
=
ret
.
data
;
ret
.
data
;
console
.
log
(
'status'
,
product_status
);
if
(
product_status
==
3
){
if
(
product_status
==
3
){
state
.
hotProductList
.
push
({
state
.
hotProductList
.
push
({
rate_lower
,
rate_lower
,
...
@@ -77,6 +79,8 @@ const fetchList = () => {
...
@@ -77,6 +79,8 @@ const fetchList = () => {
});
});
}
}
});
});
console
.
log
(
'pro'
,
state
.
hotProductList
);
};
};
</
script
>
</
script
>
...
...
src/store/loanModeStore.ts
0 → 100644
View file @
d6be2004
import
{
reactive
}
from
"vue"
import
{
eLoanMode
}
from
"@/views/withMenu/Loan/types"
export
const
loanMode
=
{
state
:
reactive
({
mode
:
eLoanMode
.
personal
}),
setModeAction
(
newV
:
eLoanMode
)
{
this
.
state
.
mode
=
newV
console
.
log
(
'newV'
,
newV
);
}
}
\ No newline at end of file
src/store/loanSearchResultStore.ts
0 → 100644
View file @
d6be2004
import
{
simpleItemInfo
}
from
"@/views/withMenu/Loan/types"
import
{
reactive
}
from
"@vue/reactivity"
export
const
loanSearchState
=
reactive
({
result
:
[]
as
simpleItemInfo
[]
})
export
function
setSearchResult
(
newV
:
simpleItemInfo
)
{
loanSearchState
.
result
.
push
(
newV
)
}
export
function
clearSearchResult
(){
loanSearchState
.
result
=
[]
}
src/views/LoanList/index.vue
View file @
d6be2004
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
@
load=
"onLoad"
@
load=
"onLoad"
>
>
<LoanCard
<LoanCard
v-for=
"item in state
.list
"
v-for=
"item in state"
:key=
"item.value"
:key=
"item.value"
:max_amount=
"item.max_amount"
:max_amount=
"item.max_amount"
:product_name=
"item.product_name"
:product_name=
"item.product_name"
...
@@ -78,6 +78,11 @@ import {
...
@@ -78,6 +78,11 @@ import {
import
{
simpleItemInfo
}
from
"@/views/withMenu/Loan/types"
;
import
{
simpleItemInfo
}
from
"@/views/withMenu/Loan/types"
;
import
{
iLoanProdcutItem
}
from
"@/service/LoanProductService/type"
;
import
{
iLoanProdcutItem
}
from
"@/service/LoanProductService/type"
;
import
{
Skeleton
}
from
"vant"
;
import
{
Skeleton
}
from
"vant"
;
import
{
loanSearchState
,
setSearchResult
,
clearSearchResult
,
}
from
"@/store/loanSearchResultStore"
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
components
:
{
...
@@ -90,9 +95,12 @@ export default defineComponent({
...
@@ -90,9 +95,12 @@ export default defineComponent({
},
},
setup
()
{
setup
()
{
const
mode
=
ref
(
+
useRoute
().
params
.
mode
);
const
mode
=
ref
(
+
useRoute
().
params
.
mode
);
onMounted
(()
=>
{
onMounted
(()
=>
{
if
(
loanSearchState
.
result
.
length
==
0
)
{
fetchList
();
fetchList
();
fetchBanks
();
fetchBanks
();
}
});
});
const
onLoad
=
()
=>
{
const
onLoad
=
()
=>
{
...
@@ -112,8 +120,8 @@ export default defineComponent({
...
@@ -112,8 +120,8 @@ export default defineComponent({
const
loading
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
finished
=
ref
(
false
);
const
total
=
ref
(
0
);
const
total
=
ref
(
0
);
let
state
=
reactive
(
{
const
state
=
computed
(()
=>
{
list
:
[]
as
simpleItemInfo
[],
return
loanSearchState
.
result
;
});
});
const
bankList
=
computed
(()
=>
{
const
bankList
=
computed
(()
=>
{
...
@@ -136,7 +144,7 @@ export default defineComponent({
...
@@ -136,7 +144,7 @@ export default defineComponent({
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
const
{
max_amount
,
inst_name
,
uuid
,
features
,
product_name
}
=
const
{
max_amount
,
inst_name
,
uuid
,
features
,
product_name
}
=
ret
.
data
;
ret
.
data
;
s
tate
.
list
.
push
({
s
etSearchResult
({
max_amount
,
max_amount
,
product_name
,
product_name
,
features
,
features
,
...
@@ -262,10 +270,10 @@ export default defineComponent({
...
@@ -262,10 +270,10 @@ export default defineComponent({
queryList
()
{
queryList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
queryDirectLoanReq
({
queryDirectLoanReq
({
rate_lower
:
+
this
.
reqParams
.
min
!
?
+
this
.
reqParams
.
min
!
:
0
,
rate_lower
:
+
this
.
reqParams
.
min
!
?
+
this
.
reqParams
.
min
!
:
0
,
rate_upper
:
+
this
.
reqParams
.
max
!
?
+
this
.
reqParams
.
max
!
:
1000
,
rate_upper
:
+
this
.
reqParams
.
max
!
?
+
this
.
reqParams
.
max
!
:
1000
,
min_amount
:
+
this
.
reqParams
.
min2
!
?
+
this
.
reqParams
.
min2
!
:
0
,
min_amount
:
+
this
.
reqParams
.
min2
!
?
+
this
.
reqParams
.
min2
!
:
0
,
max_amount
:
+
this
.
reqParams
.
max2
!
?
+
this
.
reqParams
.
max2
!
:
9999
,
max_amount
:
+
this
.
reqParams
.
max2
!
?
+
this
.
reqParams
.
max2
!
:
9999
,
bank_code
:
this
.
reqParams
.
selectedBanks
[
0
],
bank_code
:
this
.
reqParams
.
selectedBanks
[
0
],
max_date
:
this
.
reqParams
.
selectedPerids
[
0
]
max_date
:
this
.
reqParams
.
selectedPerids
[
0
]
?
this
.
reqParams
.
selectedPerids
[
0
].
max_date
?
this
.
reqParams
.
selectedPerids
[
0
].
max_date
...
@@ -281,19 +289,18 @@ export default defineComponent({
...
@@ -281,19 +289,18 @@ export default defineComponent({
}).
then
((
ret
)
=>
{
}).
then
((
ret
)
=>
{
if
(
ret
.
code
==
200
)
{
if
(
ret
.
code
==
200
)
{
this
.
loading
=
false
;
this
.
loading
=
false
;
this
.
state
.
list
=
[]
;
clearSearchResult
()
;
const
list
=
ret
.
data
.
items
.
map
((
item
)
=>
{
ret
.
data
.
items
.
map
((
item
)
=>
{
const
{
max_amount
,
inst_name
,
uuid
,
features
,
product_name
}
=
const
{
max_amount
,
inst_name
,
uuid
,
features
,
product_name
}
=
item
;
item
;
return
{
setSearchResult
(
{
max_amount
,
max_amount
,
product_name
,
product_name
,
features
,
features
,
inst_name
,
inst_name
,
uuid
,
uuid
,
};
});
});
this
.
state
.
list
=
list
;
})
;
}
}
});
});
},
},
...
...
src/views/withMenu/Home/index.vue
View file @
d6be2004
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
:features=
"features"
:features=
"features"
:inst_name=
"inst_name"
:inst_name=
"inst_name"
class=
"mt-5"
class=
"mt-5"
@
click=
"$router.push(
{ name: 'LoanDetail', params: { uuid:
u
uid } })"
@
click=
"$router.push(
{ name: 'LoanDetail', params: { uuid:
hotLoanU
uid } })"
/>
/>
</Skeleton>
</Skeleton>
<group-title
class=
"mt-7"
title=
"精彩直播"
/>
<group-title
class=
"mt-7"
title=
"精彩直播"
/>
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
@
click=
"
@
click=
"
$router.push(
{
$router.push(
{
name: 'ActivityDetail',
name: 'ActivityDetail',
params: { uuid:
u
uid },
params: { uuid:
activityU
uid },
})
})
"
"
/>
/>
...
@@ -121,11 +121,12 @@ export default defineComponent({
...
@@ -121,11 +121,12 @@ export default defineComponent({
constants
:
{},
constants
:
{},
hotNews
:
[],
hotNews
:
[],
src
:
""
,
src
:
""
,
u
uid
:
""
,
activityU
uid
:
""
,
max_amount
:
0
,
max_amount
:
0
,
product_name
:
""
,
product_name
:
""
,
features
:
""
,
features
:
""
,
inst_name
:
""
,
inst_name
:
""
,
hotLoanUuid
:
""
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -166,7 +167,7 @@ export default defineComponent({
...
@@ -166,7 +167,7 @@ export default defineComponent({
if
(
ret
.
code
===
200
)
{
if
(
ret
.
code
===
200
)
{
this
.
skeLoading
=
false
;
this
.
skeLoading
=
false
;
this
.
src
=
getImageSrcFromFileHash
(
ret
.
data
.
items
[
0
]?.
file_name
);
this
.
src
=
getImageSrcFromFileHash
(
ret
.
data
.
items
[
0
]?.
file_name
);
this
.
u
uid
=
ret
.
data
.
items
[
0
]?.
uuid
;
this
.
activityU
uid
=
ret
.
data
.
items
[
0
]?.
uuid
;
}
}
},
},
async
fetchLoanProductList
()
{
async
fetchLoanProductList
()
{
...
@@ -179,9 +180,11 @@ export default defineComponent({
...
@@ -179,9 +180,11 @@ export default defineComponent({
});
});
if
(
ret
.
code
===
200
)
{
if
(
ret
.
code
===
200
)
{
this
.
skeLoading
=
false
;
this
.
skeLoading
=
false
;
this
.
uuid
=
ret
.
data
.
uuid
[
0
];
this
.
hotLoanUuid
=
ret
.
data
.
uuid
[
0
];
const
uuid
=
this
.
uuid
;
const
uuid
=
this
.
hotLoanUuid
;
queryLoanProductInfo
({
uuid
}).
then
((
ret
)
=>
{
queryLoanProductInfo
(
{
uuid
}
).
then
((
ret
)
=>
{
console
.
log
(
'uuid'
,
uuid
);
if
(
ret
.
code
===
200
)
{
if
(
ret
.
code
===
200
)
{
this
.
max_amount
=
ret
.
data
.
max_amount
;
this
.
max_amount
=
ret
.
data
.
max_amount
;
this
.
inst_name
=
ret
.
data
.
inst_name
;
this
.
inst_name
=
ret
.
data
.
inst_name
;
...
...
src/views/withMenu/Loan/index.vue
View file @
d6be2004
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
color:
color:
eLoanMode.personal === mode ? 'rgba(62, 79, 175, 1)' : '',
eLoanMode.personal === mode ? 'rgba(62, 79, 175, 1)' : '',
}"
}"
@click="
setMode
(eLoanMode.personal)"
@click="
loanMode.setModeAction
(eLoanMode.personal)"
>个人贷
</span
>个人贷
</span
>
>
<span
<span
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
:style=
"
{
:style=
"
{
color: eLoanMode.company === mode ? 'rgba(62, 79, 175, 1)' : '',
color: eLoanMode.company === mode ? 'rgba(62, 79, 175, 1)' : '',
}"
}"
@click="
setMode
(eLoanMode.company)"
@click="
loanMode.setModeAction
(eLoanMode.company)"
>企业贷
</span
>企业贷
</span
>
>
</div>
</div>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</div>
</div>
</div>
</div>
<!-- 热门贷款 -->
<!-- 热门贷款 -->
<GroupTitle
title=
"热门贷款"
class=
"mt-2.5"
v-if=
"count"
/>
<GroupTitle
title=
"热门贷款"
class=
"mt-2.5"
v-if=
"count"
iconName=
""
/>
<LoanHotSwipe
:loanMode=
"mode"
class=
"mt-5"
/>
<LoanHotSwipe
:loanMode=
"mode"
class=
"mt-5"
/>
<!-- 非热门贷款 -->
<!-- 非热门贷款 -->
<GroupTitle
<GroupTitle
...
@@ -130,7 +130,13 @@ import GroupTitle from "@/components/GroupTitle/index.vue";
...
@@ -130,7 +130,13 @@ import GroupTitle from "@/components/GroupTitle/index.vue";
import
HotNews
from
"@/components/HotNews/index.vue"
;
import
HotNews
from
"@/components/HotNews/index.vue"
;
import
{
queryActivityList
}
from
"@/service/ActivityService"
;
import
{
queryActivityList
}
from
"@/service/ActivityService"
;
import
{
getImageSrcFromFileHash
}
from
"@/service/FileService"
;
import
{
getImageSrcFromFileHash
}
from
"@/service/FileService"
;
import
{
onMounted
,
PropType
,
reactive
,
watch
}
from
"@vue/runtime-core"
;
import
{
computed
,
onMounted
,
PropType
,
reactive
,
watch
,
}
from
"@vue/runtime-core"
;
import
{
getNewsList
}
from
"@/service/NewsService/index"
;
import
{
getNewsList
}
from
"@/service/NewsService/index"
;
import
{
simpleItemInfo
}
from
"./types"
;
import
{
simpleItemInfo
}
from
"./types"
;
import
{
Skeleton
}
from
"vant"
;
import
{
Skeleton
}
from
"vant"
;
...
@@ -139,12 +145,10 @@ import {
...
@@ -139,12 +145,10 @@ import {
queryLoanProductInfo
,
queryLoanProductInfo
,
queryLimit
,
queryLimit
,
}
from
"@/service/LoanProductService"
;
}
from
"@/service/LoanProductService"
;
import
{
loanMode
}
from
"@/store/loanModeStore"
;
const
mode
=
ref
(
eLoanMode
.
personal
);
import
{
clearSearchResult
}
from
"@/store/loanSearchResultStore"
let
skeLoading
=
ref
(
false
);
let
skeLoading
=
ref
(
false
);
const
setMode
=
(
v
:
eLoanMode
)
=>
{
mode
.
value
=
v
;
};
let
state
=
reactive
({
allProductList
:
[]
as
Array
<
simpleItemInfo
>
});
let
state
=
reactive
({
allProductList
:
[]
as
Array
<
simpleItemInfo
>
});
const
src
=
ref
(
""
);
const
src
=
ref
(
""
);
const
uuid
=
ref
(
""
);
const
uuid
=
ref
(
""
);
...
@@ -157,10 +161,18 @@ const limit = reactive({
...
@@ -157,10 +161,18 @@ const limit = reactive({
});
});
const
count
=
ref
(
0
);
const
count
=
ref
(
0
);
watch
(
mode
,
()
=>
{
const
mode
=
computed
(()
=>
{
return
loanMode
.
state
.
mode
;
});
watch
(
()
=>
loanMode
.
state
.
mode
,
()
=>
{
state
.
allProductList
=
[];
state
.
allProductList
=
[];
clearSearchResult
();
fetchList
();
fetchList
();
});
}
);
const
getNews
=
()
=>
{
const
getNews
=
()
=>
{
getNewsList
({
getNewsList
({
...
@@ -218,7 +230,7 @@ const fetchList = () => {
...
@@ -218,7 +230,7 @@ const fetchList = () => {
});
});
}
}
});
});
count
.
value
=
0
count
.
value
=
0
;
};
};
const
formatLimit
=
(
limit
:
string
):
string
=>
{
const
formatLimit
=
(
limit
:
string
):
string
=>
{
...
...
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