Commit a63eea3b authored by Damon's avatar Damon

feat: 移除错题

parent a6a47e79
...@@ -29,6 +29,9 @@ let learnApiFun = function(vm) { ...@@ -29,6 +29,9 @@ let learnApiFun = function(vm) {
let removeCollection = async (params = {}) => let removeCollection = async (params = {}) =>
await vm.$u.get('/rest/question/remove/collection/'+params.questionId, 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 = { const learnApi = {
getQuestion, getQuestion,
getQuestionTotal, getQuestionTotal,
...@@ -37,7 +40,8 @@ let learnApiFun = function(vm) { ...@@ -37,7 +40,8 @@ let learnApiFun = function(vm) {
getQuestionWarehouse, getQuestionWarehouse,
getProvinceList, getProvinceList,
joinCollection, joinCollection,
removeCollection removeCollection,
removeError
} }
return learnApi return learnApi
} }
......
...@@ -70,7 +70,12 @@ ...@@ -70,7 +70,12 @@
<text>交卷</text> <text>交卷</text>
</view> </view>
<view class="c-list" v-if="type === 4" @click="remove"> <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> <text>移出</text>
</view> </view>
</view> </view>
...@@ -192,6 +197,9 @@ export default { ...@@ -192,6 +197,9 @@ export default {
} }
return process.uniEnv.qn_base_url + name return process.uniEnv.qn_base_url + name
}, },
removeImg() {
return process.uniEnv.qn_base_url + 'remove-error.png'
},
currentNumber() { currentNumber() {
let index = this.currentIndex let index = this.currentIndex
return index === -2 ? this.total : index + 1 return index === -2 ? this.total : index + 1
...@@ -469,8 +477,10 @@ export default { ...@@ -469,8 +477,10 @@ export default {
}, },
// 移除 // 移除
remove() { remove() {
console.log('this.list[this.currentIndex]', this.list[this.currentIndex]) const info = this.list.find(v => v.index === this.currentIndex)
console.log('移除') this.$u.api.removeError({questionId: info.id}).then(res => {
this.current = this.currentIndex + 1
})
}, },
// 以下方法用于初始化数据 // 以下方法用于初始化数据
refresh(currentIndex) { 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