teacherClassroom.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <text class="title">
  5. <text class="title-brown-group">
  6. <text class="title-stroke">健康生活方式</text>
  7. <text class="title-fill">健康生活方式</text>
  8. </text>
  9. <text class="title-normal">大讲堂</text>
  10. </text>
  11. <image class="top-bg" src="https://cos.his.cdwjyyh.com/fs/20250807/52f5aa7d5c5448e3a64efed9e6a77c85.png"></image>
  12. <view class="txt">
  13. <view>让健康回归生活化,</view>
  14. <view>以健康的生活方式,</view>
  15. <view>改善健康困扰,重拾晚年幸福!</view>
  16. </view>
  17. </view>
  18. <view class="container-body">
  19. <image class="bg" src="https://cos.his.cdwjyyh.com/fs/20250807/876f5e84355241d8911180159d5f8ad5.png"></image>
  20. <view class="title-wrap">
  21. <text class="title-stroke">健康大讲堂</text>
  22. <text class="title-fill">健康大讲堂</text>
  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="https://cos.his.cdwjyyh.com/fs/20250807/a5db6bc9d11d49eca182a0086297b54b.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 || 'https://cos.his.cdwjyyh.com/fs/20250807/1eebee6c3bff4fd68d1d3dde090bdf89.png'" mode="widthFix"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {getAppletCourse} from '@/api/course.js'
  40. export default {
  41. data() {
  42. return {
  43. type:null,
  44. cardList: [],
  45. classListb:[]
  46. }
  47. },
  48. onLoad(option) {
  49. this.getCourseList()
  50. },
  51. methods: {
  52. getCourseList() {
  53. getAppletCourse().then(res => {
  54. if (res.code == 200) {
  55. this.cardList = res.data
  56. } else {
  57. uni.hideLoading();
  58. uni.showToast({
  59. title: res.msg,
  60. icon: 'none'
  61. });
  62. }
  63. })
  64. },
  65. goLearn(id) {
  66. uni.navigateTo({
  67. url: '/pages_course/learn?courseId='+id
  68. })
  69. },
  70. }
  71. }
  72. </script>
  73. <style>
  74. page{
  75. background-color: #f6e5db;
  76. }
  77. </style>
  78. <style lang="scss" scoped>
  79. .container {
  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. }
  95. /* 2. 双层渐变描边组合 */
  96. .title-brown-group {
  97. position: relative;
  98. display: inline-block;
  99. line-height: 1;
  100. }
  101. .title-stroke {
  102. position: absolute;
  103. top: 0;
  104. left: 0;
  105. z-index: 1;
  106. color: #fff;
  107. -webkit-text-stroke: 4rpx #fff;
  108. text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
  109. }
  110. .title-fill {
  111. position: relative;
  112. z-index: 2;
  113. color: transparent;
  114. background: linear-gradient(to bottom, #c47243, #b0592a);
  115. -webkit-background-clip: text;
  116. background-clip: text;
  117. -webkit-text-fill-color: transparent;
  118. }
  119. .top-bg {
  120. position: absolute;
  121. top: 0;
  122. left: 0;
  123. width: 100%;
  124. z-index: 0;
  125. }
  126. .txt {
  127. font-style: italic;
  128. text-align: left;
  129. color: #fff;
  130. font-size: 36rpx;
  131. font-weight: 500;
  132. position: absolute;
  133. left: 8%;
  134. top: 172rpx;
  135. text-shadow:
  136. 0 0 1rpx #b0663c,
  137. 1rpx 1rpx 10rpx rgba(183, 0, 3, 0.3);
  138. }
  139. }
  140. .container-body {
  141. margin-top: 250rpx;
  142. min-height: calc(100vh - 250rpx);
  143. padding: 50rpx 24rpx;
  144. display: flex;
  145. flex-direction: column;
  146. align-items: center;
  147. position: relative;
  148. z-index: 1;
  149. .bg {
  150. position: absolute;
  151. top: 0;
  152. left: 0;
  153. width: 100%;
  154. height: 100%;
  155. object-fit: cover;
  156. z-index: -1;
  157. }
  158. .title-wrap{
  159. position: relative;
  160. display: inline-block;
  161. font-size: 70rpx;
  162. font-weight: 900;
  163. line-height: 1; /* 防止上下空隙 */
  164. }
  165. /* 下层:白描边 + 投影 */
  166. .title-stroke{
  167. position: absolute;
  168. top: 0;
  169. left: 0;
  170. z-index: 1;
  171. color: #fff; /* 描边色 */
  172. -webkit-text-stroke: 2rpx #fff;
  173. text-shadow: 2rpx 2rpx 4rpx rgba(183,94,52,.5);
  174. }
  175. /* 上层:干净渐变填充 */
  176. .title-fill{
  177. position: relative;
  178. z-index: 2;
  179. color: transparent;
  180. background: linear-gradient(to bottom, #c47243, #b0592a);
  181. -webkit-background-clip: text;
  182. background-clip: text;
  183. -webkit-text-fill-color: transparent;
  184. }
  185. .card-box {
  186. width: 100%;
  187. margin-top: 30rpx;
  188. .bar {
  189. position: relative;
  190. image {
  191. position: absolute;
  192. width: 100%;
  193. height: 100%;
  194. z-index: -1;
  195. }
  196. .tit {
  197. text-align: center;
  198. line-height: 90rpx;
  199. color: #fff;
  200. font-weight: 500;
  201. font-size: 36rpx;
  202. }
  203. }
  204. .img-box {
  205. margin-top: -8rpx;
  206. padding: 24rpx;
  207. background-color: #fff;
  208. border-radius: 0 0 20rpx 20rpx;
  209. .img {
  210. max-height: 380rpx;
  211. overflow: hidden;
  212. border-radius: 20rpx;
  213. image {
  214. width: 100%;
  215. height: 100%;
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. </style>