mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 01:46:44 +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{
|
||||
width: 180px;
|
||||
|
||||
@@ -347,11 +347,11 @@
|
||||
background-position: 0 0;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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>
|
||||
<video id="myVideo" style="width: 100%;"
|
||||
:src="fileBaseUrl+coursewareInfo.content.content"
|
||||
@error="videoErrorCallback"
|
||||
:initial-time="videoPlayingTime"
|
||||
@play="onPlayerPlay"
|
||||
@pause="onPlayerPause"
|
||||
@ended="onPlayerEnded"
|
||||
@timeupdate="onPlayerPlaying"
|
||||
@fullscreenchange="onFullScreen"
|
||||
controls>
|
||||
<view class='process-container'>
|
||||
<view class="video-controls-play">
|
||||
<image :src="palyFlag ? '../../static/img/start.png' : '../../static/img/pause.png'" class='video-controls-icon' @click='videoOpreation'/>
|
||||
<view id="xvideoPlayer-box" class="video-box">
|
||||
<video id="xvideoPlayer" style="width: 100%;"
|
||||
:src="url"
|
||||
:controls="false"
|
||||
:enable-play-gesture="false"
|
||||
:initial-time="initPlayingTime"
|
||||
@error="onError"
|
||||
@touchend="onTouchend"
|
||||
@play="onPlay"
|
||||
@pause="onPause"
|
||||
@ended="onEnded"
|
||||
@timeupdate="onTimeUpdate"
|
||||
@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 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>
|
||||
</video>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from 'vuex'
|
||||
import studyUtil from '@/utils/study.js';
|
||||
export default {
|
||||
props: {
|
||||
url:{
|
||||
type: String,
|
||||
require: true
|
||||
},
|
||||
initTime:{//默认播放的位置,第几秒
|
||||
watermark:{
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
name:{
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
drag:{
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
inittime:{//默认播放的位置,第几秒
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fullScreenFlag: false,
|
||||
currtime:'00:00:00',//当前播放时间 字符串 计算后
|
||||
druationTime:'00:00:00',//总时间 字符串 计算后
|
||||
bool:false,
|
||||
contrlShow:false,//是否显示控制条
|
||||
contrlShowTimeout:null,//显示控制条句柄
|
||||
videoContext:null,//播放器
|
||||
fullScreenFlag: false,//是否全屏
|
||||
currtime:'00:00',//当前播放时间 字符串 计算后
|
||||
druationTime:'00:00',//总时间 字符串 计算后
|
||||
initPlayingTime:0,//指定播放的时间位置
|
||||
sliderValue: 0, //控制进度条slider的值,
|
||||
updateState: false, //防止视频播放过程中导致的拖拽失效
|
||||
palyFlag:false,
|
||||
updateState: true, //防止视频播放过程中导致的拖拽失效
|
||||
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: {
|
||||
// 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) {
|
||||
this.fullScreenFlag ? this.videoContext.exitFullScreen() : this.videoContext.requestFullScreen();
|
||||
// this.fullScreenFlag ? this.bool=true : this.bool=false;
|
||||
this.fullScreenFlag=!this.fullScreenFlag;
|
||||
fullScreen(){
|
||||
if(this.fullScreenFlag){
|
||||
this.videoContext.exitFullScreen();
|
||||
this.fullScreenFlag=false;
|
||||
}else{
|
||||
this.videoContext.requestFullScreen();
|
||||
this.fullScreenFlag=true;
|
||||
}
|
||||
},
|
||||
// 根据秒获取时间
|
||||
formatSeconds(a) {
|
||||
@@ -73,14 +139,29 @@
|
||||
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() {
|
||||
this.palyFlag ? this.videoContext.play() : this.videoContext.pause();
|
||||
this.palyFlag= !this.palyFlag;
|
||||
this.playing ? this.videoContext.pause() : this.videoContext.play();
|
||||
this.playing= !this.playing;
|
||||
},
|
||||
// 播放进度变化时触发,event.detail = {currentTime, duration} 。触发频率 250ms 一次
|
||||
videoUpdate(e) {
|
||||
let duration=this.live.liveRoomRecordList[0].duration;
|
||||
let duration=this.curVideo.duration;
|
||||
let sliderValue = e.detail.currentTime / duration * 100;
|
||||
let second=sliderValue / 100 * duration;
|
||||
if (this.updateState) { //判断拖拽完成后才触发更新,避免拖拽失效
|
||||
@@ -88,8 +169,9 @@
|
||||
}else{
|
||||
|
||||
}
|
||||
this.druationTime = this.formatSeconds(duration);
|
||||
this.currtime = this.formatSeconds(second);
|
||||
this.druationTime = this.formatSeconds(duration);
|
||||
//console.log(this.druationTime,'this.druationTime');
|
||||
this.currtime = this.formatSeconds(second);
|
||||
},
|
||||
//拖动过程中触发的事件
|
||||
sliderChanging(e) {
|
||||
@@ -98,7 +180,7 @@
|
||||
},
|
||||
// 拖动slider完成后触发
|
||||
sliderChange(e) {
|
||||
var duration=this.live.liveRoomRecordList[0].duration;
|
||||
var duration=this.curVideo.duration;
|
||||
var second=e.detail.value / 100 * duration;
|
||||
if (duration) { //完成拖动后,计算对应时间并跳转到指定位置
|
||||
this.videoContext.seek(second);
|
||||
@@ -106,58 +188,171 @@
|
||||
this.updateState= true //完成拖动后允许更新滚动条
|
||||
this.druationTime = this.formatSeconds(duration);
|
||||
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.palyFlag=false;
|
||||
this.playing=true;
|
||||
let $this=this;
|
||||
if(this.contrlShow){
|
||||
this.contrlShowTimeout=window.setTimeout(function(){
|
||||
$this.contrlShow=false;
|
||||
},5000);
|
||||
}
|
||||
this.$emit('play')
|
||||
},
|
||||
// 暂停
|
||||
pause() {
|
||||
this.videoContext.pause(); //站厅播放
|
||||
this.palyFlag=true;
|
||||
onTimeUpdate(e){
|
||||
this.videoUpdate(e);
|
||||
this.$emit('timeupdate',e)
|
||||
},
|
||||
stop(){
|
||||
this.videoContext.stop(); //
|
||||
onPause() {
|
||||
this.playing=false;
|
||||
this.$emit('pause')
|
||||
},
|
||||
onEnded(){
|
||||
this.playing=false;
|
||||
this.$emit('ended')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.process-container{
|
||||
width:100%;
|
||||
padding:1% 2% 1% 2%;
|
||||
height:60rpx;
|
||||
max-height:60rpx;
|
||||
position:absolute;
|
||||
bottom:40rpx;
|
||||
left:0;
|
||||
right:0;
|
||||
z-index:13;
|
||||
display:flex;
|
||||
align-items: center;
|
||||
background:rgba(59, 57, 57, 0.2);
|
||||
.video-box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.screen{
|
||||
position: relative;
|
||||
}
|
||||
.screen-full{
|
||||
position:static;
|
||||
}
|
||||
.process-container{
|
||||
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{
|
||||
display:inline-block;
|
||||
flex:1;
|
||||
max-width:50rpx;
|
||||
max-height:50rpx;
|
||||
text-align:center;
|
||||
max-width:30rpx;
|
||||
max-height:30rpx;
|
||||
text-align:center;
|
||||
}
|
||||
.slider-container{
|
||||
z-index:13;
|
||||
height:60rpx;
|
||||
margin-bottom:10rpx;
|
||||
flex:6;
|
||||
max-width:58%;
|
||||
max-width:50%;
|
||||
}
|
||||
.video-controls-play{
|
||||
.controller-play{
|
||||
width: 8%;
|
||||
}
|
||||
.controller-screen{
|
||||
width: 10%;
|
||||
}
|
||||
.currtime{
|
||||
color: #ffffff;
|
||||
font-size: 22rpx;
|
||||
@@ -174,18 +369,45 @@
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.video_back{
|
||||
display:block;
|
||||
width:60rpx;
|
||||
height:60rpx;
|
||||
left:5rpx;
|
||||
top:15rpx;
|
||||
position:absolute;
|
||||
text-align:center;
|
||||
z-index:19;
|
||||
.player-speed{
|
||||
position: relative;
|
||||
color: #e5e5e5;
|
||||
padding: 0 0.4rem;
|
||||
transition: color 0.3s;
|
||||
height: 22px;
|
||||
}
|
||||
.video_back image{
|
||||
width:44rpx;
|
||||
height:44rpx;
|
||||
.btn-speed:hover .speed-control {
|
||||
// visibility: visible;
|
||||
}
|
||||
.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>
|
||||
|
||||
@@ -16,7 +16,7 @@ if(process.env.NODE_ENV === 'development'){
|
||||
oldApiBaseUrl = '/uboeApi';
|
||||
statApiBaseUrl='/statApi';
|
||||
socialApiBaseUrl='/socialApi';
|
||||
fileUrl = 'http://192.168.0.11:9090/cdn/upload';
|
||||
fileUrl = 'http:/192.168.0.11:9090/cdn/upload';
|
||||
loginPath='/pages/login/login';
|
||||
}else if(process.env.NODE_ENV === 'preview'){
|
||||
// 预发布环境,当前配置未使用上
|
||||
@@ -40,8 +40,8 @@ if(process.env.NODE_ENV === 'development'){
|
||||
oldApiBaseUrl = '/uboeApi';
|
||||
statApiBaseUrl='/statApi';
|
||||
socialApiBaseUrl='/socialApi';
|
||||
fileUrl = 'https://u.boe.com/upload';
|
||||
loginPath='https://u.boe.com/m/loginuser';
|
||||
fileUrl = 'https://u-pre.boe.com/upload';
|
||||
loginPath='https://u-pre.boe.com/m/loginuser';
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -66,15 +66,17 @@
|
||||
}
|
||||
},
|
||||
{"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/login/next","style" : {"navigationBarTitleText": "修改密码"}},
|
||||
{"path" : "pages/login/headPortrait","style" : {"navigationBarTitleText": "修改头像"}},
|
||||
{"path" : "pages/login/nickName","style" : {"navigationBarTitleText": "修改昵称"}},
|
||||
{"path" : "pages/login/newBirt","style" : {"navigationBarTitleText": "修改生日"}},
|
||||
{"path" : "pages/login/indLabels","style" : {"navigationBarTitleText": "修改个人标签"}},
|
||||
{"path" : "pages/study/courseStudy","style" : {"navigationBarTitleText": "课程学习"}},
|
||||
{"path" : "pages/study/audioTest","style" : {"navigationBarTitleText": "音频测试"}},
|
||||
{"path" : "pages/study/courseStudy","style" : {"navigationBarTitleText": "课程学习"}}
|
||||
{"path" : "pages/study/videoTest","style" : {"navigationBarTitleText": "视频频测试"}}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
||||
@@ -249,6 +249,7 @@
|
||||
},
|
||||
startTest() {
|
||||
this.curTestAnswer = {};
|
||||
this.aloneExamAnswerId='';
|
||||
this.curIndex=0;
|
||||
// 先禁用,防止重复提交
|
||||
if (this.testPaper.entranceTime && this.testPaper.entranceTime !== '') {
|
||||
@@ -299,9 +300,9 @@
|
||||
this.testStatus = 2;
|
||||
this.startReckon();
|
||||
//60秒后执行保存处理,这里和pc端不一致,不做延迟,直接保存考试信息
|
||||
// window.setTimeout(function() {
|
||||
$this.saveUserTest();
|
||||
// }, 10000);
|
||||
//window.setTimeout(function() {
|
||||
//$this.saveUserTest();
|
||||
//}, 10000);
|
||||
} else {
|
||||
this.startButton = false;
|
||||
uni.showLoading({
|
||||
@@ -314,6 +315,7 @@
|
||||
reStartTest(item){
|
||||
//直接提取,
|
||||
this.curTestAnswer = {};
|
||||
this.aloneExamAnswerId='';
|
||||
this.curIndex=0;
|
||||
apiTestPaper.getAnswerDetail(item.id).then(res => {
|
||||
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分钟后执行
|
||||
if (this.handleSaveTest != null) {
|
||||
window.clearTimeout(this.handleSaveTest);
|
||||
@@ -385,7 +401,7 @@
|
||||
data.arrange = this.testPaper.arrange;
|
||||
data.passLine = this.testPaper.passLine;
|
||||
data.ucode = this.userInfo.userNo;
|
||||
data.paperJson = JSON.stringify(this.paper);
|
||||
data.paperJson = this.clearPagerJson();
|
||||
data.answerJson = this.getAnswer();
|
||||
//计算总分
|
||||
let total = 0;
|
||||
@@ -419,11 +435,13 @@
|
||||
total+=item.defaultScore;
|
||||
}
|
||||
}else if (item.type == 1) {
|
||||
//console.log(item,item.defaultScore,'item.defaultScore')
|
||||
item.optionList.forEach(opt => {
|
||||
if (opt.id == item.userAnswer && opt.isAnswer) {
|
||||
total += item.defaultScore;
|
||||
}
|
||||
})
|
||||
//console.log(total,'total')
|
||||
}else if (item.type == 2) {
|
||||
let tempAnswer = [];
|
||||
item.optionList.forEach(opt => {
|
||||
@@ -470,9 +488,19 @@
|
||||
data.arrange = this.testPaper.arrange;
|
||||
data.passLine = this.testPaper.passLine;
|
||||
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.realScore=this.countScore();
|
||||
if(!this.aloneExamAnswerId){
|
||||
data.paperJson = this.clearPagerJson();
|
||||
}
|
||||
|
||||
data.useSecond=this.testPaper.testDuration*60-this.remainingTime;
|
||||
//计算百分制显示
|
||||
data.score=data.realScore*100/data.totalScore;
|
||||
@@ -611,7 +639,6 @@
|
||||
},
|
||||
nextSub() {
|
||||
//console.log(this.curItem,'this.curItem');
|
||||
|
||||
if (this.curIndex >= (this.total - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
if(res.status==200){
|
||||
uni.showToast({
|
||||
title:"修改成功" ,
|
||||
duration: 1000
|
||||
duration: 1000,
|
||||
image:'../../static/images/icon/ok-icon.png'
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -157,12 +157,24 @@
|
||||
})
|
||||
},
|
||||
toFollow(item,index) {
|
||||
console.log(item,'item')
|
||||
let $this=this;
|
||||
apiFollow.save(item.userFollow.aid).then(res=>{
|
||||
if(res.status == 200) {
|
||||
$this.followMe.list[index].has = true;
|
||||
// 手动把关注成功的数据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 {
|
||||
// this.$message.error(res.message);
|
||||
}
|
||||
|
||||
@@ -338,15 +338,9 @@ export default {
|
||||
|
||||
},
|
||||
toCourseDetail(citem) {
|
||||
if (citem.contentType == 10) {
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -238,6 +238,7 @@
|
||||
color: #0A89FC;
|
||||
margin-left: 74upx;
|
||||
margin-top: 26upx;
|
||||
margin-bottom: 30upx;
|
||||
}
|
||||
// margin-top: 510upx;
|
||||
.medal-list-index{
|
||||
|
||||
@@ -190,9 +190,9 @@
|
||||
},
|
||||
|
||||
// 实例被激活时使用,用于重复激活一个实例的时候
|
||||
activated () {
|
||||
this.findData(true);
|
||||
},
|
||||
// activated () {
|
||||
// this.findData(true);
|
||||
// },
|
||||
|
||||
|
||||
methods:{
|
||||
@@ -244,7 +244,9 @@
|
||||
.then(res => {
|
||||
if (res.status == 200) {
|
||||
uni.showToast({
|
||||
title:'删除成功'
|
||||
title:'删除成功',
|
||||
// duration:500000
|
||||
image:'../../static/images/icon/ok-icon.png'
|
||||
})
|
||||
// $this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
||||
$this.findAnData(true);
|
||||
@@ -257,9 +259,13 @@
|
||||
});
|
||||
},
|
||||
editItem(item){
|
||||
this.reply = item;
|
||||
this.inputValue = item.answercontent;
|
||||
this.inputShow=true
|
||||
// this.reply = item;
|
||||
// this.inputValue = item.answercontent;
|
||||
// this.inputShow=true
|
||||
|
||||
uni.navigateTo({
|
||||
url:'/pages/plus/editAnser?value='+JSON.stringify(item)
|
||||
})
|
||||
},
|
||||
toanDetail(item) {
|
||||
uni.navigateTo({
|
||||
@@ -268,7 +274,6 @@
|
||||
});
|
||||
},
|
||||
toDetail(item) {
|
||||
console.log(item,'item')
|
||||
uni.navigateTo({
|
||||
url: '/pages/resource/qaDetail?id=' + item.id
|
||||
});
|
||||
@@ -289,7 +294,8 @@
|
||||
apiQa.del(item.id).then(res=>{
|
||||
if(res.status=200){
|
||||
uni.showToast({
|
||||
title:'删除成功'
|
||||
title:'删除成功',
|
||||
image:'../../static/images/icon/ok-icon.png'
|
||||
})
|
||||
// $this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
||||
let event = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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-if="item.type == 1">
|
||||
<view class="course_box">
|
||||
@@ -30,7 +30,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.type == 2">
|
||||
<view class="article_one" >
|
||||
<view class="article_one">
|
||||
<view>
|
||||
<view @click="toArticleDetail(item)" class="articla_tit" >
|
||||
<text v-html="$keywordActiveShow(item.title,query.keyword)"></text>
|
||||
@@ -285,15 +285,16 @@ export default {
|
||||
});
|
||||
},
|
||||
toCourseDetail(citem) {
|
||||
if (citem.contentType == 10) {
|
||||
// if (citem.contentType == 10) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/resource/microDetail?id=' + citem.objId
|
||||
// });
|
||||
// } else {
|
||||
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -128,7 +128,8 @@
|
||||
this.$store.dispatch('InitData');
|
||||
// uni.navigateBack(-1);
|
||||
uni.showToast({
|
||||
title:'更新成功'
|
||||
title:'更新成功',
|
||||
image:'../../static/images/icon/ok-icon.png'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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-if="item.type == 1">
|
||||
<view class="course_box">
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
aid: $this.userInfo.aid, //当前登录人的id
|
||||
aname: $this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
uni.redirectTo({
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
aid: $this.userInfo.aid, //当前登录人的id
|
||||
aname: $this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
$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>
|
||||
</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="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 class="row">
|
||||
<u-upload uploadIcon="plus" :fileList="fileList" multiple @afterRead="afterRead" @delete="deletePic" name="coverImg" :maxCount="5">
|
||||
@@ -41,8 +41,10 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
fileUrl:this.$config.fileUrl,
|
||||
qa:{
|
||||
content:'',
|
||||
id:'',
|
||||
title:'',
|
||||
content:'',
|
||||
@@ -55,6 +57,7 @@
|
||||
...mapGetters(['userInfo']),
|
||||
},
|
||||
methods: {
|
||||
|
||||
toBack(){
|
||||
uni.navigateBack();
|
||||
},
|
||||
@@ -120,8 +123,9 @@
|
||||
onLoad(option){
|
||||
if(option.value){
|
||||
this.qa=JSON.parse(option.value)
|
||||
this.content = (this.qa.content).replace(/<\/?[^>]*>/g, '');
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
// this.$store.dispatch("userTrigger", event);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{{ detailData.title }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="interval"></view>
|
||||
<!-- <view class="interval"></view> -->
|
||||
<view class="adetail content">
|
||||
<!--文章内容-->
|
||||
<view class="adetail-info">
|
||||
@@ -409,7 +409,7 @@ export default {
|
||||
aid: $this.userInfo.aid, //当前登录人的id
|
||||
aname: $this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
} else {
|
||||
@@ -559,7 +559,7 @@ export default {
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}
|
||||
@@ -620,7 +620,7 @@ export default {
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
} else {
|
||||
@@ -698,7 +698,7 @@ export default {
|
||||
aid: $this.userInfo.aid, //当前登录人的id
|
||||
aname: $this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
@@ -811,7 +811,7 @@ export default {
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1,
|
||||
source:2,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
@@ -938,7 +938,7 @@ export default {
|
||||
padding: 15upx 30upx;
|
||||
.adetail-title {
|
||||
background-color: #fff;
|
||||
padding-bottom: 40upx;
|
||||
// padding-bottom: 40upx;
|
||||
font-weight: 500;
|
||||
font-size: 36upx;
|
||||
letter-spacing: 0.5px;
|
||||
@@ -954,6 +954,7 @@ export default {
|
||||
color: #7e7e7e;
|
||||
}
|
||||
.adetail-body {
|
||||
padding-top: 20upx;
|
||||
line-height: 55upx;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<course-image :course="c" width="308upx" height="192upx"></course-image>
|
||||
</view>
|
||||
<view class="coures-conent">
|
||||
<view class="conent-title" v-html="c.name">
|
||||
<view class="conent-title" v-html="$keywordActiveShow(c.name,keyword)">
|
||||
</view>
|
||||
<!-- <view class="con-au"> -->
|
||||
<!-- <view v-else style="font-size: 24upx; color: #666666;padding-top: 10upx;"> -->
|
||||
@@ -101,7 +101,7 @@
|
||||
</view>
|
||||
{{converToScore(c.score)}}
|
||||
</text>
|
||||
<text>{{ c.score }}<text class="statuy-num">{{c.studies}}+</text>人学习</text>
|
||||
<text><text class="statuy-num">{{c.studies}}+</text>人学习</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -713,15 +713,9 @@
|
||||
},
|
||||
toCoursePage(coure){
|
||||
if(coure.source ==1){
|
||||
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 {
|
||||
uni.navigateTo({
|
||||
url: '/pages/study/courseStudy?id='+coure.id
|
||||
|
||||
@@ -5,40 +5,23 @@
|
||||
<u-toast ref="messager"></u-toast>
|
||||
<!-- <page-title :showBack="true"></page-title> -->
|
||||
<view class="playbox"><!--内容播放区域-->
|
||||
<view style="min-height: 500upx;" >
|
||||
<view style="min-height: 440upx;" >
|
||||
<view v-if="curContent.contentType==10" style="background-color: #000000;">
|
||||
<!--视频-->
|
||||
<view style="position: relative;">
|
||||
<video id="myVideo"
|
||||
@touchend="doubleClickVideo"
|
||||
:src="blobUrl"
|
||||
controls
|
||||
:enable-play-gesture="true"
|
||||
:initial-time="curContent.lastStudyTime"
|
||||
@play="onPlayerPlay"
|
||||
@pause="onPlayerPause"
|
||||
@ended="onPlayerEnded"
|
||||
@timeupdate="onPlayerPlaying"
|
||||
@fullscreenchange="onFullScreen"
|
||||
style="width: 100%; object-fit: fill">
|
||||
</video>
|
||||
<!--倍速度-->
|
||||
<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">
|
||||
<video-player
|
||||
:url="blobUrl"
|
||||
controls
|
||||
:enable-play-gesture="true"
|
||||
:inittime="curContent.lastStudyTime"
|
||||
@play="onPlayerPlay"
|
||||
@pause="onPlayerPause"
|
||||
@ended="onPlayerEnded"
|
||||
@timeupdate="onPlayerPlaying"
|
||||
@fullscreenchange="onFullScreen"
|
||||
style="width: 100%; object-fit: fill">
|
||||
></video-player>
|
||||
<view class="player-box" v-if="playerBoxShow">
|
||||
<view class="player-praise">
|
||||
<view @click="praiseContent" style="cursor: pointer;">
|
||||
<image class="icon-small" v-if="isPraise" src="/static/images/icon/praise-active.png" />
|
||||
@@ -1335,41 +1318,7 @@
|
||||
},
|
||||
onFullScreen(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(){
|
||||
this.isPlaying = true;
|
||||
@@ -1608,7 +1557,7 @@
|
||||
background-color: #fff;
|
||||
}
|
||||
.playbox{
|
||||
padding: 10upx;
|
||||
//padding: 10upx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.contentbox{
|
||||
@@ -1650,7 +1599,7 @@
|
||||
}
|
||||
.tabrow{
|
||||
display: flex;
|
||||
border-bottom:1px solid #999999;
|
||||
border-bottom:1px solid rgba(153,153,153,0.14);
|
||||
font-size: 28upx;
|
||||
.tabrow-active{
|
||||
font-size: 32upx;
|
||||
@@ -1864,6 +1813,51 @@
|
||||
overflow: hidden;
|
||||
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{
|
||||
background: #FFFFFF;
|
||||
padding:20upx;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
|
||||
</view>
|
||||
<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}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -334,6 +334,12 @@
|
||||
{name: '进行中',value: 1},
|
||||
{name: '已完成',value: 2}
|
||||
],
|
||||
autonomyStatustList: [
|
||||
{name: '全部',value: ''},
|
||||
{name: '未开始',value: 1},
|
||||
{name: '进行中',value: 2},
|
||||
{name: '已完成',value: 9}
|
||||
],
|
||||
statustArray: [
|
||||
[{name: '在线课',value: 'online-course'},
|
||||
{name: '面授班',value: 'face-course'},
|
||||
@@ -415,7 +421,6 @@
|
||||
},
|
||||
methods: {
|
||||
removecour(item){
|
||||
console.log(item);
|
||||
item.delcour = !item.delcour
|
||||
},
|
||||
rowbtn(row) {
|
||||
@@ -521,11 +526,15 @@
|
||||
},
|
||||
autonomyStatus(num) {
|
||||
this.Applistatus = num;
|
||||
this.autonomy.status = num;
|
||||
this.statusSelectShow = false;
|
||||
// console.log(this.Applistatus)
|
||||
this.getLearning();
|
||||
// this.getLearning();
|
||||
this.searchData();
|
||||
},
|
||||
taskStatus(num) {
|
||||
this.boeStatus = num;
|
||||
this.statusSelectShow = false;
|
||||
this.loadBoeData(true);
|
||||
},
|
||||
closeBtns() {
|
||||
@@ -576,6 +585,7 @@
|
||||
loadBoeData(flag) {
|
||||
if (flag) {
|
||||
this.taskPageIndex = 1; //回到首页
|
||||
this.couresList = [];
|
||||
}
|
||||
let params = {
|
||||
page: this.taskPageIndex,
|
||||
@@ -587,12 +597,12 @@
|
||||
params.cmtask_name = this.keyWord;
|
||||
}
|
||||
apiBoeCourse.cmtaskList(params).then(res => {
|
||||
this.taskCount = res.result.count;
|
||||
this.taskCount = res.result.count;
|
||||
res.result.list.forEach(item => {
|
||||
let time = this.formatDate(item.created_at * 1000);
|
||||
item.created_at = time.split(' ')[0];
|
||||
});
|
||||
this.couresList = res.result.list;
|
||||
this.couresList.push(...res.result.list);
|
||||
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
||||
this.taskHasMore = true;
|
||||
} else {
|
||||
@@ -648,12 +658,12 @@
|
||||
},
|
||||
clicktab(idx) {
|
||||
this.tabIndex = idx;
|
||||
if (this.tabIndex == 1) {
|
||||
if (this.tabIndex == 1 && this.studyList.length == 0) {
|
||||
this.getLearning()
|
||||
// this.searchData();
|
||||
} else if (this.tabIndex == 2) {
|
||||
this.history()
|
||||
} else if (this.tabIndex == 0) {
|
||||
} else if (this.tabIndex == 0 && this.couresList.length == 0) {
|
||||
this.loadBoeData()
|
||||
}
|
||||
},
|
||||
@@ -701,7 +711,6 @@
|
||||
})
|
||||
},
|
||||
async getLearning() {
|
||||
console.log(this.Applistatus)
|
||||
uni.showLoading({
|
||||
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