|
@@ -82,6 +82,7 @@
|
|
|
>
|
|
|
<view class="btn" v-if="article.recordStatus == 0">继续</view>
|
|
|
</navigator>
|
|
|
+ <view class="btn" v-if="article.recordStatus == 1" @click="doRepeat(article.recordId,article.examId,article.goodsId,article.moduleExamId,article.chapterExamId)">重做</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-line></u-line>
|
|
@@ -127,6 +128,8 @@
|
|
|
>
|
|
|
<view class="btn" v-if="article.recordStatus == 0">继续</view>
|
|
|
</navigator>
|
|
|
+
|
|
|
+ <view class="btn" v-if="article.recordStatus == 1" @click="doRepeat(article.recordId,article.examId,article.goodsId,0,article.chapterExamId)">重做</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -159,6 +162,7 @@
|
|
|
>
|
|
|
<view class="btn" v-if="item1.recordStatus == 0">继续</view>
|
|
|
</navigator>
|
|
|
+ <view class="btn" v-if="item1.recordStatus == 1" @click="doRepeat(item1.recordId,item1.majorId,item1.goodsId,0,0)">重做</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
</view>
|
|
@@ -185,6 +189,9 @@ export default {
|
|
|
computed: { ...mapGetters(['userInfo']) },
|
|
|
onLoad(option) {
|
|
|
this.id = option.id;
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
uni.getSystemInfo({
|
|
|
success: res => {
|
|
|
var winW = res.screenWidth;
|
|
@@ -194,10 +201,8 @@ export default {
|
|
|
.select('.canvas')
|
|
|
.boundingClientRect()
|
|
|
.exec(newRes => {
|
|
|
- this.goodsBankQuestionNum();
|
|
|
- this.goodsBankDolist();
|
|
|
// this.goodsBankList();
|
|
|
-
|
|
|
+
|
|
|
var width = newRes[0].width;
|
|
|
var height = newRes[0].height;
|
|
|
this.caculateX = winW / 750;
|
|
@@ -209,7 +214,7 @@ export default {
|
|
|
context1.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, 2 * Math.PI, true);
|
|
|
context1.stroke();
|
|
|
context1.draw();
|
|
|
-
|
|
|
+
|
|
|
var context2 = uni.createCanvasContext('Canvas2');
|
|
|
this.context2 = context2;
|
|
|
context2.setStrokeStyle('#EEEEEE');
|
|
@@ -217,12 +222,36 @@ export default {
|
|
|
context2.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, 2 * Math.PI, false);
|
|
|
context2.stroke();
|
|
|
context2.draw();
|
|
|
+
|
|
|
+ this.goodsBankQuestionNum();
|
|
|
+ this.goodsBankDolist();
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- onShow() {},
|
|
|
methods: {
|
|
|
+ doRepeat(recordId,examId,goodsId,chapterExamId) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否清空答案重做?',
|
|
|
+ cancelText:'查看上次',
|
|
|
+ cancelColor:'',
|
|
|
+ confirmText:'重做',
|
|
|
+ confirmColor:'',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages2/bank/questionBank?id=' +examId +'&goodsid=' +goodsId +'&moduleId=0&chapterId=' +chapterExamId
|
|
|
+ })
|
|
|
+ } else if (res.cancel) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages2/bank/questionBankExplain?isHistory=1&recordId='+recordId +'&id=' +examId +'&goodsid=' +goodsId +'&moduleId=0&chapterId=' +chapterExamId
|
|
|
+ })
|
|
|
+ console.log('查看上次答题');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
goodsBankDolist() {
|
|
|
this.$api
|
|
|
.goodsBankDolist({
|
|
@@ -259,13 +288,13 @@ export default {
|
|
|
this.caculateX * 90,
|
|
|
this.caculateX * 180
|
|
|
);
|
|
|
- this.context2.save();
|
|
|
- this.context2.translate(this.caculateX * 90, this.caculateX * 90);
|
|
|
- this.context2.rotate((-90 * Math.PI) / 180);
|
|
|
+ this.context1.save();
|
|
|
+ this.context1.translate(this.caculateX * 90, this.caculateX * 90);
|
|
|
+ this.context1.rotate((-90 * Math.PI) / 180);
|
|
|
this.context1.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, (this.goodsCount.rightNum / this.goodsCount.totalNum) * 2 * Math.PI, false);
|
|
|
- this.context2.restore();
|
|
|
+ this.context1.restore();
|
|
|
this.context1.stroke();
|
|
|
- this.context1.draw();
|
|
|
+ this.context1.draw(true);
|
|
|
|
|
|
this.context2.beginPath();
|
|
|
this.context2.setStrokeStyle('#007AFF');
|
|
@@ -280,7 +309,7 @@ export default {
|
|
|
this.context2.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, (this.goodsCount.doNum / this.goodsCount.totalNum) * 2 * Math.PI, false);
|
|
|
this.context2.restore();
|
|
|
this.context2.stroke();
|
|
|
- this.context2.draw();
|
|
|
+ this.context2.draw(true);
|
|
|
});
|
|
|
},
|
|
|
clickModule(id, index) {
|