|
@@ -519,7 +519,7 @@ export default {
|
|
|
needPhoto:false //是否需要拍照
|
|
|
};
|
|
|
},
|
|
|
- onLoad(option) {
|
|
|
+ async onLoad(option) {
|
|
|
this.id = option.id;
|
|
|
this.goodsId = option.goodsid;
|
|
|
this.chapterId = option.chapterId;
|
|
@@ -571,9 +571,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ await this.getGoodsDetail()
|
|
|
this.goodsQuestionList();
|
|
|
this.bankExam();
|
|
|
- this.getGoodsDetail()
|
|
|
}
|
|
|
},
|
|
|
onUnload() {
|
|
@@ -597,17 +597,21 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getGoodsDetail() {
|
|
|
- let self = this
|
|
|
- this.$api.goodsDetail(this.goodsId).then(res => {
|
|
|
- self.goodsDetail = res.data.data;
|
|
|
- if (self.goodsDetail.goodsPhotoExamConfig) {
|
|
|
- let goodsPhotoExamConfig = JSON.parse(self.goodsDetail.goodsPhotoExamConfig);
|
|
|
- if (goodsPhotoExamConfig.photograph > 0) {
|
|
|
- self.needPhoto = true;
|
|
|
- }
|
|
|
- }
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
|
- });
|
|
|
+ let self = this
|
|
|
+ this.$api.goodsDetail(this.goodsId).then(res => {
|
|
|
+ self.goodsDetail = res.data.data;
|
|
|
+ if (self.goodsDetail.goodsPhotoExamConfig) {
|
|
|
+ let goodsPhotoExamConfig = JSON.parse(self.goodsDetail.goodsPhotoExamConfig);
|
|
|
+ if (goodsPhotoExamConfig.photograph > 0) {
|
|
|
+ self.needPhoto = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ resolve()
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
postStudyRecord() {
|
|
|
let self = this
|