From 4dc86889c58be51351d5a8c1afe140de63221716 Mon Sep 17 00:00:00 2001 From: luo Date: Fri, 26 Jun 2026 14:59:15 +0800 Subject: [PATCH] fix:bug scan --- api/modules/realname.js | 7 ++- index.html | 1 + pages/auth/auth.vue | 9 ++- pages/switch/switch.vue | 121 +++++++++++++++++++++++++++++++++++++++- utils/wxsdk.js | 60 +++++++++++++++++--- 5 files changed, 183 insertions(+), 15 deletions(-) diff --git a/api/modules/realname.js b/api/modules/realname.js index 299e825..80c2285 100644 --- a/api/modules/realname.js +++ b/api/modules/realname.js @@ -1,11 +1,12 @@ import request from '@/utils/request.js'; export const realnameApi = { - getLink(identifier, iccid) { + getLink(identifier, iccid, options = {}) { return request({ url: '/api/c/v1/realname/link', method: 'GET', - data: { identifier, iccid } + data: { identifier, iccid }, + ...options }); } -}; \ No newline at end of file +}; diff --git a/index.html b/index.html index 95303c1..a0dda04 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,7 @@ +
diff --git a/pages/auth/auth.vue b/pages/auth/auth.vue index 930d062..6c0e046 100644 --- a/pages/auth/auth.vue +++ b/pages/auth/auth.vue @@ -114,22 +114,25 @@ }; const doRealName = async () => { + const iccid = currentModalIccid.value; + closeModal(); + try { - const data = await realnameApi.getLink(userStore.state.identifier, currentModalIccid.value); + const data = await realnameApi.getLink(userStore.state.identifier, iccid, { showError: false }); if (data.realname_url) { uni.setClipboardData({ - data: currentModalIccid.value, + data: iccid, success: () => { uni.showToast({ title: 'ICCID已复制', icon: 'success' }); } }); - closeModal(); setTimeout(() => { window.location.href = data.realname_url; }, 1500); } } catch (e) { console.error('获取实名链接失败', e); + uni.showToast({ title: e?.msg || '获取实名链接失败', icon: 'none' }); } }; diff --git a/pages/switch/switch.vue b/pages/switch/switch.vue index a68b777..6c51ae5 100644 --- a/pages/switch/switch.vue +++ b/pages/switch/switch.vue @@ -35,6 +35,20 @@ 切换此运营商 + + 去实名 + + + + + + + + + 实名认证 + {{ currentModalIccid }} + 点击复制ICCID并跳转实名 + @@ -42,7 +56,7 @@