index_article_list.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div style="width:100%;background:gray">
  3. <router-view />
  4. <van-tabbar route>
  5. <van-tabbar-item replace to="/user/index/article" icon="home-o">
  6. 标签
  7. </van-tabbar-item>
  8. <van-tabbar-item replace to="/user/index/video" icon="search">
  9. 标签
  10. </van-tabbar-item>
  11. </van-tabbar>
  12. <!-- <van-tabbar route v-model="active">
  13. <van-tabbar-item badge="3" to="/home">
  14. <span>自定义</span>
  15. <template #icon="props">
  16. <img :src="props.active ? icon.article.active : icon.article.inactive" />
  17. </template>
  18. </van-tabbar-item>
  19. <van-tabbar-item icon="search">标签</van-tabbar-item>
  20. <van-tabbar-item icon="setting-o">标签</van-tabbar-item>
  21. </van-tabbar> -->
  22. <!-- <van-tabbar route v-model="active">
  23. <van-tabbar-item replace icon="home-o">
  24. <span>文章</span>
  25. <template #icon="props">
  26. {{props}}
  27. <img :src="props.active ? icon.article.active : icon.article.inactive" />
  28. </template>
  29. </van-tabbar-item>
  30. <van-tabbar-item replace icon="search">
  31. <span>视频</span>
  32. <template #icon="props">
  33. <img :src="props.active ? icon.video.active : icon.video.inactive" />
  34. </template>
  35. </van-tabbar-item>
  36. <van-tabbar-item icon="setting-o">
  37. <span>我的</span>
  38. <template #icon="props">
  39. <img :src="props.active ? icon.my.active : icon.my.inactive" />
  40. </template>
  41. </van-tabbar-item>
  42. </van-tabbar> -->
  43. </div>
  44. </template>
  45. <script>
  46. import { Tabbar, TabbarItem } from 'vant'
  47. let container;
  48. export default {
  49. layout: "opacity_header",
  50. async asyncData() {
  51. return {
  52. title: `选择新建类型-程序员客栈`,
  53. // active: 0,
  54. // icon: {
  55. // active: 'https://img.yzcdn.cn/vant/user-active.png',
  56. // inactive: 'https://img.yzcdn.cn/vant/user-inactive.png',
  57. // },
  58. };
  59. },
  60. data() {
  61. return {
  62. active:1,
  63. ad:{},
  64. icon:{
  65. 'article' : {
  66. active:require("../../assets/quan/icon/book_s.png"),
  67. inactive:require("../../assets/quan/icon/book.png")
  68. },
  69. 'video':{
  70. active:require('../../assets/quan/icon/video_s.png'),
  71. inactive:require('../../assets/quan/icon/video.png')
  72. },
  73. 'my':{
  74. active:require('../../assets/quan/icon/my_s.png'),
  75. inactive:require('../../assets/quan/icon/my.png')
  76. }
  77. }
  78. }
  79. },
  80. mounted() {
  81. container = this.$refs.container;
  82. },
  83. created(){
  84. this.getList()
  85. },
  86. methods: {
  87. async getList() {
  88. let res = await this.$axios.$get(
  89. '/api/jishuquan/get_ads', {}, {
  90. neverLogout: true
  91. }
  92. );
  93. if (res) {
  94. }
  95. },
  96. async getList() {
  97. console.log(999)
  98. if (this.isLoading) {
  99. return 0
  100. }
  101. this.isLoading = true;
  102. let res = await this.$axios.$post(
  103. '/api/jishuquan/getUncollectedTopics', {
  104. collecte_id:5,
  105. page: this.currentPage,
  106. size: 10
  107. }, {
  108. neverLogout: true
  109. }
  110. );
  111. this.isLoading = false;
  112. if (res) {
  113. if (!list.length) {
  114. this.noMore = true;
  115. return;
  116. } else {
  117. let list2 = this.list
  118. this.list = list2.concat(list)
  119. }
  120. }
  121. },
  122. },
  123. };
  124. </script>
  125. <style>
  126. body {
  127. background-color: white;
  128. }
  129. </style>
  130. <style lang='less' scoped>
  131. /* .flex {
  132. height: 100vh;
  133. display: flex;
  134. flex-direction: column;
  135. justify-content: space-around;
  136. }
  137. .item {
  138. text-align: center;
  139. font-size: 0.3rem;
  140. font-family: PingFangSC-Semibold, PingFang SC;
  141. font-weight: 600;
  142. color: rgba(34, 34, 34, 1);
  143. line-height: 0.35rem;
  144. }
  145. .box {
  146. height: 5.5rem;
  147. display: flex;
  148. flex-direction: column;
  149. justify-content: space-around;
  150. } */
  151. /* img {
  152. width: 1.88rem;
  153. height: 1.88rem;
  154. } */
  155. </style>