fix: 商品锁定

This commit is contained in:
wanganmao
2022-10-20 09:59:57 +08:00
parent 77f3c74ba1
commit 85aae649a7
5 changed files with 22 additions and 6 deletions

View File

@@ -244,9 +244,7 @@ export default defineComponent({
var target = options.value.find(x => x.option_config.binding_goods_id == param.data.surveyWare.id);
if(!target) return;
var arr = [...new Set([...Object.keys(props.answer || {}), target.option_key])];
debugger
changeValue(arr);
}

View File

@@ -16,6 +16,7 @@
@onPageCompletion="onPageCompletion"
:elCart="elCart"
:surveyId="surveyId"
:lockedWare="lockedWare"
@onBehaviorFlush="onBehaviorFlush"
/>
<div class="page pageNext" @click="next">
@@ -130,7 +131,11 @@ export default defineComponent({
options() {
if(!this.question.list[0]) return [];
return this.question.list[0].options;
}
},
lockedWare() {
if(!this.config.is_initialize) return null;
return this.ware;
},
},
data() {
return {

View File

@@ -5,6 +5,7 @@
:page="page"
:sceneAction="sceneAction"
:surveyId="surveyId"
:lockedWare="lockedWare"
@onLoadingCompletion="onLoadingCompletion"
@onFromSceneHoldToShelf="onFromSceneHoldToShelf"
@onBehaviorFlush="onBehaviorFlush"
@@ -95,6 +96,10 @@ export default defineComponent({
(x) => x.planetid == this.config.ware
);
},
lockedWare() {
if(!this.config.is_initialize) return null;
return this.ware;
},
},
data(){
return {

View File

@@ -6,7 +6,7 @@
import { SurveyViewer } from "./shelves.module";
export default {
props: ["surveyId", "shopData", "page", "sceneAction", "elCart"],
props: ["surveyId", "shopData", "page", "sceneAction", "elCart", "lockedWare"],
mounted() {
this.$nextTick(() => this.tryInitView());
@@ -51,6 +51,14 @@ export default {
if (this.viewer_) {
this.viewer_.arrange(newVal).then(() => {
this.$emit("onPageCompletion");
if(!this.lockedWare) return;
// #20221018
this.viewer_.hold({
wareId: this.lockedWare?.planetid,
keepHold: true,
})
});
}
},

File diff suppressed because one or more lines are too long