mrr.sj.front/pages/coupon/couponDetail.vue

249 lines
4.9 KiB
Vue
Raw Normal View History

2026-03-24 11:45:13 +08:00
<template>
<view class="coupon-detail-page">
<!-- 顶部背景图 -->
<view class="top-bg"></view>
<!-- 透明导航栏 -->
<custom-navbar
:title="title"
:show-back="true"
title-color="#333333"
background-color="transparent"
:showHeadle="false"
:borderBottom="'none'"
></custom-navbar>
<!-- 主要内容区域 -->
<view class="detail-content">
<!-- 优惠券核心卡片 -->
<view class="coupon-card">
<!-- 标签行-->
<view class="tag-section">
<view class="tag-new-user">
<image class="tag-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/1b4ff234-ac31-4b61-9d6b-baa8025ad3cc.png"></image>
<text class="tag-text">满150元减20元优惠券</text>
</view>
</view>
<!-- 下划线-->
<view class="title-underline"></view>
<!-- 活动名称行 -->
<view class="info-row">
<view class="info-label">活动名称</view>
<view class="info-value">新人优惠券</view>
</view>
<!-- 有效期 -->
<view class="validity-row">
<view class="validity-label">有效期至</view>
<view class="validity-value">2025年11月23日 11:22:58</view>
</view>
<!-- 规则说明区域 -->
<view class="rule-row">
<view class="rule-label">规则说明</view>
<view class="rule-content">本优惠券仅限指定商品 / 全店商品使用单笔订单限用 1 不可与其他优惠叠加请在有效期内使用过期自动失效不补发不折现订单退款时优惠券将按规则退回过期则失效严禁违规套现使用本店保留最终解释权</view>
</view>
</view>
</view>
<!-- 底部固定按钮区域 -->
<view class="bottom-fixed">
<button class="use-btn" @click="handleUse">立即使用</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '优惠券详情'
};
},
methods: {
handleUse() {
// 测试用
console.log('立即使用按钮点击');
}
}
};
</script>
<style lang="less">
.coupon-detail-page {
background-color: #f8f8f8;
min-height: 100vh;
position: relative;
box-sizing: border-box;
padding-bottom: 160rpx;
}
/* 顶部背景图*/
.top-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 260rpx;
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/58ddd0be-e580-4da2-9f4f-4d088f32f11d.png');
background-size: cover;
background-position: top center;
background-repeat: no-repeat;
z-index: 1;
}
/* 主要内容区域 */
.detail-content {
padding: 20rpx 0;
position: relative;
z-index: 2;
}
/* 优惠券卡片 */
.coupon-card {
background-color: #ffffff;
border-radius: 40rpx;
padding: 30rpx 30rpx 40rpx 30rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.02);
}
/* 标签行*/
.tag-section {
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 20rpx;
}
.tag-new-user {
display: flex;
align-items: center;
font-weight: 500;
font-size: 32rpx;
color: #333333;
line-height: 45rpx;
text-align: left;
.tag-text {
margin-top: 2rpx;
}
.tag-icon {
width: 42rpx;
height: 42rpx;
margin-right: 10rpx;
flex-shrink: 0;
}
}
/* 下划线*/
.title-underline {
width: 690rpx;
height: 1rpx;
background-color: #F1F1F1 ;
border-radius: 6rpx;
margin: 20rpx 0 30rpx 0;
}
/* 活动名称 + 有效期 */
.info-row {
display: flex;
margin-bottom: 20rpx;
font-size: 24rpx;
color: #999999;
line-height: 33rpx;
text-align: left;
.info-label {
flex-shrink: 0;
}
.info-value {
flex: 1;
// margin-left: 27rpx;
word-break: break-word;
}
}
/* 有效期行 */
.validity-row {
display: flex;
margin-bottom: 20rpx;
font-size: 24rpx;
color: #999999;
line-height: 33rpx;
text-align: left;
.validity-label {
flex-shrink: 0;
}
.validity-value {
flex: 1;
// margin-left: 27rpx;
word-break: break-word;
}
}
/* 规则说明行 */
.rule-row {
display: flex;
font-size: 24rpx;
color: #999999;
line-height: 33rpx;
text-align: left;
.rule-label {
flex-shrink: 0;
}
.rule-content {
flex: 1;
word-break: break-word;
}
}
/* 底部固定按钮区域 */
.bottom-fixed {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 141rpx;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.02);
// 安全区适配
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
box-sizing: content-box;
}
/* 立即使用按钮 */
.use-btn {
width: 690rpx;
height: 88rpx;
background: #e8101e;
border-radius: 49rpx;
color: #ffffff;
font-size: 32rpx;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
border: none;
margin: 0 auto;
line-height: 88rpx;
text-align: center;
box-shadow: 0 8rpx 16rpx rgba(232, 16, 30, 0.15);
z-index: 9;
&::after {
border: none;
}
}
</style>