| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view class="page-container">
- <view class="status_bar" :style="{ height: statusBarHeight }"></view>
- <!-- 顶部标题栏 -->
- <view class="nav-header">
- <view class="back-btn" @click="goBack">
- <image class="back-icon" src="/static/right_arrow.png" mode="aspectFit"></image>
- </view>
- <text class="page-title">精选课程</text>
- <view class="placeholder"></view>
- </view>
- <!-- 课程列表 -->
- <view class="course-grid">
- <view class="course-item" v-for="(item, index) in courseList" :key="index" @click="goDetail(item)">
- <view class="course-cover-box">
- <image class="course-cover" :src="item.image" mode="aspectFill"></image>
- </view>
- <view class="course-info">
- <view class="course-name">{{ item.title }}</view>
- <view class="course-footer">
- <text class="play-count">{{ item.playCount }}次播放</text>
- <image class="share-icon" src="/static/layer_share_icon16@3x.png" mode="aspectFit"></image>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- statusBarHeight: uni.getStorageSync('menuInfo') ? uni.getStorageSync('menuInfo').statusBarHeight : 20,
- courseList: [
- {
- id: 1,
- image: "/static/famous_doctor_img.png",
- title: "健身操",
- playCount: "16.5万"
- },
- {
- id: 2,
- image: "/static/famous_doctor_img2.png",
- title: "比赛",
- playCount: "16.5万"
- },
- {
- id: 3,
- image: "/static/course_img.png",
- title: "八段锦",
- playCount: "16.5万"
- },
- {
- id: 4,
- image: "/static/famous_doctor_img.png",
- title: "广场舞",
- playCount: "16.5万"
- },
- {
- id: 5,
- image: "/static/course_img.png",
- title: "八段锦",
- playCount: "16.5万"
- },
- {
- id: 6,
- image: "/static/famous_doctor_img2.png",
- title: "广场舞",
- playCount: "16.5万"
- }
- ]
- };
- },
- methods: {
- goBack() {
- uni.navigateBack();
- },
- goDetail(item) {
- uni.navigateTo({
- url: `/pages_course/learn?courseId=${item.id}&type=1`
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .page-container {
- width: 100%;
- min-height: 100vh;
- background-color: #F8F9FB;
- padding-bottom: 120upx;
- .status_bar {
- width: 100%;
- background-color: #ffffff;
- }
- .nav-header {
- height: 88rpx;
- background-color: #ffffff;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 30rpx;
- position: sticky;
- top: 0;
- z-index: 100;
- .back-btn {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .back-icon {
- width: 36rpx;
- height: 36rpx;
- transform: rotate(180deg);
- }
- }
- .page-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #1A1A1A;
- }
- .placeholder {
- width: 60rpx;
- }
- }
- .course-grid {
- padding: 30rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .course-item {
- width: 334rpx;
- background-color: #ffffff;
- border-radius: 20rpx;
- margin-bottom: 30rpx;
- overflow: hidden;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.02);
- .course-cover-box {
- width: 100%;
- height: 250rpx;
- .course-cover {
- width: 100%;
- height: 100%;
- background-color: #f5f5f5;
- }
- }
- .course-info {
- padding: 20rpx;
- .course-name {
- font-size: 30rpx;
- font-weight: bold;
- color: #1A1A1A;
- margin-bottom: 20rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .course-footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .play-count {
- font-size: 24rpx;
- color: #999999;
- }
- .share-icon {
- width: 32rpx;
- height: 32rpx;
- }
- }
- }
- }
- }
- }
- </style>
|