zui.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view>
  3. <view class="body">
  4. <view class="pd16_15" style="box-shadow: 0px 0px 20upx 0px rgba(0,0,0,0.2); border-radius: 20upx;">
  5. <view>
  6. <view class="flex alcenter space top-show">
  7. <view class="flex alcenter">
  8. <text class="ft16 ftw600 cl-main">最近观看</text>
  9. </view>
  10. <navigator url="/pages/client/tuan/zjgk">
  11. <view class="ft14 cl-notice" v-show="historyList.length > 3">更多</view>
  12. <!-- <view class="ft14 cl-notice" >更多</view> -->
  13. </navigator>
  14. </view>
  15. </view>
  16. <view class="mt16 history-box ">
  17. <block v-for="(value,key) in historyList" :key="key" v-if="key<3">
  18. <view class="history-item-box" @click="detail(value)">
  19. <image class="history-item-image" :src="value.cover_image"></image>
  20. <label class="history-item-title">{{value.name}}</label>
  21. </view>
  22. </block>
  23. <view class="box pb10 history-item-box history-add-box" @click="goToJuYuan">
  24. <image class="add-icon" src="/static/img/zhuiju/add.png"></image>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="mt24 pd16_15">
  29. <view class="flex alcenter space">
  30. <view class="flex alcenter">
  31. <text class="ft16 ftw600 cl-main">我的追剧</text>
  32. </view>
  33. </view>
  34. <view class="mt16 zuiju-box">
  35. <block v-if="zhuijuList.length > 0" v-for="(value,key) in zhuijuList" :key="key">
  36. <view class="box pd16_15 mb16 zuiju-box-item">
  37. <image @click="detail(value)" class="zuiju-box-item-cover" :src="value.cover_image"></image>
  38. <view class="zuiju-box-item-info" @click="detail(value)">
  39. <label class="zuiju-box-item-info-title">{{value.name}}</label>
  40. <label class="zuiju-box-item-info-juji">看到<span
  41. class="guankan">{{value.watch_episode_num}}集</span></label>
  42. <label class="zuiju-box-item-info-gx">更新至<span
  43. class="update-ji">{{value.updated_episode_num}}集</span></label>
  44. </view>
  45. <view class="zuiju-box-item-del-box" @click="delzj(value.video_id)">
  46. <image class="del-icon" src="../../static/img/zhuiju/delete.png"></image>
  47. </view>
  48. </view>
  49. </block>
  50. </view>
  51. <view v-if="is_show" class="mt16 zuiju-box-kong">
  52. <image src="../../static/img/zhuiju/kong.png"></image>
  53. <text class="ft14">暂无追剧</text>
  54. <label class="ft16" @click="goToJuYuan()">去追剧</label>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. watchRecord,
  64. shelfList,
  65. delShelf
  66. } from "@/common/apis/zju.js";
  67. export default {
  68. data() {
  69. return {
  70. more_text: "查看全部",
  71. qdjl: 0,
  72. tdsy: 0,
  73. navLock: false,
  74. datasa: [],
  75. showdyxx: true,
  76. dataconfig: [],
  77. banners: [],
  78. datainfo: [],
  79. dataindex: [],
  80. newsa: [],
  81. record: [],
  82. historyList: [],
  83. zhuijuList: [],
  84. mbgColor: this.$mbgColor,
  85. is_show_more: false,
  86. is_show: false
  87. }
  88. },
  89. computed: {
  90. },
  91. onPageScroll(e) {
  92. },
  93. onShareAppMessage(e) {
  94. },
  95. onShareTimeline(e) {
  96. },
  97. onLoad(e) {},
  98. onShow() {
  99. this.getList();
  100. },
  101. methods: {
  102. changeList() {
  103. if (this.is_show_more) {
  104. this.more_text = "查看全部";
  105. } else {
  106. this.more_text = "收起"
  107. }
  108. this.is_show_more = !this.is_show_more;
  109. },
  110. async getList() {
  111. this.historyList = await watchRecord();
  112. this.zhuijuList = await shelfList();
  113. if (this.zhuijuList.length < 1) {
  114. this.is_show = 1;
  115. }else{
  116. this.is_show =0;
  117. }
  118. },
  119. saoma() {
  120. //#ifdef APP-PLUS
  121. uni.scanCode({
  122. success: function(res) {
  123. if (res.result.indexOf("uid") != -1) {
  124. var obj = JSON.parse(res.result);
  125. if (obj.uid) {
  126. uni.navigateTo({
  127. url: '/pages/login/reg?uid=' + obj.uid
  128. })
  129. }
  130. } else {
  131. uni.showToast({
  132. title: res.result,
  133. icon: "none"
  134. });
  135. }
  136. }
  137. });
  138. //#endif
  139. },
  140. detail(value) {
  141. uni.navigateTo({
  142. url: '/pages/video/index?video_id=' + value.video_id
  143. })
  144. },
  145. linkTo(e) {
  146. if (this.isLogin == false) {
  147. this.showLogin = true;
  148. } else {
  149. let link = e.currentTarget.dataset.link;
  150. uni.navigateTo({
  151. url: link
  152. })
  153. }
  154. },
  155. async delzj(id) {
  156. let res = await delShelf(id);
  157. uni.showToast({
  158. title: "删除成功",
  159. icon: "none"
  160. });
  161. // 更新最近列表数据
  162. this.zhuijuList = await shelfList();
  163. console.log(res);
  164. },
  165. exchange(e) {
  166. if (this.isLogin == false) {
  167. this.showLogin = true;
  168. } else {
  169. let id = e.currentTarget.dataset.id;
  170. uni.navigateTo({
  171. url: '/pages/client/integral/exchange?id=' + id
  172. })
  173. }
  174. },
  175. goToJuYuan() {
  176. uni.switchTab({
  177. url: '/pages/index/index'
  178. })
  179. }
  180. },
  181. }
  182. </script>
  183. <style>
  184. @import url("style/zui.css");
  185. </style>