|
|
@@ -18,7 +18,7 @@ const emit = defineEmits<{
|
|
|
(e: 'update:showModal', value: boolean): void
|
|
|
}>()
|
|
|
|
|
|
-const { shareLink, copySuccess, shareLoading, shareCoupon, copyShareLink } = useCouponShare()
|
|
|
+const { shareLink, copySuccess, shareLoading, shareCoupon, copyShareLink, cleanShareLink } = useCouponShare()
|
|
|
watch(() => props.showModal, (newVal) => {
|
|
|
console.log('showModal', newVal)
|
|
|
if (newVal && props.couponId) {
|
|
|
@@ -30,32 +30,22 @@ watch(() => props.showModal, (newVal) => {
|
|
|
function handleClose() {
|
|
|
emit('update:showModal', false)
|
|
|
emit('close')
|
|
|
+ cleanShareLink()
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<!-- 分享弹窗 - 使用uview-plus的Modal组件 -->
|
|
|
- <!-- <up-modal :show="props.showModal" title="分享优惠券" :show-cancel-button="false" confirm-text="关闭" :border-radius="16"
|
|
|
- width="600rpx" @confirm="handleClose">
|
|
|
- <view class="share-modal-content">
|
|
|
- <view class="share-link-container">
|
|
|
- <text class="share-link">{{ shareLink }}</text>
|
|
|
- <button class="copy-btn" @click="copyShareLink">
|
|
|
- 复制
|
|
|
- </button>
|
|
|
- </view>
|
|
|
- <view v-if="copySuccess" class="copy-success">
|
|
|
- 复制成功!
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </up-modal> -->
|
|
|
<up-modal title="分享优惠券" style="z-index: 1000;" :show="props.showModal" :show-confirm-button="false">
|
|
|
<view class="share-modal-content">
|
|
|
<view class="share-link-container">
|
|
|
- <text class="share-link">{{ shareLink }}</text>
|
|
|
- <button class="copy-btn" @click="copyShareLink">
|
|
|
- 复制
|
|
|
- </button>
|
|
|
+ <up-loading-icon v-if="shareLoading" mode="semicircle" text="正在获取分享链接中" text-size="18" />
|
|
|
+ <template v-else>
|
|
|
+ <text class="share-link">{{ shareLink }}</text>
|
|
|
+ <button class="copy-btn" @click="copyShareLink">
|
|
|
+ 复制
|
|
|
+ </button>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
<view v-if="copySuccess" class="copy-success">
|
|
|
复制成功!
|
|
|
@@ -63,7 +53,7 @@ function handleClose() {
|
|
|
</view>
|
|
|
<template #popupBottom>
|
|
|
<view class="rounded" style="margin-top: 20px;" @click="handleClose">
|
|
|
- <up-icon name="close-circle" size="50rpx" color="#fff" />
|
|
|
+ <up-icon name="close-circle" size="72rpx" color="#fff" />
|
|
|
</view>
|
|
|
</template>
|
|
|
</up-modal>
|