Commit e0ca77a7 authored by chenqikuai's avatar chenqikuai

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

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