Showing
4 changed files
with
199 additions
and
2 deletions
| ... | @@ -181,6 +181,22 @@ export default [{ | ... | @@ -181,6 +181,22 @@ export default [{ |
| 181 | }, | 181 | }, |
| 182 | children: [] | 182 | children: [] |
| 183 | }, { | 183 | }, { |
| 184 | + path: '/me/followList', | ||
| 185 | + name: '关注', | ||
| 186 | + component: () => import('./views/me/followList.vue'), | ||
| 187 | + meta: { | ||
| 188 | + title: '关注' | ||
| 189 | + }, | ||
| 190 | + children: [] | ||
| 191 | +}, { | ||
| 192 | + path: '/me/unwatchList', | ||
| 193 | + name: '未看作品', | ||
| 194 | + component: () => import('./views/me/unwatchList.vue'), | ||
| 195 | + meta: { | ||
| 196 | + title: '未看作品' | ||
| 197 | + }, | ||
| 198 | + children: [] | ||
| 199 | +}, { | ||
| 184 | path: '/image', | 200 | path: '/image', |
| 185 | name: 'html转图片', | 201 | name: 'html转图片', |
| 186 | component: () => import('./views/html2canvas.vue'), | 202 | component: () => import('./views/html2canvas.vue'), | ... | ... |
src/views/me/followList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="follow-list-page"> | ||
| 3 | + <div class="info van-hairline--bottom"> | ||
| 4 | + <van-row> | ||
| 5 | + <van-col> | ||
| 6 | + <van-image round width="50" height="50" src="https://cdn.jsdelivr.net/npm/@vant/assets/cat.jpeg" | ||
| 7 | + style="padding-right: 1rem;" /> | ||
| 8 | + </van-col> | ||
| 9 | + <van-col class="text-wrapper" span="18"> | ||
| 10 | + <div> | ||
| 11 | + <div class="username">瑟日古娜</div> | ||
| 12 | + <div class="user-status">已关注</div> | ||
| 13 | + </div> | ||
| 14 | + <div class="address">呼和浩特市新城区蒙古族幼儿园</div> | ||
| 15 | + </van-col> | ||
| 16 | + </van-row> | ||
| 17 | + </div> | ||
| 18 | + <div class="info van-hairline--bottom"> | ||
| 19 | + <van-row> | ||
| 20 | + <van-col> | ||
| 21 | + <van-image round width="50" height="50" src="https://cdn.jsdelivr.net/npm/@vant/assets/cat.jpeg" | ||
| 22 | + style="padding-right: 1rem;" /> | ||
| 23 | + </van-col> | ||
| 24 | + <van-col class="text-wrapper" span="18"> | ||
| 25 | + <div> | ||
| 26 | + <div class="username">瑟日古娜</div> | ||
| 27 | + <div class="user-status">已关注</div> | ||
| 28 | + </div> | ||
| 29 | + <div class="address">呼和浩特市新城区蒙古族幼儿园</div> | ||
| 30 | + </van-col> | ||
| 31 | + </van-row> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | +</template> | ||
| 35 | + | ||
| 36 | +<script setup> | ||
| 37 | +import { ref, reactive, onMounted } from 'vue' | ||
| 38 | +import { useRoute, useRouter } from 'vue-router' | ||
| 39 | +import axios from '@/utils/axios'; | ||
| 40 | +import $ from 'jquery' | ||
| 41 | +import { Toast } from 'vant'; | ||
| 42 | +const $route = useRoute(); | ||
| 43 | +const $router = useRouter(); | ||
| 44 | + | ||
| 45 | + onMounted(() => { | ||
| 46 | + | ||
| 47 | + }) | ||
| 48 | +</script> | ||
| 49 | + | ||
| 50 | +<script> | ||
| 51 | +import mixin from 'common/mixin'; | ||
| 52 | + | ||
| 53 | +export default { | ||
| 54 | + mixins: [mixin.init], | ||
| 55 | + data () { | ||
| 56 | + return { | ||
| 57 | + | ||
| 58 | + } | ||
| 59 | + }, | ||
| 60 | + mounted () { | ||
| 61 | + | ||
| 62 | + }, | ||
| 63 | + methods: { | ||
| 64 | + | ||
| 65 | + } | ||
| 66 | +} | ||
| 67 | +</script> | ||
| 68 | + | ||
| 69 | +<style lang="less" scoped> | ||
| 70 | +.follow-list-page { | ||
| 71 | + .info { | ||
| 72 | + padding: 2rem; | ||
| 73 | + padding-right: 0; | ||
| 74 | + .text-wrapper { | ||
| 75 | + line-height: 1.5; | ||
| 76 | + .username { | ||
| 77 | + display: inline-block; | ||
| 78 | + overflow: auto; | ||
| 79 | + font-size: 1.15rem; | ||
| 80 | + color: #222222; | ||
| 81 | + } | ||
| 82 | + .user-status { | ||
| 83 | + float: right; | ||
| 84 | + font-size: 0.8rem; | ||
| 85 | + background-color: white; | ||
| 86 | + border-radius: 15px; | ||
| 87 | + padding: 5px 10px; | ||
| 88 | + color: #999999; | ||
| 89 | + border: 1px solid #EEEDED; | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + .address { | ||
| 93 | + font-size: 0.85rem; | ||
| 94 | + color: #999999; | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | +} | ||
| 98 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -29,12 +29,12 @@ | ... | @@ -29,12 +29,12 @@ |
| 29 | <p>45</p> | 29 | <p>45</p> |
| 30 | </van-col> | 30 | </van-col> |
| 31 | <van-col span="1" class="divide">|</van-col> | 31 | <van-col span="1" class="divide">|</van-col> |
| 32 | - <van-col span="5"> | 32 | + <van-col span="5" @click="getFollow"> |
| 33 | <p class="tap-color">关注</p> | 33 | <p class="tap-color">关注</p> |
| 34 | <p>26</p> | 34 | <p>26</p> |
| 35 | </van-col> | 35 | </van-col> |
| 36 | <van-col span="1" class="divide">|</van-col> | 36 | <van-col span="1" class="divide">|</van-col> |
| 37 | - <van-col span="5"> | 37 | + <van-col span="5" @click="getUnwatch"> |
| 38 | <p class="tap-color">未看</p> | 38 | <p class="tap-color">未看</p> |
| 39 | <p><van-tag round color="red">28</van-tag></p> | 39 | <p><van-tag round color="red">28</van-tag></p> |
| 40 | </van-col> | 40 | </van-col> |
| ... | @@ -139,6 +139,17 @@ const itemList = [ | ... | @@ -139,6 +139,17 @@ const itemList = [ |
| 139 | }, | 139 | }, |
| 140 | ] | 140 | ] |
| 141 | 141 | ||
| 142 | +const getFollow = () => { | ||
| 143 | + $router.push({ | ||
| 144 | + path: '/me/followList' | ||
| 145 | + }) | ||
| 146 | +} | ||
| 147 | +const getUnwatch = () => { | ||
| 148 | + $router.push({ | ||
| 149 | + path: '/me/unwatchList' | ||
| 150 | + }) | ||
| 151 | +} | ||
| 152 | + | ||
| 142 | onMounted(() => { | 153 | onMounted(() => { |
| 143 | 154 | ||
| 144 | }) | 155 | }) | ... | ... |
src/views/me/unwatchList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="unwatch-list-page"> | ||
| 3 | + <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"> | ||
| 4 | + <template v-for="item in dataList" :key="item" style="height: 3rem;"> | ||
| 5 | + <video-card :item="item"></video-card> | ||
| 6 | + </template> | ||
| 7 | + </van-list> | ||
| 8 | + </div> | ||
| 9 | +</template> | ||
| 10 | + | ||
| 11 | +<script setup> | ||
| 12 | +import dataList from '@/mock/video_list' | ||
| 13 | +import VideoCard from '@/components/VideoCard/index.vue' | ||
| 14 | + | ||
| 15 | +import { ref, reactive, onMounted } from 'vue' | ||
| 16 | +import { useRoute, useRouter } from 'vue-router' | ||
| 17 | +import axios from '@/utils/axios'; | ||
| 18 | +import $ from 'jquery' | ||
| 19 | +import { Toast } from 'vant'; | ||
| 20 | +const $route = useRoute(); | ||
| 21 | +const $router = useRouter(); | ||
| 22 | + | ||
| 23 | +// 处理书籍下作品列表 | ||
| 24 | +const list = ref([]); | ||
| 25 | +const loading = ref(false); | ||
| 26 | +const finished = ref(false); | ||
| 27 | + | ||
| 28 | +const onLoad = () => { | ||
| 29 | + // 异步更新数据 | ||
| 30 | + // setTimeout 仅做示例,真实场景中一般为 ajax 请求 | ||
| 31 | + setTimeout(() => { | ||
| 32 | + for (let i = 0; i < 20; i++) { | ||
| 33 | + list.value.push(list.value.length + 1); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + // 加载状态结束 | ||
| 37 | + loading.value = false; | ||
| 38 | + | ||
| 39 | + // 数据全部加载完成 | ||
| 40 | + if (list.value.length >= 100) { | ||
| 41 | + finished.value = true; | ||
| 42 | + } | ||
| 43 | + }, 1000); | ||
| 44 | +}; | ||
| 45 | + | ||
| 46 | + onMounted(() => { | ||
| 47 | + | ||
| 48 | + }) | ||
| 49 | +</script> | ||
| 50 | + | ||
| 51 | +<script> | ||
| 52 | +import mixin from 'common/mixin'; | ||
| 53 | + | ||
| 54 | +export default { | ||
| 55 | + mixins: [mixin.init], | ||
| 56 | + data () { | ||
| 57 | + return { | ||
| 58 | + | ||
| 59 | + } | ||
| 60 | + }, | ||
| 61 | + mounted () { | ||
| 62 | + | ||
| 63 | + }, | ||
| 64 | + methods: { | ||
| 65 | + | ||
| 66 | + } | ||
| 67 | +} | ||
| 68 | +</script> | ||
| 69 | + | ||
| 70 | +<style lang="less" scoped> | ||
| 71 | +.unwatch-list-page {} | ||
| 72 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment