From 51a92031dc3dc323cc6728d7044c692daa322bfa Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Tue, 16 Sep 2025 16:22:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=AE=A1=E7=90=86=E5=91=98=E8=B5=A0?= =?UTF-8?q?=E9=80=81):=20=E8=B5=A0=E9=80=81=E7=A1=AE=E5=AE=9A=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=A2=9E=E5=8A=A0=E9=A2=9C=E8=89=B2=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ItemDistribution.vue | 52 +++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/src/views/ItemDistribution.vue b/src/views/ItemDistribution.vue index e3860f0..c9895f0 100644 --- a/src/views/ItemDistribution.vue +++ b/src/views/ItemDistribution.vue @@ -132,11 +132,11 @@ border-radius: 8px; border: 0; padding: 8px; - background-color: #bb92ff; color: white; font-size: 14px; font-weight: 590; " + :style="{ backgroundColor: confirmClick ? '#bb92ff' : '#00000080' }" @click="sendGoods" > Confirm @@ -181,6 +181,8 @@ const activeIndex = ref(0) const currentTab = ref('Frames') //选中名字 const tabItems = ref([]) // 存储标签DOM引用 +const confirmClick = ref(true) + // 选择标签 const setActiveTab = (index) => { if (activeIndex.value != index) { @@ -212,28 +214,37 @@ const underlineStyle = computed(() => { const targetUserId = ref('') const sendGoods = async () => { - console.log('赠送用户id:', targetUserId.value) - console.log('赠送商品:', selectedGoods.value) + if (confirmClick.value) { + confirmClick.value = false - try { - const targetUserInfo = await searchUser(targetUserId.value) - console.log('targetUserInfo:', targetUserInfo) - if (targetUserInfo.status && targetUserInfo.body) { - const data = { - propsId: selectedGoods.value.id, - acceptUserId: targetUserInfo.body.id, - } - const res = await giveProps(data) - if (res.errorCode == 0 && res.status) { - closedPopup() - showSuccess('Gift delivery successful') + console.log('赠送用户id:', targetUserId.value) + console.log('赠送商品:', selectedGoods.value) + + try { + const targetUserInfo = await searchUser(targetUserId.value) + console.log('targetUserInfo:', targetUserInfo) + if (targetUserInfo.status && targetUserInfo.body) { + const data = { + propsId: selectedGoods.value.id, + acceptUserId: targetUserInfo.body.id, + } + const res = await giveProps(data) + if (res.errorCode == 0 && res.status) { + closedPopup() + showSuccess('Gift delivery successful') + } else { + confirmClick.value = true + } + } else { + confirmClick.value = true } + } catch (error) { + console.log('error:', error) + // 信息提示id有误 + showWarning(error.response.errorMsg) + confirmClick.value = true + throw error } - } catch (error) { - console.log('error:', error) - // 信息提示id有误 - showWarning(error.response.errorMsg) - throw error } } @@ -289,6 +300,7 @@ const showSendDialog = (product) => { // 关闭弹窗 const closedPopup = () => { + confirmClick.value = true selectedGoods.value = {} targetUserId.value = '' dialogshow.value = false