From 92fe63f30856599926c36ab93c7d296b5f4085b6 Mon Sep 17 00:00:00 2001 From: zhanchao Date: Thu, 13 Aug 2026 19:01:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/archive/edit-archive.vue | 38 ++++- pages/experience-coupon/claim.vue | 149 +++++++++--------- .../select-rights-archive.vue | 10 +- pages/login/login.vue | 33 ++-- 4 files changed, 142 insertions(+), 88 deletions(-) diff --git a/pages/archive/edit-archive.vue b/pages/archive/edit-archive.vue index 7045af1..e7908fd 100644 --- a/pages/archive/edit-archive.vue +++ b/pages/archive/edit-archive.vue @@ -44,6 +44,7 @@ const { getExternalUserId } = useAccount() const corpId = ref(''); const corpName = ref(''); const corpUserId = ref(''); +const bindCustomerId = ref(''); const referenceCustomerId = ref(''); const customer = ref({}); const customerId = ref(''); @@ -59,6 +60,7 @@ const visible = ref(false); const referenceCustomer = ref(null) const healthTypes = ref([]); const enableHis = ref(false); +const source = ref(''); const formData = computed(() => { return { ...customer.value, ...form.value, mobile: account.value?.mobile } @@ -166,6 +168,11 @@ async function addArchive() { set('home-invite-team-info', { teamId: teamId.value }) if (res && res.success) { uni.$emit('reloadTeamCustomers') + if (source.value === 'experienceCoupon') { + await toast('档案创建成功'); + uni.navigateBack(); + return; + } // getTeam(corpId.value, teamId.value, res.data.id); if (healthTypes.value.length) { const nextType = healthTypes.value[0]; @@ -187,6 +194,16 @@ async function getResponsiblePerson() { return res && res.data ? res.data : '' } +function backAfterArchiveBound() { + if (source.value === 'experienceCoupon') { + uni.navigateBack() + return; + } + uni.switchTab({ + url: '/pages/home/home' + }) +} + async function bindArchive(customerId) { let responsiblePerson = ''; if (externalUserId.value) { @@ -197,9 +214,7 @@ async function bindArchive(customerId) { if (res && res.success) { await toast('绑定成功'); uni.$emit('reloadTeamCustomers') - uni.switchTab({ - url: '/pages/home/home' - }) + backAfterArchiveBound() } else { toast(res?.message || '绑定失败'); } @@ -210,9 +225,13 @@ async function init() { await getCustomer(); } else { await getExternalUserId(corpId.value); - const res = await getArchives(); + const res = bindCustomerId.value ? await getExperienceCouponBindArchive() : await getArchives(); if (res.length > 0) { visible.value = true; + } else if (source.value === 'experienceCoupon') { + await toast('体验券发放档案不存在或已绑定'); + uni.navigateBack(); + return; } getTeam(corpId.value, teamId.value) } @@ -223,6 +242,15 @@ async function init() { } +async function getExperienceCouponBindArchive() { + const res = await api('getCustomerByCustomerId', { corpId: corpId.value, customerId: bindCustomerId.value }); + const data = res && res.success && res.data ? res.data : null; + customers.value = data ? [data] : []; + corpName.value = res && res.corpName ? res.corpName : corpName.value; + enableHis.value = false; + return customers.value; +} + async function getArchives() { const res = await api('getUnbindMiniAppCustomers', { corpId: corpId.value, mobile: account.value?.mobile || '', externalUserId: externalUserId.value }); customers.value = res && Array.isArray(res.data) ? res.data : []; @@ -305,8 +333,10 @@ onLoad(options => { teamId.value = options.teamId; corpId.value = options.corpId; customerId.value = options.id || ''; + bindCustomerId.value = options.bindCustomerId || ''; corpUserId.value = options.corpUserId || ''; referenceCustomerId.value = options.referenceCustomerId || ''; + source.value = options.source || ''; if (referenceCustomerId.value) { getReferenceCustomer(); } diff --git a/pages/experience-coupon/claim.vue b/pages/experience-coupon/claim.vue index 4cd24a3..4d4c539 100644 --- a/pages/experience-coupon/claim.vue +++ b/pages/experience-coupon/claim.vue @@ -1,20 +1,22 @@ diff --git a/pages/experience-coupon/select-rights-archive.vue b/pages/experience-coupon/select-rights-archive.vue index f428d47..c717313 100644 --- a/pages/experience-coupon/select-rights-archive.vue +++ b/pages/experience-coupon/select-rights-archive.vue @@ -3,7 +3,7 @@ 加载中... 暂无可用档案 - + 证件号:{{ item.idCardText }} {{ item.corpName }} - + @@ -195,12 +195,16 @@ onLoad(async (optionsData = {}) => {