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

View File

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

View File

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