diff --git a/components/s-video/s-video.vue b/components/s-video/s-video.vue index 75e835e..7dfa3b2 100644 --- a/components/s-video/s-video.vue +++ b/components/s-video/s-video.vue @@ -7,6 +7,7 @@ + {{ask}} {{item.channel}} @@ -44,6 +45,7 @@ questionFreId: "", preQuestionId: "", correct: "", + ask: "", }; }, computed: { @@ -89,7 +91,7 @@ this.answerList = []; this.question = false; uni.navigateTo({ - url: '/subpkg/complete/complete' + url: '/subpkg/complete/complete?questionFreId='+this.questionFreId+'&roleId='+this.jsonId }) } }, @@ -108,6 +110,7 @@ if(null!=obj) { var param = { answer : obj.channel, + ask : this.ask, questionFreId : this.questionFreId, questionId : this.preQuestionId, correctAnswer : this.correct @@ -139,6 +142,7 @@ if(nodeId == this.videoObjList[i].nodeId) { this.videoObj = this.videoObjList[i]; this.correct = this.videoObjList[i].correct; + this.ask = this.videoObjList[i].ask; } } this.preQuestionId = this.videoObj.questionId; diff --git a/main.js b/main.js index 8fbe857..817bfc7 100644 --- a/main.js +++ b/main.js @@ -13,6 +13,7 @@ import * as filters from '@/utils/formatFilter' uni.$http = $http Vue.prototype.$api = api +// $http.baseUrl = 'http://146.56.223.227:9527' $http.baseUrl = 'http://localhost:85' $http.beforeRequest = function(options) { diff --git a/pages.json b/pages.json index 6dfaa0a..86520a7 100644 --- a/pages.json +++ b/pages.json @@ -138,6 +138,14 @@ "navigationBarTitleText" : "", "enablePullDownRefresh" : false } + }, + { + "path" : "rechallenge/rechallenge", + "style" : + { + "navigationBarTitleText" : "", + "enablePullDownRefresh" : false + } }] }], "globalStyle": { diff --git a/subpkg/complete/complete.vue b/subpkg/complete/complete.vue index 8c3b35f..46362a7 100644 --- a/subpkg/complete/complete.vue +++ b/subpkg/complete/complete.vue @@ -1,6 +1,33 @@ @@ -8,12 +35,109 @@ export default { data() { return { - + "questionFreId":"", + "roleId":"", + questionList: [], + recordList: [], + "ask":"", + "answer":"", }; + }, + onLoad(options) { + this.roleId = options.roleId + this.questionFreId = options.questionFreId + this.getQuestionList() + this.getRecordList() + }, + methods: { + async getQuestionList() { + const { + data: res + } = await uni.$http.post('/small/questionAnswer/listAll',{questionFreId:this.questionFreId}) + if (!res.success) return uni.$showMsg() + this.questionList = res.data + if (this.questionList.length !=0) { + this.ask = this.questionList[0].ask; + this.answer = this.questionList[0].answer; + } + + uni.$showMsg('数据请求成功!') + }, + async getRecordList() { + const { + data: res + } = await uni.$http.post('/small/questionFre/listAll',{roleId:this.roleId}) + if (!res.success) return uni.$showMsg() + this.recordList = res.data + + uni.$showMsg('数据请求成功!') + }, + backIndex(){ + uni.switchTab({ + url:'/pages/index/index' + }) + }, + reChallenge(){ + uni.navigateTo({ + url: '/subpkg/rechallenge/rechallenge?questionFreId='+this.questionFreId + }) + }, + itemClickHandler(item) { + if(item !== ""){ + this.ask= item.ask + this.answer= item.answer + } + }, } } diff --git a/subpkg/rechallenge/rechallenge.vue b/subpkg/rechallenge/rechallenge.vue new file mode 100644 index 0000000..0196a85 --- /dev/null +++ b/subpkg/rechallenge/rechallenge.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/utils/config.js b/utils/config.js index 1a15544..058ef40 100755 --- a/utils/config.js +++ b/utils/config.js @@ -1,2 +1,3 @@ -let url_config = "http://localhost:85/" +// let url_config = 'http://146.56.223.227:9527/' +let url_config = 'http://localhost:85/' export default url_config \ No newline at end of file