From db936079bb4b81472cd3ab2a57aa9b25851da92e Mon Sep 17 00:00:00 2001 From: aaron <> Date: Thu, 27 Mar 2025 16:18:07 +0800 Subject: [PATCH] update --- src/views/coupon/ActivityList.vue | 66 +++++++++---------------------- 1 file changed, 19 insertions(+), 47 deletions(-) diff --git a/src/views/coupon/ActivityList.vue b/src/views/coupon/ActivityList.vue index dfd901e..86a0462 100644 --- a/src/views/coupon/ActivityList.vue +++ b/src/views/coupon/ActivityList.vue @@ -36,7 +36,7 @@ @@ -224,27 +224,23 @@
-
+
-

获取链接中...

+

获取二维码中...

@@ -673,43 +669,32 @@ export default defineComponent({ }) const qrCodeModalVisible = ref(false) - const activityLink = ref('') - const linkLoading = ref(false) + const qrCodeUrl = ref('') + const qrCodeLoading = ref(false) - // 获取活动链接 - const handleGetLink = async (record) => { + // 获取活动二维码 + const handleGetQrCode = async (record) => { // 先显示模态框 qrCodeModalVisible.value = true - linkLoading.value = true + qrCodeLoading.value = true try { const res = await request.get(`/api/coupon-activities/${record.id}/get_url_link`) if (res.code === 200) { - activityLink.value = res.data + qrCodeUrl.value = res.data } else { - message.error('获取活动链接失败') + message.error('获取活动二维码失败') qrCodeModalVisible.value = false } } catch (error) { - console.error('获取活动链接失败:', error) - message.error('获取活动链接失败') + console.error('获取活动二维码失败:', error) + message.error('获取活动二维码失败') qrCodeModalVisible.value = false } finally { - linkLoading.value = false + qrCodeLoading.value = false } } - // 复制链接 - const copyLink = () => { - const input = document.createElement('input') - input.value = activityLink.value - document.body.appendChild(input) - input.select() - document.execCommand('copy') - document.body.removeChild(input) - message.success('链接已复制到剪贴板') - } - // 取消二维码模态框 const handleQrCodeModalCancel = () => { qrCodeModalVisible.value = false @@ -743,10 +728,9 @@ export default defineComponent({ isSelectedCoupon, handleCouponSelect, qrCodeModalVisible, - activityLink, - linkLoading, - handleGetLink, - copyLink, + qrCodeUrl, + qrCodeLoading, + handleGetQrCode, handleQrCodeModalCancel } } @@ -895,18 +879,6 @@ export default defineComponent({ margin-bottom: 16px; } -.link-container { - display: flex; - align-items: center; - margin-bottom: 16px; - width: 100%; - gap: 8px; -} - -.link-container .ant-input { - flex: 1; -} - .qrcode-tip { text-align: center; color: rgba(0, 0, 0, 0.65);