hookehuyr

✨ feat: 列表页面,新增为空提示页

......@@ -20,7 +20,7 @@
</van-row>
</div>
<div style="height: 4rem;"></div>
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad"
:immediate-check="false">
<template v-for="(item, key) in replyList" :key="key">
<div class="comment-wrapper">
......@@ -46,6 +46,11 @@
</div>
</template>
</van-list>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无回复"
/>
</div>
<comment-box :showPopup="showCommentBoxPopup" :type="commentType" :replayUser="replayUser"
@on-submit="submitCommentBox" @on-close="closeCommentBox"></comment-box>
......@@ -63,6 +68,7 @@
<script setup>
import CommentBox from '@/components/CommentBox/index.vue'
import NoticeOverlay from '@/components/NoticeOverlay/index.vue'
import no_image from '@images/que-shuju@2x.png'
import icon_x from '@images/x.png'
import icon_y from '@images/y.png'
......@@ -168,6 +174,7 @@ const onSubmit = () => {
path: '/me/index'
});
}
const show = ref(false);
const listTotal = ref(0)
const replyList = ref([])
......@@ -176,6 +183,10 @@ const finished = ref(false)
const limit = ref(10)
const offset = ref(0)
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
const onLoad = () => {
// 异步更新数据
axios.get('/srv/?a=reply_list', {
......@@ -197,6 +208,10 @@ const onLoad = () => {
// 加载状态结束
finished.value = true;
}
if (!replyList.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
......@@ -3,6 +3,7 @@ import axios from '@/utils/axios';
import { Toast } from 'vant';
export const bookFn = ($route) => {
const emptyStatus = ref(false);
const kg_id = $route.query.kg_id ? $route.query.kg_id : '';
const kgInfo = ref({
id: '',
......@@ -19,6 +20,9 @@ export const bookFn = ($route) => {
.then(res => {
if (res.data.code === 1) {
kgInfo.value = res.data.data;
if (!kgInfo.value.book_list.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......@@ -38,6 +42,9 @@ export const bookFn = ($route) => {
kgInfo.value = {
book_list: res.data.data
}
if (!kgInfo.value.book_list.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......@@ -53,6 +60,7 @@ export const bookFn = ($route) => {
}
return {
kg_id,
kgInfo
kgInfo,
emptyStatus
}
}
......
......@@ -86,6 +86,10 @@ export const useVideoList = ($route) => {
const loading = ref(false);
const finished = ref(false);
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
/**
* 向下滚动查询数据
*/
......@@ -111,6 +115,11 @@ export const useVideoList = ($route) => {
// 加载状态结束
finished.value = true;
}
// 空数据提示
if (!prod_list.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
} else {
// tslint:disable-next-line: no-console
console.warn(res);
......@@ -150,6 +159,8 @@ export const useVideoList = ($route) => {
checkLocalism,
checkMandarin,
onConfirm,
chooseLanguage
chooseLanguage,
finishedTextStatus,
emptyStatus,
}
}
......
......@@ -4,33 +4,28 @@
title-active-color="#222222" title-inactive-color="#777777">
<van-tab title="待审核" :badge="prod_num" :title-style="titleStyle">
<template v-if="!active">
<van-list v-model:loading="loading" :finished="finished" :finished-text="prod_list.length ? '没有更多了' : ''" @load="onLoad">
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad">
<template v-for="item in prod_list" :key="item" style="height: 3rem;">
<b-video-card :item="item" status="PENDING" @on-click="onClick"></b-video-card>
</template>
</van-list>
<van-empty v-if="!prod_list.length"
class="custom-image"
:image="no_image"
description="暂无审核信息"
/>
</template>
</van-tab>
<van-tab title="已审核" :title-style="titleStyle">
<template v-if="active">
<van-list v-model:loading="loading" :finished="finished" :finished-text="prod_list.length ? '没有更多了' : ''" @load="onLoad">
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad">
<template v-for="item in prod_list" :key="item" style="height: 3rem;">
<b-video-card :item="item" status="PROCESS"></b-video-card>
</template>
</van-list>
<van-empty v-if="!prod_list.length"
class="custom-image"
:image="no_image"
description="暂无审核信息"
/>
</template>
</van-tab>
</van-tabs>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无审核信息"
/>
</div>
</template>
......@@ -129,6 +124,13 @@ const onClick = (id) => {
_.remove(prod_list.value, item => item.id === id);
}
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
if (!prod_list.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
</script>
<script>
......
......@@ -68,6 +68,11 @@
<template v-for="(item, key) in kgInfo.book" :key="key">
<book-card :item="item" type="B" :user_id="kgInfo.user_id" @on-click="onClick(item)"></book-card>
</template>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无书籍"
/>
</div>
<div style="height: 1rem;"></div>
<shortcut-fixed type="B" :item="['me']"></shortcut-fixed>
......@@ -76,6 +81,7 @@
<script setup>
import icon_avatar from '@images/que-logo@2x.png'
import no_image from '@images/que-shuju@2x.png'
import icon_book from '@images/shu@2x.png'
import BookCard from '@/components/BookCard/index.vue'
......@@ -99,11 +105,17 @@ const onClick = (item) => {
});
}
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
const kgInfo = ref({});
axios.get('/srv/?a=kg_info')
.then(res => {
if (res.data.code === 1) {
kgInfo.value = res.data.data;
if (!res.data.data.book.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
......@@ -5,9 +5,15 @@
</template>
<div style="height: 2rem;"></div>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无视频"
/>
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import BVideoCard from '@/components/BVideoCard/index.vue'
import { ref, reactive, onMounted } from 'vue'
......@@ -20,6 +26,8 @@ const $router = useRouter();
// 处理书籍下作品列表
const kgProdList = ref([])
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
axios.get('/srv/?a=kg_prod_list')
.then(res => {
if (res.data.code === 1) {
......@@ -27,6 +35,9 @@ axios.get('/srv/?a=kg_prod_list')
item.status = item.status.toUpperCase()
})
kgProdList.value = res.data.data.prod;
if (!kgProdList.value.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......@@ -38,7 +49,8 @@ axios.get('/srv/?a=kg_prod_list')
})
.catch(err => {
console.error(err);
})
});
</script>
<script>
......
......@@ -60,14 +60,19 @@
</van-sticky>
<div class="book-video-list">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad">
<template v-for="item in prod_list" :key="item" style="height: 3rem;">
<video-card :item="item"></video-card>
</template>
</van-list>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无作品信息"
/>
</div>
<div style="height: 5rem;"></div>
<div style="height: 6rem;"></div>
<div class="book-bar">
<div @click="onSubscribe" class="text">
<van-icon v-if="!bookInfo.is_subscribe" :name="icon_subscribed" size="1.25rem" style="margin: 0 auto;" />
......@@ -127,6 +132,7 @@ import icon_up from '@images/icon-guanbi@2x.png'
import icon_down from '@images/icon-zhankai@2x.png'
import icon_subscribed from '@images/icon-dingyue01@2x.png'
import icon_unsubscribe from '@images/icon-dingyue02@2x.png'
import no_image from '@images/que-shuju@2x.png'
import ShortcutFixed from '@/components/ShortcutFixed/index.vue'
import tools from '@/common/tool'
......@@ -141,7 +147,7 @@ import { wxInfo } from '@/utils/tools';
const $route = useRoute();
const $router = useRouter();
const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage } = useVideoList($route);
const { toggleLanguage, onLoad, columns, prod_list, finished, loading, bookInfo, showPicker, checkLocalism, checkMandarin, onConfirm, chooseLanguage, finishedTextStatus, emptyStatus } = useVideoList($route);
const { donateItem } = useDefaultPerf($route.query.id);
// 判断是否显示简介的展开图标
......
......@@ -35,8 +35,7 @@
<template v-for="(item, key) in kgInfo.book_list" :key="key">
<book-card type="C" :item="item" @on-click="onClick(item)"></book-card>
</template>
<van-empty
v-if="!kgInfo.book_list.length"
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无书籍信息"
......@@ -73,7 +72,7 @@ const $router = useRouter();
// 设置页面标题
useTitle($route.meta.title)
const { kg_id, kgInfo } = bookFn($route)
const { kg_id, kgInfo, emptyStatus } = bookFn($route)
// 配置快捷跳转条
const shortcutItem = ref([]);
......
......@@ -51,6 +51,11 @@
<div style="height: 2rem;"></div>
</div>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无作品信息"
/>
</template>
<script setup>
......@@ -59,6 +64,7 @@ import { storeToRefs } from 'pinia'
import VideoCard from '@/components/VideoCard/index.vue'
import icon_avatar from '@images/que-touxiang@2x.png'
import no_image from '@images/que-shuju@2x.png'
import { ref, onActivated, onMounted } from 'vue'
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'
......@@ -70,6 +76,8 @@ const $route = useRoute();
const $router = useRouter();
const userInfo = ref({});
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
// 获取表演者信息
axios.get('/srv/?a=perf_info', {
params: {
......@@ -82,6 +90,9 @@ axios.get('/srv/?a=perf_info', {
item.type = 'read-only' // 特殊标识,判断入口 为keepAlive使用
})
userInfo.value = res.data.data;
if (!res.data.data.prod.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......@@ -167,6 +178,7 @@ onBeforeRouteLeave((to, from) => {
})
/*********************************************************/
</script>
<script>
......
<template>
<div class="">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad" :immediate-check="false">
<template v-for="(item, key) in commentList" :key="key">
<div class="comment-wrapper">
<van-row style="font-size: 0.9rem;">
......@@ -36,11 +36,17 @@
</div>
</template>
</van-list>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无留言"
/>
<div style="height: 5rem;"></div>
<div class="reply-btn" @click="setComment('', 'comment')">
<div class="text">写下你友善的留言</div>
</div>
</div>
<comment-list :showPopup="showCommentListPopup" :data="commentData" @on-close="closeCommentList"></comment-list>
<comment-box :showPopup="showCommentBoxPopup" :type="commentType" :replayUser="replayUser" @on-submit="submitCommentBox" @on-close="closeCommentBox"></comment-box>
......@@ -60,6 +66,7 @@ import CommentList from '@/components/CommentList/index.vue'
import CommentBox from '@/components/CommentBox/index.vue'
import NoticeOverlay from '@/components/NoticeOverlay/index.vue'
import icon_avatar from '@images/que-touxiang@2x.png'
import no_image from '@images/que-shuju@2x.png'
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
......@@ -84,6 +91,10 @@ const offset = ref(0)
const reply_limit = ref(3)
const commentList = ref([])
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
const onLoad = () => {
// 异步更新数据
axios.get('/srv/?a=comment_list',{
......@@ -105,6 +116,10 @@ const onLoad = () => {
// 加载状态结束
finished.value = true;
}
if (!commentList.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
<template>
<div v-for="(item, key) in commentList" :key="key">
<div class="comment-wrapper">
<van-row style="font-size: 0.9rem;">
<van-col span="4">
<van-image v-if="item.avatar" round width="3rem" height="3rem" :src="item.avatar" />
<van-image v-else round width="3rem" height="3rem" :src="icon_avatar" />
</van-col>
<van-col span="16">
<p>{{ item.name }}</p>
<p>{{ item.kg_name }}</p>
</van-col>
<van-col span="4" style="text-align: center;">
<p @click="setComment(item, 'reply')" style="color: #333333;">回复</p>
<p>2-25</p>
</van-col>
</van-row>
<van-row>
<van-col>
<span style="color: #222222;">{{ item.c_action }}<span style="color: #0B3A72;">@{{ item.c_name }}</span>:{{ item.note }}</span>
</van-col>
</van-row>
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad">
<div v-for="(item, key) in commentList" :key="key">
<div class="comment-wrapper">
<van-row style="font-size: 0.9rem;">
<van-col span="4">
<van-image v-if="item.avatar" round width="3rem" height="3rem" :src="item.avatar" />
<van-image v-else round width="3rem" height="3rem" :src="icon_avatar" />
</van-col>
<van-col span="16">
<p>{{ item.name }}</p>
<p>{{ item.kg_name }}</p>
</van-col>
<van-col span="4" style="text-align: center;">
<p @click="setComment(item, 'reply')" style="color: #333333;">回复</p>
<p>2-25</p>
</van-col>
</van-row>
<van-row>
<van-col>
<span style="color: #222222;">{{ item.c_action }}<span style="color: #0B3A72;">@{{ item.c_name }}</span>:{{ item.note }}</span>
</van-col>
</van-row>
</div>
<div style="padding: 1rem; background-color: #F7F7F7;" @click="onClick(item)">
<van-row>
<van-col span="8" style="position: relative;">
<van-image width="8rem" height="5rem" lazy-load :src="item.cover" style="vertical-align: text-bottom;">
<template v-slot:error>加载失败</template>
</van-image>
<!-- <div style="position: absolute; top: 2rem; left: 3rem;">
<van-image width="2rem" height="2rem" :src="icon_player" style="vertical-align: text-bottom;" > </van-image>
</div> -->
</van-col>
<van-col span="14" style="line-height: 2; margin-left: 1rem;">
<p style="font-size: 1.15rem;">{{ item.perf_name }}</p>
<p style="color: #999999;">{{ item.book_name }} | {{ item.localism_type }}</p>
</van-col>
</van-row>
</div>
</div>
<div style="padding: 1rem; background-color: #F7F7F7;" @click="onClick(item)">
<van-row>
<van-col span="8" style="position: relative;">
<van-image width="8rem" height="5rem" lazy-load :src="item.cover" style="vertical-align: text-bottom;">
<template v-slot:error>加载失败</template>
</van-image>
<!-- <div style="position: absolute; top: 2rem; left: 3rem;">
<van-image width="2rem" height="2rem" :src="icon_player" style="vertical-align: text-bottom;" > </van-image>
</div> -->
</van-col>
<van-col span="14" style="line-height: 2; margin-left: 1rem;">
<p style="font-size: 1.15rem;">{{ item.perf_name }}</p>
<p style="color: #999999;">{{ item.book_name }} | {{ item.localism_type }}</p>
</van-col>
</van-row>
</div>
</div>
</van-list>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无@我的"
/>
<comment-box :showPopup="showCommentBoxPopup" :type="commentType" :replayUser="replayUser" @on-submit="submitCommentBox" @on-close="closeCommentBox"></comment-box>
<!-- 写评论时,如果没有实名认证提示弹框 -->
......@@ -52,6 +60,7 @@
<script setup>
// import icon_player from '@images/bofang@2x.png'
import no_image from '@images/que-shuju@2x.png'
import CommentBox from '@/components/CommentBox/index.vue'
import NoticeOverlay from '@/components/NoticeOverlay/index.vue'
import icon_avatar from '@images/que-touxiang@2x.png'
......@@ -76,6 +85,10 @@ const commentList = ref([])
let limit = ref(10);
let offset = ref(0)
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
const onLoad = () => {
axios.get('/srv/?a=my_atme', {
params: {
......@@ -98,6 +111,10 @@ const onLoad = () => {
// 加载状态结束
finished.value = true;
}
if (!commentList.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......@@ -112,7 +129,7 @@ const onLoad = () => {
})
}
// 立即执行一次
onLoad();
// onLoad();
const showNotice = ref(false)
const onClose = () => { // 关闭提示框回调
......
......@@ -5,11 +5,17 @@
</template>
<div style="height: 2rem;"></div>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无收藏"
/>
</template>
<script setup>
import VideoCard from '@/components/VideoCard/index.vue'
import Cookies from 'js-cookie'
import no_image from '@images/que-shuju@2x.png'
import { ref } from 'vue'
import axios from '@/utils/axios';
......@@ -34,13 +40,18 @@ if (scrollTopCollection) {
// 处理书籍下作品列表
const prodList = ref([])
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
axios.get('/srv/?a=my_favor')
.then(res => {
if (res.data.code === 1) {
prodList.value = res.data.data.prod;
_.each(prodList.value, (item) => {
item.type = 'read-only' // 特殊标识,判断入口 为keepAlive使用
})
});
if (!res.data.data.prod.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
......@@ -34,6 +34,11 @@
</div>
</template>
</div>
<van-empty v-if="!dataList.length"
class="custom-image"
:image="no_image"
description="暂无捐赠信息"
/>
</div>
<van-overlay :show="show" @click="onHide">
......@@ -56,6 +61,7 @@
import DonateCert from '@/components/DonateCert/index.vue'
import icon_lock from '@images/suo@2x.png'
import no_image from '@images/que-shuju@2x.png'
import { ref, reactive, onMounted, getCurrentInstance, nextTick, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
......
......@@ -17,11 +17,18 @@
</van-row>
</div>
</template>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无关注"
/>
</div>
<div style="height: 2rem;"></div>
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from '@/utils/axios';
......@@ -30,12 +37,17 @@ import icon_avatar from '@images/que-touxiang@2x.png'
const $router = useRouter();
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
// 关注列表联调
const followList = ref([])
axios.get('/srv/?a=my_follow')
.then(res => {
if (res.data.code === 1) {
followList.value = res.data.data;
if (!res.data.data.value.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
......@@ -48,7 +48,8 @@
<my-button v-else type="custom" :custom-style="styleObject3">已认证</my-button>
</div>
<div>
<my-button type="custom" :custom-style="styleObject2" @on-click="handleUser('ADD')">新增儿童</my-button>
<my-button v-if="userInfo.status === 'enable'" type="custom" :custom-style="styleObject2" @on-click="handleUser('ADD')">新增儿童</my-button>
<my-button v-else type="custom" :custom-style="styleObject4">新增儿童</my-button>
</div>
</div>
......@@ -278,6 +279,11 @@ const styleObject3 = reactive({
color: '#FDD347',
borderColor: '#FDD347'
})
const styleObject4 = reactive({
backgroundColor: '#FFFFFF',
color: '#777777',
borderColor: '#777777'
})
const getFollow = () => {
$router.push({
......
......@@ -5,11 +5,17 @@
</template>
<div style="height: 2rem;"></div>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无点赞"
/>
</template>
<script setup>
import VideoCard from '@/components/VideoCard/index.vue'
import Cookies from 'js-cookie'
import no_image from '@images/que-shuju@2x.png'
import { ref } from 'vue'
import axios from '@/utils/axios';
......@@ -34,6 +40,8 @@ if (scrollTopLike) {
// 处理书籍下作品列表
const prodList = ref([])
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
axios.get('/srv/?a=my_like')
.then(res => {
if (res.data.code === 1) {
......@@ -41,6 +49,9 @@ axios.get('/srv/?a=my_like')
_.each(prodList.value, (item) => {
item.type = 'read-only'; // 特殊标识,判断入口 为keepAlive使用
})
if (!res.data.data.prod.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
<template>
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad">
<div v-for="(item, key) in commentList" :key="key" class="comment">
<div class="comment-wrapper">
<van-row style="font-size: 0.9rem;">
......@@ -41,10 +41,16 @@
</div>
</div>
</van-list>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无留言"
/>
</template>
<script setup>
import icon_player from '@images/bofang@2x.png'
import no_image from '@images/que-shuju@2x.png'
import icon_avatar from '@images/que-touxiang@2x.png'
import { ref, reactive, onMounted, onActivated } from 'vue'
......@@ -63,6 +69,10 @@ const commentList = ref([])
let limit = ref(10);
let offset = ref(0)
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
const onLoad = () => {
axios.get('/srv/?a=my_comment', {
params: {
......@@ -86,6 +96,10 @@ const onLoad = () => {
// 加载状态结束
finished.value = true;
}
if (!commentList.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
......@@ -4,9 +4,15 @@
<book-card type="C" :item="item" @on-click="onClick(item)"></book-card>
</template>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无订阅"
/>
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import BookCard from '@/components/BookCard/index.vue'
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
......@@ -16,11 +22,17 @@ import { Toast } from 'vant';
const $route = useRoute();
const $router = useRouter();
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
const items = ref([]);
axios.get('/srv/?a=my_subscribe')
.then(res => {
if (res.data.code === 1) {
items.value = res.data.data;
if (!res.data.data.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......
<template>
<div class="unwatch-list-page">
<div class="book-video-list">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<template v-for="item in prod_list" :key="item" style="height: 3rem;">
<van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" @load="onLoad">
<template v-if="prod_list.length" v-for="item in prod_list" :key="item" style="height: 3rem;">
<video-card :item="item"></video-card>
</template>
</van-list>
</div>
<div style="height: 2rem;"></div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无关注"
/>
</div>
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import { useUnwatchList } from '@/composables/useUnwatchList.js'
import VideoCard from '@/components/VideoCard/index.vue'
import { ref, onActivated } from 'vue'
import { ref, onActivated, computed } from 'vue'
import { mainStore } from '@/store'
import { storeToRefs } from 'pinia'
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'
......@@ -83,6 +91,13 @@ onBeforeRouteLeave((to, from) => {
/*********************************************************/
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
if (!prod_list.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
</script>
<script>
......
......@@ -5,9 +5,15 @@
</template>
<div style="height: 2rem;"></div>
</div>
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无作品"
/>
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import AuditVideoCard from '@/components/AuditVideoCard/index.vue'
import { ref } from 'vue'
......@@ -16,6 +22,8 @@ import { Toast } from 'vant';
// 处理书籍下作品列表
const prodList = ref([])
// 因为不能让空图标提前出来的写法
const emptyStatus = ref(false);
axios.get('/srv/?a=my_prod')
.then(res => {
if (res.data.code === 1) {
......@@ -24,6 +32,9 @@ axios.get('/srv/?a=my_prod')
v.path = 'myVideoList'
})
prodList.value = res.data.data.prod;
if (!res.data.data.prod.length) {
emptyStatus.value = true;
}
} else {
console.warn(res);
if (!res.data.show) return false;
......