Browse Source

答题优化

h5_css
yanyan 3 years ago
parent
commit
cf5016e727
  1. 20
      components/s-video/s-video.vue
  2. 8
      pages.json
  3. 3
      subpkg/practice/practice.vue

20
components/s-video/s-video.vue

@ -25,6 +25,7 @@
</template> </template>
<script> <script>
import { mapMutations, mapState } from 'vuex'
export default { export default {
name: "s-video", name: "s-video",
data() { data() {
@ -41,6 +42,16 @@
preQuestionId: "", preQuestionId: "",
}; };
}, },
computed: {
...mapState('m_user', ['userId'])
},
watch:{
jsonId:{
handler:function(){
this.getBindJson();
}
}
},
props:{ props:{
jsonId: { jsonId: {
type: String, type: String,
@ -73,14 +84,17 @@
this.end = true; this.end = true;
this.answerList = []; this.answerList = [];
this.question = false; this.question = false;
uni.navigateTo({
url: '/subpkg/complete/complete'
})
} }
}, },
nextQuestion(outId, obj) { nextQuestion(outId, obj) {
// 点击开始后先增加题次 // 点击开始后先增加题次
if(2==outId) { if(2==outId) {
this.$api.addQuestionFre({ this.$api.addQuestionFre({
roleId : "1", roleId : this.jsonId,
userId : "123" userId : this.userId
}) })
.then(res => { .then(res => {
this.questionFreId = res.data; this.questionFreId = res.data;
@ -102,7 +116,7 @@
} }
// 播放下一视频 // 播放下一视频
this.hasNodeId(outId); this.hasNodeId(outId);
this.videoObj.videoUrl = 'http://localhost:85/'+this.videoObj.videoUrl this.videoObj.videoUrl = uni.$http.baseUrl + this.videoObj.videoUrl
this.start = false; this.start = false;
this.question = false; this.question = false;
this.auto = true; this.auto = true;

8
pages.json

@ -130,6 +130,14 @@
"navigationBarTitleText" : "", "navigationBarTitleText" : "",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "complete/complete",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}] }]
}], }],
"globalStyle": { "globalStyle": {

3
subpkg/practice/practice.vue

@ -13,13 +13,12 @@
data() { data() {
return { return {
page: "", page: "",
jsonId: "d1d4007d09c24b84ab79fd9e7d2337c6", jsonId: "",
roleId:"", roleId:"",
}; };
}, },
onLoad(options) { onLoad(options) {
this.jsonId = options.roleId this.jsonId = options.roleId
this.$emit('getJsonId',this.jsonId)
}, },
onReady() { onReady() {
this.QR(); this.QR();

Loading…
Cancel
Save