mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 17:36:45 +08:00
考试提交连点
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</view>
|
||||
<view style="height: 50px;"></view>
|
||||
<view v-if="!stop" class="bottom-btns">
|
||||
<u-button type="success" text="提交" class="sub" @click="present"></u-button>
|
||||
<u-button type="success" text="提交" class="sub" @click="debouncedPresent"></u-button>
|
||||
<u-button type="info" text="上一题" @click="prevSub" class="next" v-if="curIndex>0"></u-button>
|
||||
<u-button type="primary" text="下一题" @click="nextSub" class="next" v-if="curIndex<(total-1)"></u-button>
|
||||
</view>
|
||||
@@ -230,9 +230,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmStop(){
|
||||
this.submitTest();
|
||||
},
|
||||
// confirmStop(){
|
||||
// this.submitTest()
|
||||
// },
|
||||
cancelStop(){
|
||||
//应该返回课程面页
|
||||
this.confirmFinish();
|
||||
@@ -350,6 +350,16 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
debounce(func, delay) {
|
||||
let timerId;
|
||||
return function (...args) {
|
||||
if (timerId) clearTimeout(timerId);
|
||||
timerId = setTimeout(() => {
|
||||
func.apply(this, args);
|
||||
timerId = null;
|
||||
}, delay);
|
||||
};
|
||||
},
|
||||
present(){
|
||||
let $this=this;
|
||||
let score=this.countTest();
|
||||
@@ -386,7 +396,11 @@
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.debouncedPresent = this.debounce(this.present, 500);
|
||||
this.confirmStop = this.debounce(this.submitTest,500)
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user