This commit is contained in:
2024-06-19 16:25:28 +08:00
38 changed files with 7797 additions and 355 deletions

View File

@@ -20,6 +20,7 @@
data() {
return {
// windowWidth:320,
emojilist:emojiList1,
list1: [
[1,2,3],[4,5,6],
@@ -56,7 +57,8 @@
},
mounted() {
console.log('jihuo')
// this.windowWidth = uni.getSystemInfoSync().windowWidth;
const query = uni.createSelectorQuery().in(this);
query.select('.emotion-box').boundingClientRect(data => {
console.log(this.windowWidth / 10);

394
components/commentsList.vue Normal file
View File

@@ -0,0 +1,394 @@
<template>
<view class="">
<view class="box">
<view class="firstLeve flexbox leve" v-for="(item, index) in sayList" :key="index" style="flex-wrap: wrap;">
<view class="imgbox" :style="getBackGround(item.user.avatar)">
<view class="img">
<!-- <image :src="item.user.avatar" mode="aspectFit" style="width: 80rpx; height: 80rpx;"></image> -->
</view>
</view>
<view class="contentBox contentBoxfirstLeve">
<view class="name">
{{item.user.name == '' ? '暂无昵称': item.user.name}}
</view>
<view class="content" v-if="item.content != ''">
<rich-text class="content" :nodes="formatRichText(item.content)"></rich-text>
</view>
<view class="imagesList flexbox" v-if="item.images !=''">
<view class="item" v-for="(item2, index2) in item.imgList" :key="index2">
<image @click="previewImage(item2)" :src="item2" mode="widthFix"
style="width: 80rpx; height: 80rpx;"></image>
</view>
</view>
<view class="others flexbox">
<view class="dianzan flexbox" @click="support('one',index,item)">
<u-icon v-if="item.support" name="heart-fill" color="#ff5500" size="24"></u-icon>
<u-icon v-else name="heart" color="#999" size="24"></u-icon>
<text>{{item.supportCount}}</text>
</view>
<view class="pinglun flexbox" @click="addSay(index,item)">
<!-- <u-icon name="chat-fill" color="#999" size="24"></u-icon> -->
<u-icon name="chat" color="#999" size="24"></u-icon>
<text>{{item.children && item.children.length > 0? item.children.length : 0}}</text>
</view>
<text>{{item.createTime}}</text>
</view>
</view>
<!-- 二级 -->
<view class="boxB" v-if="item.Bchildren && item.Bchildren.length > 0" style="width: 100%;">
<view class=" flexbox leve" v-for="(citem, cindex) in item.Bchildren" :key="cindex">
<view class="imgbox" :style="getBackGround(citem.user.avatar)">
<view class="img">
<image :src="citem.user.avatar" mode="aspectFit"></image>
</view>
</view>
<view class="contentBox">
<view class="name">
{{citem.user.name == '' ? '暂无昵称': citem.user.name}}
</view>
<view class="content" v-if="citem.content != ''">
<rich-text class="content" :nodes="formatRichText(citem.content)"></rich-text>
</view>
<view class="imagesList flexbox" v-if="citem.images !=''">
<view class="item" v-for="(item3, index3) in citem.imgList" :key="index3">
<image @click="previewImage(item3)" :src="item3" mode="widthFix"
style="width: 80rpx; height: 80rpx;"></image>
</view>
</view>
<view class="others flexbox">
<view class="dianzan flexbox" @click="support(index,cindex,citem)">
<u-icon v-if="citem.support" name="heart-fill" color="#ff5500" size="24"></u-icon>
<u-icon v-else name="heart" color="#999" size="24"></u-icon>
<text>{{citem.supportCount}}</text>
</view>
<!-- <view class="pinglun flexbox" @click="addSay(cindex,citem)">
<u-icon name="chat" color="#999" size="24"></u-icon>
<text>{{citem.children && citem.children.length > 0? item.children.length : 0}}</text>
</view> -->
<text style="margin-left: 20rpx;">{{citem.createTime}}</text>
</view>
</view>
</view>
<view class="loadMore" v-show="item.Bchildren.length < item.children.length" @click="showMoreChildren(index,item)">
<text>加载更多追评</text>
</view>
</view>
<!-- end -->
</view>
</view>
</view>
</template>
<script>
export default {
props:['sayList'],
name:"commentsList",
data() {
return {
};
},methods:{
// 加载更多子评论
showMoreChildren(i,val){
console.log('更多评论');
if(val.children.length <= val.Bchildren.length){
uni.showToast({
title:'没有更多了哦',
icon:'none'
})
return
}
let _list = []
let _cc = [...val.children]
_list = _cc.slice(val.Bchildren.length, val.Bchildren.length + 6)
this.sayList[i].Bchildren = this.sayList[i].Bchildren.concat(_list)
},
// 点赞
support(index1,index,val){
console.log(index1,index,val, '点赞');
this.$emit('support',{index1,index,val})
},
getBackGround(src){
// console.log(src,'src')
if(src == '' || src == null){
return `background: url(./static/icon/morenAvavter.png); background-size: cover;`
}else{
return `background: url(${src});background-size: cover;`
}
},
formatRichText(html) { //控制图片大小
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(/<br[^>]*\/>/gi, '');
newContent = newContent.replace(/\<img/gi,
'<img style="max-width:40rpx;height:40rpx;display:inline-block;margin:10rpx auto;"');
return newContent;
},
previewImage(url) {
console.log(url)
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ['很抱歉,暂不支持保存图片到本地'],
success: function(res) {
// console.log(res,'+++++')
}
}
});
},
addSay(index,item){
// console.log(index,item,'添加评论')
this.$emit('showSayModule',{index,item})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.flexbox{display: flex;}
// ::v-deep .contentBox {
// .ql-editor {
// font-size: 26rpx;
// font-style: normal;
// min-height: 50rpx !important;
// padding: 20rpx;
// }
// img {
// width: 20px;
// }
// .u-upload__button {
// margin: 0 auto;
// }
// }
.liuyanBox {
padding: 0 20rpx;
margin-top: 20rpx;
.contentBoxfirstLeve{
width: calc(100% - 70rpx);
}
}
.leve {
margin-bottom: 20rpx;
.imgbox {
border: 1px solid #eee;
margin-right: 10rpx;
width: 60rpx;
height: 60rpx;
border-radius: 100%; overflow: hidden;
}
.contentBox {
font-size: 24rpx;
.name {
color: #999;
@include toe();
}
.content {
color: #333;
font-size: 26rpx;
margin-top: 10rpx;
}
.others {
margin-top: 10rpx;
color: #999;
align-items: center;
.dianzan {
align-items: center;
}
.pinglun {
align-items: center;
margin-left: 10rpx;
margin-right: 20rpx;
}
}
}
}
.firstLeve{padding-bottom: 10rpx; border-bottom: 1px solid #f7f8f9;}
.loadMore{text-align: center; margin-bottom: 20rpx;
text{color: $themeColor; font-size: 26rpx;}
}
.contentBox {
padding: 0 20rpx;
.icon {
width: 80rpx;
justify-content: center;
margin-left: 10rpx;
height: 80rpx;
align-items: center;
border: 1px solid #eee;
border-radius: 50rpx;
}
.addEmoji {
margin-right: 20rpx;
}
.imagesList { margin-top: 20rpx;
.item {
margin-right: 20rpx;
}
}
}
.boxB{margin-left: 60rpx; margin-top: 20rpx; background-color: #f7f8f9;
padding-top: 20rpx; padding-left:10rpx;
.imgbox{
width: 40rpx !important;
height: 40rpx !important;
}
.contentBox{width: calc(100% - 60rpx);}
// .img{ width: 60rpx;
// height: 60rpx;
// image{width:60rpx; height: 60rpx; border-radius: 100%;}
// }
}
.chooseImgType {
margin-top: 20rpx;
.item {
text-align: center;
margin-right: 20rpx;
padding: 10rpx;
box-sizing: border-box;
justify-content: center;
align-items: center;
width: 60px;
border: 1px solid #eee;
height: 60px;
text-align: center;
border-radius: 20rpx;
background-color: #f4f5f7;
// background-color: red;
text {
font-size: 24rpx;
display: inline-block;
width: 100%;
margin-top: -10rpx;
}
.img {
margin: 0 auto;
}
.ss {
line-height: 20rpx;
color: #666;
}
}
}
.sbmitBox {
button {
margin-top: 20rpx;
margin-bottom: 20rpx;
@include theme("btn_bg");
color: #fff;
}
}
.upimgList {
margin-top: 15px;
.item {
border: 1px solid #eee;
padding: 10rpx;
margin-right: 20rpx;
width: 100rpx;
height: 100rpx;
position: relative; overflow: hidden;
image {
width: 100%;
height: 100rpx;
}
span {
display: inline-block;
width: 20px;
height: 20px;
position: absolute;
right: -10px;
top: -10px;
z-index: 1;
border: 1px solid #eee;
border-radius: 20rpx;
background-color: #fff;
line-height: 20px;
font-size: 26rpx;
text-align: center;
}
}
}
.emojiBtn {
.img {
width: 50rpx;
height: 50rpx;
image {
width: 100%;
height: 50rpx;
}
}
}
.editorBox {
width: calc(100vw - 100rpx);
}
.ql-container {
min-height: 50rpx !important;
height: auto !important;
border: 1px solid #eee;
border-radius: 50rpx;
}
.contentBox {
padding: 0 20rpx;
.icon {
width: 80rpx;
justify-content: center;
margin-left: 10rpx;
height: 80rpx;
align-items: center;
border: 1px solid #eee;
border-radius: 50rpx;
}
.addEmoji {
margin-right: 20rpx;
}
.imagesList { margin-top: 20rpx;
.item {
margin-right: 20rpx;
}
}
}
</style>

View File

@@ -3,23 +3,23 @@
<swiper class="guide_pages_swiper" indicator-dots="true" indicator-color="#d1d1d1" indicator-active-color="#54a966">
<swiper-item>
<view class="guide_pages_bg1">
吴门医述
<!-- 吴门医述
<br>
让阅读无处不在
让阅读无处不在 -->
</view>
</swiper-item>
<swiper-item>
<view class="guide_pages_bg2">
吴门医述
<!-- 吴门医述
<br>
古今一统中西互参
古今一统中西互参 -->
</view>
</swiper-item>
<swiper-item>
<view class="guide_pages_bg3">
吴门医述
<!-- 吴门医述
<br>
和光同尘普惠人间
和光同尘普惠人间 -->
</view>
<button v-if="screenHeight > 667" class="guide_pages_close close_1624" @click="onClose">开始使用</button>
<button v-else class="guide_pages_close close_btj" @click="onClose">开始使用</button>

View File

@@ -130,6 +130,7 @@ $http.requestStart = function(options) {
options.header['token'] = storeUserInfo.token;
};
options.header['appType'] = 'medical';
// options.header['appType'] = 'sociology';
return options;
}
//请求结束

View File

@@ -78,7 +78,7 @@
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"minSdkVersion" : 21,
"targetSdkVersion" : 30,
"schemes" : "nuttyreading"
"schemes" : "medicine"
},
"sdkConfigs" : {
"ad" : {},
@@ -113,12 +113,12 @@
// "UIBackgroundModes" : [ "audio" ], // 背景播放音乐
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains" : [ "applinks:verification.nuttyreading.com" ]
"com.apple.developer.associated-domains" : []
}
},
"idfa" : false,
"urltypes" : "nuttyreading",
"urlschemewhitelist" : "everhealth",
"urltypes" : "medicine",
"urlschemewhitelist" : "nuttyreading,zmzm",
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "为了给您提供修改头像的功能",
"NSCameraUsageDescription" : "为了给您提供修改头像的功能"

View File

@@ -416,6 +416,29 @@
"popGesture": "none"
}
}
},{
"path" : "pages/course/learn",
"style" :
{
"navigationBarTitleText" : "视频/音频学习播放",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/course/myCourseLearn",
"style" :
{
"navigationBarTitleText" : "课程学习页面",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/course/myCourse",
"style" :
{
"navigationBarTitleText" : "我的课程",
"enablePullDownRefresh": true
}
}
],
"globalStyle": {

File diff suppressed because it is too large Load Diff

View File

@@ -6,23 +6,25 @@
<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">
<uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.courseMedicine.title"
:thumb="item.courseMedicine.icon">
<view class="content" v-if="item.courseList.length > 1">
<!-- <pre>{{item}}</pre> -->
<view class="courseItemleve1" 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>
size="24"></u-icon><text>{{item1.title}}</text></view>
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
<view class="priceItem flexbox">
<view :class="['priceItem', item2.isBuy == 1 ? 'isBuy' : '']">
<text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1"
style="font-weight: bold; margin-right: 20rpx;">{{item2.title}}</text>
<!-- <view class="pbox flexbox"> -->
style="font-weight: bold; margin-right: 10rpx;">{{item2.title}}</text>
<view class="pbox flexbox">
<text class="text">半年{{item2.halfFee}} </text><text class="text"
style="margin-left: 20rpx;">整年{{item2.fee}} </text>
<!-- </view> -->
</view>
<i class="haveBuy" v-if="item2.isBuy == 1">已购买</i>
</view>
</view>
<view class="buyBox">
<view class="buyBox" v-if="!item1.allBuy">
<view class="saveBtn buybtn flexbox" @click="goBuy('halfFee')">
<u-icon name="bag" color="#fff" size="24"></u-icon>
<text>立即购买</text>
@@ -36,6 +38,8 @@
<u-divider v-if="status == 1" text="暂无数据"></u-divider>
<u-divider v-if="status == 0" text="加载中..."></u-divider>
</view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
:iconStyle="iconStyle"></u-back-top>
<z-navigation></z-navigation>
<!-- <music-play :playData="playData"></music-play> -->
</view>
@@ -54,6 +58,15 @@
playData: {},
courseList: [],
status:0,
scrollTop: 0,
bgiStyle: {
background: '#fff'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
};
},
//第一次加载
@@ -71,6 +84,10 @@
uni.hideTabBar();
this.getCoursePriceList()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
@@ -83,8 +100,29 @@
this.$http
.post('medical/home/getMedicalCoursePrice')
.then(res => {
if (res.code == 0 && res.list.length > 0) {
this.courseList = res.list
if (res.code == 0 && res.res.length > 0) {
let _list = res.res
let _allBuy = false
_list.map(item => {
item.courseList.forEach(item2 => {
let _number = 0
item2.courseCatalogueEntityList.forEach(item3 => {
if(item3.isBuy == 1){
_number++
}
})
if(_number == item2.courseCatalogueEntityList.length){
_allBuy = true
}else{
_allBuy = false
}
item2.allBuy = _allBuy
})
})
this.courseList = res.res
this.status = 2
} else {
this.courseList = []
@@ -131,34 +169,43 @@
.courseItemleve1 {
padding: 20rpx;
border-radius: 20rpx;
border: 1px solid #eee;
// border: 1px solid #eee;
overflow: hidden;
margin-bottom: 20rpx;
margin-bottom: 30rpx;
@include mshadow(10px,8);
background: $containerColor;
}
.priceItem {justify-content: center;
.priceItem {
// justify-content: center;
margin-bottom: 20rpx;
font-size: 28rpx;
background-color: #82aee2;
// background-color: #82aee2;
border-radius: 20rpx; padding:10rpx;
// border: 1px solid #ff5500;
.pbox{ justify-content: center; width: 100%; text-align: center;}
border: 2px solid #82aee2;
.pbox{
justify-content: center;
width: 100%; text-align: center;}
text{
color: #fff;
// color: #fff;
}
.mname{padding: 2rpx 10rpx; background: #00e1ec ; border-radius: 20rpx;}
.mname{display: block; text-align: center; margin-bottom: 10rpx; color: #694bc6;}
}
.priceItem.isBuy{position: relative; border-color:#b3b3b3; overflow: hidden; background-color: #f3f3f3;}
.isBuy{
.haveBuy{position: absolute; padding:2rpx 6rpx; border-radius:0 0 0 20rpx ; right: 0; top: 0; z-index: 1; background-color: #e1e1e1; font-style: normal; font-size: 24rpx;}
.mname{color: inherit;}
}
.courseItem {
background: $containerColor; font-weight: bold; border-bottom: 1px dotted #e1e1e1;
border-radius: 20rpx;
// background: #b9d4f2;
font-weight: bold; border-bottom: 1px solid #e1e1e1;
// border-radius: 20rpx;
align-items: center;
margin-bottom: 20rpx;
display: block;
padding: 10rpx 0;
padding: 10rpx 10rpx;
width: 100%;
color: $themeColor;
.u-icon {
display: inline-block;
}
@@ -170,6 +217,7 @@
}
.container {
background-color: $containerColor;
.content {
padding: 0 20rpx;
}

View File

@@ -3,64 +3,34 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="courseInfo.id ? courseTitle : '课程说明'">
<uni-icons type="bars" class="topRight" slot="right" @click="showDrawer('showRight')" size="22"></uni-icons>
<!-- <uni-icons type="bars" class="topRight" slot="right" @click="showDrawer('showRight')" size="22"></uni-icons> -->
</z-nav-bar>
<view class="containerBg">
<view class="example-body">
<!-- <button type="primary" @click="showDrawer('showRight')"><text class="word-btn-white">全部课程</text>
</button> -->
<uni-drawer ref="showRight" mode="right" :width="320" @change="changeD($event,'showRight')">
<view class="close">
<view class="zhan" style="width: 100%;"></view>
<u-icon name="close" @click="closeDrawer('showRight')" color="#2979ff" size="28"></u-icon>
</view>
<view class="proTitle">
<text>点击课程名称即可查看对应的课程说明</text>
</view>
<uni-collapse accordion v-model="accordionVal" v-if="treeList.length > 0" @change="collapseChange">
<uni-collapse-item v-for="(item, index) in treeList" :key="index" :title="item.title"
:show-animation="true">
<view class="content">
<!-- <text class="text">{{item.title}}</text> -->
<view class="sub1List">
<view :class="['item', 'leve2',curId == item1.id ? 'active' : '']"
v-for="(item1, index1) in item.children" :key="index1"
@click.stop="clickCourseInfo(item1)">
<text class="textss"> {{item1.title}}</text>
<view class="sub2List" v-if="item1.children">
<view :class="['item', 'leve3',curId == item2.id ? 'active' : '']"
v-for="(item2, index2) in item1.children" :key="index2"
@click.stop="clickCourseInfo(item2)">
<text class="textss">{{item2.title}}</text>
<view class="sub3List" v-if="item2.children">
<view :class="['item', 'leve4',curId == item3.id ? 'active' : '']"
v-for="(item3, index3) in item2.children" :key="index3"
@click.stop="clickCourseInfo(item3)">
<text class="textss">{{item3.title}}33</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</uni-drawer>
</view>
<view class="infoBox" v-if="courseInfo.id">
<uni-section :title="courseTitle" type="line" titleFontSize="16px">
<rich-text v-if="courseInfo.content" class="content"
:nodes="formatRichText(courseInfo.content)"></rich-text>
<!-- <text>超强树选择器树组件树插件无限级联树单选树多选树自定义样式树树形选择 </text> -->
<view class="audio" v-if="courseInfo.mediaType == 2 && courseInfo.media != ''">
<audio style="text-align: left" :src="current.src" :poster="current.poster" :name="current.name"
:author="current.author" :action="audioAction" controls></audio>
<view class="" style="background: #55aaff;">
<u-tabs :class="['tabList']" @click="tabChange" :current="curTagIndex"
:activeStyle="activeStyle" :scrollable="scrollable" lineColor="#ef9f00" :list="tabList" :inactiveStyle="{
color: '#fff', }"
itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
</view>
<view>
<view v-if="courseInfo.mediaType ==1 && courseInfo.media != ''" style="width: 100%;height: 100%;text-align: center;" v-html="videoHTML">
<view class="tabLeve1 subItem flexbox" v-if="Leve1.length > 0">
<text :class="[leve1Index == index ? 'cur' : '']" v-for="(item, index) in Leve1" :key="index" @click="leve1Click(item, index)">{{item.title}}</text>
</view>
<view class="tabLeve2 subItem flexbox" v-if="Leve2.length > 0">
<text :class="[leve2Index == index ? 'cur' : '']" v-for="(item, index) in Leve2" :key="index" @click="leve2Click(item, index)">{{item.title}}</text>
</view>
<view class="tabLeve3 subItem flexbox" v-if="Leve3.length > 0">
<text :class="[leve3Index == index ? 'cur' : '']" v-for="(item, index) in Leve3" :key="index" @click="leve3Click(item, index)">{{item.title}}</text>
</view>
<view class="containerBg">
<view class="infoBox" v-if="courseInfo.id">
<uni-section :title="courseTitle" type="line" titleFontSize="16px">
<view class="audio" style="margin-bottom: 20rpx;" v-if="courseInfo.mediaType == 2 && courseInfo.media != ''">
<audio style="text-align: left" :src="courseInfo.media" :poster="audioPoster" :name="courseTitle"
author="吴门医述" :action="audioAction" controls></audio>
</view>
<view>
<!-- <view v-if="courseInfo.mediaType ==1 && courseInfo.media != ''" style="width: 100%;height: 100%;text-align: center;" v-html="videoHTML">
</view> -->
<!-- 视频播放器样式 -->
<!-- <view class="videoTemp" v-show="showTemp">
<u-icon name="play-circle" color="#fff" size="40" @click="clickToPlay"></u-icon>
@@ -71,6 +41,12 @@
enable-danmu danmu-btn controls @ended="playEnd"></video> -->
<!-- </view> -->
</view>
<rich-text v-if="courseInfo.content" class="content"
:nodes="formatRichText(courseInfo.content)"></rich-text>
<!-- <text>超强树选择器树组件树插件无限级联树单选树多选树自定义样式树树形选择 </text> -->
</uni-section>
</view>
</view>
@@ -90,17 +66,43 @@
data() {
return {
playData: {},
Leve1:[],
Leve2:[],
Leve3:[],
accordionVal: '',
// extraIcon:{
// color: '#4cd964',
// size: '100',
// }
scrollable:true,
treeList: [],
tagId: null,
pid: null,
bgiStyle: {
background: '#fff'
},
curTagIndex:0,
leve1Index:null,
leve2Index:null,
leve3Index:null,
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
tabList:[
],
activeStyle: {
color: '#fff',
fontWeight: 'bold', padding:'20rpx',
transform: 'scale(1.2)',
backgroundColor: '#ef9f00'
},
courseInfo: {},
poster:'../../static/videoF.jpg', //封面图
audioPoster:'../../static/logo.png',
current: {
poster: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png',
name: '致爱丽丝',
@@ -114,6 +116,7 @@
courseTitle: '',
showTemp:true,
videoContext:null,
videoUrl:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4'
};
},
@@ -153,34 +156,78 @@
},
//方法
methods: {
showDrawer(e) {
this.$refs[e].open()
this.videoContext.pause()
this.showTemp = true
console.log(5555)
},
// 关闭窗口
closeDrawer(e) {
this.$refs[e].close()
},
collapseChange(e){
console.log(e,'折叠面板点击');
if(e){
this.tagId = this.treeList[e].id
this.getCourseInfo(this.tagId)
// this.closeDrawer('showRight')
tabChange(e){
console.log(e,'e');
let _index = e.index
this.clickCourseInfo(this.treeList[_index])
this.curTagIndex = _index
this.leve1Index = null
this.leve2Index = null
this.leve3Index = null
if(this.treeList[_index].isLast == 0 && this.treeList[_index].children.length > 0){
this.Leve1 = this.treeList[_index].children
if(this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0){
this.Leve2 = this.Leve1[0].children
// console.log(this.Leve2,'Leve2');
if(this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0){
this.Leve3 = this.Leve2[0].children
}else{
this.Leve3 = []
}
},
changeD(e, type) {
// console.log((type === 'showRight' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
this[type] = e
if(!e){
this.showTemp = false
console.log('关闭弹窗')
this.videoContext.play()
}else{
this.Leve2 = []
this.Leve3 = []
}
}else{
this.Leve1 = []
this.Leve2 = []
this.Leve3 = []
}
},
leve1Click(val, index){
console.log(this.Leve1[index],'val');
this.leve1Index = index
this.leve2Index = null
this.leve3Index = null
this.clickCourseInfo(val)
if(this.Leve1[index].isLast == 0 && this.Leve1[index].children.length > 0){
this.Leve2 = this.Leve1[index].children
console.log(this.Leve2,'Leve2');
}else{
this.Leve2 = []
this.Leve3 = []
}
},
leve2Click(val, index){
this.leve2Index = index
if(this.leve1Index == null){
this.leve1Index = 0
}
this.leve3Index = null
// console.log(val,'三级点击');
this.clickCourseInfo(val)
if(this.Leve2[index].isLast == 0 && this.Leve2[index].children.length > 0){
this.Leve3 = this.Leve2[index].children
}else{
this.Leve3 = []
}
},
leve3Click(val, index){
this.leve3Index = index
// console.log(val,'四级点击');
if(this.leve2Index == null){
this.leve2Index = 0
}
if(this.leve1Index == null){
this.leve1Index = 0
}
this.clickCourseInfo(val)
// if(this.Leve3[index].isLast == 0){
// this.Leve3 = this.Leve2[index].children
// }
},
formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
@@ -203,10 +250,34 @@
.post('medical/home/getCourseMedicalTree')
.then(res => {
if (res.code == 0 && res.labels.length > 0) {
this.tabList = []
this.treeList = res.labels
if(this.treeList[0].isLast == 0 && this.treeList[0].children.length > 0){
this.Leve1 = this.treeList[0].children
if(this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0){
this.Leve2 = this.Leve1[0].children
// console.log(this.Leve2,'Leve2');
if(this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0){
this.Leve3 = this.Leve2[0].children
}else{
this.Leve3 = []
}
}else{
this.Leve2 = []
this.Leve3 = []
}
}else{
this.Leve1 = []
this.Leve2 = []
this.Leve3 = []
}
res.labels.forEach( item => {
this.tabList.push({id:item.id, name: item.title})
})
this.getCourseInfo(this.treeList[0].id)
// console.log(this.treeList[0].id,'+++++')
this.showDrawer('showRight')
// this.showDrawer('showRight')
} else {
this.treeList = []
}
@@ -232,9 +303,10 @@
this.courseTitle = this.courseInfo.title + '课程说明'
this.curId = id
if(this.courseInfo.mediaType == 1 && this.courseInfo.media != ''){
// this.videoUrl = this.courseInfo.media
this.videoUrl = this.courseInfo.media
// this.poster = this.videoUrl +
// "?x-oss-process=video/snapshot,t_0,f_jpg"
// this.getVideoPath(this.courseInfo.media)
}else{
// this.videoUrl = ''
this.poster = ''
@@ -255,10 +327,31 @@
console.log(e, '课程详情报错')
});
},
// 获得播放地址
getVideoPath(str){
console.log(str,'str');
$http.request({
url: "sociology/course/checkVideo",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
id: str
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
// this.$http
// .post('sociology/course/checkVideo',{
// id: str
// })
.then(res => {
console.log(res,'res');
}).catch(e => {
console.log(e,'获取视频播放地址错误');
})
},
clickCourseInfo(item) {
this.getCourseInfo(item.id)
this.closeDrawer('showRight')
},
playEnd(){
this.showTemp = true
@@ -275,24 +368,24 @@
@import '@/style/mixin.scss';
::v-deep .containerBg {
// .uni-collapse-item__title-box {
// background-color: transparent !important;
// }
// .uni-collapse-item__title {
// background-image: linear-gradient(90deg, #258feb 0%, #00e1ec 100%) !important;
// text {
// color: #fff !important;
// font-size: 28rpx !important;
// }
// }
.uni-audio-default{width: 100% !important;}
#myVideo {
width: 100% !important;
}
video{width: 100% !important; }
}
.flexbox{display: flex;}
.subItem{
background-color: #ebeef5; padding: 10rpx;
flex-wrap: wrap;
justify-content:start;
text{display: inline-block; width: calc(25% - 8rpx); text-align: center; border-radius: 10rpx; color: #258feb; padding: 10rpx 20rpx; border: 1px solid #258feb;
margin: 6rpx 0; font-size: 26rpx; margin-right: 10rpx;
}
text:last-child{margin-right: 0 !important;}
.cur{background: #258feb; display: inline-block; color: #fff; border-radius: 10rpx; padding: 10rpx 20rpx; }
}
.close {
display: flex;
justify-content: right;

View File

@@ -3,75 +3,49 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="courseInfo.id ? courseTitle : '课程说明'">
<uni-icons type="bars" class="topRight" slot="right" @click="showDrawer('showRight')" size="22"></uni-icons>
<!-- <uni-icons type="bars" class="topRight" slot="right" @click="showDrawer('showRight')" size="22"></uni-icons> -->
</z-nav-bar>
<view class="containerBg">
<view class="example-body">
<!-- <button type="primary" @click="showDrawer('showRight')"><text class="word-btn-white">全部课程</text>
</button> -->
<uni-drawer ref="showRight" mode="right" :width="320" @change="changeD($event,'showRight')">
<view class="close">
<view class="zhan" style="width: 100%;"></view>
<u-icon name="close" @click="closeDrawer('showRight')" color="#2979ff" size="28"></u-icon>
</view>
<view class="proTitle">
<text>点击课程名称即可查看对应的课程说明</text>
</view>
<uni-collapse accordion v-model="accordionVal" v-if="treeList.length > 0" @change="collapseChange">
<uni-collapse-item v-for="(item, index) in treeList" :key="index" :title="item.title"
:show-animation="true">
<view class="content">
<!-- <text class="text">{{item.title}}</text> -->
<view class="sub1List">
<view :class="['item', 'leve2',curId == item1.id ? 'active' : '']"
v-for="(item1, index1) in item.children" :key="index1"
@click.stop="clickCourseInfo(item1)">
<text class="textss"> {{item1.title}}</text>
<view class="sub2List" v-if="item1.children">
<view :class="['item', 'leve3',curId == item2.id ? 'active' : '']"
v-for="(item2, index2) in item1.children" :key="index2"
@click.stop="clickCourseInfo(item2)">
<text class="textss">{{item2.title}}</text>
<view class="sub3List" v-if="item2.children">
<view :class="['item', 'leve4',curId == item3.id ? 'active' : '']"
v-for="(item3, index3) in item2.children" :key="index3"
@click.stop="clickCourseInfo(item3)">
<text class="textss">{{item3.title}}33</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</uni-drawer>
</view>
<view class="infoBox" v-if="courseInfo.id">
<uni-section :title="courseTitle" type="line" titleFontSize="16px">
<rich-text v-if="courseInfo.content" class="content"
:nodes="formatRichText(courseInfo.content)"></rich-text>
<!-- <text>超强树选择器树组件树插件无限级联树单选树多选树自定义样式树树形选择 </text> -->
<view class="audio" v-if="courseInfo.mediaType == 2 && courseInfo.media != ''">
<audio style="text-align: left" :src="current.src" :poster="current.poster" :name="current.name"
:author="current.author" :action="audioAction" controls></audio>
<view class="" style="background: #55aaff;">
<u-tabs :class="['tabList']" @click="tabChange" :current="curTagIndex" :activeStyle="activeStyle"
:scrollable="scrollable" lineColor="#ef9f00" :list="tabList" :inactiveStyle="{
color: '#fff', }" itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
</view>
<view class="tabLeve1 subItem flexbox" v-if="Leve1.length > 0">
<text :class="[leve1Index == index ? 'cur' : '']" v-for="(item, index) in Leve1" :key="index"
@click="leve1Click(item, index)">{{item.title}}</text>
</view>
<view class="tabLeve2 subItem flexbox" v-if="Leve2.length > 0">
<text :class="[leve2Index == index ? 'cur' : '']" v-for="(item, index) in Leve2" :key="index"
@click="leve2Click(item, index)">{{item.title}}</text>
</view>
<view class="tabLeve3 subItem flexbox" v-if="Leve3.length > 0">
<text :class="[leve3Index == index ? 'cur' : '']" v-for="(item, index) in Leve3" :key="index"
@click="leve3Click(item, index)">{{item.title}}</text>
</view>
<view class="containerBg">
<view class="infoBox" v-if="courseInfo.id">
<uni-section :title="courseTitle" type="line" titleFontSize="16px">
<view class="audio" style="margin-bottom: 20rpx;"
v-if="courseInfo.mediaType == 2 && courseInfo.media != ''">
<audio style="text-align: left" :src="courseInfo.media" :poster="audioPoster"
:name="courseTitle" author="吴门医述" :action="audioAction" controls></audio>
</view>
<view>
<view v-if="courseInfo.mediaType ==1 && courseInfo.media != ''"
style="width: 100%;height: 100%;text-align: center;" v-html="videoHTML">
</view>
<!-- 视频播放器样式 -->
<!-- <view class="videoTemp" v-show="showTemp">
<u-icon name="play-circle" color="#fff" size="40" @click="clickToPlay"></u-icon>
<image src="../../static/video.jpg" mode="aspectFit"></image>
<!-- <view v-if="courseInfo.mediaType ==1 && courseInfo.media != ''" style="width: 100%;height: 100%;text-align: center;" v-html="videoHTML">
</view> -->
<!-- <view class="" v-if="!showTemp"> -->
<!-- <video ref="myVideo" id="myVideo" poster="../../static/videoF.jpg" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"
enable-danmu danmu-btn controls @ended="playEnd"></video> -->
<!-- </view> -->
<view class="container" v-if="courseInfo.mediaType ==1 && courseInfo.media != ''">
<div ref="videoContent" @tap="renderScript.handleClick" id="url-player-test"
:videoData="videoData" :change:videoData="renderScript.receiveMsg"></div>
</view>
</view>
<!-- <rich-text v-if="courseInfo.content" class="content"
:nodes="formatRichText(courseInfo.content)"></rich-text> -->
<!-- <text>超强树选择器树组件树插件无限级联树单选树多选树自定义样式树树形选择 </text> -->
</uni-section>
</view>
</view>
@@ -79,7 +53,6 @@
<!-- <music-play :playData="playData"></music-play> -->
</view>
</template>
<script>
// import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
@@ -91,18 +64,48 @@
data() {
return {
playData: {},
value: ['0'],
accordionVal: '0',
Leve1: [],
Leve2: [],
Leve3: [],
accordionVal: '',
options: {},//上个页面获取的视频参数视频id
playAuth: "", //播放凭证
videoId: "", //阿里云视频id
videoData: {}, //阿里云视频其他参数
// extraIcon:{
// color: '#4cd964',
// size: '100',
// }
scrollable: true,
treeList: [],
tagId: null,
pid: null,
bgiStyle: {
background: '#fff'
},
curTagIndex: null,
leve1Index: null,
leve2Index: null,
leve3Index: null,
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
tabList: [
],
activeStyle: {
color: '#fff',
fontWeight: 'bold',
padding: '20rpx',
transform: 'scale(1.2)',
backgroundColor: '#ef9f00'
},
courseInfo: {},
poster: '../../static/videoF.jpg', //封面图
audioPoster: '../../static/logo.png',
current: {
poster: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png',
name: '致爱丽丝',
@@ -116,6 +119,7 @@
courseTitle: '',
showTemp: true,
videoContext: null,
videoUrl: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4'
};
},
@@ -154,29 +158,97 @@
components: {
// musicPlay
},
created() {
// this.getLive();//获取播放凭证
},
//方法
methods: {
showDrawer(e) {
this.$refs[e].open()
this.videoContext.pause()
this.showTemp = true
console.log(5555)
},
// 关闭窗口
closeDrawer(e) {
this.$refs[e].close()
// 获取数据
getLive(playAuthsss) {
//playAuth 是播放凭证 通过后端自己根据api去获取返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放
var playAuth = playAuthsss.replace(/=/g, "");
this.videoData = {
// ...res.video,//视频其他信息
videoId: this.videoId,//阿里云视频id
playAuth: playAuth,//阿里云播放凭证
};
this.playAuth = playAuth;
this.$forceUpdate();
},
changeD(e, type) {
// console.log((type === 'showRight' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
this[type] = e
if (!e) {
this.showTemp = false
console.log('关闭弹窗')
this.videoContext.play()
tabChange(e) {
console.log(e, 'e');
let _index = e.index
this.clickCourseInfo(this.treeList[_index])
this.curTagIndex = _index
this.leve1Index = null
this.leve2Index = null
this.leve3Index = null
if (this.treeList[_index].isLast == 0 && this.treeList[_index].children.length > 0) {
this.Leve1 = this.treeList[_index].children
if (this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0) {
this.Leve2 = this.Leve1[0].children
// console.log(this.Leve2,'Leve2');
if (this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0) {
this.Leve3 = this.Leve2[0].children
} else {
this.Leve3 = []
}
} else {
this.Leve2 = []
this.Leve3 = []
}
} else {
this.Leve1 = []
this.Leve2 = []
this.Leve3 = []
}
},
leve1Click(val, index) {
console.log(this.Leve1[index], 'val');
this.leve1Index = index
this.leve2Index = null
this.leve3Index = null
this.clickCourseInfo(val)
if (this.Leve1[index].isLast == 0 && this.Leve1[index].children.length > 0) {
this.Leve2 = this.Leve1[index].children
console.log(this.Leve2, 'Leve2');
} else {
this.Leve2 = []
this.Leve3 = []
}
},
leve2Click(val, index) {
this.leve2Index = index
if (this.leve1Index == null) {
this.leve1Index = 0
}
this.leve3Index = null
// console.log(val,'三级点击');
this.clickCourseInfo(val)
if (this.Leve2[index].isLast == 0 && this.Leve2[index].children.length > 0) {
this.Leve3 = this.Leve2[index].children
} else {
this.Leve3 = []
}
},
leve3Click(val, index) {
this.leve3Index = index
// console.log(val,'四级点击');
if (this.leve2Index == null) {
this.leve2Index = 0
}
if (this.leve1Index == null) {
this.leve1Index = 0
}
this.clickCourseInfo(val)
// if(this.Leve3[index].isLast == 0){
// this.Leve3 = this.Leve2[index].children
// }
},
formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
@@ -194,21 +266,65 @@
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
return newContent;
},
collapseChange(e) {
console.log(e, '折叠面板点击');
if (e) {
this.tagId = this.treeList[e].id
this.getCourseInfo(this.tagId)
// this.closeDrawer('showRight')
}
},
getData() {
this.$http
.post('medical/home/getCourseMedicalTree')
.then(res => {
if (res.code == 0 && res.labels.length > 0) {
this.tabList = []
res.labels.forEach((item, index) => {
this.tabList.push({
id: item.id,
name: item.title
})
if (item.id == this.pid) {
this.curTagIndex = index
console.log(this.curTagIndex)
}
})
this.treeList = res.labels
if (this.treeList[this.curTagIndex].isLast == 0 && this.treeList[this.curTagIndex].children
.length > 0) {
this.Leve1 = this.treeList[this.curTagIndex].children
this.Leve1.forEach((item, index) => {
if (item.id == this.tagId) {
this.leve1Index = index
}
})
if (this.Leve1[0].isLast == 0 && this.Leve1[0].children.length > 0) {
this.Leve2 = this.Leve1[0].children
this.Leve2.forEach((item, index) => {
if (item.id == this.tagId) {
this.leve2Index = index
}
})
// console.log(this.Leve2,'Leve2');
if (this.Leve2[0].isLast == 0 && this.Leve2[0].children.length > 0) {
this.Leve3 = this.Leve2[0].children
this.Leve3.forEach((item, index) => {
if (item.id == this.tagId) {
this.leve3Index = index
}
})
} else {
this.Leve3 = []
}
} else {
this.Leve2 = []
this.Leve3 = []
}
} else {
this.Leve1 = []
this.Leve2 = []
this.Leve3 = []
}
// this.getCourseInfo(this.treeList[0].id)
// console.log(this.treeList[0].id,'+++++')
// this.showDrawer('showRight')
} else {
this.curTagIndex = 0
this.treeList = []
}
}).catch(e => {
@@ -227,15 +343,20 @@
'Content-Type': 'application/json'
},
})
.then(res => {
.then(async res => {
if (res.code == 0 && res.course.id) {
this.courseInfo = res.course
this.courseTitle = this.courseInfo.title + '课程说明'
this.curId = id
if (this.courseInfo.mediaType == 1 && this.courseInfo.media != '') {
// this.videoUrl = this.courseInfo.media
// this.poster = this.videoUrl +
// "?x-oss-process=video/snapshot,t_0,f_jpg"
this.videoId = this.courseInfo.media
this.videoUrl = await this.getVideoPath(this.courseInfo.media)
this.getLive(this.videoUrl)
console.log()
// this.videoData = {
// videoId: this.videoId,//阿里云视频id
// playAuth: this.videoUrl,//阿里云播放凭证
// }
} else {
// this.videoUrl = ''
this.poster = ''
@@ -256,10 +377,36 @@
console.log(e, '课程详情报错')
});
},
// 获得播放地址
async getVideoPath(str) {
// console.log(str, 'str');
let path = ''
await $http.request({
url: "medical/course/checkVideoByMD",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
id: str
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
// this.$http
// .post('sociology/course/checkVideo',{
// id: str
// })
.then(res => {
if (res.code == 0) {
// console.log(res, 'res');
path = res.playAuth
}
}).catch(e => {
console.log(e, '获取视频播放地址错误');
})
return path
},
clickCourseInfo(item) {
this.getCourseInfo(item.id)
this.closeDrawer('showRight')
},
playEnd() {
this.showTemp = true
@@ -272,22 +419,97 @@
},
};
</script>
<script module="renderScript" lang="renderjs">
export default {
mounted() {
// 在适合的生命周期通过script和link标签引入播放器sdk、css
this.loadWebPlayerSDK()
},
data() {
return {
player: null,
}
},
methods: {
getLive() {
//配置播放器
var player = new Aliplayer({
id: "url-player-test",
"vid": this.videoData.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频查询。示例1e067a2831b641db90d570b6480f****。
"playauth": this.videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。
"encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
"playConfig": {
"EncryptType": 'AliyunVoDEncryption'
},
width: '100%', //容器的大小
height: '600rpx', //容器的大小
}, function(player) { });
this.player = player;
player.one('canplay', function() {
// console.log('canplay', this.player.tag);
player.tag.play();
});
},
//监听获取播放凭证的方法
checkValue() {
console.log(this.videoId, this.videoData.playAuth, "1111888888")
if (!this.videoData.playAuth) {
setTimeout(() => {
this.checkValue();
}, 2000);
} else {
this.getLive();
}
},
loadWebPlayerSDK() {
return new Promise((resolve, reject) => {
const s_tag = document.createElement('script'); // 引入播放器js
s_tag.type = 'text/javascript';
s_tag.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/aliplayer-min.js';
s_tag.charset = 'utf-8';
s_tag.onload = () => {
this.checkValue();
resolve();
}
document.body.appendChild(s_tag);
const l_tag = document.createElement('link'); // 引入播放器css
l_tag.rel = 'stylesheet';
l_tag.href =
'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/skins/default/aliplayer-min.css';
document.body.appendChild(l_tag);
});
},
loadComponent() {
return new Promise((resolve, reject) => {
const s_tag = document.createElement('script');
s_tag.type = 'text/javascript';
// 需要先下载组件 js 文件,放到项目 /static/ 目录下
// 下载地址https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/customComponents/dist/aliplayer-components/aliplayercomponents-1.0.9.min.js
s_tag.src = './utils/aliplayercomponents.min.js';
s_tag.charset = 'utf-8';
s_tag.onload = () => {
resolve();
}
document.body.appendChild(s_tag);
});
}
}
}
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
::v-deep .containerBg {
// .uni-collapse-item__title-box {
// background-color: transparent !important;
// }
.uni-audio-default {
width: 100% !important;
}
// .uni-collapse-item__title {
// background-image: linear-gradient(90deg, #258feb 0%, #00e1ec 100%) !important;
// text {
// color: #fff !important;
// font-size: 28rpx !important;
// }
// }
#myVideo {
width: 100% !important;
}
@@ -297,6 +519,42 @@
}
}
.flexbox {
display: flex;
}
.subItem {
background-color: #ebeef5;
padding: 10rpx;
flex-wrap: wrap;
justify-content: start;
text {
display: inline-block;
width: calc(25% - 8rpx);
text-align: center;
border-radius: 10rpx;
color: #258feb;
padding: 10rpx 20rpx;
border: 1px solid #258feb;
margin: 6rpx 0;
font-size: 26rpx;
margin-right: 10rpx;
}
text:last-child {
margin-right: 0 !important;
}
.cur {
background: #258feb;
display: inline-block;
color: #fff;
border-radius: 10rpx;
padding: 10rpx 20rpx;
}
}
.close {
display: flex;

View File

@@ -42,7 +42,7 @@
</view>
<view class="tag-view">
<uni-tag v-if="item.level != 0" style="margin-right: 10rpx;" :text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;" text="必修" size="small" type="error" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;" text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;" text="选修" size="small" type="success" />
</view>
<view class="btn_box">
@@ -130,6 +130,14 @@
}
// console.log(this.scrollTop,'this.scrollTop')
},
onPullDownRefresh() {
console.log('下拉刷新')
this.status = 3
this.page = 1
this.courseList = []
this.getData(this.subTabId)
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.status != 2) {
this.page++

208
pages/course/learn.vue Normal file
View File

@@ -0,0 +1,208 @@
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="chapter.detail.id ? chapter.detail.title : '课程详情'"></z-nav-bar>
<view class="box">
<view class="topImg" v-if="chapter.detail.imgUrl != ''">
<image :src="chapter.detail.imgUrl" mode="widthFix"></image>
</view>
<view class="sourcesList" v-if="chapter.videos.length > 0">
<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
<view class="scroll-view-item_H item" v-for="(item, index) in chapter.videos" :key="index">
<!-- .mp3 -->
<view class="" v-if="item.type == 2">
<audio style="text-align: left" :src="current.src" :poster="current.poster" :name="current.name" :author="current.author" :action="audioAction" controls></audio>
</view>
<view class="" v-if="item.type == 1">
<video id="myVideo" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"
enable-danmu danmu-btn controls></video>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="imgcontainer">
<u-tabs :class="['tabList']" @click="" :current="curTagId"
: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="chapter.detail.content" class="content"
:nodes="formatRichText(chapter.detail.content)"></rich-text>
</view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
<!-- <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,
current: {
poster: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png',
name: '致爱丽丝',
author: '暂无',
src: 'https://web-ext-storage.dcloud.net.cn/uni-app/ForElise.mp3',
},
audioAction: {
method: 'pause'
},
activeStyle: {
color: '#333',
fontWeight: 'bold',
transform: 'scale(1.2)',
// backgroundColor: '#258feb'
},
chapter: {
detail: {}, // type:0. 不加密 //1. mp4 2. mp3
videos: []
},
bgiStyle: {
background: '#fff'
},
curTagId:1,
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
tabList:[
{id:1, name:"章节介绍"},{id:3, name:"本节作业"},{id:2, name:"评论"}
],
scrollTop: 0,
courseId: null,
catalogueId: null,
chapterId: null,
};
},
//第一次加载
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
// this.newsId = e.newsId
this.courseId = e.courseId
this.catalogueId = e.catalogueId
this.chapterId = e.chapterId
console.log(e, '------')
},
computed: {
...mapState(['userInfo'])
},
//页面显示
onShow() {
// 隐藏原生的tabbar
uni.hideTabBar();
this.getData();
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
components: {
// musicPlay
},
//方法
methods: {
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
getData() {
$http.request({
url: `sociology/course/getCourseCatalogueChapterDetail`,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
id: this.chapterId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
this.chapter = res.data
}
}).catch(e => {
console.log(e, '获取新闻详情报错')
});
},
formatRichText(html) { //控制图片大小
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';
.imgcontainer {
background-color: $imgBg;
}
.scroll-view_H {
white-space: nowrap;
width: 100%;
}
.scroll-view-item_H {
display: inline-block;
// width: 100%;
// height: 300rpx;
line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
.box {
background-color: #fff;
@include pleft_right(10px);
min-height: calc(100vh - 270rpx);
}
.title {
font-size: 32rpx;
font-weight: bold;
display: block;
text-align: center;
}
.content {
font-size: 26rpx;
line-height: 48rpx;
margin-top: 10rpx;
}
</style>

171
pages/course/myCourse.vue Normal file
View File

@@ -0,0 +1,171 @@
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="pageTitle ? pageTitle : '课程中心'"></z-nav-bar>
<view class="containerBg1">
<!-- <view class="containerBg"> -->
<view class="coursePart flexbox" v-if="tabList.length > 1">
<view :class="['item','flexbox',curId == item.id? 'active': '' ]" v-for="(item, index) in tabList"
:key="index" @click="clicklib(item,index)">
<!-- <u-icon v-if="item.isBuy == 0 && curId == item.id" name="lock" color="#258feb" size="28"></u-icon> -->
<!-- <u-icon v-if="item.isBuy == 0 && curId != item.id" name="lock" color="#fff" size="28"></u-icon> -->
<view class="">{{item.title}}</view>
</view>
</view>
<view :class="['courseList',fold ? 'fold' : '']" v-if="courseList.length > 0">
<!-- 目录是否已经购买 -->
<!-- 0:普通 1超级 2医学 3国学 -->
<view class="endBox" v-if="tabList[curIndex].isBuy == 1 && userMsg.vip == '0'">
<view class="" >
<view class="flexbox" v-if="tabList[curIndex].startTime == null">
<text >当前目录还未开始学习</text><uni-tag type="warning" text="去学习" @click="goToLearn()"></uni-tag>
</view>
<view class="flexbox" v-else>
<text >课程观看有效期截止到{{tabList[curIndex].endTime}} </text><uni-tag type="primary" @click="goToLearn()" text="继续学习"></uni-tag>
</view>
</view>
</view>
<view class="item" v-for="(item, index) in courseList" :key="index" @click="chooseChapter(item, index)">
<text>{{item.title}}</text>
<uni-tag v-if="item.isAudition == 1" style="margin-left: 10rpx;" :inverted="true" text="试听"
size="mini" type="primary" />
</view>
</view>
<u-divider v-else text="暂无数据"></u-divider>
<view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
:iconStyle="iconStyle"></u-back-top>
</view>
<!-- </view> -->
<!-- 评论弹出 -->
<public-module></public-module>
<z-navigation></z-navigation>
<!-- <music-play :playData="playData"></music-play> -->
</view>
</view>
</template>
<script>
// import musicPlay from '@/components/music.vue'
import commentsList from '@/components/commentsList.vue'
import emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
import emotion from '@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue';
import $http from '@/config/requestConfig.js';
var clear;
import {
mapState
} from 'vuex';
export default {
data() {
return {
playData: {},
// fixed: false,
bgiStyle: {
background: '#fff'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
userMsg: {}, // 用户信息
scrollTop: 0,
activeStyle: {
color: '#333',
fontWeight: 'bold',
transform: 'scale(1.2)',
// backgroundColor: '#258feb'
},
scrollable: false,
pageTitle: null,
courseList: [],
tabList: [{id:1, name:'我的课程'},{id:2, name:'在学习'},{id:3, name:'已过期'}], // 目录列表
curId: null,
curIndex: 0,
};
},
//第一次加载
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
this.windowWidth = uni.getSystemInfoSync().windowWidth;
// this.pageTitle = e.title
console.log(e, '传入分类id')
this.getUserInfo()
// this.courseId = e.id
// this.getCateList(this.courseId)
// this.getData(e.id)
// this.getSayList()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
if (this.scrollTop > 500) {
this.fixed = true
} else {
this.fixed = false
}
},
computed: {
...mapState(['userInfo'])
},
//页面显示
onShow() {
// 隐藏原生的tabbar
uni.hideTabBar();
},
onReachBottom() {
console.log('触底');
if (this.status != 2) {
this.pPage++
this.getSayList()
}
},
components: {
// musicPlay
emotion,
// commentsList
},
//方法
methods: {
getUserInfo() {
// 用户详情
// if (this.userInfo.id != undefined) {
this.$http
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMsg = res.user
});
// }
},
// 跳转
onPageJump(url,id) {
uni.navigateTo({
url: `${url}?id=${id}`
});
},
},
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.flexbox {
display: flex;
}
.imgcontainer {
background-color: $imgBg;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
<z-nav-bar :title="pageTitle"></z-nav-bar>
<view class="learnBox box" >
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in courseList" :key="index">
<view class="item flexbox" v-for="(item, index) in courseList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
@@ -88,6 +88,12 @@
},
//方法
methods: {
// 跳转
onPageJump(url,thatId,title) {
uni.navigateTo({
url: `${url}?id=${thatId}&title=${title}`
});
},
getData() {
if(!this.flag){
console.log('正在执行,未完成')

View File

@@ -22,10 +22,10 @@
<image src="../../static/my_01.png" mode="aspectFit"></image>
<text>学习大纲</text>
</div>
<div class="item flexbox" @click="onPageJump()">
<!-- <div class="item flexbox" @click="onPageJump()">
<image src="../../static/my_03.png" mode="aspectFit"></image>
<text>太湖讲堂</text>
</div>
</div> -->
<div class="item flexbox" @click="onPageJump()">
<image src="../../static/my_04.png" mode="aspectFit"></image>
<text>吴门医述</text>
@@ -68,7 +68,8 @@
</view>
</view>
<!-- 正在学习 -->
<view class="learnBox" v-if="learnList.length > 0">
<!-- <view class="" style="padding:0 5px;">
<view class="learnBox" >
<view class="titleBox flexbox">
<image src="../../static/learing.png" mode="aspectFit"></image>
<text>正在学习</text>
@@ -92,6 +93,7 @@
</view>
</view>
</view>
</view> -->
<!-- 健康超市 -->
<view class="supermarketBox" v-if="tjProList.length > 0">
<view class="hightLightTitleBox " @click="onPageJump()">
@@ -166,8 +168,6 @@
</view>
</view>
<view class="fourBox" v-if="tryListenList.length > 0">
<view class="learnBox" >
<view class="titleBox flexbox">
<image src="../../static/try_listen.png" mode="aspectFit"></image>
@@ -176,7 +176,8 @@
<view class="learn flexbox shiting">
<view class="item" v-for="(item, index) in tryListenList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
<image v-if="item.image==''" src="@/static/nobg.jpg" mode="aspectFit"></image>
<image v-else :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems flexbox">
<view class="txt555">
@@ -190,7 +191,7 @@
</view>
</view>
<view class="moreBox shiting">
<text @click="onPageJump('/pages/course/tryListen',26,'精彩试听')">更多试听</text>
<text @click="onPageJump('/pages/course/tryListen',1,'精彩试听')">更多试听</text>
</view>
</view>
</view>
@@ -383,8 +384,8 @@
url: "medical/home/getMarketCourseList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"id": 26,
"limit": 2,
"id": 1,
"limit": 6,
"page": 1
},
header: { //默认 无 说明:请求头
@@ -410,7 +411,7 @@
data: {
"current": 1,
"limit": 12,
"medicineMarketId": "29"
"medicineMarketId": "1"
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -476,7 +477,7 @@
data: {
"current": 1,
"limit": 4,
"medicineMarketId": "28"
"medicineMarketId": "2"
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -640,6 +641,7 @@
}
.shiting {
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: 40rpx;

View File

@@ -190,7 +190,8 @@
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0 && res.page.records.length > 0) {
if (res.code == 0) {
if(res.page.records.length > 0){
var _list = res.page.records
this.productList = this.productList.concat(_list)
if (res.page.pages > this.pObj.page) {
@@ -199,7 +200,9 @@
// 加载完毕
this.pObj.status = 2
}
}else{
this.pObj.status = 3
}
}
this.pObj.pFlag = true
}).catch(e => {
@@ -225,7 +228,8 @@
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0 && res.page.records.length > 0) {
if (res.code == 0) {
if( res.page.records.length > 0){
var _list = res.page.records
this.newsList = this.newsList.concat(_list)
if (res.page.pages > this.nObj.page) {
@@ -234,7 +238,9 @@
// 加载完毕
this.nObj.status = 2
}
}else{
this.nObj.status = 3
}
}
this.nObj.nFlag = true
}).catch(e => {
@@ -249,6 +255,7 @@
}
this.tabId = e.id
console.log(e, '点击')
// this.getnewsData()
}
},
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 50 KiB

BIN
static/zhedieBg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 10 KiB

3613
utils/aliplayercomponents.min.js vendored Normal file

File diff suppressed because one or more lines are too long