1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

[门禁端&后端&小程序] 完成门禁端;完成小程序扫码跳转页面;完成后端获取不限制的小程序场景码接口

This commit is contained in:
2022-11-28 18:36:52 +08:00
parent 42e3952b83
commit 8640c2b413
20 changed files with 365 additions and 38 deletions

View File

@@ -15,6 +15,7 @@
</view>
<button type="primary" size="mini" @tap="toggleDot('code', true)">显示小红点</button>
<button type="primary" size="mini" @tap="toggleDot('code', false)">隐藏小红点</button>
<button type="warn" size="mini" @tap="magicButton">魔法按钮</button>
<DebugComp :params="debugObject" :userGroup="userGroup" />
</view>
</template>
@@ -51,13 +52,13 @@ export default {
onLoad() {
// 开发模式下自动跳转到指定页面,节省开发时间
if (this.debugMode) {
Taro.switchTab({ url: '/pages/residents/report' })
}
// if (this.debugMode) {
// Taro.switchTab({ url: '/pages/residents/report' })
// }
},
onShow() {
console.log('onShow')
onShow(options) {
console.log('onShow', options)
console.log("menuItemDict", menuItemDict)
this.userInfo = Taro.getStorageSync("userInfo");
this.displayUsername = this.userInfo?.username ?? "请登录";
@@ -67,8 +68,21 @@ export default {
url: '/pages/index/login'
})
} else {
// 用户已登录
this.userGroup = getUserGroupByRole(this.userInfo.role);
this.debugObject = { userGroup: this.userGroup };
//判断用户是否是通过扫小程序码进来的
let launchParams = Taro.getCurrentInstance().router.params;
if (launchParams.scene) {
// 扫门禁的小程序码
if (launchParams.scene.split('%')[0] == "guard") {
Taro.getCurrentInstance().router.params.scene = null;
Taro.navigateTo({
url: "/pages/scan/entrance"
})
}
}
}
},
methods: {
@@ -92,6 +106,11 @@ export default {
},
toggleDot(iconName, status = true) {
this.menuItemDict[iconName].addDot = status;
},
magicButton() {
Taro.navigateTo({
url: "/pages/scan/entrance"
})
}
}
}