| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <template>
- <!-- 使用规则弹窗 -->
- <BasicModal type="bottom" v-model:open="getOpen" :is-mack="true">
- <view class="rules-modal">
- <!-- 标题栏 -->
- <view class="rules-modal__header">
- <text class="header-title">使用规则</text>
- <view class="close-btn" @click="handleClose">
- <view class="close-icon"></view>
- </view>
- </view>
- <!-- 优惠券卡片 - 与列表页样式一致 -->
- <view class="coupon-card-wrapper">
- <view class="coupon-card">
- <image :src="getFileUrl('img/personal/coupon.png')" mode="widthFix" class="coupon-card-bg"></image>
- <image :src="getFileUrl('img/personal/couponLeft.png')" mode="heightFix" class="coupon-card-bgLeft"></image>
- <view class="coupon-card-content">
- <!-- 左侧金额区域 -->
- <view class="coupon-card__left">
- <view class="amount-wrapper">
- <text class="amount-number">{{ couponData?.amount || 0 }}</text>
- <text class="amount-unit">元</text>
- </view>
- <text class="condition-text">满{{ couponData?.minAmount || 0 }}可用</text>
- </view>
- <!-- 右侧信息区域 -->
- <view class="coupon-card__right">
- <view class="coupon-info">
- <text class="coupon-name">{{ couponData?.name || '6元通用优惠券' }}</text>
- <text class="coupon-expire">{{ couponData?.expireDate || '' }}到期</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 规则详情 -->
- <view class="rules-content">
- <view class="rules-item">
- <text class="rules-label">有效期</text>
- <text class="rules-value">{{ couponData?.validDays || 90 }}天</text>
- </view>
-
- <view class="rules-item">
- <text class="rules-label">补充说明</text>
- <text class="rules-value">{{ couponData?.description || '周一、周五不可用' }}</text>
- </view>
- </view>
- </view>
- </BasicModal>
- </template>
- <script setup>
- import { computed } from 'vue';
- import BasicModal from '@/components/Modal/BasicModal.vue';
- import { getFileUrl } from '@/utils/file.js';
- const props = defineProps({
- open: {
- type: Boolean,
- default: false
- },
- couponData: {
- type: Object,
- default: () => ({
- amount: 6,
- minAmount: 66,
- name: '6元通用优惠券',
- expireDate: '2025/07/12',
- validDays: 90,
- description: '周一、周五不可用'
- })
- }
- });
- const emit = defineEmits(['update:open']);
- const getOpen = computed({
- get: () => props.open,
- set: (val) => emit('update:open', val)
- });
- // 关闭弹窗
- const handleClose = () => {
- getOpen.value = false;
- };
- </script>
- <style lang="scss" scoped>
- .rules-modal {
- width: 100%;
- background: #FFFFFF;
- border-radius: 24rpx 24rpx 0 0;
- padding: 32rpx 30rpx;
- padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
- box-sizing: border-box;
- // 标题栏
- &__header {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 32rpx;
- position: relative;
- .header-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #151515;
- }
- .close-btn {
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- width: 48rpx;
- height: 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- .close-icon {
- width: 28rpx;
- height: 28rpx;
- position: relative;
- &::before,
- &::after {
- content: '';
- position: absolute;
- width: 28rpx;
- height: 2rpx;
- background: #999999;
- top: 50%;
- left: 50%;
- transform-origin: center;
- }
- &::before {
- transform: translate(-50%, -50%) rotate(45deg);
- }
- &::after {
- transform: translate(-50%, -50%) rotate(-45deg);
- }
- }
- }
- }
- // 优惠券卡片容器
- .coupon-card-wrapper {
- margin-bottom: 32rpx;
- }
- // 优惠券卡片样式 - 与列表页完全一致
- .coupon-card {
- display: flex;
- align-items: center;
- overflow: hidden;
- position: relative;
- box-sizing: border-box;
- .coupon-card-bg {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 1;
- }
- .coupon-card-bgLeft {
- position: absolute;
- top: 0;
- left: 0;
- width: auto;
- height: 190rpx;
- z-index: 1;
- }
- .coupon-card-content {
- position: relative;
- z-index: 3;
- display: flex;
- align-items: center;
- width: 100%;
- height: 200rpx;
- }
- &__left {
- width: 200rpx;
- padding: 32rpx 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .amount-wrapper {
- display: flex;
- align-items: baseline;
- margin-bottom: 8rpx;
- .amount-number {
- font-size: 64rpx;
- font-weight: bold;
- color: #F47D1F;
- line-height: 1;
- }
- .amount-unit {
- font-size: 28rpx;
- color: #F47D1F;
- margin-left: 4rpx;
- }
- }
- .condition-text {
- font-size: 22rpx;
- color: #F47D1F;
- }
- }
- &__right {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 32rpx 24rpx;
- .coupon-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- .coupon-name {
- font-size: 28rpx;
- font-weight: bold;
- color: #151515;
- margin-bottom: 12rpx;
- }
- .coupon-expire {
- font-size: 22rpx;
- color: #999999;
- }
- }
- }
- }
- // 规则详情
- .rules-content {
- margin-bottom: 40rpx;
- padding: 0 8rpx;
- .rules-item {
- display: flex;
- align-items: flex-start;
- margin-bottom: 20rpx;
- font-size: 26rpx;
- line-height: 40rpx;
- &:last-child {
- margin-bottom: 0;
- }
- .rules-label {
- color: #666666;
- flex-shrink: 0;
- }
- .rules-value {
- color: #151515;
- margin-left: 16rpx;
- flex: 1;
- }
- }
- }
- }
- .hover-active {
- opacity: 0.8;
- transform: scale(0.98);
- transition: all 0.2s;
- }
- </style>
|