zyxq.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="">
  3. <u-navbar :border-bottom="false" back-icon-size="35" :title="type_name" title-size="32" :background="background"
  4. :back-text-style="hhyanm" title-color="#FFFFFF" back-icon-color="#FFFFFF"></u-navbar>
  5. <view class="zykkddr">
  6. <view class="zykkddra">
  7. <image src="/static/zy/zya1.png"
  8. style="width: 750rpx;height: 410rpx;margin-top: -102rpx;margin-left: 132rpx;" mode=""></image>
  9. </view>
  10. <view class="zykkddrb">
  11. <view style="margin: 0 24rpx;">
  12. <u-swiper :list="imglist" interval="58000" height="364" border-radius="16"></u-swiper>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="zynnuy">
  17. <view class="zyhttry">
  18. <view class="zyjjdew"></view>
  19. <text>更多视频</text>
  20. </view>
  21. <view class="">
  22. <!-- <block v-for="(item,index) in list" :key="index">
  23. </block> -->
  24. <view class="zytlidde" @click="toDetail(item)">
  25. <image class="zytyyrimg" :src="item.cover" mode=""></image>
  26. <view class="zytyyopf">
  27. <view class="zytyotxta"><text>{{item.title}}</text></view>
  28. <view class="flztoa zytyotxtb">
  29. <text>{{item.desc}}</text>
  30. <image src="/static/zy/zyb3.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  31. </view>
  32. <!-- <view class="flztoa">
  33. <view class="fzctob zytyotxtc">
  34. <text>{{item.sales}}人观看</text>
  35. <image :src="item.is_collect == 1?'/static/zy/zyb1.png':'/static/zy/zyb2.png'" style="width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="shocuang(item.id)"></image>
  36. </view>
  37. <text class="zytyotxtd">{{item.time}}分钟</text>
  38. </view> -->
  39. </view>
  40. </view>
  41. <view class="zyhxyyer"></view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <style>
  47. page {
  48. background: #FAFAFA;
  49. }
  50. </style>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. item:null,
  56. background: {
  57. backgroundColor: '#486A92',
  58. },
  59. hhyanm: {
  60. color: '#FFFFFF',
  61. },
  62. timestamp: 86400,
  63. type_id: '',
  64. user_id: '',
  65. page: 1,
  66. num: 20,
  67. list: [],
  68. imglist:[],
  69. total: 0,
  70. type_name: '视频'
  71. }
  72. },
  73. onLoad(e) {
  74. this.item = JSON.parse(e.item);
  75. let imgs = [];
  76. imgs.push(this.item.cover);
  77. this.imglist = imgs;
  78. // this.user_id = uni.getStorageSync('id');
  79. // this.getlist();
  80. // this.getimg();
  81. },
  82. onReachBottom() {
  83. if (this.list.length < this.total) {
  84. this.page = this.page + 1
  85. this.getlist();
  86. } else {
  87. uni.showToast({
  88. title: '没有更多数据了',
  89. icon: 'none'
  90. })
  91. }
  92. },
  93. methods: {
  94. getlist() {
  95. let that = this;
  96. let data = {
  97. page: that.page,
  98. num: that.num,
  99. type_id: that.type_id,
  100. user_id: that.user_id,
  101. title: ''
  102. }
  103. console.log(data)
  104. this.$post({
  105. data: {
  106. do: 'CourseList',
  107. data: {
  108. page: that.page,
  109. num: that.num,
  110. type_id: that.type_id,
  111. user_id: that.user_id,
  112. title: ''
  113. }
  114. }
  115. }).then(res => {
  116. that.list = [...that.list, ...res.data.data]
  117. that.total = Number(res.data.total)
  118. that.type_name = res.data.type_name
  119. })
  120. },
  121. shocuang(id){
  122. let that = this;
  123. this.$post({
  124. data: {
  125. do: 'CourseAttribute',
  126. data: {
  127. id: id,
  128. user_id: that.user_id,
  129. pw:'375'
  130. }
  131. }
  132. }).then(res => {
  133. that.page = 1;
  134. that.list = [];
  135. that.getlist();
  136. })
  137. },
  138. // 获取分类列表
  139. getimg() {
  140. let user_id = uni.getStorageSync('id');
  141. this.$post({
  142. data: {
  143. do: 'CourseType',
  144. data: {
  145. user_id: user_id,
  146. type_id: this.type_id,
  147. pw: '375'
  148. }
  149. }
  150. }).then(res => {
  151. this.imglist = res.data[0].img
  152. })
  153. },
  154. // 去详情
  155. toDetail(i){
  156. uni.navigateTo({
  157. url:'/pages/index/kcxq-x?item='+ JSON.stringify(this.item)
  158. })
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. </style>