ztsp.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="">
  3. <u-navbar :border-bottom="false" back-icon-size="35" title="主题课程" 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" style="width: 750rpx;height: 410rpx;margin-top: -102rpx;margin-left: 132rpx;" mode=""></image>
  8. </view>
  9. <view class="zykkddrb">
  10. <view style="margin: 0 24rpx;">
  11. <u-swiper :list="list" interval="58000" height="364" border-radius="16"></u-swiper>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="rmkdwwer" @click="toSearch">
  16. <view class="fzctob inbddwddre">
  17. <image src="/static/index/ina1.png"
  18. style="width: 40rpx;height: 40rpx;min-width: 40rpx;margin-right: 12rpx;"></image>
  19. <input type="text" disabled value="" placeholder-style="color: #CCCCCC;font-size: 28rpx;"
  20. placeholder="搜索你感兴趣的内容" />
  21. </view>
  22. </view>
  23. <view class="ztryeddf">
  24. <view class="indhuyr">
  25. <view class="indjbrr"></view>
  26. <text>热门推荐</text>
  27. </view>
  28. <view class="inyyshiy">
  29. <view class="ztmddy" @click="toDetail(item.id,item.to_type)" style="overflow: hidden;" v-for="(item,index) in hotlist" :key="index">
  30. <image :src="item.img" style="width: 100%; height: 100%;" mode="aspectFill"></image>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="ztdknuy">
  35. <view class="indhuyr">
  36. <view class="indjbrr"></view>
  37. <text>最新课程</text>
  38. </view>
  39. <view>
  40. <view class="zytlidde" @click="toDetail(item.id,1)" v-for="(item,index) in clist" :key="index">
  41. <view class="zytyyrimg" style="overflow: hidden;">
  42. <image :src="item.img" mode="aspectFill" style="width: 100%; height: 100%;"></image>
  43. </view>
  44. <view class="zytyyopf">
  45. <view class="zytyotxta"><text>{{item.title}}</text></view>
  46. <view class="flztoa zytyotxtb">
  47. <text>{{item.lecturer_name}}</text>
  48. <image src="/static/zy/zyb3.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  49. </view>
  50. <view class="flztoa">
  51. <view class="fzctob zytyotxtc">
  52. <text>{{item.sales}}人观看</text>
  53. <!-- <image v-show="xqaxuye" @click="xqaxuye = false" src="/static/zy/zyb1.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image>
  54. <image v-show="!xqaxuye" @click="xqaxuye = true" src="/static/zy/zyb2.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image> -->
  55. </view>
  56. <!-- 分钟 -->
  57. <text class="zytyotxtd">{{item.time}}</text>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="zyhxyyer"></view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <style>
  67. page {
  68. background: #FAFAFA;
  69. }
  70. </style>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. xqaxuye:false,
  76. xqaxuyea:true,
  77. xqaxuyeb:true,
  78. background: {
  79. backgroundColor: '#486A92',
  80. },
  81. hhyanm: {
  82. color: '#FFFFFF',
  83. },
  84. timestamp: 86400,
  85. list: [],
  86. hotlist:[] ,// 热门推荐
  87. clist:[]
  88. }
  89. },
  90. onLoad() {
  91. this.getInfo()
  92. this.getHot()
  93. },
  94. methods:{
  95. getInfo(){
  96. this.$post({
  97. data:{
  98. do:'CourseType',
  99. data:{
  100. user_id:uni.getStorageSync('id'),
  101. type_id:30,
  102. pw:35
  103. }
  104. }
  105. }).then(res=>{
  106. console.log(res,'iiiiiiiiiii')
  107. this.list = res.data[0].img
  108. this.clist = res.data[0].list
  109. })
  110. },
  111. toSearch(){
  112. console.log(111)
  113. uni.navigateTo({
  114. url:'/pages/index/SearchPage?type_id=30'
  115. })
  116. },
  117. // 获取热门推荐
  118. getHot(){
  119. this.$post({
  120. data:{
  121. do:'HomeView',
  122. }
  123. }).then(res=>{
  124. console.log(res,'hhhhhhhhh')
  125. this.hotlist = res.data.type_5
  126. })
  127. },
  128. toDetail(id,type){
  129. if (type == 1) {
  130. uni.navigateTo({
  131. url: './kcxq-x?id=' + id
  132. })
  133. } else if (type == 2) {
  134. uni.navigateTo({
  135. url: './zxshi?id=' + id
  136. })
  137. }
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .ztdknuy {
  144. background: #FFFFFF;
  145. border-radius: 16rpx 16rpx 16rpx 16rpx;
  146. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(0, 0, 0, 0.058823529411764705);
  147. padding: 30rpx 23rpx;
  148. padding-bottom: 200rpx;
  149. margin: 0 24rpx;
  150. margin-top: 30rpx;
  151. }
  152. .ztmddy {
  153. width: 214rpx;
  154. height:176rpx;
  155. background:#374B6E;
  156. border-radius: 16rpx 16rpx 16rpx 16rpx;
  157. }
  158. .ztryeddf {
  159. background: #FFFFFF;
  160. border-radius: 16rpx 16rpx 16rpx 16rpx;
  161. padding: 32rpx 20rpx;
  162. margin: 0 24rpx;
  163. margin-top: 10rpx;
  164. }
  165. </style>