Commit a63eea3b authored by Damon's avatar Damon

feat: 移除错题

parent a6a47e79
......@@ -29,6 +29,9 @@ let learnApiFun = function(vm) {
let removeCollection = async (params = {}) =>
await vm.$u.get('/rest/question/remove/collection/'+params.questionId, params)
let removeError = async (params = {}) =>
await vm.$u.get('/rest/question/remove/error/'+params.questionId, params)
const learnApi = {
getQuestion,
getQuestionTotal,
......@@ -37,7 +40,8 @@ let learnApiFun = function(vm) {
getQuestionWarehouse,
getProvinceList,
joinCollection,
removeCollection
removeCollection,
removeError
}
return learnApi
}
......
......@@ -70,7 +70,12 @@
<text>交卷</text>
</view>
<view class="c-list" v-if="type === 4" @click="remove">
<u-icon name="order" color="#5A6073" size="40"></u-icon>
<u-image
:src="removeImg"
width="36"
height="40"
:lazy-load="false"
/>
<text>移出</text>
</view>
</view>
......@@ -192,6 +197,9 @@ export default {
}
return process.uniEnv.qn_base_url + name
},
removeImg() {
return process.uniEnv.qn_base_url + 'remove-error.png'
},
currentNumber() {
let index = this.currentIndex
return index === -2 ? this.total : index + 1
......@@ -469,8 +477,10 @@ export default {
},
// 移除
remove() {
console.log('this.list[this.currentIndex]', this.list[this.currentIndex])
console.log('移除')
const info = this.list.find(v => v.index === this.currentIndex)
this.$u.api.removeError({questionId: info.id}).then(res => {
this.current = this.currentIndex + 1
})
},
// 以下方法用于初始化数据
refresh(currentIndex) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment