|
|
|
@ -6,20 +6,23 @@ |
|
|
|
<view class="popup-layer-back" v-if="!start" v-show="question"> |
|
|
|
<!-- <view class="popup-layer-close" @click="question=false">关闭</view> --> |
|
|
|
<view class="popup-layer"> |
|
|
|
<h2>请选择</h2> |
|
|
|
<p @click="nextQuestion(item.outs[0], item)" v-for="(item, index) in answerList">{{item.channel}}</p> |
|
|
|
<!-- <h2>请选择</h2> --> |
|
|
|
<view class="anitem" @click="nextQuestion(item.outs[0], item)" v-for="(item, index) in answerList"> |
|
|
|
<image class="animg" src="/static/videos/skin_bg_1a.png"></image> |
|
|
|
<view class="antxt">{{item.channel}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-layer-back" v-if="start"> |
|
|
|
<!-- <view class="popup-layer-back" v-if="start"> |
|
|
|
<view class="popup-layer" @click="nextQuestion(2, null)"> |
|
|
|
<p>开始</p> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-layer-back" v-if="end"> |
|
|
|
</view> --> |
|
|
|
<!-- <view class="popup-layer-back" v-if="end"> |
|
|
|
<view class="popup-layer" @click="getBindJson()"> |
|
|
|
<p>重新开始</p> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -40,6 +43,7 @@ |
|
|
|
question: false, |
|
|
|
questionFreId: "", |
|
|
|
preQuestionId: "", |
|
|
|
correct: "", |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -70,8 +74,8 @@ |
|
|
|
this.getBindJson(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
videoEnded() { |
|
|
|
debugger |
|
|
|
this.auto = false; |
|
|
|
this.question = true; |
|
|
|
// 出答案 |
|
|
|
@ -98,16 +102,15 @@ |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
this.questionFreId = res.data; |
|
|
|
console.log(this.questionFreId); |
|
|
|
}).catch((e) => console.log(e)); //捕获异常 |
|
|
|
} |
|
|
|
|
|
|
|
// 先提交所选答案 |
|
|
|
if(null!=obj) { |
|
|
|
var param = { |
|
|
|
answer : obj.channel, |
|
|
|
questionFreId : this.questionFreId, |
|
|
|
questionId : this.preQuestionId |
|
|
|
questionId : this.preQuestionId, |
|
|
|
correctAnswer : this.correct |
|
|
|
} |
|
|
|
this.$api.addAnswer(param) |
|
|
|
.then(res => { |
|
|
|
@ -135,13 +138,19 @@ |
|
|
|
for(var i=0; i<this.videoObjList.length; i++) { |
|
|
|
if(nodeId == this.videoObjList[i].nodeId) { |
|
|
|
this.videoObj = this.videoObjList[i]; |
|
|
|
this.correct = this.videoObjList[i].correct; |
|
|
|
} |
|
|
|
} |
|
|
|
this.preQuestionId = this.videoObj.questionId; |
|
|
|
// 直接自动开始播放 |
|
|
|
if(nodeId == 1) { |
|
|
|
this.nextQuestion(2, null) |
|
|
|
} |
|
|
|
}, |
|
|
|
getAnswer(outId) { |
|
|
|
for(var i=0; i<this.videoObjList.length; i++) { |
|
|
|
if(outId == this.videoObjList[i].nodeId) { |
|
|
|
console.log(this.videoObjList[i]) |
|
|
|
this.answerList.push(this.videoObjList[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -168,10 +177,31 @@ |
|
|
|
top: 50%; |
|
|
|
left: 50%; |
|
|
|
transform: translate(-50%, -50%); |
|
|
|
background-color: #fff; |
|
|
|
/* background-color: #fff; */ |
|
|
|
color: #fff; |
|
|
|
padding: 20px; |
|
|
|
z-index: 9999; |
|
|
|
} |
|
|
|
|
|
|
|
.popup-layer .anitem { |
|
|
|
position: relative; |
|
|
|
margin: 80rpx; |
|
|
|
width: 300rpx; |
|
|
|
height: 100rpx; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.popup-layer .anitem .animg { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.popup-layer .anitem .antxt { |
|
|
|
position: absolute; |
|
|
|
top: 30%; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 设置关闭按钮 */ |
|
|
|
.popup-layer-close { |
|
|
|
|