fix: 商品锁定

This commit is contained in:
wanganmao
2022-10-20 10:47:42 +08:00
parent c63a1f1121
commit 3ccbaaabbd
3 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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