美化了样式2.0
This commit is contained in:
@ -11,9 +11,37 @@ Page({
|
||||
courseId: 0, // 课程id
|
||||
courseObj: '', // 课程对象
|
||||
globalImgUrl, // 全局图片
|
||||
isMaskVisible: false
|
||||
isMaskVisible: false,
|
||||
isNoticeVisible: true,
|
||||
noticeHtml: `
|
||||
<h3>一、购买与使用</h3>
|
||||
<p>1)购买后请在 <strong>「我的订单」</strong> 中查看并进入课程学习;</p>
|
||||
<p>2)课程为虚拟内容服务,一经购买概不支持无理由退款;</p>
|
||||
|
||||
<h3>二、账号与权益</h3>
|
||||
<p>1)课程仅限购买账号本人使用,不可转借、分享或用于商业用途;</p>
|
||||
<p>2)如发现恶意盗链、传播等行为,我们有权封禁账号并追究法律责任。</p>
|
||||
|
||||
<h3>三、发票与售后</h3>
|
||||
<p>如需发票或遇到问题,请在课程详情页联系客服。</p>
|
||||
|
||||
<h3>四、其他</h3>
|
||||
<p>购买即视为同意本须知及平台服务协议。</p>
|
||||
`,
|
||||
},
|
||||
|
||||
// 打开/关闭弹窗
|
||||
openNotice() {
|
||||
this.setData({ isNoticeVisible: true });
|
||||
},
|
||||
closeNotice() {
|
||||
this.setData({ isNoticeVisible: false });
|
||||
},
|
||||
// 阻止冒泡/滚动穿透的空函数
|
||||
noop() {},
|
||||
|
||||
|
||||
|
||||
// 创建订单方法
|
||||
createOrder() {
|
||||
const { courseId } = this.data;
|
||||
|
@ -51,3 +51,27 @@
|
||||
<!-- 遮罩 -->
|
||||
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- ===== 购买须知弹窗(富文本) ===== -->
|
||||
<view wx:if="{{isNoticeVisible}}" class="modal-mask" catchtouchmove="noop">
|
||||
<view class="modal" catchtap="noop">
|
||||
<view class="modal-title">课程购买须知</view>
|
||||
|
||||
<!-- 富文本内容:支持 p/h1-h6/strong/em/ul/ol/a 等常见标签 -->
|
||||
<scroll-view scroll-y class="modal-body">
|
||||
<rich-text nodes="{{noticeHtml}}"></rich-text>
|
||||
</scroll-view>
|
||||
|
||||
<view class="modal-actions">
|
||||
<button class="btn-primary" bindtap="closeNotice">我知道了</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 右上角购买须知按钮 -->
|
||||
<view class="notice-icon" bindtap="openNotice">
|
||||
<image src="./image/info.png" mode="aspectFit" class="notice-icon-img" />
|
||||
<text class="notice-icon-text">购买须知</text>
|
||||
</view>
|
||||
|
||||
|
@ -203,3 +203,108 @@
|
||||
.ml-11 { margin-left: 20rpx; }
|
||||
.mt-15 { margin-top: 28rpx; }
|
||||
.ml-1 { margin-left: 2rpx; }
|
||||
|
||||
|
||||
|
||||
/* 入口小字 */
|
||||
.notice-entry {
|
||||
margin-right: 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8a8a8a;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 弹窗遮罩 */
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
z-index: 999; /* 确保在你的 .footer 与其他遮罩之上 */
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,0.45);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
/* 弹窗容器 */
|
||||
.modal {
|
||||
width: 86%;
|
||||
max-width: 640rpx;
|
||||
max-height: 70vh;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 12rpx 40rpx rgba(0,0,0,0.18);
|
||||
}
|
||||
|
||||
/* 标题 */
|
||||
.modal-title {
|
||||
padding: 28rpx 32rpx 12rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
/* 内容区滚动 */
|
||||
.modal-body {
|
||||
max-height: 48vh;
|
||||
padding: 8rpx 32rpx 24rpx;
|
||||
}
|
||||
|
||||
/* 富文本默认样式优化 */
|
||||
.modal-body rich-text {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.75;
|
||||
color: #444;
|
||||
}
|
||||
.modal-body h3 { font-size: 28rpx; margin: 18rpx 0 8rpx; color: #222; }
|
||||
.modal-body p { margin: 10rpx 0; }
|
||||
.modal-body ul, .modal-body ol { margin: 10rpx 0 10rpx 28rpx; }
|
||||
.modal-body a { color: #1677ff; word-break: break-all; }
|
||||
|
||||
/* 底部按钮区 */
|
||||
.modal-actions {
|
||||
padding: 20rpx 24rpx 28rpx;
|
||||
}
|
||||
.btn-primary {
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
background: #ff8a00; /* 你的主色调(可换成项目变量) */
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.btn-primary:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.notice-icon {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
border-radius: 30rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
|
||||
padding: 6rpx 14rpx;
|
||||
}
|
||||
|
||||
.notice-icon-img {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.notice-icon-text {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
.notice-icon:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
BIN
pages/course/createCourseOrder/image/info.png
Normal file
BIN
pages/course/createCourseOrder/image/info.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
Reference in New Issue
Block a user