123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <template>
- <view class="container">
- <view class="top">
- <text class="title"><text class="title-brown">健康生活方式</text>大讲堂</text>
- <image class="top-bg" src="/static/assets/famous1.png"></image>
- <view class="txt">
- <view>让医学回归生活化,</view>
- <view>以健康的生活方式,</view>
- <view>改善健康困扰,重拾晚年幸福!</view>
- </view>
- </view>
- <view class="container-body">
- <image class="bg" src="/static/assets/bg-class.png"></image>
- <text class="title">上医有话说</text>
- <!-- <view class="card-box">
- <view class="bar">
- <image class="" src="/static/assets/bar.png"></image>
- <view class="tit">科学养生 | 名师首发</view>
- </view>
- <view class="img">
- <image src="/static/assets/class.png"></image>
- </view>
- </view> -->
- <view class="card-box" v-for="(item,index) in cardList" :key="index" @click="goLearn(item.courseId)">
- <view class="bar">
- <image src="/static/assets/bar.png" mode="widthFix"></image>
- <view class="tit">{{item.courseName}}</view>
- </view>
- <view class="img-box">
- <view class="img">
-
- <image :src="item.imgUrl || '/static/assets/no-img.png'" mode="widthFix"></image>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- courseList
- } from '@/api/class.js'
- export default {
- data() {
- return {
- cardList: []
- }
- },
- computed: {
- },
- mounted() {
- this.getCourseList()
- //this.getDepartmentList();
- },
- methods: {
- getCourseList() {
- courseList().then(res => {
- if (res.code == 200) {
- this.cardList = res.data
- } else {
- uni.hideLoading();
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- }
- })
- },
- goLearn(id) {
- uni.navigateTo({
- url: `/pages_manage/learn?courseId=${id}`
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- background-color: #f6e5db;
- min-height: 100vh;
- .top {
- position: relative;
- z-index: 1;
- font-size: 78rpx;
- font-weight: 900;
- text-align: center;
- padding: 34rpx 0;
- .title {
- background: linear-gradient(to right, #333032, #5f3b32);
- -webkit-background-clip: text;
- background-clip: text;
- -webkit-text-fill-color: transparent;
- position: relative;
- z-index: 2;
- .title-brown {
- -webkit-text-stroke: 2rpx #fff;
- text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
- background: linear-gradient(to bottom, #c47243, #b0592a);
- -webkit-background-clip: text;
- background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- }
- .top-bg {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 0;
- }
- .txt {
- font-style: italic;
- text-align: left;
- color: #fff;
- font-size: 36rpx;
- font-weight: 500;
- position: absolute;
- left: 8%;
- top: 172rpx;
- text-shadow:
- 0 0 1rpx #b0663c,
- 1rpx 1rpx 10rpx rgba(183, 0, 3, 0.3);
- }
- }
- .container-body {
- margin-top: 250rpx;
- min-height: calc(100vh - 250rpx);
- padding: 50rpx 24rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- z-index: 1;
- .bg {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- object-fit: cover;
- z-index: -1;
- }
- .title {
- font-size: 70rpx;
- font-weight: 900;
- background: linear-gradient(to bottom, #c47243, #b0592a);
- -webkit-background-clip: text;
- background-clip: text;
- -webkit-text-fill-color: transparent;
- -webkit-text-stroke: 2rpx #fff;
- text-shadow: 2rpx 2rpx 4rpx rgba(183, 94, 52, 0.5);
- }
- .card-box {
- width: 100%;
- margin-top: 30rpx;
- .bar {
- position: relative;
- image {
- position: absolute;
- width: 100%;
- height: 100%;
- z-index: -1;
- }
- .tit {
- text-align: center;
- line-height: 90rpx;
- color: #fff;
- font-weight: 500;
- font-size: 36rpx;
- }
- }
- .img-box {
- margin-top: -8rpx;
- padding: 24rpx;
- background-color: #fff;
- border-radius: 0 0 20rpx 20rpx;
- .img {
- max-height: 380rpx;
- overflow: hidden;
- border-radius: 20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- }
- }
- </style>
|