课程大纲
This commit is contained in:
107
pages/course/coursePrice.vue
Normal file
107
pages/course/coursePrice.vue
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
|
<z-nav-bar title="课程价格"></z-nav-bar>
|
||||||
|
<view class="container">
|
||||||
|
<view class="" v-if="courseList.length > 0">
|
||||||
|
<uni-collapse accordion>
|
||||||
|
<uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.medical.title"
|
||||||
|
:thumb="item.medical.icon">
|
||||||
|
<view class="content">
|
||||||
|
<view class="" v-for="(item1, index1) in item.courseList" :key="index1">
|
||||||
|
<view class="text courseItem flexbox"><u-icon name="pushpin" color="#2979ff" size="24"></u-icon><text>{{item1.title}}--</text></view>
|
||||||
|
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
|
||||||
|
<view class="priceItem">
|
||||||
|
<text class="text" v-if="item1.courseCatalogueEntityList.length > 1" style="font-weight: bold; margin-right: 20rpx;">{{item2.title}}</text>
|
||||||
|
<text class="text">半年:¥{{item2.halfFee}}</text><text class="text" style="margin-left: 20rpx;">整年:¥{{item2.fee}}</text>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-collapse-item>
|
||||||
|
</uni-collapse>
|
||||||
|
</view>
|
||||||
|
<u-divider v-else text="暂无数据"></u-divider>
|
||||||
|
</view>
|
||||||
|
<z-navigation></z-navigation>
|
||||||
|
<!-- <music-play :playData="playData"></music-play> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import musicPlay from '@/components/music.vue'
|
||||||
|
import $http from '@/config/requestConfig.js';
|
||||||
|
var clear;
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from 'vuex';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
playData: {},
|
||||||
|
courseList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//第一次加载
|
||||||
|
onLoad(e) {
|
||||||
|
// 隐藏原生的tabbar
|
||||||
|
uni.hideTabBar();
|
||||||
|
// console.log(e, '------')
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['userInfo'])
|
||||||
|
},
|
||||||
|
//页面显示
|
||||||
|
onShow() {
|
||||||
|
// 隐藏原生的tabbar
|
||||||
|
uni.hideTabBar();
|
||||||
|
this.getCoursePriceList()
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// musicPlay
|
||||||
|
},
|
||||||
|
//方法
|
||||||
|
methods: {
|
||||||
|
getCoursePriceList() {
|
||||||
|
this.$http
|
||||||
|
.post('medical/home/getMedicalCoursePrice')
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0 && res.list.length > 0) {
|
||||||
|
this.courseList = res.list
|
||||||
|
} else {
|
||||||
|
this.courseList = []
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e, '报错')
|
||||||
|
this.courseList = []
|
||||||
|
});
|
||||||
|
},
|
||||||
|
itemClick(op) {
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/style/mixin.scss';
|
||||||
|
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.priceItem{margin-bottom:20rpx; font-size: 28rpx;}
|
||||||
|
.courseItem{ background: $containerColor; border-radius: 20rpx;
|
||||||
|
align-items: center;margin-bottom:20rpx; display: block; padding: 10rpx 0; width: 100%;
|
||||||
|
.u-icon{display: inline-block;}
|
||||||
|
text{font-size: 28rpx; padding-left: 10rpx;}
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
.content{padding: 0 20rpx;}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -205,6 +205,7 @@
|
|||||||
if (res.code == 0 && res.labels.length > 0) {
|
if (res.code == 0 && res.labels.length > 0) {
|
||||||
this.treeList = res.labels
|
this.treeList = res.labels
|
||||||
this.getCourseInfo(this.treeList[0].id)
|
this.getCourseInfo(this.treeList[0].id)
|
||||||
|
// console.log(this.treeList[0].id,'+++++')
|
||||||
this.showDrawer('showRight')
|
this.showDrawer('showRight')
|
||||||
} else {
|
} else {
|
||||||
this.treeList = []
|
this.treeList = []
|
||||||
|
|||||||
@@ -87,13 +87,13 @@
|
|||||||
var path = ''
|
var path = ''
|
||||||
switch(op){
|
switch(op){
|
||||||
case "jiage":
|
case "jiage":
|
||||||
path = '/'
|
path = '/pages/course/coursePrice'
|
||||||
break
|
break
|
||||||
case "shuoming":
|
case "shuoming":
|
||||||
path = '/pages/course/illustrate';
|
path = '/pages/course/courseSet';
|
||||||
break;
|
break;
|
||||||
case "jianjie":
|
case "jianjie":
|
||||||
path = '/pages/course/outline';
|
path = '/pages/course/platformInfo';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
175
pages/course/platformInfo.vue
Normal file
175
pages/course/platformInfo.vue
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
<public-module></public-module>
|
||||||
|
<z-nav-bar title="平台说明"></z-nav-bar>
|
||||||
|
<view class="tabs">
|
||||||
|
<u-tabs :class="['tabList']" @click="tabClick" :activeStyle="activeStyle" :scrollable="scrollable"
|
||||||
|
:list="tabList" itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="box">
|
||||||
|
<rich-text v-if="showId == 1" class="content" :nodes="formatRichText(platform.buyRecord)"></rich-text>
|
||||||
|
<rich-text v-if="showId == 2" class="content" :nodes="formatRichText(platform.useRecord)"></rich-text>
|
||||||
|
<rich-text v-if="showId == 3" class="content" :nodes="formatRichText(platform.studyRecord)"></rich-text>
|
||||||
|
<rich-text v-if="showId == 4" class="content" :nodes="formatRichText(platform.vipRecord)"></rich-text>
|
||||||
|
</view>
|
||||||
|
<!-- <music-play :playData="playData"></music-play> -->
|
||||||
|
<z-navigation></z-navigation>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import musicPlay from '@/components/music.vue'
|
||||||
|
import $http from '@/config/requestConfig.js';
|
||||||
|
var clear;
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from 'vuex';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
playData: {},
|
||||||
|
scrollable: false,
|
||||||
|
activeStyle: {
|
||||||
|
color: '#333',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
transform: 'scale(1.2)',
|
||||||
|
// backgroundColor: '#258feb'
|
||||||
|
|
||||||
|
},
|
||||||
|
platform: {},
|
||||||
|
showId: 1,
|
||||||
|
tabList: [{
|
||||||
|
id: 1,
|
||||||
|
name: '购买须知'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: '使用须知'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: '学习次序'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: '超V用户'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//第一次加载
|
||||||
|
onLoad(e) {
|
||||||
|
// 隐藏原生的tabbar
|
||||||
|
uni.hideTabBar();
|
||||||
|
this.newsId = e.newsId
|
||||||
|
this.type = e.type
|
||||||
|
this.surl = e.url
|
||||||
|
console.log(e, '------')
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['userInfo'])
|
||||||
|
},
|
||||||
|
//页面显示
|
||||||
|
onShow() {
|
||||||
|
// 隐藏原生的tabbar
|
||||||
|
uni.hideTabBar();
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// musicPlay
|
||||||
|
},
|
||||||
|
//方法
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
this.$http
|
||||||
|
.post('medical/home/getMedicalCourseRecord')
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.platform = res.result
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e, '报错')
|
||||||
|
});
|
||||||
|
},
|
||||||
|
tabClick(e) {
|
||||||
|
console.log(e, '点击')
|
||||||
|
var cid = e.id
|
||||||
|
switch (cid) {
|
||||||
|
case 1:
|
||||||
|
// 购买须知
|
||||||
|
this.showId = 1
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 用户须知
|
||||||
|
this.showId = 2
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
// 学习须知
|
||||||
|
this.showId = 3
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// vip须知
|
||||||
|
this.showId = 4
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
formatRichText(html) {
|
||||||
|
if(html == ''){
|
||||||
|
return '暂无内容';
|
||||||
|
}
|
||||||
|
//控制图片大小
|
||||||
|
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
|
||||||
|
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
||||||
|
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
|
||||||
|
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
|
||||||
|
return match;
|
||||||
|
});
|
||||||
|
newContent = newContent.replace(/style="[^"]+"/gi, function(match, capture) {
|
||||||
|
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
|
||||||
|
'max-width:100%;');
|
||||||
|
return match;
|
||||||
|
});
|
||||||
|
// newContent = newContent.replace(/<img[^>]*>/gi, function(match, capture) {
|
||||||
|
// match = match.replace(/<img[^>]*>/gi, "@click='1111'").replace(/<img[^>]*>/gi, "@click='1111'");
|
||||||
|
// return match;
|
||||||
|
// });
|
||||||
|
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
|
||||||
|
newContent = newContent.replace(/\<img/gi,
|
||||||
|
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
|
||||||
|
return newContent;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/style/mixin.scss';
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
background-color: $containerColor;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
@include pleft_right(10px);
|
||||||
|
min-height: calc(100vh - 270rpx);
|
||||||
|
padding-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user