From 012f4f0f7beba86742b1c78084be04739fca8a44 Mon Sep 17 00:00:00 2001 From: weiwei Date: Thu, 20 Mar 2025 11:01:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=89=AB=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/tabbar/my.vue | 42 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 22 deletions(-) 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