diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index deb71d5..7495de7 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -37,6 +37,11 @@ 退出登录 + + + 扫扫扫 + + @@ -183,36 +188,29 @@ const onTabMenu = async (v: MenuItem, i: number) => { if (isLogin) { if (v.text === "扫一扫") { console.log("扫一扫") - dd.scan({ - type: "all", - }) - .then((res) => { - console.log(res) - uni.showToast({ - title: JSON.stringify(res), - icon: "none", - }) - }) - .catch() } else { router.jump(v.router) } } } -dd.ready(function () { - dd.confirm({ - message: "2022年亚运会在哪里举办", - title: "提问", - buttonLabels: ["杭州", "上海"], - }) - .then((res) => { - console.log(res) +// 扫扫扫 +const doScanCode = async () => { + try { + const res = await dd.scan({ type: "all" }) + console.log(res) + uni.showToast({ + title: JSON.stringify(res), + icon: "none", }) - .catch((err) => { - console.error(err) + } catch (error) { + console.log("error", error) + uni.showToast({ + title: JSON.stringify(error), + icon: "none", }) -}) + } +} const getStorageUserInfo = () => { const tokenKey = constant.storageConstant.TOKEN