teacherClassroom.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <text class="title"><text class="title-brown">健康生活方式</text>大讲堂</text>
  5. <image class="top-bg" src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/famous1.png"></image>
  6. <view class="txt">
  7. <view>让医学回归生活化,</view>
  8. <view>以健康的生活方式,</view>
  9. <view>改善健康困扰,重拾晚年幸福!</view>
  10. </view>
  11. </view>
  12. <view class="container-body">
  13. <image class="bg" src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/bg-class.png"></image>
  14. <text class="title">{{type==1?'健康大讲堂':'生活大讲堂'}}</text>
  15. <view class="card-box" v-for="(item,index) in cardList" :key="index" @click="goLearn(item.courseId)">
  16. <view class="bar">
  17. <image src="https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/bar.png" mode="widthFix"></image>
  18. <view class="tit">{{item.courseName}}</view>
  19. </view>
  20. <view class="img-box">
  21. <view class="img">
  22. <image :src="item.imgUrl || 'https://hst2-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/no-img.png'" mode="widthFix"></image>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. courseList,
  32. courseListB
  33. } from '@/api/class.js'
  34. export default {
  35. data() {
  36. return {
  37. type:null,
  38. cardList: [],
  39. classListb:[]
  40. }
  41. },
  42. computed: {
  43. },
  44. mounted() {
  45. },
  46. onLoad(option) {
  47. this.type=option.type
  48. if(this.type==1){
  49. this.getCourseList()
  50. }else{
  51. this.getCourseListb()
  52. }
  53. },
  54. methods: {
  55. getCourseListb() {
  56. //私域看课
  57. courseListB().then(res => {
  58. if (res.code == 200) {
  59. this.cardList = res.data
  60. } else {
  61. uni.hideLoading();
  62. uni.showToast({
  63. title: res.msg,
  64. icon: 'none'
  65. });
  66. }
  67. })
  68. },
  69. getCourseList() {
  70. courseList().then(res => {
  71. if (res.code == 200) {
  72. this.cardList = res.data
  73. } else {
  74. uni.hideLoading();
  75. uni.showToast({
  76. title: res.msg,
  77. icon: 'none'
  78. });
  79. }
  80. })
  81. },
  82. goLearn(id) {
  83. uni.navigateTo({
  84. url: '/pages_course/learn?courseId='+id+'&type='+this.type
  85. })
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .container {
  92. background-color: #f6e5db;
  93. min-height: 100vh;
  94. .top {
  95. position: relative;
  96. z-index: 1;
  97. font-size: 78rpx;
  98. font-weight: 900;
  99. text-align: center;
  100. padding: 34rpx 0;
  101. .title {
  102. background: linear-gradient(to right, #333032, #5f3b32);
  103. -webkit-background-clip: text;
  104. background-clip: text;
  105. -webkit-text-fill-color: transparent;
  106. position: relative;
  107. z-index: 2;
  108. .title-brown {
  109. -webkit-text-stroke: 2rpx #fff;
  110. text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
  111. background: linear-gradient(to bottom, #c47243, #b0592a);
  112. -webkit-background-clip: text;
  113. background-clip: text;
  114. -webkit-text-fill-color: transparent;
  115. }
  116. }
  117. .top-bg {
  118. position: absolute;
  119. top: 0;
  120. left: 0;
  121. width: 100%;
  122. z-index: 0;
  123. }
  124. .txt {
  125. font-style: italic;
  126. text-align: left;
  127. color: #fff;
  128. font-size: 36rpx;
  129. font-weight: 500;
  130. position: absolute;
  131. left: 8%;
  132. top: 172rpx;
  133. text-shadow:
  134. 0 0 1rpx #b0663c,
  135. 1rpx 1rpx 10rpx rgba(183, 0, 3, 0.3);
  136. }
  137. }
  138. .container-body {
  139. margin-top: 250rpx;
  140. min-height: calc(100vh - 250rpx);
  141. padding: 50rpx 24rpx;
  142. display: flex;
  143. flex-direction: column;
  144. align-items: center;
  145. position: relative;
  146. z-index: 1;
  147. .bg {
  148. position: absolute;
  149. top: 0;
  150. left: 0;
  151. width: 100%;
  152. height: 100%;
  153. object-fit: cover;
  154. z-index: -1;
  155. }
  156. .title {
  157. font-size: 70rpx;
  158. font-weight: 900;
  159. background: linear-gradient(to bottom, #c47243, #b0592a);
  160. -webkit-background-clip: text;
  161. background-clip: text;
  162. -webkit-text-fill-color: transparent;
  163. -webkit-text-stroke: 2rpx #fff;
  164. text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
  165. }
  166. .card-box {
  167. width: 100%;
  168. margin-top: 30rpx;
  169. .bar {
  170. position: relative;
  171. image {
  172. position: absolute;
  173. width: 100%;
  174. height: 100%;
  175. z-index: -1;
  176. }
  177. .tit {
  178. text-align: center;
  179. line-height: 90rpx;
  180. color: #fff;
  181. font-weight: 500;
  182. font-size: 36rpx;
  183. }
  184. }
  185. .img-box {
  186. margin-top: -8rpx;
  187. padding: 24rpx;
  188. background-color: #fff;
  189. border-radius: 0 0 20rpx 20rpx;
  190. .img {
  191. max-height: 380rpx;
  192. overflow: hidden;
  193. border-radius: 20rpx;
  194. image {
  195. width: 100%;
  196. height: 100%;
  197. }
  198. }
  199. }
  200. }
  201. }
  202. }
  203. </style>