美化了样式
This commit is contained in:
@ -1,88 +1,101 @@
|
||||
<view class="flex-col page">
|
||||
<view class="flex-col group">
|
||||
<view class="flex-col section">
|
||||
<!-- 订单状态 + 倒计时 -->
|
||||
<view class="flex-row justify-between self-stretch group_2">
|
||||
<text class="font">订单状态</text>
|
||||
<view class="flex-row group_3">
|
||||
<text class="font_2 text" wx:if="{{ orderObj.orderStatus === '待支付' }}">请在{{countdown}}内完成支付</text>
|
||||
<text class="font_2 text_2 ml-37">{{ orderObj.orderStatus }}</text>
|
||||
<!-- pages/order/orderDetail.wxml -->
|
||||
<view class="page">
|
||||
|
||||
<!-- 中间内容滚动,底部按钮固定,所以这里预留底部内边距 -->
|
||||
<scroll-view scroll-y class="content no-scrollbar">
|
||||
|
||||
<!-- 订单状态 + 倒计时 + 课程信息 -->
|
||||
<view class="card header-card">
|
||||
<!-- 状态与倒计时 -->
|
||||
<view class="status-line">
|
||||
<view class="status-badge {{ orderObj.orderStatus === '待支付' ? 'status-pending' : (orderObj.orderStatus === '已支付' || orderObj.orderStatus === '交易成功' ? 'status-success' : 'status-default') }}">
|
||||
<text class="status-text">{{ orderObj.orderStatus }}</text>
|
||||
</view>
|
||||
<view wx:if="{{ orderObj.orderStatus === '待支付' }}" class="countdown-pill">
|
||||
<text class="countdown-text">请在 {{ countdown }} 内完成支付</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 课程信息 -->
|
||||
<view class="course-line">
|
||||
<image class="cover" src="{{ globalImgUrl + orderObj.image }}" mode="aspectFill" lazy-load="true" />
|
||||
<view class="course-info">
|
||||
<text class="course-title ellipsis-2">{{ orderObj.name }}</text>
|
||||
<view class="price-line">
|
||||
<text class="price-origin">¥{{ orderObj.originPrice }}</text>
|
||||
<text class="price-amount">应付:¥{{ orderObj.totalAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 课程信息 -->
|
||||
<view class="flex-row self-stretch group_4 mt-15">
|
||||
<image
|
||||
class="shrink-0 image"
|
||||
src="{{ globalImgUrl + orderObj.image }}"
|
||||
/>
|
||||
<text class="flex-1 self-start font_3 text_3 ml-7">
|
||||
{{ orderObj.name }}
|
||||
</text>
|
||||
</view>
|
||||
<!-- 课程价格 -->
|
||||
<text class="self-end font_3 text_4 mt-15">¥{{ orderObj.originPrice }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 订单详情 -->
|
||||
<view class="mt-16 flex-col section_2">
|
||||
<view class="self-start group_5">
|
||||
<text class="font text_5">订单编号:</text>
|
||||
<text class="font_4">{{ orderObj.orderNumber }}</text>
|
||||
</view>
|
||||
<view class="flex-row items-baseline self-start group_6">
|
||||
<text class="shrink-0 font text_6">下单时间:</text>
|
||||
<text class="flex-1 font_5 ml-3">{{ orderObj.createTime }}</text>
|
||||
</view>
|
||||
<view class="flex-col justify-start self-stretch relative group_7">
|
||||
<view class="flex-col section_3">
|
||||
<view class="self-stretch divider"></view>
|
||||
<view class="flex-row self-stretch group_8 mt-17">
|
||||
<text class="font text_7">支付方式:</text>
|
||||
<text class="ml-8 font text_8">微信支付</text>
|
||||
</view>
|
||||
<view class="flex-row items-center self-stretch mt-17">
|
||||
<text class="font text_9">交易号:</text>
|
||||
<!-- TODO -->
|
||||
<text class="font_4 ml-23">4002506191307440406460485418</text>
|
||||
</view>
|
||||
<text class="self-start font text_10 mt-17" wx:if="{{ orderObj.orderStatus === '交易成功' }}">交付时间:</text>
|
||||
</view>
|
||||
<text class="font_5 text_11 pos" wx:if="{{ orderObj.orderStatus === '交易成功' }}">{{ orderObj.updateTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 价格明细 -->
|
||||
<view class="mt-16 flex-col section_4">
|
||||
<view class="flex-row justify-between items-center">
|
||||
<text class="font text_12">课程价格</text>
|
||||
<text class="font_4">¥{{ orderObj.originPrice }}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center mt-11">
|
||||
<text class="font text_13">价格折扣</text>
|
||||
<text class="font_4 text_14">-¥{{ orderObj.originPrice - orderObj.totalAmount }}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center group_9 mt-11">
|
||||
<text class="font_2 text_15">订单金额</text>
|
||||
<text class="font_4 text_16">¥{{ orderObj.totalAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮:待支付 -->
|
||||
<view class="flex-row bottom-buttons" wx:if="{{ orderObj.orderStatus === '待支付' }}">
|
||||
<view class="flex-col justify-start items-center text-wrapper" bindtap="cancelOrder">
|
||||
<text class="font_3 text_17">取消</text>
|
||||
<!-- 订单详情 -->
|
||||
<view class="card">
|
||||
<view class="kv">
|
||||
<text class="kv-key">订单编号</text>
|
||||
<text class="kv-val selectable">{{ orderObj.orderNumber }}</text>
|
||||
</view>
|
||||
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="showIsPayModal">
|
||||
<text class="font_3 text_18">立即支付</text>
|
||||
|
||||
<view class="kv">
|
||||
<text class="kv-key">下单时间</text>
|
||||
<text class="kv-val">{{ orderObj.createTime }}</text>
|
||||
</view>
|
||||
|
||||
<view class="divider"></view>
|
||||
|
||||
<view class="kv">
|
||||
<text class="kv-key">支付方式</text>
|
||||
<text class="kv-val">微信支付</text>
|
||||
</view>
|
||||
|
||||
<view class="kv">
|
||||
<text class="kv-key">交易号</text>
|
||||
<!-- 这里可替换为真实字段 -->
|
||||
<text class="kv-val selectable">4002506191307440406460485418</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{ orderObj.orderStatus === '交易成功' }}" class="kv">
|
||||
<text class="kv-key">交付时间</text>
|
||||
<text class="kv-val">{{ orderObj.updateTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮:已支付 -->
|
||||
<view class="flex-row bottom-buttons" wx:if="{{ orderObj.orderStatus === '已支付' }}">
|
||||
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="refundOrder">
|
||||
<text class="font_3 text_18">退款</text>
|
||||
<!-- 价格明细 -->
|
||||
<view class="card">
|
||||
<view class="kv">
|
||||
<text class="kv-key">课程价格</text>
|
||||
<text class="kv-val">¥{{ orderObj.originPrice }}</text>
|
||||
</view>
|
||||
|
||||
<view class="kv">
|
||||
<text class="kv-key">价格折扣</text>
|
||||
<text class="kv-val discount">-¥{{ (orderObj.originPrice - orderObj.totalAmount) >= 0 ? (orderObj.originPrice - orderObj.totalAmount) : 0 }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="kv total">
|
||||
<text class="kv-key total-key">订单金额</text>
|
||||
<text class="kv-val total-val">¥{{ orderObj.totalAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
<!-- 底部按钮:待支付 -->
|
||||
<view class="footer" wx:if="{{ orderObj.orderStatus === '待支付' }}">
|
||||
<view class="footer-inner two-btns">
|
||||
<view class="btn btn-ghost" bindtap="cancelOrder">取消</view>
|
||||
<view class="btn btn-primary" bindtap="showIsPayModal">立即支付</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮:已支付 -->
|
||||
<view class="footer" wx:if="{{ orderObj.orderStatus === '已支付' }}">
|
||||
<view class="footer-inner one-btn">
|
||||
<view class="btn btn-primary" bindtap="refundOrder">退款</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 遮罩 -->
|
||||
<view wx:if="{{ isMaskVisible }}" class="page-mask"></view>
|
||||
</view>
|
||||
|
@ -1,224 +1,255 @@
|
||||
.ml-37 {
|
||||
margin-left: 69.38rpx;
|
||||
/* ===== 页面框架 ===== */
|
||||
.page {
|
||||
background: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.ml-7 {
|
||||
margin-left: 13.13rpx;
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 24rpx 24rpx 200rpx; /* 为底部固定按钮预留空间 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mt-15 {
|
||||
margin-top: 28.13rpx;
|
||||
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
.ml-3 {
|
||||
margin-left: 5.63rpx;
|
||||
}
|
||||
.ml-23 {
|
||||
margin-left: 40.13rpx;
|
||||
}
|
||||
.mt-17 {
|
||||
margin-top: 31.88rpx;
|
||||
}
|
||||
.mt-11 {
|
||||
margin-top: 20.63rpx;
|
||||
}
|
||||
.mt-389 {
|
||||
margin-top: 729.38rpx;
|
||||
}
|
||||
/* app.wxss 或 当前页面 .wxss */
|
||||
|
||||
/* 遮罩 */
|
||||
.page-mask {
|
||||
position: fixed;
|
||||
top: 0; left: 0;
|
||||
width: 100%; height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
inset: 0;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
z-index: 9999;
|
||||
}
|
||||
/* 整体布局 */
|
||||
.page {
|
||||
padding-top: 26.25rpx;
|
||||
background-color: #f8f8f8;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.group {
|
||||
padding: 0 18.75rpx;
|
||||
|
||||
/* ===== 卡片通用 ===== */
|
||||
.card {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
/* 调整首屏 section 右边内边距,不让价格太贴边 */
|
||||
.section {
|
||||
padding: 0 22.5rpx 33.75rpx 22.5rpx;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 7.22rpx;
|
||||
.card + .card {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/* 订单详情区 */
|
||||
.group_2 {
|
||||
padding: 33.75rpx 0 26.25rpx;
|
||||
border-bottom: solid 1.88rpx #e3e3e3;
|
||||
}
|
||||
.group_3 {
|
||||
margin-right: 18.75rpx;
|
||||
}
|
||||
.font_2 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.23rpx;
|
||||
color: #f84947;
|
||||
}
|
||||
.text {
|
||||
line-height: 24.56rpx;
|
||||
}
|
||||
.text_2 {
|
||||
line-height: 24.17rpx;
|
||||
}
|
||||
.group_4 {
|
||||
margin-right: 33.75rpx;
|
||||
}
|
||||
.image {
|
||||
border-radius: 9.38rpx;
|
||||
width: 208.13rpx;
|
||||
height: 133.13rpx;
|
||||
}
|
||||
.font_3 {
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 27.64rpx;
|
||||
}
|
||||
.text_3 {
|
||||
color: #000000;
|
||||
line-height: 35.63rpx;
|
||||
}
|
||||
.text_4 {
|
||||
color: #3d3d3d;
|
||||
line-height: 22.76rpx;
|
||||
}
|
||||
|
||||
/* 订单详情二级区 */
|
||||
.section_2 {
|
||||
padding: 33.75rpx 22.5rpx 0;
|
||||
background-color: #ffffff;
|
||||
border-radius: 7.39rpx;
|
||||
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
||||
}
|
||||
.group_5 {
|
||||
line-height: 24.28rpx;
|
||||
}
|
||||
.font_4 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 19.93rpx;
|
||||
color: #323232;
|
||||
}
|
||||
.group_6 {
|
||||
margin-top: 30rpx;
|
||||
width: 369.94rpx;
|
||||
}
|
||||
.font_5 {
|
||||
font-size: 26.25rpx;
|
||||
line-height: 31.88rpx;
|
||||
color: #323232;
|
||||
}
|
||||
.group_7 {
|
||||
margin-top: 11.25rpx;
|
||||
padding-bottom: 26.25rpx;
|
||||
}
|
||||
.section_3 {
|
||||
padding-top: 9.38rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.divider {
|
||||
background-color: #cccccc;
|
||||
height: 1.88rpx;
|
||||
}
|
||||
.group_8 {
|
||||
padding: 0 3.75rpx;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.23rpx;
|
||||
color: #696969;
|
||||
}
|
||||
.text_7 {
|
||||
line-height: 24.36rpx;
|
||||
}
|
||||
.text_6 {
|
||||
line-height: 31.88rpx;
|
||||
}
|
||||
.text_5 {
|
||||
line-height: 24.28rpx;
|
||||
}
|
||||
.text_8 {
|
||||
color: #323232;
|
||||
}
|
||||
.text_9 {
|
||||
line-height: 24.52rpx;
|
||||
}
|
||||
.text_10 {
|
||||
line-height: 24.43rpx;
|
||||
}
|
||||
.text_11 {
|
||||
width: 270rpx;
|
||||
}
|
||||
.pos {
|
||||
position: absolute;
|
||||
left: 141.05rpx;
|
||||
top: 142.92rpx;
|
||||
}
|
||||
|
||||
/* 调整价格明细区右边内边距 */
|
||||
.section_4 {
|
||||
padding: 22.5rpx 22.5rpx 0 22.5rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 4.01rpx;
|
||||
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
||||
}
|
||||
.text_12 {
|
||||
line-height: 24.41rpx;
|
||||
}
|
||||
.text_13 {
|
||||
line-height: 24.41rpx;
|
||||
}
|
||||
.text_14 {
|
||||
/* margin-right: 15rpx; */
|
||||
}
|
||||
.group_9 {
|
||||
padding: 22.5rpx 0 18.75rpx;
|
||||
border-top: solid 1.88rpx #e3e3e3;
|
||||
}
|
||||
.text_15 {
|
||||
line-height: 24.49rpx;
|
||||
}
|
||||
.text_16 {
|
||||
color: #f84947;
|
||||
}
|
||||
|
||||
/* 底部按钮 */
|
||||
.text-wrapper {
|
||||
padding: 37.5rpx 0;
|
||||
flex: 1 1 375rpx;
|
||||
background-color: #ffffff;
|
||||
height: 105rpx;
|
||||
}
|
||||
.text-wrapper_2 {
|
||||
padding: 37.5rpx 0;
|
||||
flex: 1 1 375rpx;
|
||||
background-color: #ff8d1a;
|
||||
height: 105rpx;
|
||||
}
|
||||
.text_17 {
|
||||
color: #323232;
|
||||
}
|
||||
.text_18 {
|
||||
color: #ffffff;
|
||||
line-height: 27.81rpx;
|
||||
}
|
||||
.bottom-buttons {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
/* ===== 顶部卡片:状态 + 倒计时 + 课程 ===== */
|
||||
.header-card .status-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: #ffffff; /* 可以根据需要设置背景色 */
|
||||
gap: 16rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
height: 48rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 999rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.status-pending {
|
||||
background: #fff6e6;
|
||||
color: #ff8d1a;
|
||||
}
|
||||
|
||||
.status-success {
|
||||
background: #e9fbef;
|
||||
color: #12b05b;
|
||||
}
|
||||
|
||||
.status-default {
|
||||
background: #f0f0f0;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.countdown-pill {
|
||||
background: #fff4f2;
|
||||
border: 1rpx solid #ffd6cc;
|
||||
padding: 0 18rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 999rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.countdown-text {
|
||||
font-size: 24rpx;
|
||||
color: #ff5a1a;
|
||||
}
|
||||
|
||||
/* 课程行 */
|
||||
.course-line {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 240rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #f2f2f2;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.course-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.course-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #1f1f1f;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
.ellipsis-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.price-line {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 16rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.price-origin {
|
||||
font-size: 28rpx;
|
||||
color: #9f9f9f;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.price-amount {
|
||||
font-size: 30rpx;
|
||||
color: #ff5a1a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* ===== 键值对(订单详情 / 价格明细) ===== */
|
||||
.kv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 12rpx 0;
|
||||
}
|
||||
|
||||
.kv + .kv {
|
||||
border-top: 1rpx dashed #f0f0f0;
|
||||
}
|
||||
|
||||
.kv-key {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.kv-val {
|
||||
font-size: 28rpx;
|
||||
color: #1f1f1f;
|
||||
max-width: 70%;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.selectable {
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.divider {
|
||||
height: 1rpx;
|
||||
background: #f2f2f2;
|
||||
margin: 8rpx 0 12rpx;
|
||||
}
|
||||
|
||||
.discount {
|
||||
color: #12b05b;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.total {
|
||||
border-top: 1rpx solid #f2f2f2;
|
||||
margin-top: 8rpx;
|
||||
padding-top: 16rpx;
|
||||
}
|
||||
|
||||
.total-key {
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.total-val {
|
||||
font-size: 34rpx;
|
||||
color: #ff5a1a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* ===== 底部操作栏 ===== */
|
||||
.footer {
|
||||
position: fixed;
|
||||
left: 0; right: 0; bottom: 0;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 -6rpx 20rpx rgba(0,0,0,0.06);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.footer-inner {
|
||||
height: 120rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 24rpx;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.footer-inner.two-btns { justify-content: space-between; }
|
||||
.footer-inner.one-btn { justify-content: flex-end; }
|
||||
|
||||
.btn {
|
||||
height: 88rpx;
|
||||
min-width: 260rpx;
|
||||
border-radius: 999rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btn-ghost {
|
||||
background: #ffffff;
|
||||
color: #333333;
|
||||
border: 2rpx solid #e6e6e6;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: linear-gradient(180deg, #ffa64a 0%, #ff8d1a 100%);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 6rpx 14rpx rgba(255, 141, 26, 0.35);
|
||||
}
|
||||
|
||||
/* ===== 迁移提示:以下旧的散装类建议删除(如无外部依赖) ===== */
|
||||
/* .ml-37, .ml-7, .mt-15, .ml-3, .ml-23, .mt-17, .mt-11, .mt-389 等 */
|
||||
|
Reference in New Issue
Block a user