名医精彩

This commit is contained in:
liuyuan
2025-06-20 17:40:41 +08:00
parent a26581fd81
commit 6dd6e9d213
59 changed files with 12940 additions and 86 deletions

775
pages/curriculum/detail.vue Normal file
View File

@@ -0,0 +1,775 @@
<template>
<view class="commonPageBox commonDetailPage" style="background-color: #fff">
<template v-show="!screenLoading">
<z-nav-bar title="教学内容"></z-nav-bar>
<view
class="contentBox curriculum_box"
:style="`height:calc(100% - ${60 + statusBarHeight}px !important;${
isFullScreen ? 'background:#000' : ''
}`"
>
<view
:style="`background:#000;height:200px;`"
v-if="videoArray.length > 0"
>
<common-video
:isfresh="isfresh"
v-if="isfresh"
:secondCountDown="secondCountDown"
@handleFresh="handleFresh"
@changeScreen="changeScreen"
@changeScreenLoading="changeScreenLoading"
ref="commonVideo"
:currentVideoId="currentVideoId"
:currentVideoIndex="currentVideoIndex"
:curriculumData="{...curriculumData,curriculumImgUrl:options.curriculumImgUrl}"
>
</common-video>
<view style="color: #fff"></view>
</view>
<scroll-view
scroll-y="true"
class="scroll-Y"
>
<view class="" style="padding: 20rpx; font-size: 34rpx; color: #333"
>课程{{ options.navTitle }}
</view>
<view style="padding: 20rpx; margin-bottom: 40rpx">
章节 {{ curriculumData.title }}
</view>
<view
v-if="videoArray.length > 0"
class="PM_font"
style="padding: 20rpx; font-size: 40rpx; color: #294a97"
>视频教学</view
>
<view class="scroll-view-item">
<common-curriculum-video
v-if="videoArray.length > 0"
:detailInfo="curriculumData"
:currentVideo="currentVideo"
:dataList="videoArray"
@open="changeVideo"
>
</common-curriculum-video>
</view>
<view
class="PM_font"
style="padding: 20rpx; font-size: 40rpx; color: #333"
>文章简介</view
>
<view class="scroll-view-item" style="padding-bottom: 80rpx;">
<common-rich-detail :detailInfo="{ ...curriculumData, title: '' }">
<image
v-if="curriculumData.imgUrl"
@click="previewImage(curriculumData.imgUrl)"
:src="curriculumData.imgUrl"
mode="widthFix"
class="headImage"
></image>
</common-rich-detail>
</view>
</scroll-view>
<p class="aui-text-danger">
本课程版权归天津众妙之门科技有限公司所有翻版必究!
</p>
</view>
</template>
<view
style="
background-color: red;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
"
v-show="screenLoading"
>
</view>
</view>
</template>
<script>
import courseDescription from "@/pages/component/commonComponents/list";
import curriculumMp3 from "./mp3Detail.vue";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
components: {
courseDescription, //课程说明
curriculumMp3, //mp3
},
data() {
return {
secondCountDown: 10,
isFullScreen: false,
screenLoading: false,
isfresh: false,
currentCateIndex: 0,
currentVideo: {},
videoList: {},
isOpenMp3: false,
praise: "",
reward: "",
commentLst: [],
correlationiList: [
],
options: {},
videoArrayHW: [],
videoArray: [],
relatedCoursesList: [], //相关课程
medicalCasesList: [], //相关医案
curriculumData: {},
curriculumInfo: {},
fdButtonStyle: {
width: "120rpx",
"border-color": "#000",
color: "#000",
float: "right",
"margin-right": "20rpx",
"margin-left": "30rpx",
},
modalInfo: {},
show: false,
playData: {},
taiHuClassInfo: {},
searchValue: "",
ordersTabs: [
{
name: "视频教学",
type: "1",
},
{
name: "文章简介",
type: "2",
},
], // 一级分类标题1
cateList: [], // 一级分类标题1
twoCateList: [], // 二级分类标题
dataList: [], // 方剂标题
allDataList: [], // 方剂标题
currentStatusIndex: 0, // 当前选中的一级分类
curTwoCateIndex: 0, // 当前选中的二级分类
searchList: [], // 搜索结果数组
showSearchList: false,
userMes: {}, // 用户信息
searchDisable: false, // 搜索不可用
limitShow: false,
limitTitle: "提示",
limitContent: "",
scrollViewHeight: 0,
urlList: {
detail: "sociology/course/getCourseCatalogueChapterDetail",
checkVideo: "sociology/course/checkVideo",
curriculumInfo: "app/phone.do?getCourseInfo",
},
currentVideoId: null,
currentVideoIndex: null,
currentSelectVideoId: null,
currentSelectVideo: {},
};
},
onLoad(options) {
this.options = options;
this.getCourseDescriptionData();
this.screenLoading = false;
this.currentCateIndex = 0;
},
onHide() {},
onShow() {},
computed: {
...mapState(["userInfo"]),
},
watch: {
currentVideoId() {
this.currentVideoIndex = this.videoArray.findIndex(
(e) => e.id == this.currentVideoId,
);
console.log(
"that.currentVideoIndex at line 3401111111111111:",
this.currentVideoIndex,
);
},
},
methods: {
changeScreenLoading(status) {
this.screenLoading = status;
},
changeScreen(status) {
this.isFullScreen = status;
},
ordersTabCLi(data) {
console.log("i at line 312:", data);
this.currentCateIndex = data.index;
this.$forceUpdate();
},
handleFresh(status) {
this.isfresh = status;
this.$forceUpdate();
},
changeVideo(data) {
if (data.id != this.currentVideo.id) {
this.isfresh = false;
this.$nextTick(() => {
this.currentVideo = data;
this.currentVideoId = data.id;
this.isfresh = true;
});
}
},
hancleModalCancel() {
this.show = false;
},
handleClickMore(v, i, status) {
this.$set(this.correlationiList[i], "isOpen", status);
},
hancleModalConfirm() {
var data = {
values: {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
...this.taiHuClassInfo,
},
};
},
async getCourseDescriptionData() {
this.isfresh = false;
var data = {
id: this.options.id,
load: false,
};
var that = this;
$http.request({
url: that.urlList.detail,
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
that.curriculumData = res.data.detail;
that.videoArray = res.data.videos;
if (that.videoArray.length > 0) {
that.currentVideo = that.videoArray[0];
that.currentVideoId = that.videoArray[0].id;
that.isfresh = true;
}
});
},
getPriceData() {
var that = this;
setTimeout(() => {
that.$nextTick(() => {
that.$refs.priceDetail.getData();
});
}, 100);
},
// 检查是有权限使用搜索功能
checkDisable() {},
// 获取用户详情
getUserInfo() {
// 用户详情
if (this.userInfo.id != undefined) {
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
this.userMes = res.user;
this.getCateList();
});
}
},
async handleselectCate(item, index) {
this.dataList = [];
var data = [];
var that = this;
this.$http
.post(this.urlList.curriculumInfo, {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
oid: item.coid,
})
.then(async (res) => {
that.curriculumInfo = res.obj;
that.dataList = res.obj.courseList;
});
this.searchValue = "";
this.searchList = [];
this.showSearchList = false;
return data;
},
async setOneCateIndex(item, index) {
this.allDataList = [];
var that = this;
this.currentStatusIndex = index;
this.searchValue = "";
this.searchList = [];
this.showSearchList = false;
this.$nextTick(async () => {
await that.getCourseDescriptionData();
this.$forceUpdate();
});
},
transformData(inputData) {
const result = {};
inputData.forEach((item) => {
const { letter } = item;
if (!result[letter]) {
result[letter] = [];
}
result[letter].push(item);
});
return result;
},
getCateList(id) {
id ? "" : (id = 0);
this.twoCateList = [];
this.curTwoCateIndex = 0;
},
// 放大图片
previewImage(url) {
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function (res) {
},
},
});
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.searchList {
.item {
font-size: 28rpx;
padding: 20rpx;
border-bottom: 1px solid #dadbde;
}
}
.scroll-view_H {
background-color: #fff;
white-space: nowrap;
padding: 10rpx;
}
.contentBox {
height: 100vh;
.statusList {
padding: 10rpx;
box-sizing: border-box;
justify-content: space-between;
text {
text-align: center;
display: inline-block;
width: 32%;
padding: 20rpx 0;
font-size: 34rpx;
border-radius: 10rpx;
}
.cur {
background-color: $themeColor;
color: #fff;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
}
.twoCateList {
font-size: 28rpx;
margin-top: 20rpx;
.grid-text {
padding: 10rpx 0rpx;
text-align: center;
}
.cur {
color: $themeColor;
}
// .u-grid-list{border: 0.5px solid #dadbde;}
}
.dataList {
font-size: 26rpx;
// margin-top: 20rpx;
// padding: 32rpx 0rpx;
border-radius: 10rpx;
background-color: #f8f9fa;
box-sizing: border-box;
.JFtitleItem {
background-color: #ffffff;
padding: 20rpx 10rpx;
width: 100%;
border-bottom: 0.5px solid #f8f9fa;
}
.wmzhimg {
width: 220rpx;
height: 220rpx;
}
}
}
.search_box {
margin: 0 auto;
overflow: hidden;
align-items: center;
width: calc(100% - 10px);
margin-top: 20rpx;
margin-bottom: 20rpx;
.search {
height: 56upx;
display: flex;
width: 86%;
margin: 0 auto;
align-items: center;
padding: 0upx 40upx;
background-color: #fff;
border-radius: 20upx;
box-shadow: 0 0px 10px 1px $themeColor;
}
.prompt {
color: #838383;
font-size: 24rpx;
}
}
.flexbox {
display: flex;
}
.uni-modal .uni-modal__bd {
text-align: left;
}
.limiTy {
font-size: 28rpx;
line-height: 46rpx;
}
.chImage {
height: 100rpx;
}
.dataList {
height: 100%;
}
.titleList2 {
height: calc(100% - 150rpx);
}
.priceDetail {
height: calc(100% - 180rpx) !important;
padding: 0rpx 0;
box-sizing: border-box;
}
.componentPage {
height: calc(100% - 90rpx) !important;
}
.dateReminder {
width: 100%;
font-size: 24rpx;
text-align: right;
line-height: 40rpx;
}
.fdButtonBox {
border: 1rpx solid $themeColor;
background-color: $themeColor;
color: #fff;
// width: 100%;
float: right;
padding: 4rpx 14rpx;
font-size: 24rpx;
font-weight: 500;
line-height: 30rpx;
border-radius: 10rpx;
box-sizing: border-box;
// margin-top: 20rpx;
// display: flex;
// align-items: center;
}
.headImage {
// height: 400rpx !important;
}
.commonDetailPage {
}
.curriulum_box {
margin-top: 20rpx;
width: 100%;
.curriulum_title_box {
display: flex;
align-items: center;
margin-bottom: 20rpx;
background-color: #fff;
.curriulum_title {
width: calc(100% - 80rpx);
font-size: 32rpx;
line-height: 40rpx;
padding: 20rpx;
box-sizing: border-box;
}
}
}
/deep/.scroll-view-item:nth-child(2n-1) {
background-color: transparent !important;
}
.dataList {
height: auto !important;
}
.small_class_teaching_box {
width: 100%;
margin-top: 20rpx;
background: #b7e0e2;
.small_class_teaching_top {
padding: 20rpx 20rpx 0 10rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
// background: #EDFCF7;
color: #8f8e8e;
// box-shadow: 0px 0px 6rpx 0px #E9DCCC;
.icon1 {
width: 50rpx;
height: 50rpx;
}
.small_class_teaching_top_left {
display: flex;
align-items: center;
color: #018f89;
font-family: MicrosoftYaHei;
}
}
.small_class_teaching_content {
margin-top: 20rpx;
// background: #EDFCF7;
padding-bottom: 10rpx;
.top {
padding: 20rpx 20rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 4rpx solid #fff;
.top_item {
width: 23%;
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
font-weight: normal;
font-size: 34rpx;
color: #018f89;
line-height: 80rpx;
background: #cef8ea;
text-align: center;
border-radius: 10rpx;
box-shadow: 0px 0px 6rpx 0px #e9dccc;
}
}
.schedule {
width: 100%;
overflow: hidden;
padding: 20rpx 20rpx;
box-sizing: border-box;
align-items: center;
color: #018f89;
font-family: MicrosoftYaHei;
.icon_box {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 0rpx;
.icon1 {
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
}
.progress_box {
width: 100%;
display: flex;
align-items: center;
position: relative;
.progress_icon {
width: calc(100% - 240rpx);
}
.icon1 {
width: 60rpx;
height: 60rpx;
margin: 0 20rpx;
}
.icon2 {
width: 140rpx;
height: 100rpx;
position: absolute;
right: 0;
// margin-top: -20rpx;
}
}
}
}
}
.related_courses_box {
background-color: #fff;
.small_class_teaching_content {
padding: 10rpx 20rpx;
box-sizing: border-box;
}
}
.related_courses_name {
display: inline-block;
width: calc(100% - 150rpx) !important;
.aui-text-danger {
display: inline-block;
float: right;
}
}
.curriculum_box {
.curriculum_title {
padding: 20rpx 40rpx 0;
font-size: 38rpx;
line-height: 66rpx;
font-weight: bold;
text-align: center;
box-sizing: border-box;
margin-bottom: 20rpx;
}
}
.aui-text-danger{
width:100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
position: fixed;
bottom: 0rpx;
background: #fff;
}
.curriculum_content {
background-color: #fff;
padding-bottom: 40rpx;
.richDetail {
height: auto !important;
margin-bottom: 20rpx;
}
}
.dianzan_box {
width: calc(100% - 80rpx);
margin: 0 auto;
padding: 20rpx 20rpx;
color: #6e6e6e;
font-weight: 600;
text-align: justify;
background: #f4fffb;
border-radius: 10rpx;
box-shadow: 0px 0px 6rpx 0px #e9dccc;
}
.dashang_box {
color: #ff5521;
background: #fff7f4;
box-shadow: 0px 0px 6rpx 0px rgba(255, 85, 33, 0.4);
}
.correlation_box {
background-color: #fff;
padding-bottom: 40rpx;
.title {
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
font-weight: normal;
font-size: 40rpx;
color: #018f89;
}
.more {
font-size: 24rpx;
}
.close {
text-align: center;
color: #b0b0b0;
line-height: 40rpx;
margin-top: 10rpx;
// padding-bottom: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>

1394
pages/curriculum/index.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,226 @@
<template>
<view class="commonPageBox commonDetailPage">
<z-nav-bar title="我的课程" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view class="cateList flexbox" :style="`top: ${45 + statusBarHeight}px;`">
<common-sticky itemStyle="width: 50%; height: 68rpx;font-size:24rpx;" :list="ordersTabs" label="name"
:currentCateIndex="currentCateIndex" @handleselectCate="ordersTabCLi"></common-sticky>
</view>
<view class="list_block">
<view class="list_item"
v-for="(item, index) in dataList" :key="index"
v-if="dataList&&dataList.length>0"
@click="goToDetail(item)"
>
<view class="list_item_image">
<image v-if="item.image" :src="item.image" mode="aspectFit"></image>
<text class="image_null" v-else>暂无封面图</text>
</view>
<view class="list_item_right">
<view class="list_item_title">{{item.title}}</view>
<view class="list_item_content" v-html="item.content"></view>
</view>
</view>
<text v-if="statusNull" class="text_null">暂无数据</text>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
export default {
data(){
return {
ordersTabs: [{
name: "我的课程",
value: 0,
},
{
name: "过期课程",
value: 1,
}
],
currentCateIndex: 0,
dataList: [], //列表数据
timer: null,
statusNull: null, //暂无数据显示
current: 1,
limit: 10
}
},
onShow(){
},
onLoad() {
//我的课程
this.getMyList();
},
methods: {
//我的课程数据
getMyList(){
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'taihumed/course/getMyCourseList',
method: "POST",
data: {
current: this.current,
limit: this.limit
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if (res.code == 0) {
uni.hideLoading();
if(res.pageRes.records&&res.pageRes.records.length>0){
this.dataList = res.pageRes.records;
}else{
this.dataList = [];
this.statusNull =true;
}
}
});
},
//过期课程数据
getExpireList(){
this.dataList = [];
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'taihumed/course/getCourseExpire',
method: "POST",
data: {},
header: {
"Content-Type": "application/json",
},
})
.then(res => {
if (res.code == 0) {
uni.hideLoading();
if(res.courseList&&res.courseList.length>0){
this.dataList = res.courseList;
}else{
this.dataList = [];
this.statusNull =true;
}
}
});
},
//切换tab状态
ordersTabCLi(data, index) {
this.dataList = [];
this.statusNull = null;
this.currentCateIndex = index;
if(index==0){
this.getMyList();
}else if(index==1){
this.getExpireList();
}
},
//跳转课程详情
goToDetail(item) {
uni.navigateTo({
url: `/pages/curriculum/index?navTitle=${item.title}&title=${item.title}&id=${item.id}`,
});
},
},
}
</script>
<style lang="scss">
.commonPageBox{
background: #eff5f8;
height: 100vh;
}
.cateList {
width: 100%;
}
.flexbox {
position: fixed;
left: 0;
z-index: 9999;
}
.list_block{
padding: 20rpx 20rpx 0;
margin-top: 70rpx;
}
.list_item{
position: relative;
background: #fff;
box-shadow: 0px 0px 10px 0px #a7bbe4;
padding: 30rpx 20rpx 30rpx;
margin-bottom: 20rpx;
display: flex;
border-radius: 10rpx;
}
.list_item_bt{
padding: 30rpx 20rpx 70rpx;
}
.list_item_image,.image_null{
width: 250rpx;
height: 220rpx;
background-color: rgba(125, 193, 240, 0.1);
display: flex;
justify-content: center;
align-items: center;
}
.list_item_image image{
width: 100%;
}
.list_item_right{
margin-left: 30rpx;
width: calc(100% - 250rpx);
}
.list_item_title{
font-size: 30rpx;
line-height: 36rpx;
font-weight: bold;
color: #333;
}
.list_item_content{
margin-top: 15rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #999;
max-height: 108rpx;
overflow: hidden;
}
.list_item_study{
line-height: 48rpx;
position: absolute;
right: 20rpx;
bottom: 30rpx;
background: #7dc1f0;
color: #fff;
border-radius: 40rpx;
font-size: 24rpx;
padding: 0 20rpx;
}
.list_item_study_out{
line-height: 48rpx;
position: absolute;
right: 20rpx;
bottom: 30rpx;
background: #294a97;
color: #fff;
border-radius: 40rpx;
font-size: 24rpx;
padding: 0 20rpx;
}
.text_null{
display: block;
width: 100%;
text-align: center;
font-size: 26rpx;
color: #999;
margin: 150rpx 0;
}
.image_null{
color: #999;
font-size: 22rpx;
}
</style>

1482
pages/curriculum/index3.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,354 @@
<template>
<view
class="container commonPageBox commonDetailPage"
style="position: relative; height: auto"
>
<video
@timeupdate="videoTimeUpdateEvent($event)"
ref="videos"
style="width: 100%; height: 60rpx"
autoplay
id="videoId"
controls
:show-progress="true"
:show-fullscreen-btn="false"
object-fit="contain"
class="video-box"
:src="videoUrl"
:poster="`${videoUrl}?x-oss-process=video/snapshot,t_${1},f_jpg`"
@play="playVideo"
></video>
<!-- 倍速 -->
<view class="play-rate" @click="videoPlayRate" v-if="showRate">{{ playbackRate }}x</view>
<!-- 倍速菜单 -->
<ul class="play-rate-menu" :style="{ height: height }" v-if="showRateMenu">
<li
v-for="item in playbackRates"
:key="item"
:class="[{ activeRate: playbackRate === item }, 'play-rate-item']"
@click="changePlayRate(item)"
>
{{ item }}x
</li>
</ul>
</view>
</template>
<script>
import courseDescription from "@/pages/component/commonComponents/list";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
components: {
courseDescription, //课程说明
},
data() {
return {
playbackRate: 1, // 初始播放速率
showRateMenu: false, //显示播放速率
speedState: 1,
timer: null,
videoUrl: "",
currentTime: 0,
firstTime: 0,
options: {},
videoData: {},
isSetFirstTime: false,
currentVideoTime: "", //初始播放时长(秒)
urlList: {
detail: "sociology/course/getCourseCatalogueChapterDetail",
curriculumInfo: "app/phone.do?getCourseInfo",
},
};
},
async onUnload() {
this.timer = null;
// #ifdef APP-PLUS
uni.navigateTo({
url: "/pages/curriculum/order/back",
});
plus.screen.lockOrientation("portrait-primary"); //锁死屏幕方向为竖屏
// #endif
await this.setVideoTime();
},
onLoad(options) {
},
onHide() {
},
computed: {
...mapState(["userInfo"]),
},
methods: {
// 显示倍速
videoPlayRate() {
this.showRateMenu = true
},
// 点击倍速
changePlayRate(rate) {
this.playbackRate = rate
this.videoPlayer.playbackRate(rate)
this.showRateMenu = false
this.hideControls()
},
// 创建倍速按钮
createPlayRateDOM() {
const playRateDom = document.createElement('div')
playRateDom.className = 'full-play-rate'
playRateDom.innerText = `${this.playbackRate}x`
playRateDom.onclick = () => {
const playRateMenuDom = document.querySelector('.full-play-rate-menu')
playRateMenuDom.style.display = 'block'
}
return playRateDom
},
// 创建倍速菜单
createPlayRateMenuDom() {
const playRateMenuDom = document.createElement('ul')
playRateMenuDom.className = `play-rate-menu full-play-rate-menu`
playRateMenuDom.style.height = this.windowWidth + 'px'
playRateMenuDom.style.display = 'none'
let liStr = ''
this.playbackRates.forEach((item) => {
liStr += `
<li class="${this.playbackRate === item ? 'activeRate' : ''} play-rate-item full-play-rate-item">
${item}x
</li>
`
})
playRateMenuDom.innerHTML = liStr
return playRateMenuDom
},
handleSetSpeedRate(rate) {
console.log("rate at line 125:", rate);
let videoContext = uni.createVideoContext("videoId");
videoContext.playbackRate(rate);
speedRate.value = rate;
},
init(options) {
this.options = JSON.parse(options.data);
this.getLive();
this.timer = setInterval(() => {
var that = this;
if (this.currentTime) {
that.setVideoTime();
}
}, 60000 * 10);
},
// 播放进度改变
videoTimeUpdateEvent(e) {
console.log("e at line 78:", e);
this.playTime = parseInt(e.detail.currentTime);
this.allTime = parseInt(e.detail.duration);
this.recordTime({
time: this.playTime,
});
},
recordTime(data) {
this.currentTime = data.time;
console.log("data at line 54:", data);
var list = [];
if (uni.getStorageSync("videoList")) {
list = JSON.parse(uni.getStorageSync("videoList"));
}
console.log("点击后设置播放时长的方法list at line 65:", list);
var index = list.findIndex((e) => e.id == this.videoData.id);
if (list.length > 0 && index >= 0) {
list[index] = {
...this.videoData,
time: data.time,
};
} else {
list.push({
...this.videoData,
time: data.time,
});
}
uni.setStorageSync("videoList", JSON.stringify(list));
},
//是否全屏
fullscreenchange(e) {
if (!e.target.fullScreen) {
uni.navigateBack({
delta: 1,
});
}
},
getData(data) {
if (!this.isSetFirstTime) {
var netWork = this.videoData.userCourseVideoPositionEntity
? this.videoData.userCourseVideoPositionEntity.position
: 0;
var list = [];
if (uni.getStorageSync("videoList")) {
list = JSON.parse(uni.getStorageSync("videoList"));
}
var index = list.findIndex((e) => e.id == this.videoData.id);
if (netWork) {
if (index >= 0) {
this.firstTime =
list[index].time > netWork ? list[index].time : netWork;
} else {
this.firstTime = netWork ? netWork : 0;
}
} else {
if (index >= 0) {
this.firstTime = list[index].time ? list[index].time : 0;
} else {
this.firstTime = 0;
}
}
uni.setStorageSync("videoList", JSON.stringify(list));
this.playVideo();
this.isSetFirstTime = true;
}
},
setVideoTime(time) {
var data = {
videoId: this.videoData.id,
position: this.currentTime, //秒数
};
$http
.request({
url: `sociology/course/saveCoursePosition`,
method: "Post",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
this.$forceUpdate();
});
},
playVideo(e) {
this.videoContext = uni.createVideoContext("videoId", this);
this.videoContext.seek(this.firstTime);
},
async getLive() {
var data = {
...this.options,
};
console.log("data at line 57:", data);
$http
.request({
url: `sociology/course/checkVideo`,
method: "Post",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
console.log("res at line 252:", res);
this.videoData = res.video;
this.videoUrl =
res.video.videoUrl;
this.$nextTick(async () => {
await this.getData();
});
this.$forceUpdate();
});
},
hancleModalCancel() {
this.show = false;
},
handleClickMore(v, i, status) {
this.$set(this.correlationiList[i], "isOpen", status);
},
hancleModalConfirm() {
var data = {
values: {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
...this.taiHuClassInfo,
},
};
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
};
</script>
<style lang="scss" scoped>
.video-box {
position: relative;
}
.image_box {
background-color: red;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.speed {
position: absolute;
right: 20rpx;
top: 16rpx;
.doubleSpeed {
color: #fff;
font-size: 14rpx;
background-color: rgba(0, 0, 0, 0.6);
padding: 4rpx 6rpx;
}
}
// 倍速的蒙版
.speedModal {
background-color: rgba(0, 0, 0, 0.7);
}
.speedNumBox {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
background-color: #2c2c2c;
width: 120rpx;
position: absolute;
right: 0rpx;
top: 0;
.number {
width: 120rpx;
font-weight: 700;
font-size: 14rpx;
padding: 18rpx 0;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.active {
color: red;
}
.noActive {
color: #fff;
}
}
</style>