|
|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="video-wrapper" id="video-container"> |
|
|
<view class="video-wrapper" id="video-container"> |
|
|
<view style="position:relative;width:100%;" :style="{'height':videoHeight+'px'}"> |
|
|
<view style="position:relative;width:100%;" :style="{'height':videoHeight+'px'}"> |
|
|
<video id="video_play" :src="videoObj.videoUrl" @ended="videoEnded()" :autoplay="auto" :show-fullscreen-btn="false" :loop="isLoop" style="width: 100%;height: 90%;"></video> |
|
|
<video id="video_play" :controls="false" :src="videoObj.videoUrl" @ended="videoEnded()" :autoplay="auto" :show-fullscreen-btn="false" :loop="isLoop" style="width: 100%;height: 90%;"></video> |
|
|
<view class="question"></view> |
|
|
<view class="question"></view> |
|
|
<view class="popup-layer-back" v-if="!start" v-show="question"> |
|
|
<view class="popup-layer-back" v-if="!start" v-show="question"> |
|
|
<!-- <view class="popup-layer-close" @click="question=false">关闭</view> --> |
|
|
<!-- <view class="popup-layer-close" @click="question=false">关闭</view> --> |
|
|
@ -10,7 +10,8 @@ |
|
|
<view>{{ask}}</view> |
|
|
<view>{{ask}}</view> |
|
|
<view class="anitem" @click="nextQuestion(item.outs[0], item)" v-for="(item, index) in answerList" :key="index"> |
|
|
<view class="anitem" @click="nextQuestion(item.outs[0], item)" v-for="(item, index) in answerList" :key="index"> |
|
|
<image class="animg" src="/static/videos/skin_bg_1a.png"></image> |
|
|
<image class="animg" src="/static/videos/skin_bg_1a.png"></image> |
|
|
<view class="antxt">{{item.channel}}</view> |
|
|
<!-- <view class="antxt">{{item.channel}}</view> --> |
|
|
|
|
|
<view :class="autoChannel===item.channel?'antxtCheck':'antxt'">{{item.channel}}</view> |
|
|
<view class="judd jdok" v-show="isOk && item.choose === 'true'"><image class="judimg" src="/static/images/icon-ok.png"></image></view> |
|
|
<view class="judd jdok" v-show="isOk && item.choose === 'true'"><image class="judimg" src="/static/images/icon-ok.png"></image></view> |
|
|
<view class="judd jderr" v-show="isError && item.choose === 'false'"><image class="judimg" src="/static/images/icon-err.png"></image></view> |
|
|
<view class="judd jderr" v-show="isError && item.choose === 'false'"><image class="judimg" src="/static/images/icon-err.png"></image></view> |
|
|
</view> |
|
|
</view> |
|
|
@ -22,7 +23,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> --> |
|
|
</view> --> |
|
|
<view class="popup-layer-back" v-show="resCheck"> |
|
|
<view class="popup-layer-back" v-show="resCheck"> |
|
|
<view class="popup-layer" @click="toResVideo()"> |
|
|
<view class="popup-layer" style="color: red;" @click="toResVideo()"> |
|
|
<p>重新选择逃生路线</p> |
|
|
<p>重新选择逃生路线</p> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -45,6 +46,10 @@ |
|
|
videoObjList: [], |
|
|
videoObjList: [], |
|
|
videoObj:{}, |
|
|
videoObj:{}, |
|
|
answerList: [], |
|
|
answerList: [], |
|
|
|
|
|
autoAnswerList: [], |
|
|
|
|
|
autoIndex: 0, |
|
|
|
|
|
autoChannel: "", |
|
|
|
|
|
txtColor: "", |
|
|
start: true, |
|
|
start: true, |
|
|
end: false, |
|
|
end: false, |
|
|
auto: true, |
|
|
auto: true, |
|
|
@ -95,6 +100,18 @@ |
|
|
for(var i=0; i<this.videoObj.outs.length; i++) { |
|
|
for(var i=0; i<this.videoObj.outs.length; i++) { |
|
|
this.getAnswer(this.videoObj.outs[i]) |
|
|
this.getAnswer(this.videoObj.outs[i]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 在这里进行答案自动选择 |
|
|
|
|
|
var that = this; |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
for(var i=0; i<that.answerList.length; i++) { |
|
|
|
|
|
if(that.answerList[i].channel == that.autoAnswerList[that.autoIndex].answer) { |
|
|
|
|
|
that.autoChannel = that.autoAnswerList[that.autoIndex].answer; |
|
|
|
|
|
that.nextQuestion(that.answerList[i].outs[0], that.answerList[i]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
that.autoIndex++ |
|
|
|
|
|
}, 500); |
|
|
} else { |
|
|
} else { |
|
|
if(this.resVideoUrl == "") { |
|
|
if(this.resVideoUrl == "") { |
|
|
// 为空表示答题正确正常跳转 |
|
|
// 为空表示答题正确正常跳转 |
|
|
@ -108,6 +125,7 @@ |
|
|
// 不为空表示答题错误展示返回重新选择 |
|
|
// 不为空表示答题错误展示返回重新选择 |
|
|
this.resCheck = true; |
|
|
this.resCheck = true; |
|
|
this.question = false; |
|
|
this.question = false; |
|
|
|
|
|
this.toResVideo(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -124,14 +142,14 @@ |
|
|
nextQuestion(outId, obj) { |
|
|
nextQuestion(outId, obj) { |
|
|
// 点击开始后先增加题次 |
|
|
// 点击开始后先增加题次 |
|
|
if(2==outId) { |
|
|
if(2==outId) { |
|
|
this.$api.addQuestionFre({ |
|
|
// this.$api.addQuestionFre({ |
|
|
roleId : this.jsonId, |
|
|
// roleId : this.jsonId, |
|
|
// userId : this.userId |
|
|
// // userId : this.userId |
|
|
userId : '007' |
|
|
// userId : '007' |
|
|
}) |
|
|
// }) |
|
|
.then(res => { |
|
|
// .then(res => { |
|
|
this.questionFreId = res.data; |
|
|
// this.questionFreId = res.data; |
|
|
}).catch((e) => console.log(e)); //捕获异常 |
|
|
// }).catch((e) => console.log(e)); //捕获异常 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var isCorrect = 0; |
|
|
var isCorrect = 0; |
|
|
@ -156,10 +174,10 @@ |
|
|
correctAnswer : this.correct, |
|
|
correctAnswer : this.correct, |
|
|
correct : isCorrect, |
|
|
correct : isCorrect, |
|
|
} |
|
|
} |
|
|
this.$api.addAnswer(param) |
|
|
// this.$api.addAnswer(param) |
|
|
.then(res => { |
|
|
// .then(res => { |
|
|
console.log(res); |
|
|
// console.log(res); |
|
|
}).catch((e) => console.log(e)); //捕获异常 |
|
|
// }).catch((e) => console.log(e)); //捕获异常 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 所选答案错误处理1: 用于之前的对错提示展示 |
|
|
// 所选答案错误处理1: 用于之前的对错提示展示 |
|
|
@ -216,7 +234,7 @@ |
|
|
queryQAByFreId() { |
|
|
queryQAByFreId() { |
|
|
this.$api.queryQAByFreId('084ddf84e4be4b02acdcfad396c28f98') |
|
|
this.$api.queryQAByFreId('084ddf84e4be4b02acdcfad396c28f98') |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
console.log(res); |
|
|
this.autoAnswerList.push(...res.data); |
|
|
}).catch((e) => console.log(e)); //捕获异常 |
|
|
}).catch((e) => console.log(e)); //捕获异常 |
|
|
}, |
|
|
}, |
|
|
hasNodeId(nodeId) { |
|
|
hasNodeId(nodeId) { |
|
|
@ -296,6 +314,14 @@ |
|
|
font-size: 1.2rem; |
|
|
font-size: 1.2rem; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.antxtCheck { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: 60%; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
font-size: 1.2rem; |
|
|
|
|
|
color: red; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.judd { |
|
|
.judd { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
top: -20rpx; |
|
|
top: -20rpx; |
|
|
|