top.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!-- 完成了商学院页面 -->
  2. <template>
  3. <view class="business ">
  4. <view class="two-item">
  5. <view class="plat-form" @click="goToplatform()">
  6. <image src="../../../static/platform.png" mode=""></image>
  7. </view>
  8. <view class="propaganda" @click="goTomaterial()">
  9. <image src="../../../static/propaganda.png" mode=""></image>
  10. </view>
  11. </view>
  12. <view class="choice-course">
  13. <view class="item" v-for="(item,index) in curriculum" :class="{itemActive:colorIndex==index}" @click="getMsg(item,index)" :key="item.id">
  14. {{item.course_name}}
  15. </view>
  16. </view>
  17. <view class="curriculum-list">
  18. <view class="curriculum-list-item">
  19. <view class="item" v-for="(item,index) in bottomList" @click="gotoarticle()">
  20. <view class="image">
  21. <image :src="item.cover" mode=""></image>
  22. </view>
  23. <view class="right-title">
  24. <view class="title">
  25. {{item.title}}
  26. </view>
  27. <view class="video-num">
  28. 观看 241321
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import {classifyList,articleList} from "@/api/notice.js"
  38. export default{
  39. data(){
  40. return{
  41. curriculum:[
  42. {
  43. id:1,
  44. name:"推荐课程",
  45. },
  46. {
  47. id:2,
  48. name:"热门课程",
  49. },
  50. {
  51. id:3,
  52. name:"社区运营",
  53. },
  54. {
  55. id:4,
  56. name:"选品"
  57. }
  58. ],
  59. params:{
  60. recommend:1,
  61. hot:1,
  62. title:1,
  63. article_id:1
  64. },
  65. bottomList:[],//底部list数据
  66. colorIndex:0,
  67. }
  68. },
  69. created() {
  70. this.getList()
  71. },
  72. onPullDownRefresh(){
  73. this.getMsg()
  74. },
  75. methods:{
  76. //获取list列表内容
  77. getMsg(item,index){
  78. console.log(index)
  79. this.colorIndex = index
  80. this.params.article_id = item.id
  81. this.$http.get(articleList,this.params).then(res=>{
  82. if(res&&res.code==200){
  83. // this.bottomList = res.data.list
  84. console.log(res.page.list)
  85. this.bottomList= res.page.list
  86. }
  87. })
  88. },
  89. //获取头部list内容
  90. getList(){
  91. console.log(6666666666666)
  92. this.$http.get(classifyList).then(res=>{
  93. if(res&&res.code==200){
  94. console.log(res)
  95. this.curriculum = res.list
  96. }
  97. })
  98. },
  99. //跳转平台公告页面
  100. goToplatform(){
  101. uni.navigateTo({
  102. url:"../../../pages/research/business/platform"
  103. })
  104. },
  105. //跳转宣传素材页面
  106. goTomaterial(){
  107. uni.navigateTo({
  108. url:"../../../pages/research/business/material"
  109. })
  110. },
  111. gotoarticle(){
  112. uni.navigateTo({
  113. url:"../../../pages/research/business/article"
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .business{
  121. overflow: hidden;
  122. .two-item{
  123. background-color: #02331e;
  124. margin-top: 88rpx;
  125. display: flex;
  126. padding: 32rpx 30rpx 41rpx 30rpx;
  127. .plat-form{
  128. image{
  129. width: 328rpx;
  130. height: 172rpx;
  131. margin-right: 34rpx;
  132. }
  133. }
  134. .propaganda{
  135. image{
  136. width: 328rpx;
  137. height: 172rpx;
  138. }
  139. }
  140. }
  141. .curriculum-list{
  142. background-color: #02331e;
  143. .curriculum-list-item{
  144. padding: 40rpx 30rpx 40rpx 30rpx;
  145. border-radius: 40rpx 40rpx 0 0;
  146. background-color: #f5f5f5;
  147. .item{
  148. background-color: #ffffff;
  149. padding: 20rpx;
  150. display: flex;
  151. margin-bottom: 25rpx;
  152. border-radius: 18rpx;
  153. .image{
  154. margin-right: 40rpx;
  155. image{
  156. border-radius: 18rpx;
  157. width: 238rpx;
  158. height: 151rpx;
  159. }
  160. }
  161. }
  162. .right-title{
  163. display: flex;
  164. flex-direction: column;
  165. justify-content: space-between;
  166. .title{
  167. line-height: 36rpx;
  168. margin-top: 4rpx;
  169. color: #181818;
  170. font-size: 28rpx;
  171. font-weight: 400;
  172. }
  173. .video-num{
  174. margin-bottom: 4rpx;
  175. color: #999999;
  176. font-weight: 400;
  177. font-size: 24rpx;
  178. }
  179. }
  180. }
  181. }
  182. .choice-course{
  183. background-color: #02331e;
  184. display: flex;
  185. color: #ffffff;
  186. padding: 38rpx 33rpx 19rpx 30rpx;
  187. .item{
  188. margin-right: 33rpx;
  189. padding-bottom: 19rpx;
  190. margin-bottom: 10rpx;
  191. font-size: 28rpx;
  192. font-weight: Medium;
  193. color: rgba(255,255,255,1);
  194. position: relative;
  195. }
  196. .itemActive:before{
  197. content: "";
  198. position: absolute;
  199. left: 25%;
  200. bottom: 0;
  201. width: 50%;
  202. height: 2rpx;
  203. background-color: #FFFFFF;
  204. }
  205. }
  206. }
  207. </style>