zui.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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.video_id,value.video_series_sequence)">
  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.video_id,value.atch_episode_num)" class="zuiju-box-item-cover" :src="value.cover_image"></image>
  38. <view class="zuiju-box-item-info" @click="detail(value.video_id,value.watch_episode_num)">
  39. <label class="zuiju-box-item-info-title">{{value.name}}</label>
  40. <label class="zuiju-box-item-info-juji">看到<span class="guankan">{{value.watch_episode_num}}集</span></label>
  41. <label class="zuiju-box-item-info-gx">更新至<span class="update-ji">{{value.updated_episode_num}}集</span></label>
  42. </view>
  43. <view class="zuiju-box-item-del-box" @click="delzj(value.video_id)">
  44. <image class="del-icon" src="../../static/img/zhuiju/delete.png"></image>
  45. </view>
  46. </view>
  47. </block>
  48. </view>
  49. <view v-if="zhuijuList.length < 1" class="mt16 zuiju-box-kong">
  50. <image src="../../static/img/zhuiju/kong.png"></image>
  51. <text class="ft14">暂无追剧</text>
  52. <label class="ft16">去追剧</label>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. watchRecord,
  62. shelfList,
  63. delShelf
  64. } from "@/common/apis/zju.js";
  65. export default {
  66. data() {
  67. return {
  68. more_text: "查看全部",
  69. qdjl: 0,
  70. tdsy: 0,
  71. navLock: false,
  72. datasa: [],
  73. showdyxx: true,
  74. dataconfig: [],
  75. banners: [],
  76. datainfo: [],
  77. dataindex: [],
  78. newsa: [],
  79. record: [],
  80. historyList: [],
  81. zhuijuList: [],
  82. mbgColor: this.$mbgColor,
  83. is_show_more: false,
  84. }
  85. },
  86. computed: {
  87. },
  88. onPageScroll(e) {
  89. },
  90. onShareAppMessage(e) {
  91. },
  92. onShareTimeline(e) {
  93. },
  94. onLoad(e) {},
  95. onShow() {
  96. this.getList();
  97. },
  98. methods: {
  99. changeList() {
  100. if (this.is_show_more) {
  101. this.more_text = "查看全部";
  102. } else {
  103. this.more_text = "收起"
  104. }
  105. this.is_show_more = !this.is_show_more;
  106. },
  107. async getList() {
  108. this.historyList = await watchRecord();
  109. this.zhuijuList = await shelfList();
  110. },
  111. saoma() {
  112. //#ifdef APP-PLUS
  113. uni.scanCode({
  114. success: function(res) {
  115. if (res.result.indexOf("uid") != -1) {
  116. var obj = JSON.parse(res.result);
  117. if (obj.uid) {
  118. uni.navigateTo({
  119. url: '/pages/login/reg?uid=' + obj.uid
  120. })
  121. }
  122. } else {
  123. uni.showToast({
  124. title: res.result,
  125. icon: "none"
  126. });
  127. }
  128. }
  129. });
  130. //#endif
  131. },
  132. detail(vid, mid) {
  133. var fxpid = 1
  134. if (uni.getStorageSync("userinfo")) {
  135. fxpid = uni.getStorageSync("userinfo").id
  136. }
  137. uni.navigateTo({
  138. url: '/pages/client/tuan/detail?vid=' + vid + '&mid=' + mid + '&fxpid=' + fxpid
  139. })
  140. },
  141. linkTo(e) {
  142. if (this.isLogin == false) {
  143. this.showLogin = true;
  144. } else {
  145. let link = e.currentTarget.dataset.link;
  146. uni.navigateTo({
  147. url: link
  148. })
  149. }
  150. },async delzj(id){
  151. let res = await delShelf(id);
  152. console.log(res);
  153. },
  154. exchange(e) {
  155. if (this.isLogin == false) {
  156. this.showLogin = true;
  157. } else {
  158. let id = e.currentTarget.dataset.id;
  159. uni.navigateTo({
  160. url: '/pages/client/integral/exchange?id=' + id
  161. })
  162. }
  163. },
  164. goToJuYuan(){
  165. uni.switchTab({
  166. url: '/pages/client/index'
  167. })
  168. }
  169. },
  170. }
  171. </script>
  172. <style>
  173. @import url("style/zui.css");
  174. </style>