mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 09:56:45 +08:00
Merge branch 'stat' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/mobile into stat
This commit is contained in:
7
App.vue
7
App.vue
@@ -93,7 +93,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
uni-toast .uni-toast{
|
||||||
|
img{
|
||||||
|
width: 38px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
/**统一样式*/
|
/**统一样式*/
|
||||||
.fixed-field{
|
.fixed-field{
|
||||||
width: 180px;
|
width: 180px;
|
||||||
|
|||||||
@@ -347,11 +347,11 @@
|
|||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.list-box-index:nth-child(2){
|
.list-box-index:nth-child(2){
|
||||||
background: url(../../static/images/ranking/list-or.png) no-repeat 100% / 100%;
|
background: url(../../static/images/ranking/list-pink.png) no-repeat 100% / 100%;
|
||||||
background-position: 0 -1px;
|
background-position: 0 -1px;
|
||||||
}
|
}
|
||||||
.list-box-index:nth-child(3){
|
.list-box-index:nth-child(3){
|
||||||
background: url(../../static/images/ranking/list-pink.png) no-repeat 100% / 100%;
|
background: url(../../static/images/ranking/list-or.png) no-repeat 100% / 100%;
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.list-box-index{
|
.list-box-index{
|
||||||
|
|||||||
BIN
components/video-player/images/back.png
Normal file
BIN
components/video-player/images/back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 537 B |
BIN
components/video-player/images/full.png
Normal file
BIN
components/video-player/images/full.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 518 B |
BIN
components/video-player/images/pause.png
Normal file
BIN
components/video-player/images/pause.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 385 B |
BIN
components/video-player/images/play.png
Normal file
BIN
components/video-player/images/play.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 532 B |
@@ -1,62 +1,128 @@
|
|||||||
<template>
|
<template>
|
||||||
<video id="myVideo" style="width: 100%;"
|
<view id="xvideoPlayer-box" class="video-box">
|
||||||
:src="fileBaseUrl+coursewareInfo.content.content"
|
<video id="xvideoPlayer" style="width: 100%;"
|
||||||
@error="videoErrorCallback"
|
:src="url"
|
||||||
:initial-time="videoPlayingTime"
|
:controls="false"
|
||||||
@play="onPlayerPlay"
|
:enable-play-gesture="false"
|
||||||
@pause="onPlayerPause"
|
:initial-time="initPlayingTime"
|
||||||
@ended="onPlayerEnded"
|
@error="onError"
|
||||||
@timeupdate="onPlayerPlaying"
|
@touchend="onTouchend"
|
||||||
@fullscreenchange="onFullScreen"
|
@play="onPlay"
|
||||||
controls>
|
@pause="onPause"
|
||||||
<view class='process-container'>
|
@ended="onEnded"
|
||||||
<view class="video-controls-play">
|
@timeupdate="onTimeUpdate"
|
||||||
<image :src="palyFlag ? '../../static/img/start.png' : '../../static/img/pause.png'" class='video-controls-icon' @click='videoOpreation'/>
|
@fullscreenchange="onFullScreen"
|
||||||
|
@loadeddata="onLoad"
|
||||||
|
@loadedmetadata="onMetaLoad"
|
||||||
|
@controlstoggle="onControlsToggle"
|
||||||
|
></video>
|
||||||
|
<view id="xplayer-control" >
|
||||||
|
<view class="process-container" v-if="contrlShow">
|
||||||
|
<view class="controller-play">
|
||||||
|
<image :src="require(playing? './images/pause.png':'./images/play.png')" @click.stop='videoOpreation'/>
|
||||||
|
</view>
|
||||||
|
<view class="currtime">{{currtime}}</view>
|
||||||
|
<view class='slider-container'>
|
||||||
|
<slider :disabled="!drag" @change.stop="sliderChange" @changing="sliderChanging" step="1" :value="sliderValue" backgroundColor="#9f9587" activeColor="#d6d2cc" block-color="#FFFFFF" block-size="12"/>
|
||||||
|
</view>
|
||||||
|
<view class="druationTime">{{druationTime}}</view>
|
||||||
|
<view class="druationTime">
|
||||||
|
<view id="myVideoSpeed" class="player-speed btn-speed">
|
||||||
|
<view @click="showSpeedCtrl">{{videoSpeed === 1 ? '倍速' : `${videoSpeed}x`}}</view>
|
||||||
|
<view class="speed-control" v-if="speedListShow">
|
||||||
|
<view class="speed-control-list">
|
||||||
|
<view class="li"
|
||||||
|
v-for="item in speedList"
|
||||||
|
:key="item"
|
||||||
|
@click="changeSpeed(item)"
|
||||||
|
:data-value="item"
|
||||||
|
:class="{'current': videoSpeed === Number(item)}">
|
||||||
|
{{ item }}x
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="controller-screen">
|
||||||
|
<image :src="require(fullScreenFlag? './images/back.png':'./images/full.png')" @click.stop='fullScreen'/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="currtime">{{currtime}}</view>
|
|
||||||
<view class='slider-container'>
|
|
||||||
<slider @change="sliderChange" @changing="sliderChanging" step="1" :value="sliderValue" backgroundColor="#9f9587" activeColor="#d6d2cc" block-color="#FFFFFF" block-size="16rpx"/>
|
|
||||||
</view>
|
|
||||||
<view class="druationTime">{{druationTime}}</view>
|
|
||||||
<image :src="fullScreenFlag ? '../../static/img/videoBack.png' : '../../static/img/fullScreen.png'" class='video-controls-icon' @click='videoAllscreen'></image>
|
|
||||||
</view>
|
</view>
|
||||||
</video>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapGetters} from 'vuex'
|
||||||
|
import studyUtil from '@/utils/study.js';
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
url:{
|
url:{
|
||||||
type: String,
|
type: String,
|
||||||
require: true
|
require: true
|
||||||
},
|
},
|
||||||
initTime:{//默认播放的位置,第几秒
|
watermark:{
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
name:{
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
drag:{
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
inittime:{//默认播放的位置,第几秒
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fullScreenFlag: false,
|
contrlShow:false,//是否显示控制条
|
||||||
currtime:'00:00:00',//当前播放时间 字符串 计算后
|
contrlShowTimeout:null,//显示控制条句柄
|
||||||
druationTime:'00:00:00',//总时间 字符串 计算后
|
videoContext:null,//播放器
|
||||||
bool:false,
|
fullScreenFlag: false,//是否全屏
|
||||||
|
currtime:'00:00',//当前播放时间 字符串 计算后
|
||||||
|
druationTime:'00:00',//总时间 字符串 计算后
|
||||||
|
initPlayingTime:0,//指定播放的时间位置
|
||||||
sliderValue: 0, //控制进度条slider的值,
|
sliderValue: 0, //控制进度条slider的值,
|
||||||
updateState: false, //防止视频播放过程中导致的拖拽失效
|
updateState: true, //防止视频播放过程中导致的拖拽失效
|
||||||
palyFlag:false,
|
playing:false,//是否在播放中
|
||||||
|
curVideo:{
|
||||||
|
duration:0
|
||||||
|
},
|
||||||
|
touchNum:0,
|
||||||
|
speedListShow:false,
|
||||||
|
speedList:["2.0", "1.5", "1.25", "1.0", "0.75", "0.5"],
|
||||||
|
videoSpeed: 1.0, // 当前倍速:
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo']),
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
url(newVal,oldVal){
|
||||||
|
this.videoContext.stop();
|
||||||
|
this.playing=false;
|
||||||
|
},
|
||||||
|
inittime(newVal,oldVal){
|
||||||
|
this.initPlayingTime=newVal;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initPlayingTime=this.inittime;
|
||||||
|
this.videoContext=uni.createVideoContext("xvideoPlayer", this);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// video_back: function (e) {
|
|
||||||
// this.fullScreenFlag ? this.videoContext.requestFullScreen() : this.videoContext.exitFullScreen();
|
|
||||||
// // this.fullScreenFlag ? this.bool=false : this.bool=true;
|
|
||||||
// this.fullScreenFlag= !this.fullScreenFlag;
|
|
||||||
// },
|
|
||||||
// 全屏+退出全屏
|
// 全屏+退出全屏
|
||||||
videoAllscreen(e) {
|
fullScreen(){
|
||||||
this.fullScreenFlag ? this.videoContext.exitFullScreen() : this.videoContext.requestFullScreen();
|
if(this.fullScreenFlag){
|
||||||
// this.fullScreenFlag ? this.bool=true : this.bool=false;
|
this.videoContext.exitFullScreen();
|
||||||
this.fullScreenFlag=!this.fullScreenFlag;
|
this.fullScreenFlag=false;
|
||||||
|
}else{
|
||||||
|
this.videoContext.requestFullScreen();
|
||||||
|
this.fullScreenFlag=true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 根据秒获取时间
|
// 根据秒获取时间
|
||||||
formatSeconds(a) {
|
formatSeconds(a) {
|
||||||
@@ -73,14 +139,29 @@
|
|||||||
return "00:00";
|
return "00:00";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
changeSpeed(e) {
|
||||||
|
// 获取选择的倍速
|
||||||
|
let value = e;
|
||||||
|
this.videoSpeed = Number(value);
|
||||||
|
this.videoContext.playbackRate(this.videoSpeed);
|
||||||
|
studyUtil.setVideoSpeed(this.videoSpeed);
|
||||||
|
this.speedListShow=false;
|
||||||
|
},
|
||||||
|
showSpeedCtrl(){
|
||||||
|
if(this.speedListShow){
|
||||||
|
this.speedListShow=false;
|
||||||
|
}else{
|
||||||
|
this.speedListShow=true;
|
||||||
|
}
|
||||||
|
},
|
||||||
//开始+暂停
|
//开始+暂停
|
||||||
videoOpreation() {
|
videoOpreation() {
|
||||||
this.palyFlag ? this.videoContext.play() : this.videoContext.pause();
|
this.playing ? this.videoContext.pause() : this.videoContext.play();
|
||||||
this.palyFlag= !this.palyFlag;
|
this.playing= !this.playing;
|
||||||
},
|
},
|
||||||
// 播放进度变化时触发,event.detail = {currentTime, duration} 。触发频率 250ms 一次
|
// 播放进度变化时触发,event.detail = {currentTime, duration} 。触发频率 250ms 一次
|
||||||
videoUpdate(e) {
|
videoUpdate(e) {
|
||||||
let duration=this.live.liveRoomRecordList[0].duration;
|
let duration=this.curVideo.duration;
|
||||||
let sliderValue = e.detail.currentTime / duration * 100;
|
let sliderValue = e.detail.currentTime / duration * 100;
|
||||||
let second=sliderValue / 100 * duration;
|
let second=sliderValue / 100 * duration;
|
||||||
if (this.updateState) { //判断拖拽完成后才触发更新,避免拖拽失效
|
if (this.updateState) { //判断拖拽完成后才触发更新,避免拖拽失效
|
||||||
@@ -88,8 +169,9 @@
|
|||||||
}else{
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
this.druationTime = this.formatSeconds(duration);
|
this.druationTime = this.formatSeconds(duration);
|
||||||
this.currtime = this.formatSeconds(second);
|
//console.log(this.druationTime,'this.druationTime');
|
||||||
|
this.currtime = this.formatSeconds(second);
|
||||||
},
|
},
|
||||||
//拖动过程中触发的事件
|
//拖动过程中触发的事件
|
||||||
sliderChanging(e) {
|
sliderChanging(e) {
|
||||||
@@ -98,7 +180,7 @@
|
|||||||
},
|
},
|
||||||
// 拖动slider完成后触发
|
// 拖动slider完成后触发
|
||||||
sliderChange(e) {
|
sliderChange(e) {
|
||||||
var duration=this.live.liveRoomRecordList[0].duration;
|
var duration=this.curVideo.duration;
|
||||||
var second=e.detail.value / 100 * duration;
|
var second=e.detail.value / 100 * duration;
|
||||||
if (duration) { //完成拖动后,计算对应时间并跳转到指定位置
|
if (duration) { //完成拖动后,计算对应时间并跳转到指定位置
|
||||||
this.videoContext.seek(second);
|
this.videoContext.seek(second);
|
||||||
@@ -106,58 +188,171 @@
|
|||||||
this.updateState= true //完成拖动后允许更新滚动条
|
this.updateState= true //完成拖动后允许更新滚动条
|
||||||
this.druationTime = this.formatSeconds(duration);
|
this.druationTime = this.formatSeconds(duration);
|
||||||
this.currtime = this.formatSeconds(second);
|
this.currtime = this.formatSeconds(second);
|
||||||
}
|
}
|
||||||
else { }
|
},
|
||||||
|
onFullScreen(e) {
|
||||||
|
this.fullScreenFlag=e.detail.fullScreen;
|
||||||
|
let divId='videowatermark';//水印
|
||||||
|
let full=e.detail.fullScreen;
|
||||||
|
let divControlId='xplayer-control';
|
||||||
|
let box=document.getElementById('xvideoPlayer-box');
|
||||||
|
let control=document.getElementById(divControlId);
|
||||||
|
let $this=this;
|
||||||
|
setTimeout(() => {
|
||||||
|
var div = document.getElementById("xvideoPlayer");
|
||||||
|
var div1 = div.firstChild;
|
||||||
|
//水印
|
||||||
|
if(full){
|
||||||
|
if($this.watermark){
|
||||||
|
var div3 = document.createElement("div");
|
||||||
|
div3.id =divId;
|
||||||
|
div3.setAttribute("class", "fullmark");
|
||||||
|
div3.innerHTML='';
|
||||||
|
for(var i=0;i<4;i++){
|
||||||
|
div3.innerHTML+='<div style="color:#ffffff;width: 40%;height: 155px;padding-left:60px;padding-top:50px; display: flex;justify-content: center; transform: rotate(-36deg);font-size:20px;">'+$this.userInfo.name+$this.userInfo.code+'</div>';
|
||||||
|
}
|
||||||
|
div3.style.cssText = "position:absolute;pointer-events: none; width: 100%;height: 100%;top:0;left:0;bottom: 0;right: 0; display: flex;justify-content: center;flex-wrap: wrap;overflow: hidden; opacity:0.3;padding-top:10px";
|
||||||
|
div1.appendChild(div3);
|
||||||
|
|
||||||
|
}
|
||||||
|
//添加控制条
|
||||||
|
div1.appendChild(control);
|
||||||
|
}else{
|
||||||
|
var hasControlDiv=div1.querySelector("#"+divControlId);
|
||||||
|
if(hasControlDiv){
|
||||||
|
box.appendChild(hasControlDiv);
|
||||||
|
}
|
||||||
|
if($this.watermark){
|
||||||
|
var markDiv=div1.querySelector("#"+divId);
|
||||||
|
if(markDiv){
|
||||||
|
div1.removeChild(markDiv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},200);
|
||||||
|
this.$emit('fullscreenchange',e);
|
||||||
|
//this.fullScreenFlag ? this.videoContext.exitFullScreen() : this.videoContext.requestFullScreen();
|
||||||
|
// this.fullScreenFlag ? this.bool=true : this.bool=false;
|
||||||
|
//this.fullScreenFlag=!this.fullScreenFlag;
|
||||||
|
},
|
||||||
|
onError(e){
|
||||||
|
console.log(e,'播放错误');
|
||||||
|
this.$emit('error',e);
|
||||||
|
},
|
||||||
|
onTouchend(e){
|
||||||
|
if(this.contrlShowTimeout!=null){
|
||||||
|
window.clearTimeout(this.contrlShowTimeout);
|
||||||
|
}
|
||||||
|
if(!this.fullScreenFlag){
|
||||||
|
this.contrlShow=!this.contrlShow;
|
||||||
|
}else{
|
||||||
|
if(!this.contrlShow){
|
||||||
|
this.contrlShow=show;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// this.onPlayerPause()
|
||||||
|
// this.touchNum ++
|
||||||
|
// let $this=this;
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// if($this.touchNum == 1){
|
||||||
|
// // console.log('单击')
|
||||||
|
// }else if($this.touchNum >= 2){
|
||||||
|
// if($this.playing){
|
||||||
|
// $this.onPause()
|
||||||
|
// } else {
|
||||||
|
// $this.onPlay()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// this.touchNum = 0
|
||||||
|
// },250)
|
||||||
|
},
|
||||||
|
onLoad(e){
|
||||||
|
this.contrlShow=false;
|
||||||
|
this.$emit('loadeddata',e);
|
||||||
|
},
|
||||||
|
onMetaLoad(e){
|
||||||
|
this.curVideo.duration=Number(e.detail.duration);
|
||||||
|
this.druationTime = this.formatSeconds(this.curVideo.duration);
|
||||||
|
this.contrlShow=true;
|
||||||
|
this.$emit('loadedmetadata',e);
|
||||||
|
},
|
||||||
|
onControlsToggle(e){
|
||||||
|
console.log(e,"ControlsToggle");
|
||||||
},
|
},
|
||||||
// 开始
|
// 开始
|
||||||
contrPlay(){
|
onPlay(){
|
||||||
this.videoContext.play();
|
this.videoContext.play();
|
||||||
this.palyFlag=false;
|
this.playing=true;
|
||||||
|
let $this=this;
|
||||||
|
if(this.contrlShow){
|
||||||
|
this.contrlShowTimeout=window.setTimeout(function(){
|
||||||
|
$this.contrlShow=false;
|
||||||
|
},5000);
|
||||||
|
}
|
||||||
|
this.$emit('play')
|
||||||
},
|
},
|
||||||
// 暂停
|
onTimeUpdate(e){
|
||||||
pause() {
|
this.videoUpdate(e);
|
||||||
this.videoContext.pause(); //站厅播放
|
this.$emit('timeupdate',e)
|
||||||
this.palyFlag=true;
|
|
||||||
},
|
},
|
||||||
stop(){
|
onPause() {
|
||||||
this.videoContext.stop(); //
|
this.playing=false;
|
||||||
|
this.$emit('pause')
|
||||||
|
},
|
||||||
|
onEnded(){
|
||||||
|
this.playing=false;
|
||||||
|
this.$emit('ended')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.process-container{
|
.video-box{
|
||||||
width:100%;
|
width: 100%;
|
||||||
padding:1% 2% 1% 2%;
|
height: 100%;
|
||||||
height:60rpx;
|
position: relative;
|
||||||
max-height:60rpx;
|
}
|
||||||
position:absolute;
|
.screen{
|
||||||
bottom:40rpx;
|
position: relative;
|
||||||
left:0;
|
}
|
||||||
right:0;
|
.screen-full{
|
||||||
z-index:13;
|
position:static;
|
||||||
display:flex;
|
}
|
||||||
align-items: center;
|
.process-container{
|
||||||
background:rgba(59, 57, 57, 0.2);
|
width:100%;
|
||||||
|
padding:1% 2% 1% 2%;
|
||||||
|
height:60rpx;
|
||||||
|
max-height:60rpx;
|
||||||
|
position:absolute;
|
||||||
|
bottom:0rpx;
|
||||||
|
color:#ffffff;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
z-index:9999;
|
||||||
|
display:flex;
|
||||||
|
align-items: center;
|
||||||
|
background:rgba(59, 57, 57, 0.2);
|
||||||
}
|
}
|
||||||
.process-container image{
|
.process-container image{
|
||||||
display:inline-block;
|
max-width:30rpx;
|
||||||
flex:1;
|
max-height:30rpx;
|
||||||
max-width:50rpx;
|
text-align:center;
|
||||||
max-height:50rpx;
|
|
||||||
text-align:center;
|
|
||||||
}
|
}
|
||||||
.slider-container{
|
.slider-container{
|
||||||
z-index:13;
|
z-index:13;
|
||||||
height:60rpx;
|
height:60rpx;
|
||||||
margin-bottom:10rpx;
|
margin-bottom:10rpx;
|
||||||
flex:6;
|
flex:6;
|
||||||
max-width:58%;
|
max-width:50%;
|
||||||
}
|
}
|
||||||
.video-controls-play{
|
.controller-play{
|
||||||
width: 8%;
|
width: 8%;
|
||||||
}
|
}
|
||||||
|
.controller-screen{
|
||||||
|
width: 10%;
|
||||||
|
}
|
||||||
.currtime{
|
.currtime{
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@@ -174,18 +369,45 @@
|
|||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.video_back{
|
.player-speed{
|
||||||
display:block;
|
position: relative;
|
||||||
width:60rpx;
|
color: #e5e5e5;
|
||||||
height:60rpx;
|
padding: 0 0.4rem;
|
||||||
left:5rpx;
|
transition: color 0.3s;
|
||||||
top:15rpx;
|
height: 22px;
|
||||||
position:absolute;
|
|
||||||
text-align:center;
|
|
||||||
z-index:19;
|
|
||||||
}
|
}
|
||||||
.video_back image{
|
.btn-speed:hover .speed-control {
|
||||||
width:44rpx;
|
// visibility: visible;
|
||||||
height:44rpx;
|
}
|
||||||
|
.speed-control {
|
||||||
|
position: absolute;
|
||||||
|
//top: 180px;
|
||||||
|
transition: visibility 0.3s;
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list {
|
||||||
|
list-style: none;
|
||||||
|
color: #e5e5e5;
|
||||||
|
width: 50px;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0px 0px 0px 5px;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba(21, 21, 21, 0.8);
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list .li {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list .li:hover {
|
||||||
|
color: #fff;
|
||||||
|
background: rgba(99, 99, 99, 0.8);
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list .li.current {
|
||||||
|
color: var(--primaryColor);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if(process.env.NODE_ENV === 'development'){
|
|||||||
oldApiBaseUrl = '/uboeApi';
|
oldApiBaseUrl = '/uboeApi';
|
||||||
statApiBaseUrl='/statApi';
|
statApiBaseUrl='/statApi';
|
||||||
socialApiBaseUrl='/socialApi';
|
socialApiBaseUrl='/socialApi';
|
||||||
fileUrl = 'http://192.168.0.11:9090/cdn/upload';
|
fileUrl = 'http:/192.168.0.11:9090/cdn/upload';
|
||||||
loginPath='/pages/login/login';
|
loginPath='/pages/login/login';
|
||||||
}else if(process.env.NODE_ENV === 'preview'){
|
}else if(process.env.NODE_ENV === 'preview'){
|
||||||
// 预发布环境,当前配置未使用上
|
// 预发布环境,当前配置未使用上
|
||||||
@@ -40,8 +40,8 @@ if(process.env.NODE_ENV === 'development'){
|
|||||||
oldApiBaseUrl = '/uboeApi';
|
oldApiBaseUrl = '/uboeApi';
|
||||||
statApiBaseUrl='/statApi';
|
statApiBaseUrl='/statApi';
|
||||||
socialApiBaseUrl='/socialApi';
|
socialApiBaseUrl='/socialApi';
|
||||||
fileUrl = 'https://u.boe.com/upload';
|
fileUrl = 'https://u-pre.boe.com/upload';
|
||||||
loginPath='https://u.boe.com/m/loginuser';
|
loginPath='https://u-pre.boe.com/m/loginuser';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -66,15 +66,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{"path" : "pages/plus/addQuestion","style" : {"navigationBarTitleText": "提问题"}},
|
{"path" : "pages/plus/addQuestion","style" : {"navigationBarTitleText": "提问题"}},
|
||||||
{"path" : "pages/plus/editQuestion","style" : {"navigationBarTitleText": "编辑问题"}},
|
{"path" : "pages/plus/editQuestion","style" : {"navigationBarTitleText": "编辑问题"}},
|
||||||
|
{"path" : "pages/plus/editAnser","style" : {"navigationBarTitleText": "编辑回答"}},
|
||||||
{"path" : "pages/plus/feedback","style" : {"navigationBarTitleText": "提意见"}},
|
{"path" : "pages/plus/feedback","style" : {"navigationBarTitleText": "提意见"}},
|
||||||
{"path" : "pages/login/next","style" : {"navigationBarTitleText": "修改密码"}},
|
{"path" : "pages/login/next","style" : {"navigationBarTitleText": "修改密码"}},
|
||||||
{"path" : "pages/login/headPortrait","style" : {"navigationBarTitleText": "修改头像"}},
|
{"path" : "pages/login/headPortrait","style" : {"navigationBarTitleText": "修改头像"}},
|
||||||
{"path" : "pages/login/nickName","style" : {"navigationBarTitleText": "修改昵称"}},
|
{"path" : "pages/login/nickName","style" : {"navigationBarTitleText": "修改昵称"}},
|
||||||
{"path" : "pages/login/newBirt","style" : {"navigationBarTitleText": "修改生日"}},
|
{"path" : "pages/login/newBirt","style" : {"navigationBarTitleText": "修改生日"}},
|
||||||
{"path" : "pages/login/indLabels","style" : {"navigationBarTitleText": "修改个人标签"}},
|
{"path" : "pages/login/indLabels","style" : {"navigationBarTitleText": "修改个人标签"}},
|
||||||
|
{"path" : "pages/study/courseStudy","style" : {"navigationBarTitleText": "课程学习"}},
|
||||||
{"path" : "pages/study/audioTest","style" : {"navigationBarTitleText": "音频测试"}},
|
{"path" : "pages/study/audioTest","style" : {"navigationBarTitleText": "音频测试"}},
|
||||||
{"path" : "pages/study/courseStudy","style" : {"navigationBarTitleText": "课程学习"}}
|
{"path" : "pages/study/videoTest","style" : {"navigationBarTitleText": "视频频测试"}}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
|
|||||||
@@ -249,6 +249,7 @@
|
|||||||
},
|
},
|
||||||
startTest() {
|
startTest() {
|
||||||
this.curTestAnswer = {};
|
this.curTestAnswer = {};
|
||||||
|
this.aloneExamAnswerId='';
|
||||||
this.curIndex=0;
|
this.curIndex=0;
|
||||||
// 先禁用,防止重复提交
|
// 先禁用,防止重复提交
|
||||||
if (this.testPaper.entranceTime && this.testPaper.entranceTime !== '') {
|
if (this.testPaper.entranceTime && this.testPaper.entranceTime !== '') {
|
||||||
@@ -299,9 +300,9 @@
|
|||||||
this.testStatus = 2;
|
this.testStatus = 2;
|
||||||
this.startReckon();
|
this.startReckon();
|
||||||
//60秒后执行保存处理,这里和pc端不一致,不做延迟,直接保存考试信息
|
//60秒后执行保存处理,这里和pc端不一致,不做延迟,直接保存考试信息
|
||||||
// window.setTimeout(function() {
|
//window.setTimeout(function() {
|
||||||
$this.saveUserTest();
|
//$this.saveUserTest();
|
||||||
// }, 10000);
|
//}, 10000);
|
||||||
} else {
|
} else {
|
||||||
this.startButton = false;
|
this.startButton = false;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -314,6 +315,7 @@
|
|||||||
reStartTest(item){
|
reStartTest(item){
|
||||||
//直接提取,
|
//直接提取,
|
||||||
this.curTestAnswer = {};
|
this.curTestAnswer = {};
|
||||||
|
this.aloneExamAnswerId='';
|
||||||
this.curIndex=0;
|
this.curIndex=0;
|
||||||
apiTestPaper.getAnswerDetail(item.id).then(res => {
|
apiTestPaper.getAnswerDetail(item.id).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
@@ -368,6 +370,20 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
clearPagerJson(){
|
||||||
|
let paperJson = [];
|
||||||
|
this.paper.forEach((item,index) => {
|
||||||
|
let option = {
|
||||||
|
id:item.id,
|
||||||
|
optionList:[]
|
||||||
|
};
|
||||||
|
item.optionList.forEach(it=>{
|
||||||
|
option.optionList.push({id:it.id})
|
||||||
|
})
|
||||||
|
paperJson.push(option);
|
||||||
|
})
|
||||||
|
return JSON.stringify(paperJson);
|
||||||
|
},
|
||||||
saveUserTest() { //保存用户的考试,在点击开始考试1分钟后执行
|
saveUserTest() { //保存用户的考试,在点击开始考试1分钟后执行
|
||||||
if (this.handleSaveTest != null) {
|
if (this.handleSaveTest != null) {
|
||||||
window.clearTimeout(this.handleSaveTest);
|
window.clearTimeout(this.handleSaveTest);
|
||||||
@@ -385,7 +401,7 @@
|
|||||||
data.arrange = this.testPaper.arrange;
|
data.arrange = this.testPaper.arrange;
|
||||||
data.passLine = this.testPaper.passLine;
|
data.passLine = this.testPaper.passLine;
|
||||||
data.ucode = this.userInfo.userNo;
|
data.ucode = this.userInfo.userNo;
|
||||||
data.paperJson = JSON.stringify(this.paper);
|
data.paperJson = this.clearPagerJson();
|
||||||
data.answerJson = this.getAnswer();
|
data.answerJson = this.getAnswer();
|
||||||
//计算总分
|
//计算总分
|
||||||
let total = 0;
|
let total = 0;
|
||||||
@@ -419,11 +435,13 @@
|
|||||||
total+=item.defaultScore;
|
total+=item.defaultScore;
|
||||||
}
|
}
|
||||||
}else if (item.type == 1) {
|
}else if (item.type == 1) {
|
||||||
|
//console.log(item,item.defaultScore,'item.defaultScore')
|
||||||
item.optionList.forEach(opt => {
|
item.optionList.forEach(opt => {
|
||||||
if (opt.id == item.userAnswer && opt.isAnswer) {
|
if (opt.id == item.userAnswer && opt.isAnswer) {
|
||||||
total += item.defaultScore;
|
total += item.defaultScore;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//console.log(total,'total')
|
||||||
}else if (item.type == 2) {
|
}else if (item.type == 2) {
|
||||||
let tempAnswer = [];
|
let tempAnswer = [];
|
||||||
item.optionList.forEach(opt => {
|
item.optionList.forEach(opt => {
|
||||||
@@ -470,9 +488,19 @@
|
|||||||
data.arrange = this.testPaper.arrange;
|
data.arrange = this.testPaper.arrange;
|
||||||
data.passLine = this.testPaper.passLine;
|
data.passLine = this.testPaper.passLine;
|
||||||
data.scoreType=this.testPaper.scoringType;
|
data.scoreType=this.testPaper.scoringType;
|
||||||
data.totalScore=this.curTestAnswer.totalScore;
|
data.ucode = this.userInfo.userNo;
|
||||||
|
//计算总分
|
||||||
|
let total = 0;
|
||||||
|
this.paper.forEach(item => {
|
||||||
|
total += item.defaultScore;
|
||||||
|
});
|
||||||
|
data.totalScore=total;
|
||||||
data.answerJson = this.getAnswer();
|
data.answerJson = this.getAnswer();
|
||||||
data.realScore=this.countScore();
|
data.realScore=this.countScore();
|
||||||
|
if(!this.aloneExamAnswerId){
|
||||||
|
data.paperJson = this.clearPagerJson();
|
||||||
|
}
|
||||||
|
|
||||||
data.useSecond=this.testPaper.testDuration*60-this.remainingTime;
|
data.useSecond=this.testPaper.testDuration*60-this.remainingTime;
|
||||||
//计算百分制显示
|
//计算百分制显示
|
||||||
data.score=data.realScore*100/data.totalScore;
|
data.score=data.realScore*100/data.totalScore;
|
||||||
@@ -611,7 +639,6 @@
|
|||||||
},
|
},
|
||||||
nextSub() {
|
nextSub() {
|
||||||
//console.log(this.curItem,'this.curItem');
|
//console.log(this.curItem,'this.curItem');
|
||||||
|
|
||||||
if (this.curIndex >= (this.total - 1)) {
|
if (this.curIndex >= (this.total - 1)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,8 @@
|
|||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:"修改成功" ,
|
title:"修改成功" ,
|
||||||
duration: 1000
|
duration: 1000,
|
||||||
|
image:'../../static/images/icon/ok-icon.png'
|
||||||
});
|
});
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -157,12 +157,24 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toFollow(item,index) {
|
toFollow(item,index) {
|
||||||
|
console.log(item,'item')
|
||||||
let $this=this;
|
let $this=this;
|
||||||
apiFollow.save(item.userFollow.aid).then(res=>{
|
apiFollow.save(item.userFollow.aid).then(res=>{
|
||||||
if(res.status == 200) {
|
if(res.status == 200) {
|
||||||
$this.followMe.list[index].has = true;
|
$this.followMe.list[index].has = true;
|
||||||
// 手动把关注成功的数据push进我关注的列表
|
// 手动把关注成功的数据push进我关注的列表
|
||||||
|
let data = {
|
||||||
|
has:true,
|
||||||
|
userFollow:{
|
||||||
|
aid:res.result.aid,
|
||||||
|
followId:res.result.followId,
|
||||||
|
followTime:res.result.followTime,
|
||||||
|
id:res.result.id,
|
||||||
|
authorInfo:item.userFollow.authorInfo,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
$this.follow.list.push(data);
|
||||||
} else {
|
} else {
|
||||||
// this.$message.error(res.message);
|
// this.$message.error(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -338,15 +338,9 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
toCourseDetail(citem) {
|
toCourseDetail(citem) {
|
||||||
if (citem.contentType == 10) {
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/resource/microDetail?id=' + citem.objId
|
url: '/pages/study/courseStudy?id=' + citem.objId
|
||||||
});
|
});
|
||||||
} else if (citem.contentType == 20 || citem.contentType == 21) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/resource/courseDetail?id=' + citem.objId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
toArticleDetail(item) {
|
toArticleDetail(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -238,6 +238,7 @@
|
|||||||
color: #0A89FC;
|
color: #0A89FC;
|
||||||
margin-left: 74upx;
|
margin-left: 74upx;
|
||||||
margin-top: 26upx;
|
margin-top: 26upx;
|
||||||
|
margin-bottom: 30upx;
|
||||||
}
|
}
|
||||||
// margin-top: 510upx;
|
// margin-top: 510upx;
|
||||||
.medal-list-index{
|
.medal-list-index{
|
||||||
|
|||||||
@@ -190,9 +190,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 实例被激活时使用,用于重复激活一个实例的时候
|
// 实例被激活时使用,用于重复激活一个实例的时候
|
||||||
activated () {
|
// activated () {
|
||||||
this.findData(true);
|
// this.findData(true);
|
||||||
},
|
// },
|
||||||
|
|
||||||
|
|
||||||
methods:{
|
methods:{
|
||||||
@@ -244,7 +244,9 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'删除成功'
|
title:'删除成功',
|
||||||
|
// duration:500000
|
||||||
|
image:'../../static/images/icon/ok-icon.png'
|
||||||
})
|
})
|
||||||
// $this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
// $this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
||||||
$this.findAnData(true);
|
$this.findAnData(true);
|
||||||
@@ -257,9 +259,13 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
editItem(item){
|
editItem(item){
|
||||||
this.reply = item;
|
// this.reply = item;
|
||||||
this.inputValue = item.answercontent;
|
// this.inputValue = item.answercontent;
|
||||||
this.inputShow=true
|
// this.inputShow=true
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/plus/editAnser?value='+JSON.stringify(item)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
toanDetail(item) {
|
toanDetail(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -268,7 +274,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
toDetail(item) {
|
toDetail(item) {
|
||||||
console.log(item,'item')
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/resource/qaDetail?id=' + item.id
|
url: '/pages/resource/qaDetail?id=' + item.id
|
||||||
});
|
});
|
||||||
@@ -289,7 +294,8 @@
|
|||||||
apiQa.del(item.id).then(res=>{
|
apiQa.del(item.id).then(res=>{
|
||||||
if(res.status=200){
|
if(res.status=200){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'删除成功'
|
title:'删除成功',
|
||||||
|
image:'../../static/images/icon/ok-icon.png'
|
||||||
})
|
})
|
||||||
// $this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
// $this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
||||||
let event = {
|
let event = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<page-title :showBack="true">我的分享</page-title>
|
<!-- <page-title :showBack="true">我的分享</page-title> -->
|
||||||
<view v-for="(item,index) in dataList.list" :key="index">
|
<view v-for="(item,index) in dataList.list" :key="index">
|
||||||
<view v-if="item.type == 1">
|
<view v-if="item.type == 1">
|
||||||
<view class="course_box">
|
<view class="course_box">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.type == 2">
|
<view v-if="item.type == 2">
|
||||||
<view class="article_one" >
|
<view class="article_one">
|
||||||
<view>
|
<view>
|
||||||
<view @click="toArticleDetail(item)" class="articla_tit" >
|
<view @click="toArticleDetail(item)" class="articla_tit" >
|
||||||
<text v-html="$keywordActiveShow(item.title,query.keyword)"></text>
|
<text v-html="$keywordActiveShow(item.title,query.keyword)"></text>
|
||||||
@@ -285,15 +285,16 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
toCourseDetail(citem) {
|
toCourseDetail(citem) {
|
||||||
if (citem.contentType == 10) {
|
// if (citem.contentType == 10) {
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/pages/resource/microDetail?id=' + citem.objId
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/resource/microDetail?id=' + citem.objId
|
url: '/pages/study/courseStudy?id=' + citem.id
|
||||||
});
|
});
|
||||||
} else if (citem.contentType == 20 || citem.contentType == 21) {
|
// }
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/resource/courseDetail?id=' + citem.objId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
toArticleDetail(item) {
|
toArticleDetail(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -128,7 +128,8 @@
|
|||||||
this.$store.dispatch('InitData');
|
this.$store.dispatch('InitData');
|
||||||
// uni.navigateBack(-1);
|
// uni.navigateBack(-1);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'更新成功'
|
title:'更新成功',
|
||||||
|
image:'../../static/images/icon/ok-icon.png'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<page-title :showBack="true">分享给我的</page-title>
|
<!-- <page-title :showBack="true">分享给我的</page-title> -->
|
||||||
<view v-for="(item,index) in dataList.list" :key="index">
|
<view v-for="(item,index) in dataList.list" :key="index">
|
||||||
<view v-if="item.type == 1">
|
<view v-if="item.type == 1">
|
||||||
<view class="course_box">
|
<view class="course_box">
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
aid: $this.userInfo.aid, //当前登录人的id
|
aid: $this.userInfo.aid, //当前登录人的id
|
||||||
aname: $this.userInfo.name,//当前人的姓名
|
aname: $this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
aid: $this.userInfo.aid, //当前登录人的id
|
aid: $this.userInfo.aid, //当前登录人的id
|
||||||
aname: $this.userInfo.name,//当前人的姓名
|
aname: $this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
$this.$refs.messager.show({message:'提交成功',type:'success'});
|
$this.$refs.messager.show({message:'提交成功',type:'success'});
|
||||||
|
|||||||
250
pages/plus/editAnser.vue
Normal file
250
pages/plus/editAnser.vue
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
<template>
|
||||||
|
<!--添加文章-->
|
||||||
|
<view style="background-color: #fff;">
|
||||||
|
<u-toast ref="messager"></u-toast>
|
||||||
|
<!-- <page-title :showBack="true">编辑问题</page-title> -->
|
||||||
|
<view style="background-color: #fff;padding-top: 18rpx;">
|
||||||
|
<view class="bar-box">
|
||||||
|
<view class="bar-cancel" @click="toBack()"><u-icon style="color: #333333;font-weight: 600;" name="arrow-left"></u-icon></view>
|
||||||
|
<view class="bar-center">编辑回答</view>
|
||||||
|
<view @click="goSubmit()" class="bar-go">发布</view>
|
||||||
|
</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="big-box-content">
|
||||||
|
<view class="row row-lin">
|
||||||
|
<u--input placeholder="请输入标题" placeholder-style="font-size:42upx;color:#c1c1c1;display:inline-block;white-space: pre-wrap; word-wrap: break-word;height: auto;
|
||||||
|
" maxlength="30" class="row-input" border="surround" v-model="qa.title" @change="change"></u--input>
|
||||||
|
</view>
|
||||||
|
<view class="row ">
|
||||||
|
<u--textarea class="row-input row-text" placeholder-style="font-size:42upx;color:#666;font-weight: normal;" :height="300" count maxlength="140" v-model="inputValue" placeholder="请输入正文"></u--textarea>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="row">
|
||||||
|
<u-upload uploadIcon="plus" :fileList="fileList" multiple @afterRead="afterRead" @delete="deletePic" name="coverImg" :maxCount="5">
|
||||||
|
</u-upload>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import apiQa from '@/api/modules/qa.js'
|
||||||
|
import uploadUtil from '@/utils/upload.js'
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import apiStat from '@/api/phase2/stat.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
fileUrl:this.$config.fileUrl,
|
||||||
|
inputValue:'',
|
||||||
|
qa:{
|
||||||
|
id:'',
|
||||||
|
title:'',
|
||||||
|
answercontent:'',
|
||||||
|
},
|
||||||
|
fileList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
...mapGetters(['userInfo']),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toBack(){
|
||||||
|
uni.navigateBack();
|
||||||
|
},
|
||||||
|
goSubmit() {
|
||||||
|
let $this = this;
|
||||||
|
// let images=[];
|
||||||
|
// this.fileList.forEach(file=>{
|
||||||
|
// images.push(file.path);
|
||||||
|
// })
|
||||||
|
// this.qa.images=images.join();
|
||||||
|
// uni.showLoading({title:'提交中...'})
|
||||||
|
// apiQa.update(this.qa).then(rs=>{
|
||||||
|
// if(rs.status==200){
|
||||||
|
|
||||||
|
// this.$refs.messager.show({message:'提交成功',type:'success'});
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url:'/pages/resource/qaDetail?id='+rs.result.id
|
||||||
|
// })
|
||||||
|
// }else{
|
||||||
|
// this.$refs.messager.show({message:rs.message,type:'error'});
|
||||||
|
// setTimeout(function(){uni.hideLoading()},1000);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
let {answerid,content,sysCreateAid,favorites,praises,shares}=this.qa;
|
||||||
|
apiQa
|
||||||
|
.updateAnswer({id:answerid,sysCreateAid,content:$this.inputValue})
|
||||||
|
.then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title:'修改成功'
|
||||||
|
})
|
||||||
|
// $this.$refs.articleToast.show({message:'修改成功',type:'success'});
|
||||||
|
// $this.closeInput();
|
||||||
|
// $this.findAnData(true);
|
||||||
|
uni.redirectTo({
|
||||||
|
url:'/pages/resource/qaDetail?id='+this.qa.qid
|
||||||
|
})
|
||||||
|
// this.toBack();
|
||||||
|
} else {
|
||||||
|
// $this.$refs.articleToast.show({message:'修改失败',type:'error'});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
change(e) {
|
||||||
|
//没有任何处理,打印console.log无意义
|
||||||
|
//console.log('change', e);
|
||||||
|
},
|
||||||
|
|
||||||
|
//删除图片
|
||||||
|
// deletePic(event) {
|
||||||
|
// this.fileList.splice(event.index, 1);
|
||||||
|
// },
|
||||||
|
//新增图片
|
||||||
|
// async afterRead(event) {
|
||||||
|
// //当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||||
|
// //console.log(event.file);
|
||||||
|
// let $this=this;
|
||||||
|
// event.file.forEach(img=>{
|
||||||
|
// uploadUtil.uploadFile(img.url).then(rs=>{
|
||||||
|
// //console.log(rs);
|
||||||
|
|
||||||
|
// let item={
|
||||||
|
// status: 'success',
|
||||||
|
// message: '已上传',
|
||||||
|
// path:rs.result.filePath,
|
||||||
|
// url:rs.result.httpPath
|
||||||
|
// }
|
||||||
|
|
||||||
|
// this.fileList.push(item)
|
||||||
|
|
||||||
|
// uni.hideLoading();
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
|
||||||
|
// },
|
||||||
|
reverse() {
|
||||||
|
uni.navigateBack({
|
||||||
|
url: '/pages/plus/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option){
|
||||||
|
|
||||||
|
if(option.value){
|
||||||
|
this.qa=JSON.parse(option.value)
|
||||||
|
this.inputValue = this.qa.answercontent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .uni-textarea-textarea{
|
||||||
|
color: #666 !important;
|
||||||
|
}
|
||||||
|
::v-deep .uni-input-input{
|
||||||
|
font-size: 36upx !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
color: #333333 !important;
|
||||||
|
}
|
||||||
|
.sub-box{
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.sub-success{
|
||||||
|
.sub-title{
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 45rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
.sub-text{
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
.sub-bar{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-bottom: 2rpx solid #ccc;
|
||||||
|
.bar-time{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bar-reply{
|
||||||
|
text-align: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
.field-icon{
|
||||||
|
display: block;
|
||||||
|
width: 40rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bar-cor{
|
||||||
|
height: 20rpx;
|
||||||
|
background-color: #ebebeb;
|
||||||
|
}
|
||||||
|
.bar-bon{
|
||||||
|
text-align: center;
|
||||||
|
min-height: 600rpx;
|
||||||
|
margin-top: 35rpx;
|
||||||
|
.bon-icon{
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
}
|
||||||
|
.bon-text{
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bar-box{
|
||||||
|
display: flex;
|
||||||
|
margin: 18rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
// position: relative;
|
||||||
|
|
||||||
|
.bar-cancel{
|
||||||
|
font-size: 32upx;
|
||||||
|
color: #7F7F7F;
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
.bar-center{
|
||||||
|
font-size: 36upx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #0D0D0D;
|
||||||
|
}
|
||||||
|
.bar-go{
|
||||||
|
// position: absolute;
|
||||||
|
// right: 18rpx;
|
||||||
|
color: #387DF7;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.row {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
.row-input{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.row-lin{
|
||||||
|
// border-top: 1px solid #eee;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
" maxlength="30" class="row-input" border="surround" v-model="qa.title" @change="change"></u--input>
|
" maxlength="30" class="row-input" border="surround" v-model="qa.title" @change="change"></u--input>
|
||||||
</view>
|
</view>
|
||||||
<view class="row ">
|
<view class="row ">
|
||||||
<u--textarea class="row-input row-text" placeholder-style="font-size:42upx;color:#666;font-weight: normal;" :height="300" count maxlength="500" v-model="qa.content" placeholder="请输入正文"></u--textarea>
|
<u--textarea class="row-input row-text" placeholder-style="font-size:42upx;color:#666;font-weight: normal;" :height="300" count maxlength="500" v-model="content" placeholder="请输入正文"></u--textarea>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<u-upload uploadIcon="plus" :fileList="fileList" multiple @afterRead="afterRead" @delete="deletePic" name="coverImg" :maxCount="5">
|
<u-upload uploadIcon="plus" :fileList="fileList" multiple @afterRead="afterRead" @delete="deletePic" name="coverImg" :maxCount="5">
|
||||||
@@ -41,8 +41,10 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
fileUrl:this.$config.fileUrl,
|
fileUrl:this.$config.fileUrl,
|
||||||
qa:{
|
qa:{
|
||||||
|
content:'',
|
||||||
id:'',
|
id:'',
|
||||||
title:'',
|
title:'',
|
||||||
content:'',
|
content:'',
|
||||||
@@ -55,6 +57,7 @@
|
|||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
toBack(){
|
toBack(){
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
},
|
},
|
||||||
@@ -120,8 +123,9 @@
|
|||||||
onLoad(option){
|
onLoad(option){
|
||||||
if(option.value){
|
if(option.value){
|
||||||
this.qa=JSON.parse(option.value)
|
this.qa=JSON.parse(option.value)
|
||||||
|
this.content = (this.qa.content).replace(/<\/?[^>]*>/g, '');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
aid: this.userInfo.aid, //当前登录人的id
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
aid: this.userInfo.aid, //当前登录人的id
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
// this.$store.dispatch("userTrigger", event);
|
// this.$store.dispatch("userTrigger", event);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
{{ detailData.title }}
|
{{ detailData.title }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="interval"></view>
|
<!-- <view class="interval"></view> -->
|
||||||
<view class="adetail content">
|
<view class="adetail content">
|
||||||
<!--文章内容-->
|
<!--文章内容-->
|
||||||
<view class="adetail-info">
|
<view class="adetail-info">
|
||||||
@@ -409,7 +409,7 @@ export default {
|
|||||||
aid: $this.userInfo.aid, //当前登录人的id
|
aid: $this.userInfo.aid, //当前登录人的id
|
||||||
aname: $this.userInfo.name,//当前人的姓名
|
aname: $this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
} else {
|
} else {
|
||||||
@@ -559,7 +559,7 @@ export default {
|
|||||||
aid: this.userInfo.aid, //当前登录人的id
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,7 @@ export default {
|
|||||||
aid: this.userInfo.aid, //当前登录人的id
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
} else {
|
} else {
|
||||||
@@ -698,7 +698,7 @@ export default {
|
|||||||
aid: $this.userInfo.aid, //当前登录人的id
|
aid: $this.userInfo.aid, //当前登录人的id
|
||||||
aname: $this.userInfo.name,//当前人的姓名
|
aname: $this.userInfo.name,//当前人的姓名
|
||||||
status: 1 ,//状态,直接写1
|
status: 1 ,//状态,直接写1
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
}else{
|
}else{
|
||||||
@@ -811,7 +811,7 @@ export default {
|
|||||||
aid: this.userInfo.aid, //当前登录人的id
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
aname: this.userInfo.name,//当前人的姓名
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
status: 1,
|
status: 1,
|
||||||
source:2,
|
source:"h5",
|
||||||
}
|
}
|
||||||
apiStat.sendEvent(event);
|
apiStat.sendEvent(event);
|
||||||
}else{
|
}else{
|
||||||
@@ -938,7 +938,7 @@ export default {
|
|||||||
padding: 15upx 30upx;
|
padding: 15upx 30upx;
|
||||||
.adetail-title {
|
.adetail-title {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding-bottom: 40upx;
|
// padding-bottom: 40upx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 36upx;
|
font-size: 36upx;
|
||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
@@ -954,6 +954,7 @@ export default {
|
|||||||
color: #7e7e7e;
|
color: #7e7e7e;
|
||||||
}
|
}
|
||||||
.adetail-body {
|
.adetail-body {
|
||||||
|
padding-top: 20upx;
|
||||||
line-height: 55upx;
|
line-height: 55upx;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
<course-image :course="c" width="308upx" height="192upx"></course-image>
|
<course-image :course="c" width="308upx" height="192upx"></course-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="coures-conent">
|
<view class="coures-conent">
|
||||||
<view class="conent-title" v-html="c.name">
|
<view class="conent-title" v-html="$keywordActiveShow(c.name,keyword)">
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="con-au"> -->
|
<!-- <view class="con-au"> -->
|
||||||
<!-- <view v-else style="font-size: 24upx; color: #666666;padding-top: 10upx;"> -->
|
<!-- <view v-else style="font-size: 24upx; color: #666666;padding-top: 10upx;"> -->
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
</view>
|
</view>
|
||||||
{{converToScore(c.score)}}
|
{{converToScore(c.score)}}
|
||||||
</text>
|
</text>
|
||||||
<text>{{ c.score }}<text class="statuy-num">{{c.studies}}+</text>人学习</text>
|
<text><text class="statuy-num">{{c.studies}}+</text>人学习</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -713,15 +713,9 @@
|
|||||||
},
|
},
|
||||||
toCoursePage(coure){
|
toCoursePage(coure){
|
||||||
if(coure.source ==1){
|
if(coure.source ==1){
|
||||||
uni.navigateTo({
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
});
|
url: '/pages/study/studydetail?id='+coure.id+'&type='+coure.type
|
||||||
});
|
});
|
||||||
if(coure.type==10){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/resource/microDetail?id='+coure.id
|
|
||||||
})
|
|
||||||
}else if(coure.type==20){
|
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/study/courseStudy?id='+coure.id
|
url: '/pages/study/courseStudy?id='+coure.id
|
||||||
|
|||||||
@@ -5,40 +5,23 @@
|
|||||||
<u-toast ref="messager"></u-toast>
|
<u-toast ref="messager"></u-toast>
|
||||||
<!-- <page-title :showBack="true"></page-title> -->
|
<!-- <page-title :showBack="true"></page-title> -->
|
||||||
<view class="playbox"><!--内容播放区域-->
|
<view class="playbox"><!--内容播放区域-->
|
||||||
<view style="min-height: 500upx;" >
|
<view style="min-height: 440upx;" >
|
||||||
<view v-if="curContent.contentType==10" style="background-color: #000000;">
|
<view v-if="curContent.contentType==10" style="background-color: #000000;">
|
||||||
<!--视频-->
|
<!--视频-->
|
||||||
<view style="position: relative;">
|
<view style="position: relative;">
|
||||||
<video id="myVideo"
|
<video-player
|
||||||
@touchend="doubleClickVideo"
|
:url="blobUrl"
|
||||||
:src="blobUrl"
|
controls
|
||||||
controls
|
:enable-play-gesture="true"
|
||||||
:enable-play-gesture="true"
|
:inittime="curContent.lastStudyTime"
|
||||||
:initial-time="curContent.lastStudyTime"
|
@play="onPlayerPlay"
|
||||||
@play="onPlayerPlay"
|
@pause="onPlayerPause"
|
||||||
@pause="onPlayerPause"
|
@ended="onPlayerEnded"
|
||||||
@ended="onPlayerEnded"
|
@timeupdate="onPlayerPlaying"
|
||||||
@timeupdate="onPlayerPlaying"
|
@fullscreenchange="onFullScreen"
|
||||||
@fullscreenchange="onFullScreen"
|
style="width: 100%; object-fit: fill">
|
||||||
style="width: 100%; object-fit: fill">
|
></video-player>
|
||||||
</video>
|
<view class="player-box" v-if="playerBoxShow">
|
||||||
<!--倍速度-->
|
|
||||||
<view id="myVideoSpeed" class="player-controls-btn cursor-pointer btn-speed">
|
|
||||||
<view @click="showSpeedCtrl">{{videoSpeed === 1 ? '倍速' : `${videoSpeed}x`}}</view>
|
|
||||||
<view class="speed-control" v-if="speedListShow">
|
|
||||||
<view class="speed-control-list">
|
|
||||||
<view class="li"
|
|
||||||
v-for="item in speedList"
|
|
||||||
:key="item"
|
|
||||||
@click="changeSpeed(item)"
|
|
||||||
:data-value="item"
|
|
||||||
:class="{'current': videoSpeed === Number(item)}">
|
|
||||||
{{ item }}x
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="player-box" v-if="playerBoxShow">
|
|
||||||
<view class="player-praise">
|
<view class="player-praise">
|
||||||
<view @click="praiseContent" style="cursor: pointer;">
|
<view @click="praiseContent" style="cursor: pointer;">
|
||||||
<image class="icon-small" v-if="isPraise" src="/static/images/icon/praise-active.png" />
|
<image class="icon-small" v-if="isPraise" src="/static/images/icon/praise-active.png" />
|
||||||
@@ -1335,41 +1318,7 @@
|
|||||||
},
|
},
|
||||||
onFullScreen(e){
|
onFullScreen(e){
|
||||||
//console.log(e,'e');
|
//console.log(e,'e');
|
||||||
let full=e.detail.fullScreen;
|
|
||||||
let divId='videowatermark';
|
|
||||||
setTimeout(() => {
|
|
||||||
var div = document.getElementById('myVideo')
|
|
||||||
var div1 = div.firstChild;
|
|
||||||
var speedDiv=div1.querySelector("#myVideoSpeed");
|
|
||||||
if(full){
|
|
||||||
var div3 = document.createElement("div");
|
|
||||||
div3.id =divId;
|
|
||||||
div3.setAttribute("class", "fullmark");
|
|
||||||
div3.innerHTML='';
|
|
||||||
// 从父组件传过来的水印内容
|
|
||||||
//div3.innerText =this.userInfo.name+this.userInfo.code;
|
|
||||||
for(var i=0;i<4;i++){
|
|
||||||
div3.innerHTML+='<div style="color:#ffffff;width: 40%;height: 155px;padding-left:60px;padding-top:50px; display: flex;justify-content: center; transform: rotate(-36deg);font-size:20px;">'+this.userInfo.name+this.userInfo.code+'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
div3.style.cssText = "position:absolute;pointer-events: none; width: 100%;height: 100%;top:0;left:0;bottom: 0;right: 0; display: flex;justify-content: center;flex-wrap: wrap;overflow: hidden; opacity:0.3;padding-top:10px";
|
|
||||||
//console.log(div3,'div3');
|
|
||||||
div1.appendChild(div3);
|
|
||||||
if(!speedDiv){
|
|
||||||
var speedDiv=document.getElementById('myVideoSpeed');
|
|
||||||
div1.appendChild(speedDiv)
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
var markDiv=div1.querySelector("#"+divId);
|
|
||||||
//var speedDiv=div1.querySelector("#myVideoSpeed");
|
|
||||||
if(markDiv){
|
|
||||||
div1.removeChild(markDiv);
|
|
||||||
}
|
|
||||||
if(speedDiv){
|
|
||||||
//div1.removeChild(speedDiv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 200);
|
|
||||||
},
|
},
|
||||||
onPlayerPlay(){
|
onPlayerPlay(){
|
||||||
this.isPlaying = true;
|
this.isPlaying = true;
|
||||||
@@ -1608,7 +1557,7 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.playbox{
|
.playbox{
|
||||||
padding: 10upx;
|
//padding: 10upx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.contentbox{
|
.contentbox{
|
||||||
@@ -1650,7 +1599,7 @@
|
|||||||
}
|
}
|
||||||
.tabrow{
|
.tabrow{
|
||||||
display: flex;
|
display: flex;
|
||||||
border-bottom:1px solid #999999;
|
border-bottom:1px solid rgba(153,153,153,0.14);
|
||||||
font-size: 28upx;
|
font-size: 28upx;
|
||||||
.tabrow-active{
|
.tabrow-active{
|
||||||
font-size: 32upx;
|
font-size: 32upx;
|
||||||
@@ -1864,6 +1813,51 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
.player-controls-btn {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
color: #e5e5e5;
|
||||||
|
padding: 0 0.4rem;
|
||||||
|
transition: color 0.3s;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
.btn-speed:hover .speed-control {
|
||||||
|
// visibility: visible;
|
||||||
|
}
|
||||||
|
.speed-control {
|
||||||
|
position: absolute;
|
||||||
|
top: 180px;
|
||||||
|
right: -20px;
|
||||||
|
transition: visibility 0.3s;
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list {
|
||||||
|
list-style: none;
|
||||||
|
color: #e5e5e5;
|
||||||
|
width: 50px;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0px 0px 0px 5px;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba(21, 21, 21, 0.8);
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list .li {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list .li:hover {
|
||||||
|
color: #fff;
|
||||||
|
background: rgba(99, 99, 99, 0.8);
|
||||||
|
}
|
||||||
|
.speed-control .speed-control-list .li.current {
|
||||||
|
color: var(--primaryColor);
|
||||||
|
}
|
||||||
.catalog{
|
.catalog{
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
padding:20upx;
|
padding:20upx;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
|
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="sea-show" v-show="statusSelectShow">
|
<view class="sea-show" v-show="statusSelectShow">
|
||||||
<view v-for="(status,index) in statustList" :key="index" :class="[Applistatus === status.value? 'sea-active':'','sea-index']" @click="autonomyStatus(status.value)">
|
<view v-for="(status,index) in autonomyStatustList" :key="index" :class="[Applistatus === status.value? 'sea-active':'','sea-index']" @click="autonomyStatus(status.value)">
|
||||||
{{status.name}}
|
{{status.name}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -334,6 +334,12 @@
|
|||||||
{name: '进行中',value: 1},
|
{name: '进行中',value: 1},
|
||||||
{name: '已完成',value: 2}
|
{name: '已完成',value: 2}
|
||||||
],
|
],
|
||||||
|
autonomyStatustList: [
|
||||||
|
{name: '全部',value: ''},
|
||||||
|
{name: '未开始',value: 1},
|
||||||
|
{name: '进行中',value: 2},
|
||||||
|
{name: '已完成',value: 9}
|
||||||
|
],
|
||||||
statustArray: [
|
statustArray: [
|
||||||
[{name: '在线课',value: 'online-course'},
|
[{name: '在线课',value: 'online-course'},
|
||||||
{name: '面授班',value: 'face-course'},
|
{name: '面授班',value: 'face-course'},
|
||||||
@@ -415,7 +421,6 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
removecour(item){
|
removecour(item){
|
||||||
console.log(item);
|
|
||||||
item.delcour = !item.delcour
|
item.delcour = !item.delcour
|
||||||
},
|
},
|
||||||
rowbtn(row) {
|
rowbtn(row) {
|
||||||
@@ -521,11 +526,15 @@
|
|||||||
},
|
},
|
||||||
autonomyStatus(num) {
|
autonomyStatus(num) {
|
||||||
this.Applistatus = num;
|
this.Applistatus = num;
|
||||||
|
this.autonomy.status = num;
|
||||||
|
this.statusSelectShow = false;
|
||||||
// console.log(this.Applistatus)
|
// console.log(this.Applistatus)
|
||||||
this.getLearning();
|
// this.getLearning();
|
||||||
|
this.searchData();
|
||||||
},
|
},
|
||||||
taskStatus(num) {
|
taskStatus(num) {
|
||||||
this.boeStatus = num;
|
this.boeStatus = num;
|
||||||
|
this.statusSelectShow = false;
|
||||||
this.loadBoeData(true);
|
this.loadBoeData(true);
|
||||||
},
|
},
|
||||||
closeBtns() {
|
closeBtns() {
|
||||||
@@ -576,6 +585,7 @@
|
|||||||
loadBoeData(flag) {
|
loadBoeData(flag) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.taskPageIndex = 1; //回到首页
|
this.taskPageIndex = 1; //回到首页
|
||||||
|
this.couresList = [];
|
||||||
}
|
}
|
||||||
let params = {
|
let params = {
|
||||||
page: this.taskPageIndex,
|
page: this.taskPageIndex,
|
||||||
@@ -587,12 +597,12 @@
|
|||||||
params.cmtask_name = this.keyWord;
|
params.cmtask_name = this.keyWord;
|
||||||
}
|
}
|
||||||
apiBoeCourse.cmtaskList(params).then(res => {
|
apiBoeCourse.cmtaskList(params).then(res => {
|
||||||
this.taskCount = res.result.count;
|
this.taskCount = res.result.count;
|
||||||
res.result.list.forEach(item => {
|
res.result.list.forEach(item => {
|
||||||
let time = this.formatDate(item.created_at * 1000);
|
let time = this.formatDate(item.created_at * 1000);
|
||||||
item.created_at = time.split(' ')[0];
|
item.created_at = time.split(' ')[0];
|
||||||
});
|
});
|
||||||
this.couresList = res.result.list;
|
this.couresList.push(...res.result.list);
|
||||||
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
||||||
this.taskHasMore = true;
|
this.taskHasMore = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -648,12 +658,12 @@
|
|||||||
},
|
},
|
||||||
clicktab(idx) {
|
clicktab(idx) {
|
||||||
this.tabIndex = idx;
|
this.tabIndex = idx;
|
||||||
if (this.tabIndex == 1) {
|
if (this.tabIndex == 1 && this.studyList.length == 0) {
|
||||||
this.getLearning()
|
this.getLearning()
|
||||||
// this.searchData();
|
// this.searchData();
|
||||||
} else if (this.tabIndex == 2) {
|
} else if (this.tabIndex == 2) {
|
||||||
this.history()
|
this.history()
|
||||||
} else if (this.tabIndex == 0) {
|
} else if (this.tabIndex == 0 && this.couresList.length == 0) {
|
||||||
this.loadBoeData()
|
this.loadBoeData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -701,7 +711,6 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getLearning() {
|
async getLearning() {
|
||||||
console.log(this.Applistatus)
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
});
|
});
|
||||||
|
|||||||
80
pages/study/videoTest.vue
Normal file
80
pages/study/videoTest.vue
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view v-if="show">
|
||||||
|
<video-player
|
||||||
|
:url="fileUrl"
|
||||||
|
:name="title"
|
||||||
|
:inittime="initTime"
|
||||||
|
:drag="true"
|
||||||
|
@play="videoPlay"
|
||||||
|
@pause="videoPause"
|
||||||
|
@timeupdate="videoPlaying"
|
||||||
|
@ended="videoEnd"
|
||||||
|
@fullscreenchange="videoScreen">
|
||||||
|
</video-player>
|
||||||
|
</view>
|
||||||
|
<view style="padding-top: 30px;display: flex;justify-content: center;">
|
||||||
|
<button type="default" @click="loadVideo()">加载</button>
|
||||||
|
<button type="primary" @click="changeSrc()">切换测试</button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<video style="width: 100%;"
|
||||||
|
:src="fileUrl"
|
||||||
|
:controls="true"
|
||||||
|
@fullscreenchange="videoScreen"
|
||||||
|
></video>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default{
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
show:false,
|
||||||
|
fileUrl:'',
|
||||||
|
initTime:0,
|
||||||
|
title:'',
|
||||||
|
author:'',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadVideo();
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
loadVideo(){
|
||||||
|
//this.fileUrl='http://localhost:9090/cdn/upload/course/2022/5/979321410778959872.mp3';
|
||||||
|
this.fileUrl='/static/temp/test.mp4';
|
||||||
|
this.title='标题内容111';
|
||||||
|
this.initTime=40;
|
||||||
|
this.show=true;
|
||||||
|
},
|
||||||
|
changeSrc(){
|
||||||
|
this.fileUrl='/static/temp/video.mp4';
|
||||||
|
this.title='标题内容221';
|
||||||
|
this.initTime=20
|
||||||
|
},
|
||||||
|
videoPlay(){
|
||||||
|
console.log('videoPlay');
|
||||||
|
},
|
||||||
|
videoEnd(){
|
||||||
|
console.log('videoEnd');
|
||||||
|
},
|
||||||
|
videoPause(){
|
||||||
|
console.log('videoPause');
|
||||||
|
},
|
||||||
|
videoPlaying(){
|
||||||
|
console.log('videoPlaying');
|
||||||
|
},
|
||||||
|
videoScreen(e){
|
||||||
|
console.log('全屏',e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.xaudio{
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
static/images/icon/ok-icon.png
Normal file
BIN
static/images/icon/ok-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 572 B |
Reference in New Issue
Block a user