diff --git a/src/components/door-panel/door-panel.vue b/src/components/door-panel/door-panel.vue index afb7670..98a120d 100644 --- a/src/components/door-panel/door-panel.vue +++ b/src/components/door-panel/door-panel.vue @@ -151,17 +151,19 @@ export default { }, methods: { // 外部调用:启动开门流程 - async open() { + async open(userId) { if (this.step) return; this.cancelled = false; this.step = 'opening'; + const uid = userId || this.userId; + try { const res = await post('/device-scan/open', { device_id: this.deviceId, door_index: 0, - user_id: this.userId + user_id: uid }); const ret = res.data || {}; diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 9523562..883f3f3 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -441,7 +441,7 @@ export default { } // 调用组件方法启动开门流程 - this.$refs.doorPanel.open(); + this.$refs.doorPanel.open(this.userId); }, handleMenuClick(item) { switch (item.action) {