拼团修复

This commit is contained in:
2025-12-18 17:05:43 +08:00
parent 2285c796aa
commit 1539850f96
10 changed files with 986 additions and 171 deletions

View File

@@ -0,0 +1,41 @@
<template>
<modal v-model="show" title="查看券码" :showBottom="false">
<view class="u-p-28">
<view class="u-flex u-row-center">
<up-qrcode cid="ex1" :size="104" :val="qrcode"></up-qrcode>
</view>
<view class="u-m-t-22 u-flex u-row-center">
<text>{{ qrcode }}</text>
<view @click="copyCode">
<image src="/scoreShop/static/image/copy.png" class="u-m-l-24 copy"></image>
</view>
</view>
</view>
</modal>
</template>
<script setup>
import modal from '@/components/modal.vue'
const props = defineProps({
qrcode: {
type: String,
default: ''
}
})
const show = defineModel({
default: false
})
function copyCode() {
uni.setClipboardData({
data: props.qrcode
})
}
</script>
<style lang="scss">
.copy {
width: 28rpx;
height: 28rpx;
}
</style>

97
components/modal.vue Normal file
View File

@@ -0,0 +1,97 @@
<template>
<view>
<up-popup
:show="show"
mode="center"
:safeAreaInsetBottom="mode === 'bottom' ? true : false"
>
<view class="popup-content">
<view class="top u-flex u-row-between">
<text class="font-bold u-font-32 color-333">{{ title }}</text>
<up-icon size="18" name="close" @click="show = false"></up-icon>
</view>
<up-line></up-line>
<scroll-view style="max-height: 50vh" :scroll-y="true">
<slot></slot>
</scroll-view>
<template v-if="showBottom">
<up-line></up-line>
<view class="bottom">
<view class="btn cancel" @click="close">{{ cancelText }}</view>
<view class="btn success" @click="confirm">{{ confirmText }}</view>
</view>
</template>
</view>
</up-popup>
</view>
</template>
<script setup>
const props = defineProps({
mode: {
type: String,
default: "center",
},
title: {
type: String,
default: "标题",
},
confirmText: {
type: String,
default: "确认",
},
cancelText: {
type: String,
default: "取消",
},
showBottom: {
type: Boolean,
default: true,
},
});
const show = defineModel({
type: Boolean,
default: false,
});
const emits = defineEmits(["close", "confirm"]);
function close() {
show.value = false;
emits("close");
}
function confirm() {
emits("confirm");
}
</script>
<style lang="scss">
.popup-content {
background: #fff;
width: 640rpx;
border-radius: 18rpx;
}
.top {
padding: 40rpx 48rpx;
}
.bottom {
padding: 48rpx 52rpx;
display: flex;
justify-content: space-between;
gap: 50rpx;
.btn {
flex: 1;
text-align: center;
padding: 18rpx 60rpx;
border-radius: 100rpx;
font-size: 32rpx;
border: 2rpx solid transparent;
&.success {
background-color: $my-main-color;
color: #fff;
}
&.cancel {
border-color: $my-main-color;
color: $my-main-color;
}
}
}
</style>