下拉刷新

parent fdab40c4
......@@ -64,7 +64,8 @@
{
"path": "pages/index/listFood",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
......@@ -184,7 +185,8 @@
{
"path": "pages/assistingAgriculture/commentList/index",
"style": {
"navigationBarTitleText": "评价列表"
"navigationBarTitleText": "评价列表",
"enablePullDownRefresh": true
}
},
{
......
......@@ -159,6 +159,7 @@ const getCommentListFn = () => {
});
getCommentList(commentParameters).then((res) => {
xma.hideLoading();
xma.stopPullDownRefresh();
total = res.data.total;
res.data.records.forEach((v) => {
v.avatar = imgUrl + v.avatar;
......@@ -183,6 +184,11 @@ const choice = (i, type) => {
commentParameters.type = type;
getCommentListFn();
};
onPullDownRefresh(() => {
reset();
getEvalStatisFn();
getCommentListFn();
});
</script>
<style lang="scss" scoped>
......
......@@ -114,6 +114,7 @@ const getShop = async () => {
params.lng = lon;
params.lat = lat;
getShopAndProdPage(params).then((res) => {
xma.stopPullDownRefresh();
xma.hideLoading();
total = res.data.total;
res.data.records.forEach((item) => {
......@@ -126,6 +127,7 @@ const getShop = async () => {
};
onPullDownRefresh(() => {
reset();
getCoupons();
getShop();
});
......
......@@ -203,8 +203,8 @@ const getMerchantList = async () => {
listParams.lat = lat;
merchantList(listParams).then((res) => {
xma.hideLoading();
xma.stopPullDownRefresh();
total = res.data.totalElements;
xma.hideLoading();
console.log('商家列表', res);
res.data.content.forEach((item) => {
item.shopLogo = import.meta.env.VITE_APP_IMG_URL + item.shopLogo;
......@@ -262,6 +262,10 @@ onPageScroll((e) => {
title.value = '';
}
});
onPullDownRefresh(() => {
reset();
getMerchantList();
});
</script>
<style lang="scss" scoped>
......
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