diff --git a/pages/adminNfc/components/bindDialog.vue b/pages/adminNfc/components/bindDialog.vue index 4a6b58f..3b84a7d 100644 --- a/pages/adminNfc/components/bindDialog.vue +++ b/pages/adminNfc/components/bindDialog.vue @@ -9,25 +9,16 @@ {{ currentRow.name }} - - + + + - 传入参数:{{ showMsg }} 接口返回结果:{{ resData }} + + @@ -49,8 +40,6 @@ 1.请将标签卡贴靠设备NFC识别处! 2.如果确定将该卡片写入该区域,请将标签卡贴靠设备xNFC识别处,否则请退出! 3.请再次将标签卡贴靠设备NFC识别处! - - @@ -82,6 +71,7 @@ export default { return { isChange: false, step: 0, + isAdd: false, lookData: {}, resData: {}, showMsg: '' @@ -124,7 +114,7 @@ export default { const req = { "AreaId": data.areaId, "pwd": data.pwd, - "isAdd": !this.currentRow.state, + "isAdd": this.isAdd, // "isAdd": true, } console.log(req, '重置nfc--req') @@ -168,9 +158,15 @@ export default { } return } + // 写入完成 if (data.step === 4) { + uni.showToast({ title: '绑定成功', icon: 'none' }) this.lookData = data this.step = 4 + this.$emit('closeRes') // 兼容只使用 :visible 和 @close 的情况 + return + this.isAdd = true + this.isChange = true // uni.showModal({ // title: '查看', // content: JSON.stringify(data) || '未传入参数 initFn', diff --git a/pages/adminNfc/index.vue b/pages/adminNfc/index.vue index ab4b1ca..78ed997 100644 --- a/pages/adminNfc/index.vue +++ b/pages/adminNfc/index.vue @@ -33,10 +33,10 @@ - + {{ item.name }} - 已绑定 - 去绑定 + 已绑定 + 去绑定 @@ -46,7 +46,7 @@ + @changeBinding="onChangeBinding" @confirm="onConfirm" @closeRes="closeResFn"> @@ -151,6 +151,7 @@ export default { this.$refs.dialogRef.isChange = row.state // 重置弹窗状态 this.$refs.dialogRef.resData = '' this.$refs.dialogRef.showMsg = '' + this.$refs.dialogRef.isAdd = !row.state this.$refs.dialogRef.step = 0 // 重置弹窗状态 if (row.state === false) { this.$refs.dialogRef.step = 1 // 重置弹窗状态 @@ -172,6 +173,14 @@ export default { this.getSonAreaFn() } }, + // 绑定成功 + closeResFn() { + this.showDialog = false + uni.showToast({ title: '绑定成功', icon: 'none' }) + setTimeout(() => { + this.getSonAreaFn() + }, 500) + }, // 获取子区域列表 async getSonAreaFn() { const req = {