Commit e0ca77a7 authored by chenqikuai's avatar chenqikuai

fix: 修复展示顺序错乱的问题

parent f7894440
<template> <template>
<Skeleton :row="3" :loading="skeLoading"> <Skeleton :row="3" :loading="skeLoading">
<van-swipe <van-swipe class="my-swipe" indicator-color="#3E4FAF" style="margin-top: 20px">
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 state.hotProductList" v-for="item in state.hotProductList"
...@@ -64,8 +60,9 @@ const fetchList = () => { ...@@ -64,8 +60,9 @@ const fetchList = () => {
}).then((ret) => { }).then((ret) => {
if (ret.code === 200) { if (ret.code === 200) {
skeLoading.value = false; skeLoading.value = false;
const promiseList = [] as Promise<any>[];
ret.data.uuid.map((uuid) => { ret.data.uuid.map((uuid) => {
queryLoanProductInfo({ uuid }).then((ret) => { const promise = queryLoanProductInfo({ uuid }).then((ret) => {
const { const {
rate_lower, rate_lower,
rate, rate,
...@@ -77,7 +74,7 @@ const fetchList = () => { ...@@ -77,7 +74,7 @@ const fetchList = () => {
product_status, product_status,
} = ret.data; } = ret.data;
state.hotProductList.push({ return {
rate, rate,
max_amount, max_amount,
date, date,
...@@ -85,9 +82,16 @@ const fetchList = () => { ...@@ -85,9 +82,16 @@ const fetchList = () => {
product_name, product_name,
uuid, uuid,
product_status, product_status,
};
}); });
promiseList.push(promise);
}); });
}); state.hotProductList = [];
Promise.all(promiseList).then(list => {
list.forEach(i => {
state.hotProductList.push(i);
})
})
} }
}); });
}; };
......
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