teacherClassroom.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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="/static/assets/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="/static/assets/bg-class.png"></image>
  14. <text class="title">上医有话说</text>
  15. <!-- <view class="card-box">
  16. <view class="bar">
  17. <image class="" src="/static/assets/bar.png"></image>
  18. <view class="tit">科学养生 | 名师首发</view>
  19. </view>
  20. <view class="img">
  21. <image src="/static/assets/class.png"></image>
  22. </view>
  23. </view> -->
  24. <view class="card-box" v-for="(item,index) in cardList" :key="index" @click="goLearn(item.courseId)">
  25. <view class="bar">
  26. <image src="/static/assets/bar.png" mode="widthFix"></image>
  27. <view class="tit">{{item.courseName}}</view>
  28. </view>
  29. <view class="img-box">
  30. <view class="img">
  31. <image :src="item.imgUrl || '/static/assets/no-img.png'" mode="widthFix"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. courseList
  41. } from '@/api/class.js'
  42. export default {
  43. data() {
  44. return {
  45. cardList: []
  46. }
  47. },
  48. computed: {
  49. },
  50. mounted() {
  51. this.getCourseList()
  52. //this.getDepartmentList();
  53. },
  54. methods: {
  55. getCourseList() {
  56. courseList().then(res => {
  57. if (res.code == 200) {
  58. this.cardList = res.data
  59. } else {
  60. uni.hideLoading();
  61. uni.showToast({
  62. title: res.msg,
  63. icon: 'none'
  64. });
  65. }
  66. })
  67. },
  68. goLearn(id) {
  69. uni.navigateTo({
  70. url: `/pages_manage/learn?courseId=${id}`
  71. })
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .container {
  78. background-color: #f6e5db;
  79. min-height: 100vh;
  80. .top {
  81. position: relative;
  82. z-index: 1;
  83. font-size: 78rpx;
  84. font-weight: 900;
  85. text-align: center;
  86. padding: 34rpx 0;
  87. .title {
  88. background: linear-gradient(to right, #333032, #5f3b32);
  89. -webkit-background-clip: text;
  90. background-clip: text;
  91. -webkit-text-fill-color: transparent;
  92. position: relative;
  93. z-index: 2;
  94. .title-brown {
  95. -webkit-text-stroke: 2rpx #fff;
  96. text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
  97. background: linear-gradient(to bottom, #c47243, #b0592a);
  98. -webkit-background-clip: text;
  99. background-clip: text;
  100. -webkit-text-fill-color: transparent;
  101. }
  102. }
  103. .top-bg {
  104. position: absolute;
  105. top: 0;
  106. left: 0;
  107. width: 100%;
  108. z-index: 0;
  109. }
  110. .txt {
  111. font-style: italic;
  112. text-align: left;
  113. color: #fff;
  114. font-size: 36rpx;
  115. font-weight: 500;
  116. position: absolute;
  117. left: 8%;
  118. top: 172rpx;
  119. text-shadow:
  120. 0 0 1rpx #b0663c,
  121. 1rpx 1rpx 10rpx rgba(183, 0, 3, 0.3);
  122. }
  123. }
  124. .container-body {
  125. margin-top: 250rpx;
  126. min-height: calc(100vh - 250rpx);
  127. padding: 50rpx 24rpx;
  128. display: flex;
  129. flex-direction: column;
  130. align-items: center;
  131. position: relative;
  132. z-index: 1;
  133. .bg {
  134. position: absolute;
  135. top: 0;
  136. left: 0;
  137. width: 100%;
  138. height: 100%;
  139. object-fit: cover;
  140. z-index: -1;
  141. }
  142. .title {
  143. font-size: 70rpx;
  144. font-weight: 900;
  145. background: linear-gradient(to bottom, #c47243, #b0592a);
  146. -webkit-background-clip: text;
  147. background-clip: text;
  148. -webkit-text-fill-color: transparent;
  149. -webkit-text-stroke: 2rpx #fff;
  150. text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
  151. }
  152. .card-box {
  153. width: 100%;
  154. margin-top: 30rpx;
  155. .bar {
  156. position: relative;
  157. image {
  158. position: absolute;
  159. width: 100%;
  160. height: 100%;
  161. z-index: -1;
  162. }
  163. .tit {
  164. text-align: center;
  165. line-height: 90rpx;
  166. color: #fff;
  167. font-weight: 500;
  168. font-size: 36rpx;
  169. }
  170. }
  171. .img-box {
  172. margin-top: -8rpx;
  173. padding: 24rpx;
  174. background-color: #fff;
  175. border-radius: 0 0 20rpx 20rpx;
  176. .img {
  177. max-height: 380rpx;
  178. overflow: hidden;
  179. border-radius: 20rpx;
  180. image {
  181. width: 100%;
  182. height: 100%;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. }
  189. </style>