diff --git a/weixin-miniprogram/image/icon/done.svg b/weixin-miniprogram/image/icon/done.svg new file mode 100644 index 0000000..29b7338 --- /dev/null +++ b/weixin-miniprogram/image/icon/done.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/weixin-miniprogram/image/icon/error.svg b/weixin-miniprogram/image/icon/error.svg new file mode 100644 index 0000000..f6e3190 --- /dev/null +++ b/weixin-miniprogram/image/icon/error.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/weixin-miniprogram/pages/person/person.js b/weixin-miniprogram/pages/person/person.js index 4205ab3..8bf06be 100644 --- a/weixin-miniprogram/pages/person/person.js +++ b/weixin-miniprogram/pages/person/person.js @@ -150,6 +150,7 @@ Page({ url: '/pages/person/updpwd' }) break + // 退出登录 case "logout": wx.clearStorageSync() diff --git a/weixin-miniprogram/pages/scan/entrance.js b/weixin-miniprogram/pages/scan/entrance.js index 93867f0..50fcf6f 100644 --- a/weixin-miniprogram/pages/scan/entrance.js +++ b/weixin-miniprogram/pages/scan/entrance.js @@ -16,9 +16,15 @@ Page({ // UI显示用 gateName: "未知", - open: false, + open: false, // 大门是否开始 currentTime: "", + + // 是否已经完成开门 + finishOpen: false, + // 用户是否有权限进入 + isForbidden: false, + forbiddenMsg: "", }, /** @@ -116,6 +122,20 @@ Page({ (async () => { let enterGate = await gateService.enterGate(this.data.gateId, "IN") console.log("enterGate", enterGate) + if (enterGate === true) { + // 开门成功 + this.setData({ + finishOpen: true, + isForbidden: false, + }) + } else { + // 无权进入大门 + this.setData({ + finishOpen: true, + isForbidden: true, + forbiddenMsg: "开门失败", + }) + } })(); }, diff --git a/weixin-miniprogram/pages/scan/entrance.wxml b/weixin-miniprogram/pages/scan/entrance.wxml index 377a9dd..a2bd900 100644 --- a/weixin-miniprogram/pages/scan/entrance.wxml +++ b/weixin-miniprogram/pages/scan/entrance.wxml @@ -1,11 +1,12 @@ - + + - 您将要进入社区 + 您将要进入社区 @@ -15,13 +16,21 @@ 当前大门暂不允许通行 当前时间:{{ currentTime }} + 大门已为您开启,欢迎回家! + + {{ forbiddenMsg }} + 您无权进入该大门,请联系管理员 + - - + + + + +