Commit 50cc4cb2 authored by Zhang Xiaojie's avatar Zhang Xiaojie

fix

parent 5c200d41
<template> <template>
<Skeleton :row="3" :loading="skeLoading"> <Skeleton :row="3" :loading="skeLoading">
<van-swipe class="my-swipe" indicator-color="#3E4FAF" style="marginTop:20px"> <van-swipe class="my-swipe" indicator-color="#3E4FAF" style="margin-top:20px">
<van-swipe-item <van-swipe-item
class="flex justify-center swpiItem" class="flex justify-center swpiItem"
v-for="item in hotProductList" v-for="item in state.hotProductList"
:key="item.value" :key="item.value"
> >
<LoanHotCard <LoanHotCard
...@@ -38,11 +38,10 @@ const props = defineProps({ ...@@ -38,11 +38,10 @@ const props = defineProps({
}); });
let skeLoading = ref(true); let skeLoading = ref(true);
let hotProductList: Array<hotProduct> = reactive([]); let state = reactive({hotProductList: [] as Array<hotProduct>})
watch(props, (newV, oldV) => { watch(props, (newV, oldV) => {
console.log(props.loanMode); state.hotProductList = [];
hotProductList = [];
fetchList(); fetchList();
}); });
...@@ -63,7 +62,7 @@ const fetchList = () => { ...@@ -63,7 +62,7 @@ const fetchList = () => {
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 } =
ret.data; ret.data;
hotProductList.push({ state.hotProductList.push({
rate_lower, rate_lower,
max_amount, max_amount,
max_date, max_date,
......
...@@ -65,11 +65,12 @@ ...@@ -65,11 +65,12 @@
<!-- 非热门贷款 --> <!-- 非热门贷款 -->
<GroupTitle <GroupTitle
title="贷款精选" title="贷款精选"
v-if="state.allProductList"
@seeMore="$router.push({ name: 'LoanList', params: { mode: mode } })" @seeMore="$router.push({ name: 'LoanList', params: { mode: mode } })"
/> />
<Skeleton :row="3" :loading="skeLoading" style="marginTop:20px"> <Skeleton :row="3" :loading="skeLoading" style="margin-top: 20px" v-if="state.allProductList">
<LoanCard <LoanCard
v-for="item in allProductList" v-for="item in state.allProductList"
: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"
...@@ -139,7 +140,7 @@ let skeLoading = ref(false); ...@@ -139,7 +140,7 @@ let skeLoading = ref(false);
const setMode = (v: eLoanMode) => { const setMode = (v: eLoanMode) => {
mode.value = v; mode.value = v;
}; };
let allProductList: Array<simpleItemInfo> = reactive([]); let state = reactive({ allProductList: [] as Array<simpleItemInfo> });
const src = ref(""); const src = ref("");
const uuid = ref(""); const uuid = ref("");
const hotNews = ref([]); const hotNews = ref([]);
...@@ -151,7 +152,7 @@ const limit = reactive({ ...@@ -151,7 +152,7 @@ const limit = reactive({
}); });
watch(mode, () => { watch(mode, () => {
allProductList = []; state.allProductList = [];
fetchList(); fetchList();
}); });
...@@ -189,7 +190,7 @@ const fetchList = () => { ...@@ -189,7 +190,7 @@ const fetchList = () => {
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;
allProductList.push({ state.allProductList.push({
max_amount, max_amount,
product_name, product_name,
features, features,
...@@ -202,9 +203,9 @@ const fetchList = () => { ...@@ -202,9 +203,9 @@ const fetchList = () => {
}); });
}; };
const formatLimit = (limit:string):string=>{ const formatLimit = (limit: string): string => {
return Number(limit+'0000').toLocaleString() return Number(limit + "0000").toLocaleString();
} };
const fetchLimit = () => { const fetchLimit = () => {
limit.state = true; limit.state = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment