fix(custom): 修复带有切换项页面分页数据错乱的bug
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -149,6 +149,7 @@ const getData = async () => {
|
|||||||
|
|
||||||
const tabChange = (e: number) => {
|
const tabChange = (e: number) => {
|
||||||
tabVal.value = e;
|
tabVal.value = e;
|
||||||
|
dataList.value = [];
|
||||||
getData();
|
getData();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -160,7 +161,7 @@ const toDetailPage = (item: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Taro.useReachBottom(() => {
|
Taro.useReachBottom(() => {
|
||||||
if (pageOpt.value.total === dataList.value.length)
|
if (pageOpt.value.total >= dataList.value.length)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: '没有更多数据了',
|
title: '没有更多数据了',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
class="flex items-center"
|
class="flex items-center"
|
||||||
:title="item.name"
|
:title="item.name"
|
||||||
:desc="item.number > 0 ? item.number : ''"
|
:desc="item.number > 0 ? `可用积分:${item.number}` : ''"
|
||||||
@click="cellClick(item.ID)">
|
@click="cellClick(item.ID)">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<IconFont size="30" :name="item.icon" />
|
<IconFont size="30" :name="item.icon" />
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ Taro.useDidShow(() => {
|
|||||||
|
|
||||||
const changeTabs = (index: number) => {
|
const changeTabs = (index: number) => {
|
||||||
tabsIndex.value = index;
|
tabsIndex.value = index;
|
||||||
|
listData.value = [];
|
||||||
get_list();
|
get_list();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user