hookehuyr

fix

......@@ -13,6 +13,10 @@ export const useUnwatchList = () => {
const loading = ref(false);
const finished = ref(false);
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
/**
* 向下滚动查询数据
*/
......@@ -38,6 +42,11 @@ export const useUnwatchList = () => {
// 加载状态结束
finished.value = true;
}
// 空数据提示
if (!prod_list.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
} else {
// tslint:disable-next-line: no-console
console.warn(res);
......@@ -58,6 +67,8 @@ export const useUnwatchList = () => {
onLoad,
prod_list,
finished,
loading
loading,
finishedTextStatus,
emptyStatus,
}
}
......
......@@ -45,7 +45,7 @@ axios.get('/srv/?a=my_follow')
.then(res => {
if (res.data.code === 1) {
followList.value = res.data.data;
if (!res.data.data.value.length) {
if (!res.data.data.length) {
emptyStatus.value = true;
}
} else {
......
......@@ -11,7 +11,7 @@
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无关注"
description="暂无未看"
/>
</div>
</template>
......@@ -33,7 +33,7 @@ import { wxInfo } from '@/utils/tools';
const $router = useRouter();
const { onLoad, prod_list, finished, loading } = useUnwatchList();
const { onLoad, prod_list, finished, loading, finishedTextStatus, emptyStatus } = useUnwatchList();
/****************** keepAlive 模块 *******************/
......@@ -91,13 +91,6 @@ onBeforeRouteLeave((to, from) => {
/*********************************************************/
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
if (!prod_list.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
</script>
<script>
......