2025-08-15 16:54:57 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view v-if="visible" class="qrcode-modal-overlay" @click="handleOverlayClick">
|
|
|
|
|
|
<view class="qrcode-modal" @click.stop>
|
|
|
|
|
|
<view class="modal-content">
|
|
|
|
|
|
<view class="qrcode-container">
|
2025-08-27 11:36:35 +08:00
|
|
|
|
<uv-qrcode
|
|
|
|
|
|
:options="qrcodeOptions"
|
|
|
|
|
|
:value="ticketNumber"
|
|
|
|
|
|
size="500rpx"
|
|
|
|
|
|
></uv-qrcode>
|
2025-08-15 16:54:57 +08:00
|
|
|
|
</view>
|
2025-08-27 11:36:35 +08:00
|
|
|
|
|
2025-08-15 16:54:57 +08:00
|
|
|
|
<view class="qrcode-info">
|
2025-08-26 17:49:35 +08:00
|
|
|
|
<text class="subscribe-id">票号: {{ ticketNumber }}</text>
|
2025-08-27 11:36:35 +08:00
|
|
|
|
<text class="info-text">{{ description }}</text>
|
2025-08-15 16:54:57 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2025-08-27 11:36:35 +08:00
|
|
|
|
name: "QRCodeModal",
|
2025-08-15 16:54:57 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
visible: {
|
|
|
|
|
|
type: Boolean,
|
2025-08-27 11:36:35 +08:00
|
|
|
|
default: false,
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
2025-08-26 17:49:35 +08:00
|
|
|
|
// 二维码内容值
|
|
|
|
|
|
value: {
|
|
|
|
|
|
type: String,
|
2025-08-27 11:36:35 +08:00
|
|
|
|
default: "",
|
2025-08-26 17:49:35 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 预约ID(兼容旧版本)
|
2025-08-15 16:54:57 +08:00
|
|
|
|
subscribeId: {
|
|
|
|
|
|
type: String,
|
2025-08-27 11:36:35 +08:00
|
|
|
|
default: "",
|
2025-08-26 17:49:35 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 票号
|
|
|
|
|
|
ticketNumber: {
|
|
|
|
|
|
type: String,
|
2025-08-27 11:36:35 +08:00
|
|
|
|
default: "",
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
title: {
|
|
|
|
|
|
type: String,
|
2025-08-27 11:36:35 +08:00
|
|
|
|
default: "核销验证码",
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
description: {
|
|
|
|
|
|
type: String,
|
2025-08-27 11:36:35 +08:00
|
|
|
|
default: "此二维码可直接检票",
|
|
|
|
|
|
},
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-08-27 11:36:35 +08:00
|
|
|
|
qrcodeOptions: {
|
|
|
|
|
|
errorCorrectLevel: "Q",
|
|
|
|
|
|
margin: 10,
|
|
|
|
|
|
areaColor: "#fff",
|
|
|
|
|
|
},
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
};
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
2025-08-27 11:36:35 +08:00
|
|
|
|
|
2025-08-15 16:54:57 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
handleOverlayClick() {
|
2025-08-27 11:36:35 +08:00
|
|
|
|
this.handleClose();
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
2025-08-27 11:36:35 +08:00
|
|
|
|
|
2025-08-15 16:54:57 +08:00
|
|
|
|
handleClose() {
|
2025-08-27 11:36:35 +08:00
|
|
|
|
this.$emit("close");
|
2025-08-15 16:54:57 +08:00
|
|
|
|
},
|
2025-08-27 11:36:35 +08:00
|
|
|
|
},
|
|
|
|
|
|
};
|
2025-08-15 16:54:57 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.qrcode-modal-overlay {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.6);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.qrcode-modal {
|
|
|
|
|
|
width: 600rpx;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
|
border-bottom: 1rpx solid #eee;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-title {
|
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-close {
|
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
padding: 10rpx;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-content {
|
|
|
|
|
|
padding: 40rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.qrcode-container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.qrcode-image {
|
|
|
|
|
|
width: 300rpx;
|
|
|
|
|
|
height: 300rpx;
|
|
|
|
|
|
border: 1rpx solid #eee;
|
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.qrcode-loading {
|
|
|
|
|
|
width: 300rpx;
|
|
|
|
|
|
height: 300rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.qrcode-info {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-27 11:36:35 +08:00
|
|
|
|
.subscribe-id {
|
2025-08-15 16:54:57 +08:00
|
|
|
|
display: block;
|
|
|
|
|
|
font-size: 28rpx;
|
2025-08-27 11:36:35 +08:00
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
color: #7f7f7f;
|
|
|
|
|
|
font-family: monospace;
|
|
|
|
|
|
padding-bottom: 10rpx;
|
2025-08-15 16:54:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-27 11:36:35 +08:00
|
|
|
|
.info-text {
|
2025-08-15 16:54:57 +08:00
|
|
|
|
display: block;
|
2025-08-27 11:36:35 +08:00
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
|
color: #522510;
|
|
|
|
|
|
margin-bottom: 20rpx;
|
2025-08-15 16:54:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-footer {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
|
border-top: 1rpx solid #eee;
|
|
|
|
|
|
gap: 20rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.btn-secondary,
|
|
|
|
|
|
.btn-primary {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
|
border-radius: 40rpx;
|
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.btn-secondary {
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.btn-primary {
|
2025-08-27 11:36:35 +08:00
|
|
|
|
background-color: #48893b;
|
2025-08-15 16:54:57 +08:00
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
2025-08-27 11:36:35 +08:00
|
|
|
|
</style>
|