index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <view class="shenbaoList">
  4. <view class="list_li" v-for="(item,index) in list" :key="index" @click="detail(item)">
  5. <image :src="item.thumb_resource.url" mode="aspectFit" class="img"></image>
  6. <view class="title"><text style="margin-right: 5px;">{{item.title}}</text> <text class="tag" v-for="item1 in item.labels" :key="item1"
  7. >{{item1}}</text></view>
  8. <!-- <view class="tag">类型:英语</view> -->
  9. <view class="li_bottom">
  10. <view class="">
  11. 视频数量:<text style="color: #fc521c;font-weight: 550;">{{item.video_nums}}</text>
  12. </view>
  13. <view class="">
  14. 观看人数:<text style="color: #fc521c;font-weight: 550;">{{item.user_count}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. var app = getApp()
  23. import navBar from '../../components/navBar/navbar.vue';
  24. export default {
  25. components: {
  26. navBar
  27. },
  28. data() {
  29. return {
  30. list: []
  31. };
  32. },
  33. onLoad() {
  34. app.request('/courses/list', 'get').then(res => {
  35. console.log(res)
  36. this.list = res.data.data.data
  37. })
  38. },
  39. onShow() {
  40. },
  41. methods: {
  42. backLast: function() {
  43. uni.reLaunch({
  44. url: './index'
  45. })
  46. },
  47. detail(item) {
  48. uni.navigateTo({
  49. url: './detail?slug=' + item.slug
  50. })
  51. },
  52. }
  53. }
  54. </script>
  55. <style lang="scss">
  56. page {
  57. background: #f5f5f5;
  58. padding-bottom: 50upx;
  59. }
  60. .title {
  61. padding: 8px 0;
  62. font-weight: 550;
  63. color: #3e3e3e;
  64. font-size: 16px;
  65. }
  66. .shenbaoList {
  67. display: flex;
  68. flex-direction: column;
  69. width: 100%;
  70. align-items: center;
  71. .tag {
  72. display: inline-block;
  73. border-radius: 3px;
  74. border: solid 1px #1c85f1;
  75. color: #1c85f1;
  76. font-size: 12px;
  77. padding: 0px 3px;
  78. margin-right: 5px;
  79. font-weight: normal;
  80. }
  81. .list_li {
  82. display: flex;
  83. flex-direction: column;
  84. width: 90%;
  85. margin-top: 20upx;
  86. padding: 20upx;
  87. font-size: 26upx;
  88. background: white;
  89. border-radius: 10upx;
  90. view {
  91. // margin-top: 4px;
  92. }
  93. .img {
  94. width: 100%;
  95. height: 260upx;
  96. background-color: #f5f5f5;
  97. }
  98. .text1 {
  99. padding-top: 10upx;
  100. }
  101. .li_bottom {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. // padding-top: 10upx;
  106. .none {
  107. background: blue;
  108. color: white;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. padding: 5upx 10upx;
  113. }
  114. .upload {
  115. background: green;
  116. color: white;
  117. display: flex;
  118. align-items: center;
  119. justify-content: center;
  120. padding: 5upx 15upx;
  121. }
  122. }
  123. }
  124. }
  125. </style>