6 changed files with 229 additions and 6 deletions
@ -0,0 +1,85 @@ |
|||
<template> |
|||
<view> |
|||
<span class="title">重新挑战</span> |
|||
<view class="background-info"> |
|||
您上次挑战的场景是“{{sceneName}}”,挑战角色是 “{{roleName}}”,共计{{total}}道题目。您可从第1题开始重新挑战,或者任意选择其中一道题重新挑战。 |
|||
</view> |
|||
<scroll-view class="question-info" scroll-y> |
|||
<view class="question-list"> |
|||
<view class="question-item" v-for="(item, i) in questionList" :key="i" @click="itemClickHandler(item)"> |
|||
<view class="question-num">{{i+1}}:{{item.ask}}</view> |
|||
<image :src="backgroundImg"></image> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
"sceneName":"", |
|||
"roleName":"", |
|||
"backgroundImg":"", |
|||
"total":0, |
|||
"questionFreId":"", |
|||
questionList:[] |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
this.questionFreId = options.questionFreId |
|||
this.getQuestionList() |
|||
this.getRelationInfo() |
|||
}, |
|||
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 |
|||
this.total = res.data.length |
|||
//uni.$showMsg('数据请求成功!') |
|||
}, |
|||
async getRelationInfo() { |
|||
const { |
|||
data: res |
|||
} = await uni.$http.post('/small/questionFre/getRelationInfo',this.questionFreId) |
|||
if (!res.success) return uni.$showMsg() |
|||
if (res.data != null) { |
|||
this.roleName = res.data.sceneRole != null ? res.data.sceneRole.name : "" |
|||
this.sceneName = res.data.sceneManage != null ? res.data.sceneManage.name : "" |
|||
this.backgroundImg = res.data.file.length!=0 ? uni.$http.baseUrl +res.data.file[0].uploadPath : "" |
|||
} |
|||
//uni.$showMsg('数据请求成功!') |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.title{ |
|||
margin-left: 40%; |
|||
font-size: 20px; |
|||
} |
|||
.background-info{ |
|||
border: 1px solid lightgreen; |
|||
width: 96%; |
|||
margin-left: 2%; |
|||
height: 200rpx; |
|||
border-radius: 10px; |
|||
} |
|||
.question-info{ |
|||
border: 1px solid lightgreen; |
|||
width: 96%; |
|||
margin-top: 5%; |
|||
margin-left: 2%; |
|||
height: 880rpx; |
|||
border-radius: 10px; |
|||
} |
|||
.question-num{ |
|||
width: 96%; |
|||
height: 60rpx; |
|||
} |
|||
</style> |
|||
@ -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 |
|||
Loading…
Reference in new issue