下拉刷新

parent e9e29550
...@@ -223,7 +223,9 @@ function refresh() { ...@@ -223,7 +223,9 @@ function refresh() {
} }
onPullDownRefresh(() => { onPullDownRefresh(() => {
refresh().then(() => { refresh().then(() => {
getMerchantList(); getMerchantList().then(() => {
xma.stopPullDownRefresh();
});
}); });
}); });
// 根据父级分类id查询子分类列表 // 根据父级分类id查询子分类列表
...@@ -242,13 +244,15 @@ function jumpProductDetails(prodId) { ...@@ -242,13 +244,15 @@ function jumpProductDetails(prodId) {
} }
const prodSpecialFn = () => { const prodSpecialFn = () => {
prodSpecial({ categoryId: categoryId.value }).then((res) => { prodSpecial({ categoryId: categoryId.value }).then((res) => {
res.data.data = res.data.data.map((el) => { if (res.data.data) {
if (el.labels && el.labels !== '') { res.data.data = res.data.data.map((el) => {
el.labels = el.labels.split(','); if (el.labels && el.labels !== '') {
} el.labels = el.labels.split(',');
return el; }
}); return el;
topDiscountedProducts.value = res.data.data; });
topDiscountedProducts.value = res.data.data;
}
}); });
}; };
const choice = (index) => { const choice = (index) => {
...@@ -300,14 +304,9 @@ const getMerchantList = () => { ...@@ -300,14 +304,9 @@ const getMerchantList = () => {
item.labels = item.labels.split(','); item.labels = item.labels.split(',');
} }
}); });
return new Promise((resolve) => { cardData.value = cardData.value.concat(res.data.content);
cardData.value = cardData.value.concat(res.data.content); xma.hideLoading();
xma.hideLoading(); setTimeout(() => {}, 500);
xma.stopPullDownRefresh();
setTimeout(() => {
resolve();
}, 500);
});
}); });
}; };
function getLocationFn() { function getLocationFn() {
......
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