teacherClassroom.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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="imgPath+'/app/commonCourse/famous1.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="imgPath+'/app/commonCourse/bg-class.png'"></image>
  20. <view class="title-wrap">
  21. <text class="title-stroke">{{type==1?'健康大讲堂':'生活大讲堂'}}</text>
  22. <text class="title-fill">{{type==1?'健康大讲堂':'生活大讲堂'}}</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="imgPath+'/app/commonCourse/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 || imgPath+'/app/commonCourse/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. courseListB
  42. } from '@/api/class.js'
  43. export default {
  44. data() {
  45. return {
  46. type:null,
  47. cardList: [],
  48. classListb:[]
  49. }
  50. },
  51. computed: {
  52. imgPath() {
  53. return this.$store.state.imgpath
  54. },
  55. },
  56. mounted() {
  57. },
  58. onLoad(option) {
  59. this.type=option.type
  60. if(this.type==1){
  61. this.getCourseList()
  62. }else{
  63. this.getCourseListb()
  64. }
  65. },
  66. methods: {
  67. getCourseListb() {
  68. //私域看课
  69. courseListB().then(res => {
  70. if (res.code == 200) {
  71. this.cardList = res.data
  72. } else {
  73. uni.hideLoading();
  74. uni.showToast({
  75. title: res.msg,
  76. icon: 'none'
  77. });
  78. }
  79. })
  80. },
  81. getCourseList() {
  82. courseList().then(res => {
  83. if (res.code == 200) {
  84. this.cardList = res.data
  85. } else {
  86. uni.hideLoading();
  87. uni.showToast({
  88. title: res.msg,
  89. icon: 'none'
  90. });
  91. }
  92. })
  93. },
  94. goLearn(id) {
  95. uni.navigateTo({
  96. url: '/pages_course/learn?courseId='+id+'&type='+this.type
  97. })
  98. },
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .container {
  104. background-color: #f6e5db;
  105. min-height: 100vh;
  106. .top {
  107. position: relative;
  108. z-index: 1;
  109. font-size: 78rpx;
  110. font-weight: 900;
  111. text-align: center;
  112. padding: 34rpx 0;
  113. .title {
  114. background: linear-gradient(to right, #333032, #5f3b32);
  115. -webkit-background-clip: text;
  116. background-clip: text;
  117. -webkit-text-fill-color: transparent;
  118. position: relative;
  119. z-index: 2;
  120. }
  121. /* 2. 双层渐变描边组合 */
  122. .title-brown-group {
  123. position: relative;
  124. display: inline-block;
  125. line-height: 1;
  126. }
  127. .title-stroke {
  128. position: absolute;
  129. top: 0;
  130. left: 0;
  131. z-index: 1;
  132. color: #fff;
  133. -webkit-text-stroke: 4rpx #fff;
  134. text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
  135. }
  136. .title-fill {
  137. position: relative;
  138. z-index: 2;
  139. color: transparent;
  140. background: linear-gradient(to bottom, #c47243, #b0592a);
  141. -webkit-background-clip: text;
  142. background-clip: text;
  143. -webkit-text-fill-color: transparent;
  144. }
  145. .top-bg {
  146. position: absolute;
  147. top: 0;
  148. left: 0;
  149. width: 100%;
  150. z-index: 0;
  151. }
  152. .txt {
  153. font-style: italic;
  154. text-align: left;
  155. color: #fff;
  156. font-size: 36rpx;
  157. font-weight: 500;
  158. position: absolute;
  159. left: 8%;
  160. top: 172rpx;
  161. text-shadow:
  162. 0 0 1rpx #b0663c,
  163. 1rpx 1rpx 10rpx rgba(183, 0, 3, 0.3);
  164. }
  165. }
  166. .container-body {
  167. margin-top: 250rpx;
  168. min-height: calc(100vh - 250rpx);
  169. padding: 50rpx 24rpx;
  170. display: flex;
  171. flex-direction: column;
  172. align-items: center;
  173. position: relative;
  174. z-index: 1;
  175. .bg {
  176. position: absolute;
  177. top: 0;
  178. left: 0;
  179. width: 100%;
  180. height: 100%;
  181. object-fit: cover;
  182. z-index: -1;
  183. }
  184. .title-wrap{
  185. position: relative;
  186. display: inline-block;
  187. font-size: 70rpx;
  188. font-weight: 900;
  189. line-height: 1; /* 防止上下空隙 */
  190. }
  191. /* 下层:白描边 + 投影 */
  192. .title-stroke{
  193. position: absolute;
  194. top: 0;
  195. left: 0;
  196. z-index: 1;
  197. color: #fff; /* 描边色 */
  198. -webkit-text-stroke: 2rpx #fff;
  199. text-shadow: 2rpx 2rpx 4rpx rgba(183,94,52,.5);
  200. }
  201. /* 上层:干净渐变填充 */
  202. .title-fill{
  203. position: relative;
  204. z-index: 2;
  205. color: transparent;
  206. background: linear-gradient(to bottom, #c47243, #b0592a);
  207. -webkit-background-clip: text;
  208. background-clip: text;
  209. -webkit-text-fill-color: transparent;
  210. }
  211. .card-box {
  212. width: 100%;
  213. margin-top: 30rpx;
  214. .bar {
  215. position: relative;
  216. image {
  217. position: absolute;
  218. width: 100%;
  219. height: 100%;
  220. z-index: -1;
  221. }
  222. .tit {
  223. text-align: center;
  224. line-height: 90rpx;
  225. color: #fff;
  226. font-weight: 500;
  227. font-size: 36rpx;
  228. }
  229. }
  230. .img-box {
  231. margin-top: -8rpx;
  232. padding: 24rpx;
  233. background-color: #fff;
  234. border-radius: 0 0 20rpx 20rpx;
  235. .img {
  236. max-height: 380rpx;
  237. overflow: hidden;
  238. border-radius: 20rpx;
  239. image {
  240. width: 100%;
  241. height: 100%;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. }
  248. </style>