fix: 3D缓存技术方案修改
This commit is contained in:
@@ -115,9 +115,9 @@ export default defineComponent({
|
||||
surveyId() {
|
||||
return this.config.scene;
|
||||
},
|
||||
scene() {
|
||||
return this.config.scene_information;
|
||||
},
|
||||
// scene() {
|
||||
// return this.config.scene_information;
|
||||
// },
|
||||
shelves() {
|
||||
if (!this.scene) return [];
|
||||
return this.scene.shelves;
|
||||
@@ -162,6 +162,9 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
scene: null,
|
||||
|
||||
shopData: null,
|
||||
page: null,
|
||||
sceneAction: null,
|
||||
@@ -197,10 +200,21 @@ export default defineComponent({
|
||||
beforeUnmount() {
|
||||
this.pager.clear();
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
|
||||
this.pager.init();
|
||||
|
||||
this.scene = this.config.scene_information;
|
||||
|
||||
// 解决缓存问题,答卷时加载场景信息
|
||||
if(!this.scene) {
|
||||
var res = await BrowsingRecordApi.getSurveysScene({
|
||||
sn: this.$route.query.sn,
|
||||
question_index: this.question.question_index
|
||||
});
|
||||
this.scene = res.data?.scene_information;
|
||||
}
|
||||
|
||||
this.shopData = buildShopDataDemo(this.scene);
|
||||
|
||||
if(this.config.is_show_time && this.config.show_time){
|
||||
|
||||
@@ -107,9 +107,9 @@ export default defineComponent({
|
||||
surveyId() {
|
||||
return this.config.scene;
|
||||
},
|
||||
scene() {
|
||||
return this.config.scene_information;
|
||||
},
|
||||
// scene() {
|
||||
// return this.config.scene_information;
|
||||
// },
|
||||
shelves() {
|
||||
if (!this.scene) return [];
|
||||
return this.scene.shelves;
|
||||
@@ -135,6 +135,9 @@ export default defineComponent({
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
||||
scene: null,
|
||||
|
||||
shopData: null,
|
||||
page: null,
|
||||
rowIndex: 0,
|
||||
@@ -170,9 +173,22 @@ export default defineComponent({
|
||||
beforeUnmount() {
|
||||
this.pager.clear();
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
|
||||
this.pager.init();
|
||||
|
||||
this.scene = this.config.scene_information;
|
||||
|
||||
// 解决缓存问题,答卷时加载场景信息
|
||||
if(!this.scene) {
|
||||
var res = await BrowsingRecordApi.getSurveysScene({
|
||||
sn: this.$route.query.sn,
|
||||
question_index: this.question.question_index
|
||||
});
|
||||
this.scene = res.data?.scene_information;
|
||||
}
|
||||
|
||||
this.shopData = buildShopDataDemo(this.scene);
|
||||
|
||||
this.$emit("update:answer", {});
|
||||
this.shopData = buildShopDataDemo(this.scene);
|
||||
|
||||
@@ -8,5 +8,12 @@ export default class BrowsingRecordApi {
|
||||
data: params.data,
|
||||
})
|
||||
}
|
||||
/* 获取3D资源 */
|
||||
static getSurveysScene(params) {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: `/answer/surveys/${params.sn}/scene?question_index=${params.question_index}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user