kc.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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="#000000" back-icon-color="#000000"></u-navbar>
  5. <view class="rmkdwwer" @click="toSearch">
  6. <view class="fzctob inbddwddre">
  7. <image src="/static/index/ina1.png"
  8. style="width: 40rpx;height: 40rpx;min-width: 40rpx;margin-right: 12rpx;"></image>
  9. <input type="text" disabled value="" placeholder-style="color: #CCCCCC;font-size: 28rpx;"
  10. placeholder="搜索你感兴趣的内容" />
  11. </view>
  12. </view>
  13. <view class="zykkddr">
  14. <!-- <view class="zykkddra">
  15. <image src="/static/zy/zya1.png"
  16. style="width: 750rpx;height: 410rpx;margin-top: -102rpx;margin-left: 132rpx;" mode=""></image>
  17. </view> -->
  18. <view class="zykkddrb">
  19. <view style="margin: 0 24rpx;">
  20. <u-swiper :list="list" interval="58000" height="364" border-radius="16"></u-swiper>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 分类 -->
  25. <view class="nav-box bgfff">
  26. <view class="grid-item" v-for="item in labelList" @click="goto(item.id,item.label)">
  27. <!-- <image mode="widthFix" class="nav" :src="item.icon"></image> -->
  28. <image src="/static/index/ibb5.png" style="width: 68rpx;height: 68rpx;"></image>
  29. <text class="text">{{ item.label }}</text>
  30. </view >
  31. </view>
  32. <!-- 视频列表 -->
  33. <view class="rmknuy">
  34. <view class="zyhttry" style="padding: 20rpx 30rpx;">
  35. <!-- <image v-if="identity >0" src="/static/index/kcr1.png" style="width: 200rpx;height: 56rpx" mode=""></image> -->
  36. <!-- <image v-else src="/static/index/kcr2.png" style="width: 160rpx;height: 56rpx" mode=""></image> -->
  37. <view class="rmknuy-title">大咖好课</view>
  38. </view>
  39. <view style="padding: 20rpx 30rpx;">
  40. <view class="zytlidde" @click="toDetail(item)"
  41. v-for="(item,index) in dkhkList" :key="index">
  42. <view class="zytyyrimg" style="overflow: hidden;">
  43. <image :src="item.cover" mode="aspectFill" style="width: 100%; height: 100%;"></image>
  44. </view>
  45. <view class="zytyyopf">
  46. <view class="zytyotxta"><text>{{item.title}}</text></view>
  47. <view class="flztoa zytyotxtb">
  48. <text>{{item.lecturer_name}}</text>
  49. </view>
  50. <view class="flztoa zytyotxtc" style="margin-top: 6rpx;">
  51. <text>
  52. <text style="padding-right: 10rpx;">折扣价格: {{item.current_price}}</text>
  53. <text>原价格: {{item.original_price}}</text>
  54. </text>
  55. <image src="/static/zy/zyb3.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  56. </view>
  57. <view class="flztoa">
  58. <view class="fzctob zytyotxtc">
  59. <text>{{item.play_count}}播放量 - 共{{item.chapter_num}}课时</text>
  60. <!-- <image v-show="xqaxuye" @click="xqaxuye = false" src="/static/zy/zyb1.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image>
  61. <image v-show="!xqaxuye" @click="xqaxuye = true" src="/static/zy/zyb2.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image> -->
  62. </view>
  63. <!-- 分钟 -->
  64. <text class="zytyotxtd">{{item.time}}</text>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="zyhxyyer"></view>
  69. </view>
  70. </view>
  71. <view class="rmknuy">
  72. <view class="zyhttry" style="padding: 20rpx 30rpx;">
  73. <!-- <image v-if="identity >0" src="/static/index/kcr1.png" style="width: 200rpx;height: 56rpx" mode=""></image> -->
  74. <!-- <image v-else src="/static/index/kcr2.png" style="width: 160rpx;height: 56rpx" mode=""></image> -->
  75. <view class="rmknuy-title">免费试听</view>
  76. </view>
  77. <view style="padding: 20rpx 30rpx;">
  78. <view class="zytlidde" @click="toDetail(item)"
  79. v-for="(item,index) in mfstList" :key="index">
  80. <view class="zytyyrimg" style="overflow: hidden;">
  81. <image :src="item.cover" mode="aspectFill" style="width: 100%; height: 100%;"></image>
  82. </view>
  83. <view class="zytyyopf">
  84. <view class="zytyotxta"><text>{{item.title}}</text></view>
  85. <view class="flztoa zytyotxtb">
  86. <text></text>
  87. <image src="/static/zy/zyb3.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  88. </view>
  89. <view class="flztoa">
  90. <view class="fzctob zytyotxtc">
  91. <text>{{item.play_count}}播放量</text>
  92. <!-- <image v-show="xqaxuye" @click="xqaxuye = false" src="/static/zy/zyb1.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image>
  93. <image v-show="!xqaxuye" @click="xqaxuye = true" src="/static/zy/zyb2.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image> -->
  94. </view>
  95. <!-- 分钟 -->
  96. <text class="zytyotxtd">{{item.time}}</text>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="zyhxyyer"></view>
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. <style>
  106. page {
  107. background: #FAFAFA;
  108. }
  109. </style>
  110. <script>
  111. export default {
  112. data() {
  113. return {
  114. xqaxuye: false,
  115. xqaxuyea: true,
  116. xqaxuyeb: true,
  117. background: {
  118. backgroundColor: '#ffffff',
  119. },
  120. hhyanm: {
  121. color: '#FFFFFF',
  122. },
  123. timestamp: 86400,
  124. list: [],
  125. identity: 0, // 0普通用户 1 讲师
  126. mfstList:[], // 免费试听
  127. dkhkList:[], // 大咖好课
  128. courseList: [
  129. {
  130. id:1,
  131. cover:'',//封面
  132. title:'标题',
  133. original_price:0,
  134. current_price:0,
  135. pay_count:0,//领取数量
  136. one_level_label:0,
  137. tow_level_label:0,
  138. type:0,//类型
  139. },
  140. ],
  141. curtab: 0 ,// 当前选中的分类index
  142. labelList: [
  143. {label:'分类一',icon:''},
  144. {label:'分类二',icon:''},
  145. {label:'分类三',icon:''},
  146. ]
  147. }
  148. },
  149. onLoad() {
  150. // 分类
  151. // this.getLabelList();
  152. this.getOne1Label();
  153. this.getOne2Label();
  154. this.identity = uni.getStorageSync('userinfo').identity || 0
  155. },
  156. methods: {
  157. toSearch() {
  158. console.log(111)
  159. let id = this.type == 1 ? 31 : 34
  160. uni.navigateTo({
  161. url: '/pages/index/SearchPage?type_id=' + id
  162. })
  163. },
  164. changeTab(index) {
  165. this.curtab = index
  166. },
  167. // 课程分类
  168. getLabelList() {
  169. this.$request.labelList({}).then(res => {
  170. console.log(res)
  171. this.labelList = res.data
  172. }).catch(err => {
  173. console.log(err)
  174. })
  175. },
  176. // 课程筛选 免费
  177. getOne1Label() {
  178. this.$request.getCourseListByLabel({
  179. one_label:1, // 1免费 2大咖
  180. }).then(res => {
  181. console.log(res)
  182. this.mfstList = res.data;
  183. }).catch(err => {
  184. console.log(err)
  185. })
  186. },
  187. //课程筛选 大咖
  188. getOne2Label() {
  189. this.$request.getCourseListByLabel({
  190. one_label:2, // 1免费 2大咖
  191. }).then(res => {
  192. console.log(res)
  193. this.dkhkList = res.data;
  194. }).catch(err => {
  195. console.log(err)
  196. })
  197. },
  198. toDetail(i) {
  199. let item = JSON.stringify(i);
  200. uni.navigateTo({
  201. url: './kcxq-x?item=' + item
  202. })
  203. },
  204. goto(id,t) {
  205. uni.navigateTo({
  206. url: '/pages/index/kcxq-t?id=' + id +'&title=' + t
  207. })
  208. },
  209. }
  210. }
  211. </script>
  212. <style lang="scss" scoped>
  213. .rmknuy{
  214. padding-bottom: 100rpx;
  215. }
  216. .rmknuy-title{
  217. font-size: 40rpx;
  218. font-weight: bold;
  219. }
  220. .nav{width: 80rpx;height: 80rpx !important;margin: 0 auto;}
  221. .nav-box{
  222. display: flex;
  223. width: 100%;
  224. flex-wrap: wrap; padding: 0 0 40rpx 0;margin-bottom: 15rpx;}
  225. .grid-item{
  226. width: 25%;
  227. display: flex;
  228. flex-direction: column;
  229. align-items: center;
  230. justify-content: center;
  231. text-align: center;
  232. margin-top: 20rpx;
  233. }
  234. .nav-box .text{margin-top: 8rpx;}
  235. .bgfff{background-color: #fff;}
  236. </style>