Browse Source

'鏈條所有接口完畢——加入音頻播放和進度控制'

hfll
hflllll 1 month ago
parent
commit
a4761c8134
4 changed files with 149 additions and 8 deletions
  1. +1
    -1
      mixins/config.js
  2. +2
    -2
      pages/index/user.vue
  3. +144
    -3
      subPages/home/directory.vue
  4. +2
    -2
      subPages/user/policy.vue

+ 1
- 1
mixins/config.js View File

@ -35,7 +35,7 @@ export default {
title: this.configParamContent('app_name'), title: this.configParamContent('app_name'),
desc: this.configParamContent('share_desc'), desc: this.configParamContent('share_desc'),
imageUrl: this.configParamContent('login_logo'), imageUrl: this.configParamContent('login_logo'),
path: '/pages/index/index'
path: this.configParamContent('xcxSharePage'),
} }
} }
}, },


+ 2
- 2
pages/index/user.vue View File

@ -127,7 +127,7 @@
<view class="contact-content"> <view class="contact-content">
<view class="title">联系我们</view> <view class="title">联系我们</view>
<view class="contact-item" @click="callPhone"> <view class="contact-item" @click="callPhone">
<text class="contact-phone">0731-599327-8899</text>
<text class="contact-phone">{{ configParamContent('contact_us') }}</text>
<image src="/static/拨号图标.png" class="contact-icon"></image> <image src="/static/拨号图标.png" class="contact-icon"></image>
</view> </view>
</view> </view>
@ -171,7 +171,7 @@ export default {
// //
callPhone() { callPhone() {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: '0731-599327-8899'
phoneNumber: this.configParamContent('contact_us'),
}) })
}, },
// //


+ 144
- 3
subPages/home/directory.vue View File

@ -40,8 +40,9 @@
<view class="course-title">课程</view> <view class="course-title">课程</view>
</view> </view>
<view class="course-list"> <view class="course-list">
<!-- 限制在做多五個課程 -->
<view <view
v-for="(course, index) in courseList.records"
v-for="(course, index) in courseList.records.slice(0, 5)"
@click="startLearning(course.id)" @click="startLearning(course.id)"
:key="index" :key="index"
class="course-item" class="course-item"
@ -54,7 +55,7 @@
</view> </view>
</view> </view>
<view class="course-footer"> <view class="course-footer">
<view class="course-total">全部课程 · {{ courseList.total }}</view>
<view class="course-total" @click="showAllCoursePopup">全部课程 · {{ courseList.total }}</view>
<uv-icon name="arrow-right" size="24rpx" color="#999"></uv-icon> <uv-icon name="arrow-right" size="24rpx" color="#999"></uv-icon>
</view> </view>
</view> </view>
@ -110,6 +111,40 @@
<uv-safe-bottom></uv-safe-bottom> <uv-safe-bottom></uv-safe-bottom>
</view> </view>
<!-- 全部課程彈出窗 -->
<uv-popup
mode="bottom"
ref="allCoursePopup"
round="32rpx"
bg-color="#f8f8f8"
>
<view class="course-popup">
<view class="popup-header">
<view>
<uv-icon name="arrow-down" color="black" size="20"></uv-icon>
</view>
<view class="popup-title">全部课程</view>
<view class="popup-title" @click="toggleCourseSort">
倒序
</view>
</view>
<view class="course-list">
<view
v-for="(course, index) in displayAllCourseList"
:key="course.id"
class="course-item"
@click="startLearning(course.id)"
>
<view class="course-number">{{ String(course.index || index + 1).padStart(2, '0') }}</view>
<view class="course-content">
<view class="course-english">{{ course.english }}</view>
<view class="course-chinese">{{ course.chinese }}</view>
</view>
</view>
</view>
</view>
</uv-popup>
</view> </view>
</template> </template>
@ -128,7 +163,16 @@ export default {
id: '', id: '',
courseList: [ courseList: [
]
],
allCourseList: [], //
isCourseSortReversed: false, //
}
},
computed: {
//
displayAllCourseList() {
const list = this.allCourseList.length > 0 ? this.allCourseList : this.courseList.records || [];
return this.isCourseSortReversed ? [...list].reverse() : list;
} }
}, },
methods: { methods: {
@ -173,8 +217,20 @@ export default {
}) })
if (courseRes.code === 200){ if (courseRes.code === 200){
this.courseList = courseRes.result this.courseList = courseRes.result
//
this.allCourseList = courseRes.result.records || []
} }
}, },
//
showAllCoursePopup() {
this.$refs.allCoursePopup.open()
},
//
toggleCourseSort() {
this.isCourseSortReversed = !this.isCourseSortReversed
},
}, },
onLoad(options) { onLoad(options) {
if (options.id){ if (options.id){
@ -380,6 +436,91 @@ export default {
.course-total { .course-total {
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
cursor: pointer;
}
/* 课程弹出窗样式 */
.course-popup {
padding: 0 32rpx;
max-height: 80vh;
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
border-bottom: 2rpx solid #EEEEEE
// margin-bottom: 40rpx;
}
.popup-title {
font-family: PingFang SC;
font-weight: 500;
font-size: 34rpx;
color: #181818;
}
.course-list {
max-height: 60vh;
overflow-y: auto;
}
.course-item {
display: flex;
align-items: center;
gap: 24rpx;
padding-top: 24rpx;
padding-right: 8rpx;
padding-bottom: 24rpx;
padding-left: 8rpx;
border-bottom: 1px solid #EEEEEE;
cursor: pointer;
&:last-child {
border-bottom: none;
}
}
.course-number {
width: 80rpx;
font-family: PingFang SC;
// font-weight: 400;
font-size: 36rpx;
color: #999;
&.highlight {
color: $primary-color;
}
// margin-right: 24rpx;
}
.course-content {
flex: 1;
}
.course-english {
font-family: PingFang SC;
font-weight: 600;
font-size: 36rpx;
line-height: 44rpx;
color: #252545;
margin-bottom: 8rpx;
&.highlight {
color: $primary-color;
}
}
.course-chinese {
font-size: 28rpx;
line-height: 48rpx;
color: #3B3D3D;
&.highlight {
color: $primary-color;
}
}
} }
/* 简介部分 */ /* 简介部分 */


+ 2
- 2
subPages/user/policy.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<view class="body"> <view class="body">
<rich-text :nodes="htmlContent"></rich-text>
<rich-text :nodes="configParamContent('privacy_policy')"></rich-text>
</view> </view>
</view> </view>
</template> </template>
@ -10,7 +10,7 @@
export default { export default {
data() { data() {
return { return {
htmlContent: '<h1>这是一个标题</h1><p>这是一个段落</p>'
} }
} }
} }


Loading…
Cancel
Save