美化了样式
@ -1,5 +1,7 @@
|
||||
import { baseUrl, globalImgUrl } from "../../../request";
|
||||
import { decodeBase64 } from "../../../utils/decodebase64";
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
|
||||
|
||||
// pages/course/courseDetail/courseDetail.js
|
||||
Page({
|
||||
@ -31,6 +33,8 @@ Page({
|
||||
courseObj: res.data.data,
|
||||
richText: decodeBase64(res.data.data.detail)
|
||||
})
|
||||
} else {
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,36 +1,47 @@
|
||||
<view class="flex-col page">
|
||||
<view class="flex-col">
|
||||
<view class="flex-col">
|
||||
<image class="image" src="{{ globalImgUrl + courseObj.image }}" />
|
||||
<view class="flex-col section">
|
||||
<view class="flex-row items-center group">
|
||||
<view class="shrink-0 group_2">
|
||||
<text class="text">{{ courseObj.discountPrice }}</text>
|
||||
<text class="font text_2">元券后价</text>
|
||||
</view>
|
||||
<view class="ml-4 flex-col justify-start items-start shrink-0 relative group_3">
|
||||
<text class="font text_3">{{ courseObj.originPrice }}元</text>
|
||||
<view class="divider pos"></view>
|
||||
</view>
|
||||
<!-- pages/course/courseDetail/courseDetail.wxml -->
|
||||
<view class="page">
|
||||
<!-- 滚动内容 -->
|
||||
<scroll-view scroll-y class="content no-scrollbar">
|
||||
<!-- 顶部主图 -->
|
||||
<view class="hero">
|
||||
<image class="hero-img" src="{{ globalImgUrl + courseObj.image }}" mode="aspectFill" lazy-load="true" />
|
||||
</view>
|
||||
|
||||
<!-- 价格 + 标题 -->
|
||||
<view class="card">
|
||||
<view class="price-row">
|
||||
<view class="price-now">
|
||||
<text class="price-num">{{ courseObj.discountPrice }}</text>
|
||||
<text class="price-suffix">元券后价</text>
|
||||
</view>
|
||||
<view class="price-origin">
|
||||
<text class="origin-text">{{ courseObj.originPrice }}元</text>
|
||||
</view>
|
||||
<text class="group text_4 mt-9">{{ courseObj.name }}</text>
|
||||
</view>
|
||||
<text class="title">{{ courseObj.name }}</text>
|
||||
</view>
|
||||
<view class="mt-26 flex-col section_2">
|
||||
<view class="flex-row items-center group_4">
|
||||
<image class="image_2" src="./image/cal.png" />
|
||||
<text class="ml-6 font text_5">课程概述</text>
|
||||
|
||||
<!-- 课程概述 -->
|
||||
<view class="card">
|
||||
<view class="card-head">
|
||||
<image class="head-icon" src="./image/cal.png" mode="aspectFit" />
|
||||
<text class="head-text">课程概述</text>
|
||||
</view>
|
||||
<rich-text class="section_3" nodes="{{ richText }}"></rich-text>
|
||||
<rich-text class="rt" nodes="{{ richText }}"></rich-text>
|
||||
</view>
|
||||
|
||||
<!-- 占位,避免被底部栏遮挡 -->
|
||||
<view class="bottom-gap"></view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 固定底部购买栏 -->
|
||||
<view class="buy-bar">
|
||||
<view class="buy-left">
|
||||
<image class="consult-icon" src="./image/messge.png" mode="aspectFit" />
|
||||
<text class="consult-text">咨询</text>
|
||||
</view>
|
||||
<view class="buy-btn" bindtap="gotoCourseOrder" data-id="{{ courseObj.id }}">
|
||||
<text class="buy-btn-text">立即购买</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center section_4 mt-37">
|
||||
<view class="flex-col items-center">
|
||||
<image class="image_3" src="./image/messge.png" />
|
||||
<text class="text_7 mt-1">咨询</text>
|
||||
</view>
|
||||
<view class="flex-col justify-start items-center text-wrapper" bind:tap="gotoCourseOrder" data-id="{{ courseObj.id }}">
|
||||
<text class="text_6">立即购买</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1,131 +1,148 @@
|
||||
.mt-9 {
|
||||
margin-top: 16.88rpx;
|
||||
}
|
||||
.mt-37 {
|
||||
margin-top: 69.38rpx;
|
||||
}
|
||||
.mt-1 {
|
||||
margin-top: 1.88rpx;
|
||||
}
|
||||
/* pages/course/courseDetail/courseDetail.wxss */
|
||||
|
||||
/* ===== 页面骨架:整页固定、内容滚动、底部栏固定 ===== */
|
||||
.page {
|
||||
background-color: #f6f7f9;
|
||||
padding-bottom: 100rpx;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
.image {
|
||||
width: 100vw;
|
||||
height: 54.75vw;
|
||||
}
|
||||
.section {
|
||||
padding: 37.5rpx 11.25rpx 30rpx 18.75rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.group {
|
||||
padding: 0 3.75rpx;
|
||||
}
|
||||
.group_2 {
|
||||
line-height: 28.8rpx;
|
||||
height: 30.58rpx;
|
||||
}
|
||||
.text {
|
||||
color: #f84947;
|
||||
font-size: 37.5rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
font-weight: 700;
|
||||
line-height: 28.8rpx;
|
||||
}
|
||||
.group_3 {
|
||||
margin-right: 453.75rpx;
|
||||
width: 75.02rpx;
|
||||
}
|
||||
.divider {
|
||||
background-color: #8c8c8c;
|
||||
width: 75.02rpx;
|
||||
height: 1.88rpx;
|
||||
}
|
||||
.pos {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.text_4 {
|
||||
color: #000000;
|
||||
font-size: 33.75rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 41.25rpx;
|
||||
}
|
||||
.section_2 {
|
||||
padding: 0 30rpx 52.5rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.group_4 {
|
||||
padding: 26.25rpx 0;
|
||||
}
|
||||
.image_2 {
|
||||
width: 39.38rpx;
|
||||
height: 39.38rpx;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 25.97rpx;
|
||||
}
|
||||
.text_3 {
|
||||
width: 100rpx;
|
||||
color: #8c8c8c;
|
||||
line-height: 31.88rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
.text_2 {
|
||||
color: #f84947;
|
||||
line-height: 24.43rpx;
|
||||
}
|
||||
.text_5 {
|
||||
color: #000000;
|
||||
font-size: 28.13rpx;
|
||||
}
|
||||
.section_3 {
|
||||
height: auto;
|
||||
padding-bottom: 40rpx;
|
||||
/* 以下是新增 */
|
||||
white-space: normal; /* 允许换行 */
|
||||
word-break: break-all; /* 在任意字符处断行,数字也会换行 */
|
||||
}
|
||||
.section_4 {
|
||||
padding: 15rpx 26.25rpx;
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 999; /* 确保它在最上层 */
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #f6f7f9;
|
||||
overflow: auto; /* 禁止整页滚动 */
|
||||
box-sizing: border-box;
|
||||
font-family: SourceHanSansCN, PingFang SC, Microsoft YaHei, system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
|
||||
.image_3 {
|
||||
width: 52.5rpx;
|
||||
height: 52.5rpx;
|
||||
/* 独立滚动内容区(隐藏滚动条) */
|
||||
.content {
|
||||
flex: 1;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.text_7 {
|
||||
color: #000000;
|
||||
font-size: 22.5rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 20.94rpx;
|
||||
.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; background: transparent; }
|
||||
.no-scrollbar { scrollbar-width: none; }
|
||||
|
||||
/* ===== 顶部主图(自适应圆角阴影) ===== */
|
||||
.hero {
|
||||
padding: 24rpx 24rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.text-wrapper {
|
||||
padding: 22.5rpx 0 18.75rpx;
|
||||
background-color: #ff8d1a;
|
||||
border-radius: 75rpx;
|
||||
width: 268.13rpx;
|
||||
height: 71.25rpx;
|
||||
.hero-img {
|
||||
width: 100%;
|
||||
height: 420rpx; /* 沉浸横幅高度 */
|
||||
border-radius: 20rpx;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 12rpx 30rpx rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
/* ===== 通用卡片容器 ===== */
|
||||
.card {
|
||||
margin: 20rpx 24rpx 0;
|
||||
padding: 22rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.05);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ===== 价格区:券后价 + 原价 ===== */
|
||||
.price-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.price-now { display: inline-flex; align-items: baseline; gap: 8rpx; }
|
||||
.price-num {
|
||||
font-size: 44rpx;
|
||||
line-height: 1;
|
||||
color: #ff6a00; /* 主题橙 */
|
||||
font-weight: 700;
|
||||
}
|
||||
.price-suffix { font-size: 24rpx; color: #ff6a00; opacity: .9; }
|
||||
.price-origin .origin-text { font-size: 24rpx; color: #9aa0a6; text-decoration: line-through; }
|
||||
|
||||
/* 课程标题 */
|
||||
.title {
|
||||
display: block;
|
||||
margin-top: 14rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 46rpx;
|
||||
color: #111;
|
||||
font-weight: 600;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* ===== 概述标题行 ===== */
|
||||
.card-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.head-icon { width: 34rpx; height: 34rpx; }
|
||||
.head-text { font-size: 28rpx; color: #111; font-weight: 600; }
|
||||
|
||||
/* rich-text 内容排版(图片适配) */
|
||||
.rt {
|
||||
font-size: 26rpx;
|
||||
line-height: 42rpx;
|
||||
color: #333;
|
||||
white-space: normal;
|
||||
word-break: break-word;
|
||||
}
|
||||
.rt p { margin: 8rpx 0; }
|
||||
.rt img { max-width: 100%; height: auto !important; border-radius: 12rpx; }
|
||||
|
||||
/* 底部占位,避免被购买栏遮挡 */
|
||||
.bottom-gap {
|
||||
height: calc(env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
/* ===== 固定底部购买栏(含安全区) ===== */
|
||||
.buy-bar {
|
||||
position: sticky;
|
||||
bottom: 0; left: 0; right: 0;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: 20rpx;
|
||||
padding: 12rpx 24rpx calc(12rpx + env(safe-area-inset-bottom));
|
||||
background: #ffffff;
|
||||
box-shadow: 0 -8rpx 20rpx rgba(0,0,0,0.06);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 左侧咨询 */
|
||||
.buy-left {
|
||||
display: inline-flex; align-items: center; gap: 10rpx;
|
||||
padding: 12rpx 16rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.consult-icon { width: 36rpx; height: 36rpx; }
|
||||
.consult-text { font-size: 24rpx; color: #333; }
|
||||
|
||||
/* 右侧按钮 */
|
||||
.buy-btn {
|
||||
flex: 1;
|
||||
height: 72rpx;
|
||||
border-radius: 9999rpx;
|
||||
background: linear-gradient(90deg, #ff6a00, #ff8a2a);
|
||||
box-shadow: 0 10rpx 24rpx rgba(255,106,0,0.26);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.buy-btn-text {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
/* ===== 小的间距工具(保留你原有语义) ===== */
|
||||
.mt-9 { margin-top: 16rpx; }
|
||||
.mt-37 { margin-top: 68rpx; }
|
||||
.mt-1 { margin-top: 2rpx; }
|
||||
|
||||
/* 你之前的 class 若仍在别处使用,可继续保留或删去:
|
||||
.image, .section, .group, .group_2, .group_3, .divider, .pos, .text_4, .section_2, .group_4, .image_2, .font, .text_3, .text_2, .text_5, .section_3, .section_4, .image_3, .text_7, .text-wrapper, .text_6
|
||||
当前新版未依赖它们。 */
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
background: transparent;
|
||||
}
|
||||
.text_6 {
|
||||
color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 28.11rpx;
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import { baseUrl, globalImgUrl } from "../../../request";
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
|
||||
// pages/course/courseList/courseList.js
|
||||
Page({
|
||||
@ -10,6 +11,8 @@ Page({
|
||||
courseList:[], // 课程列表
|
||||
courseType: '', // 课程类别
|
||||
globalImgUrl,
|
||||
tempCourseList: [],
|
||||
searchKeyword: ''
|
||||
},
|
||||
|
||||
// 跳转课程详情页面
|
||||
@ -22,6 +25,23 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
onSearchInput(e) {
|
||||
const keyword = (e.detail.value || '').trim();
|
||||
this.setData({ searchKeyword: keyword });
|
||||
},
|
||||
// 键盘“搜索/回车”触发:立即搜索
|
||||
onSearch() {
|
||||
const { tempCourseList } = this.data
|
||||
const keyword = (this.data.searchKeyword || '').trim();
|
||||
if (!keyword) {
|
||||
this.setData({courseList: tempCourseList})
|
||||
return;
|
||||
}
|
||||
// 模糊匹配 name
|
||||
const filtered = this.data.courseList.filter(item => item.name.includes(keyword)
|
||||
);
|
||||
this.setData({ courseList: filtered });
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
@ -48,13 +68,11 @@ Page({
|
||||
console.log('课程列表',res.data.data);
|
||||
if (res.data.code === 1) {
|
||||
this.setData({
|
||||
courseList: res.data.data
|
||||
courseList: res.data.data,
|
||||
tempCourseList: res.data.data
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: 'none',
|
||||
title: res.data.message || '获取课程失败',
|
||||
});
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
|
@ -1,39 +1,38 @@
|
||||
<view class="flex-col page">
|
||||
<text class="self-center text">{{ courseType }}</text>
|
||||
<image class="shrink-0 self-start image image_2" src="./image/line.png" />
|
||||
<image class="shrink-0 self-end image image_3" src="./image/line.png" />
|
||||
<!-- pages/course/searchCourses/searchCourses.wxml -->
|
||||
<view class="page">
|
||||
|
||||
<view class="flex-col self-stretch list">
|
||||
<!-- 遍历接口返回的 items 数组 -->
|
||||
<view
|
||||
class="flex-col list-item"
|
||||
wx:for="{{courseList}}"
|
||||
wx:for-item="item"
|
||||
wx:for-index="index"
|
||||
wx:key="id"
|
||||
>
|
||||
<view
|
||||
class="flex-row items-center relative group"
|
||||
bindtap="gotoCourseDetail"
|
||||
data-id="{{item.id}}"
|
||||
>
|
||||
<!-- 课程封面 -->
|
||||
<image
|
||||
class="shrink-0 image_4"
|
||||
src="{{ globalImgUrl + item.image}}"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="flex-col flex-1 ml-12">
|
||||
<!-- 课程名称 -->
|
||||
<text class="font">{{item.name}}</text>
|
||||
<view class="flex-row justify-between items-baseline mt-17">
|
||||
<!-- 卷后价格 -->
|
||||
<text class="font_2">券后{{item.discountPrice}}元起</text>
|
||||
<!-- 已有下单人数 -->
|
||||
<text class="font_3">{{item.orderCount}}人学习</text>
|
||||
</view>
|
||||
<!-- 顶部搜索条(固定) -->
|
||||
<view class="search-bar" hover-class="hover">
|
||||
<image class="search-icon" src="./image/sousuo.png" mode="aspectFit"/>
|
||||
<input
|
||||
class="search-input"
|
||||
placeholder="搜索更多好课"
|
||||
placeholder-class="search-ph"
|
||||
bindinput="onSearchInput"
|
||||
confirm-type="search"
|
||||
bindconfirm="onSearch"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 搜索结果(独立滚动 & 隐藏滚动条) -->
|
||||
<scroll-view scroll-y class="list no-scrollbar">
|
||||
<block wx:for="{{courseList}}" wx:for-item="item" wx:key="item.id">
|
||||
<view class="course-card" bindtap="gotoCourseDetail" data-id="{{item.id}}" hover-class="hover">
|
||||
<image class="cover" src="{{ globalImgUrl + item.image }}" mode="aspectFill" lazy-load="true"/>
|
||||
<view class="info">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<view class="meta">
|
||||
<text class="price-pill">券后{{item.discountPrice}}元起</text>
|
||||
<text class="people">{{item.orderCount}}人学习</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 空状态(可选) -->
|
||||
<view wx:if="{{!courseList || courseList.length === 0}}" class="empty">
|
||||
<image class="empty-icon" src="./image/empty.png" mode="aspectFit"/>
|
||||
<text class="empty-text">没找到相关课程,换个关键词试试~</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
@ -1,63 +1,131 @@
|
||||
/* pages/course/courseList/courseList.wxss */
|
||||
.mt-17 {
|
||||
margin-top: 31.88rpx;
|
||||
}
|
||||
/* pages/course/searchCourses/searchCourses.wxss */
|
||||
|
||||
/* ===== 页面骨架:整页固定,列表单独滚动 ===== */
|
||||
.page {
|
||||
/* padding: 38.53rpx 0 ; */
|
||||
background-color: #ffffff;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #ffffff;
|
||||
overflow: hidden; /* 禁止整页滚动 */
|
||||
box-sizing: border-box;
|
||||
font-family: SourceHanSansCN, PingFang SC, Microsoft YaHei, system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
.text {
|
||||
color: #000000;
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 27.64rpx;
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
background: transparent;
|
||||
}
|
||||
.image {
|
||||
width: 255rpx;
|
||||
height: 1.88rpx;
|
||||
|
||||
|
||||
/* 轻触反馈 */
|
||||
.hover { opacity: .86; transition: opacity .18s ease; }
|
||||
|
||||
/* ===== 顶部搜索条(固定) ===== */
|
||||
.search-bar {
|
||||
padding: 24rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.image_2 {
|
||||
margin-left: 40.78rpx;
|
||||
margin-top: -14.7rpx;
|
||||
}
|
||||
.image_3 {
|
||||
margin-right: 37.97rpx;
|
||||
.search-icon { width: 36rpx; height: 36rpx; opacity: .9; }
|
||||
|
||||
/* 胶囊输入框 */
|
||||
.search-input {
|
||||
flex: 1;
|
||||
height: 72rpx;
|
||||
padding: 0 26rpx;
|
||||
border-radius: 9999rpx;
|
||||
background: #f5f6f7;
|
||||
font-size: 26rpx;
|
||||
color: #111;
|
||||
line-height: 72rpx;
|
||||
box-shadow: inset 0 0 0 1rpx rgba(0,0,0,.04);
|
||||
}
|
||||
.search-ph { color: #a8a8a8; font-size: 26rpx; }
|
||||
|
||||
/* ===== 列表:占满剩余高度,单独滚动,隐藏滚动条 ===== */
|
||||
.list {
|
||||
padding-top: 20.21rpx;
|
||||
flex: 1;
|
||||
padding: 0 24rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: #fff;
|
||||
}
|
||||
.list-item {
|
||||
height: 178.13rpx;
|
||||
.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; background: transparent; }
|
||||
.no-scrollbar { scrollbar-width: none; }
|
||||
|
||||
/* ===== 课程卡片(左图右文) ===== */
|
||||
.course-card {
|
||||
display: flex;
|
||||
gap: 22rpx;
|
||||
padding: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
border: 1rpx solid #f1f1f1;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0,0,0,.05);
|
||||
}
|
||||
.group {
|
||||
margin: -18.24rpx 29.46rpx 0 35.63rpx;
|
||||
padding: 57.19rpx 0 26.27rpx;
|
||||
border-bottom: solid 1.88rpx #d6d6d6;
|
||||
.cover {
|
||||
width: 280rpx; /* 3:2 比例更舒服 */
|
||||
height: 186rpx;
|
||||
flex: 0 0 280rpx;
|
||||
border-radius: 14rpx;
|
||||
object-fit: cover;
|
||||
}
|
||||
.image_4 {
|
||||
border-radius: 9.38rpx;
|
||||
width: 208.13rpx;
|
||||
height: 133.13rpx;
|
||||
.info {
|
||||
flex: 1;
|
||||
min-width: 0; /* 防文字溢出 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 31.88rpx;
|
||||
color: #000000;
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #111;
|
||||
font-weight: 600;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2; /* 两行省略 */
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
word-break: break-word;
|
||||
}
|
||||
.font_2 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 24.15rpx;
|
||||
color: #ff5733;
|
||||
.meta {
|
||||
margin-top: 12rpx;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.font_3 {
|
||||
font-size: 22.5rpx;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 20.34rpx;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
.price-pill {
|
||||
padding: 6rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 9999rpx;
|
||||
background: linear-gradient(90deg, #ff6a00, #ff8a2a);
|
||||
box-shadow: 0 6rpx 16rpx rgba(255,106,0,.22);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.people {
|
||||
font-size: 22rpx;
|
||||
color: #9aa0a6;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ===== 空状态 ===== */
|
||||
.empty {
|
||||
padding: 120rpx 0 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 18rpx;
|
||||
color: #9aa0a6;
|
||||
}
|
||||
.empty-icon { width: 240rpx; height: 240rpx; opacity: .7; }
|
||||
.empty-text { font-size: 24rpx; line-height: 34rpx; }
|
||||
|
||||
/* ===== 兼容你项目里可能已有的工具类(可留可删) ===== */
|
||||
.ml-3 { margin-left: 6rpx; }
|
||||
.mt-17 { margin-top: 12rpx; }
|
||||
|
BIN
pages/course/courseList/image/empty.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
pages/course/courseList/image/sousuo.png
Normal file
After Width: | Height: | Size: 812 B |
@ -1,4 +1,5 @@
|
||||
import { baseUrl } from "../../../request";
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
|
||||
// pages/course/courseOrderList/courseOrderList.js
|
||||
Page({
|
||||
@ -70,7 +71,7 @@ Page({
|
||||
});
|
||||
|
||||
} else {
|
||||
wx.showToast({ title: res.data.message || '获取失败', icon: 'none' });
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
@ -1,42 +1,55 @@
|
||||
<!-- pages/course/courseOrderList/courseOrderList.wxml -->
|
||||
<view class="flex-col justify-start page">
|
||||
<view class="flex-col group_1">
|
||||
<view
|
||||
class="flex-col list-item mt-17"
|
||||
wx:for="{{orderList}}"
|
||||
wx:for-item="item"
|
||||
wx:for-index="index"
|
||||
wx:key="item"
|
||||
bind:tap="gotoOrderDetail"
|
||||
data-id="{{ item.id }}"
|
||||
>
|
||||
<view class="flex-row self-stretch group">
|
||||
<text class="font text">订单号:{{item.orderNumber}}</text>
|
||||
<text class="font_2">{{ item.orderStatus }}</text>
|
||||
<view class="page">
|
||||
|
||||
<!-- 列表滚动区 -->
|
||||
<scroll-view scroll-y class="content no-scrollbar">
|
||||
|
||||
<!-- 空状态(可选) -->
|
||||
<view wx:if="{{ !orderList || orderList.length === 0 }}" class="empty">
|
||||
<image class="empty-img" src="./image/empty.png" mode="aspectFit" />
|
||||
<text class="empty-text">暂无订单</text>
|
||||
</view>
|
||||
|
||||
<!-- 订单卡片列表 -->
|
||||
<view wx:for="{{ orderList }}"
|
||||
wx:for-item="item"
|
||||
wx:for-index="index"
|
||||
wx:key="item.id"
|
||||
class="card order-item"
|
||||
bind:tap="gotoOrderDetail"
|
||||
data-id="{{ item.id }}">
|
||||
|
||||
<!-- 顶部:订单号 + 状态徽标 -->
|
||||
<view class="topline">
|
||||
<text class="order-no">订单号:{{ item.orderNumber }}</text>
|
||||
<view class="status-badge {{ item.orderStatus === '待支付' ? 'status-pending' : (item.orderStatus === '已支付' || item.orderStatus === '交易成功' ? 'status-success' : 'status-default') }}">
|
||||
<text class="status-text">{{ item.orderStatus }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text class="self-stretch font_3 text_2">{{ item.name }}</text>
|
||||
<text class="self-end font_4 text_3">¥{{ item.totalAmount }}</text>
|
||||
<!-- 课程名称 -->
|
||||
<text class="course-name ellipsis-2">{{ item.name }}</text>
|
||||
|
||||
<!-- 倒计时,只在“待支付”时显示 -->
|
||||
<text wx:if="{{ item.orderStatus === '待支付' }}" class="self-end font_5 text_4">
|
||||
请在 {{ item.countDownStr }} 内完成支付
|
||||
</text>
|
||||
<!-- 价格 + 倒计时(仅待支付显示) -->
|
||||
<view class="price-line">
|
||||
<text class="amount">¥{{ item.totalAmount }}</text>
|
||||
<view wx:if="{{ item.orderStatus === '待支付' }}" class="countdown-pill">
|
||||
<text class="countdown-text">请在 {{ item.countDownStr }} 内完成支付</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex-row justify-between items-center self-stretch group_2">
|
||||
<text class="font_6 text_5">{{ item.createTime }}</text>
|
||||
<view class="flex-row">
|
||||
<!-- 仅待支付时可操作 -->
|
||||
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper" catch:tap="cancelOrder" data-id="{{ item.id }}">
|
||||
<text class="font_7">取消订单</text>
|
||||
</view>
|
||||
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper_2 ml-11" catch:tap="showIsPayModal"
|
||||
data-order-id="{{ item.id }}">
|
||||
<text class="font_8">支付</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部:下单时间 + 操作按钮(仅待支付显示) -->
|
||||
<view class="bottomline">
|
||||
<text class="ctime">{{ item.createTime }}</text>
|
||||
<view class="actions" wx:if="{{ item.orderStatus === '待支付' }}">
|
||||
<view class="btn btn-ghost" catch:tap="cancelOrder" data-id="{{ item.id }}">取消订单</view>
|
||||
<view class="btn btn-primary" catch:tap="showIsPayModal" data-order-id="{{ item.id }}">支付</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
<!-- 遮罩 -->
|
||||
<view wx:if="{{ isMaskVisible }}" class="page-mask"></view>
|
||||
</view>
|
||||
|
@ -1,134 +1,169 @@
|
||||
/* pages/course/courseOrderList/courseOrderList.wxss */
|
||||
/* ===== 页面与滚动 ===== */
|
||||
.page {
|
||||
background: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mt-17 {
|
||||
margin-top: 31.88rpx;
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 24rpx 24rpx; /* 统一外边距 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.ml-37 {
|
||||
margin-left: 92.38rpx;
|
||||
}
|
||||
.ml-11 {
|
||||
margin-left: 20.63rpx;
|
||||
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 遮罩 */
|
||||
.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: 26.25rpx 0 50.63rpx;
|
||||
background-color: #f8f8f8;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
.group_1 {
|
||||
margin-left: 20.63rpx;
|
||||
margin-right: 18.77rpx;
|
||||
}
|
||||
.list-item {
|
||||
padding-left: 22.5rpx;
|
||||
padding-right: 3.51rpx;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.66rpx;
|
||||
}
|
||||
.list-item:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.group {
|
||||
padding: 32.51rpx 15rpx 25.82rpx 0;
|
||||
border-bottom: solid 1.88rpx #e3e3e3;
|
||||
|
||||
/* ===== 空状态 ===== */
|
||||
.empty {
|
||||
padding: 100rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
color: #999999;
|
||||
}
|
||||
.empty-img { width: 280rpx; height: 280rpx; margin-bottom: 20rpx; }
|
||||
.empty-text { font-size: 28rpx; }
|
||||
|
||||
/* ===== 卡片通用 ===== */
|
||||
.card {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05);
|
||||
}
|
||||
.card + .card { margin-top: 20rpx; }
|
||||
|
||||
/* ===== 列表项排版 ===== */
|
||||
.order-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
/* 顶部行:订单号 + 状态 */
|
||||
.topline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.17rpx;
|
||||
color: #696969;
|
||||
.order-no {
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.text {
|
||||
line-height: 24.02rpx;
|
||||
|
||||
.status-badge {
|
||||
height: 40rpx;
|
||||
padding: 0 18rpx;
|
||||
border-radius: 999rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.font_2 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.17rpx;
|
||||
color: #f84947;
|
||||
.status-text {
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.font_3 {
|
||||
.status-pending { background: #fff6e6; color: #ff8d1a; } /* 待支付:主题橙 */
|
||||
.status-success { background: #e9fbef; color: #12b05b; } /* 已/成功:绿色 */
|
||||
.status-default { background: #f0f0f0; color: #666666; } /* 其他:灰 */
|
||||
|
||||
/* 课程名称 */
|
||||
.course-name {
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 35.63rpx;
|
||||
color: #000000;
|
||||
font-weight: 600;
|
||||
color: #1f1f1f;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
.text_2 {
|
||||
margin-top: 25.69rpx;
|
||||
.ellipsis-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.font_4 {
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.17rpx;
|
||||
color: #3d3d3d;
|
||||
|
||||
/* 价格 + 倒计时 */
|
||||
.price-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.text_3 {
|
||||
margin-top: 58.09rpx;
|
||||
line-height: 22.76rpx;
|
||||
margin-right: 22rpx; /* 向左移动:增加右侧间距 */
|
||||
.amount {
|
||||
font-size: 34rpx;
|
||||
color: #ff5a1a; /* 与你的小程序橙色系统一 */
|
||||
font-weight: 700;
|
||||
}
|
||||
.font_5 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 26.32rpx;
|
||||
color: #f84947;
|
||||
|
||||
.countdown-pill {
|
||||
background: #fff4f2;
|
||||
border: 1rpx solid #ffd6cc;
|
||||
padding: 0 16rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 999rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
.text_4 {
|
||||
margin-right: 7.13rpx;
|
||||
margin-top: 34.91rpx;
|
||||
font-size: 28.13rpx;
|
||||
.countdown-text {
|
||||
font-size: 22rpx;
|
||||
color: #ff5a1a;
|
||||
}
|
||||
.group_2 {
|
||||
margin-right: 20.87rpx;
|
||||
margin-top: 30.30rpx;
|
||||
padding: 15.94rpx 0 17.81rpx;
|
||||
border-top: solid 1.88rpx #e3e3e3;
|
||||
|
||||
/* 底部行:时间 + 操作区 */
|
||||
.bottomline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
padding-top: 8rpx;
|
||||
border-top: 1rpx dashed #f0f0f0;
|
||||
}
|
||||
.font_6 {
|
||||
font-size: 22.5rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 26.25rpx;
|
||||
color: #a1a1a1;
|
||||
.ctime {
|
||||
font-size: 24rpx;
|
||||
color: #888888;
|
||||
}
|
||||
/* .text_5 {
|
||||
width: 206.25rpx;
|
||||
} */
|
||||
.text-wrapper {
|
||||
padding: 10.8rpx 0 8.16rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
width: 142.5rpx;
|
||||
height: 46.88rpx;
|
||||
border: solid 1.88rpx #ff8d1a;
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.font_7 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.17rpx;
|
||||
color: #ff8d1a;
|
||||
|
||||
/* 按钮 */
|
||||
.btn {
|
||||
height: 64rpx;
|
||||
min-width: 180rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 999rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.text-wrapper_2 {
|
||||
padding: 11.89rpx 0 8.94rpx;
|
||||
background-color: #ff8d1a;
|
||||
border-radius: 9.38rpx;
|
||||
width: 140.63rpx;
|
||||
height: 45rpx;
|
||||
.btn-ghost {
|
||||
background: #ffffff;
|
||||
color: #333333;
|
||||
border: 2rpx solid #e6e6e6;
|
||||
}
|
||||
.font_8 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.17rpx;
|
||||
.btn-primary {
|
||||
background: linear-gradient(180deg, #ffa64a 0%, #ff8d1a 100%);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 6rpx 14rpx rgba(255, 141, 26, 0.25);
|
||||
}
|
||||
|
||||
/* ===== 迁移提示:以下旧的散装类可删除(如无外部依赖) ===== */
|
||||
/* .mt-17, .ml-37, .ml-11, .group_1, .list-item, .group, .font*, .text* 等 */
|
||||
|
BIN
pages/course/courseOrderList/image/empty.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
@ -1,4 +1,6 @@
|
||||
import { baseUrl, globalImgUrl } from "../../../request";
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
|
||||
// pages/course/createCourseOrder/createCourseOrder.js
|
||||
Page({
|
||||
|
||||
@ -131,6 +133,8 @@ Page({
|
||||
this.setData({
|
||||
courseObj: res.data.data,
|
||||
})
|
||||
} else {
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,48 +1,53 @@
|
||||
<!-- pages/course/createCourseOrder/createCourseOrder.wxml -->
|
||||
<view class="flex-col page">
|
||||
<view class="flex-col content">
|
||||
<view class="flex-row items-center section">
|
||||
<view class="page">
|
||||
|
||||
<!-- 可滚动内容区:为固定底部预留内边距,避免遮挡 -->
|
||||
<scroll-view scroll-y class="content no-scrollbar">
|
||||
|
||||
<!-- 商品信息卡片 -->
|
||||
<view class="card product">
|
||||
<image
|
||||
class="shrink-0 image"
|
||||
class="cover"
|
||||
src="{{ globalImgUrl + courseObj.image }}"
|
||||
mode="aspectFill"
|
||||
lazy-load="true"
|
||||
/>
|
||||
<view class="flex-col flex-1 ml-11">
|
||||
<text class="self-start text">{{ courseObj.name }}</text>
|
||||
<view class="flex-row items-center self-stretch group mt-15">
|
||||
<text class="text_2">¥{{ courseObj.discountPrice }}</text>
|
||||
<view class="flex-col justify-start relative ml-1">
|
||||
<text class="text_3">¥{{ courseObj.originPrice }}</text>
|
||||
<view class="divider pos"></view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="title ellipsis-2">{{ courseObj.name }}</text>
|
||||
<view class="price-line">
|
||||
<text class="price-now">¥{{ courseObj.discountPrice }}</text>
|
||||
<text class="price-origin">¥{{ courseObj.originPrice }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center section_2 mt-14">
|
||||
<text class="font">商品价格</text>
|
||||
<text class="font text_4">¥{{ courseObj.discountPrice }}</text>
|
||||
|
||||
<!-- 商品价格行 -->
|
||||
<view class="card row">
|
||||
<text class="row-left">商品价格</text>
|
||||
<text class="row-right accent">¥{{ courseObj.discountPrice }}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center section_3 mt-14">
|
||||
<view class="flex-row items-center">
|
||||
<image
|
||||
class="shrink-0 image_2"
|
||||
src="./image/wxpay.png"
|
||||
/>
|
||||
<text class="font ml-12">微信支付</text>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view class="card pay">
|
||||
<view class="pay-left">
|
||||
<image class="pay-icon" src="./image/wxpay.png" mode="aspectFit" />
|
||||
<text class="pay-text">微信支付</text>
|
||||
</view>
|
||||
<radio-group class="image_3">
|
||||
<radio checked="true"></radio>
|
||||
<radio-group class="pay-right" bindchange="onPayMethodChange">
|
||||
<radio value="wxpay" checked></radio>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 固定在底部的区域 -->
|
||||
|
||||
</scroll-view>
|
||||
|
||||
<!-- 固定底部结算栏 -->
|
||||
<view class="footer">
|
||||
<view class="flex-row justify-between items-center section_4">
|
||||
<text class="font text_5">应付¥{{ courseObj.discountPrice }}</text>
|
||||
<view class="flex-col justify-center items-center text-wrapper" bindtap="createOrder">
|
||||
<text class="font text_6">立即支付</text>
|
||||
</view>
|
||||
<view class="footer-inner">
|
||||
<text class="to-pay">应付 <text class="to-pay-amount">¥{{ courseObj.discountPrice }}</text></text>
|
||||
<view class="btn-pay" bindtap="createOrder">立即支付</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 遮罩 -->
|
||||
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
|
||||
</view>
|
||||
|
@ -1,126 +1,205 @@
|
||||
.ml-11 {
|
||||
margin-left: 20.63rpx;
|
||||
}
|
||||
.mt-15 {
|
||||
margin-top: 28.13rpx;
|
||||
}
|
||||
.ml-1 {
|
||||
margin-left: 1.88rpx;
|
||||
}
|
||||
/* app.wxss 或 当前页面 .wxss */
|
||||
.page-mask {
|
||||
position: fixed;
|
||||
top: 0; left: 0;
|
||||
width: 100%; height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
z-index: 9999;
|
||||
}
|
||||
/* 页面与滚动容器 */
|
||||
.page {
|
||||
background-color: #f7f7f7;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.section {
|
||||
padding: 20.63rpx 22.5rpx 27.58rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 3.94rpx;
|
||||
}
|
||||
.image {
|
||||
border-radius: 9.38rpx;
|
||||
width: 208.13rpx;
|
||||
height: 133.13rpx;
|
||||
}
|
||||
.text {
|
||||
color: #000000;
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 35.63rpx;
|
||||
width: 429.38rpx;
|
||||
}
|
||||
.group {
|
||||
padding: 0 4.29rpx;
|
||||
}
|
||||
.text_2 {
|
||||
color: #f84947;
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 22.76rpx;
|
||||
}
|
||||
.text_3 {
|
||||
color: #8c8c8c;
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 19.93rpx;
|
||||
}
|
||||
.divider {
|
||||
background-color: #8c8c8c;
|
||||
width: 69.56rpx;
|
||||
height: 1.88rpx;
|
||||
}
|
||||
.pos {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.section_2 {
|
||||
padding: 48.69rpx 29.21rpx 43.35rpx 44.96rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.font {
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 27.96rpx;
|
||||
color: #323232;
|
||||
}
|
||||
.text_4 {
|
||||
line-height: 22.91rpx;
|
||||
}
|
||||
.section_3 {
|
||||
padding: 39.38rpx 46.88rpx 897.38rpx 48.75rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.image_2 {
|
||||
width: 52.5rpx;
|
||||
height: 52.5rpx;
|
||||
}
|
||||
.image_3 {
|
||||
width: 41.25rpx;
|
||||
height: 41.25rpx;
|
||||
}
|
||||
.section_4 {
|
||||
padding: 16.88rpx 24.38rpx 16.88rpx 31.09rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.text_5 {
|
||||
color: #000000;
|
||||
line-height: 28.05rpx;
|
||||
}
|
||||
.text-wrapper {
|
||||
padding: 14.07rpx 0 19.07rpx;
|
||||
background-color: #ff8d1a;
|
||||
border-radius: 75rpx;
|
||||
width: 268.13rpx;
|
||||
height: 71.25rpx;
|
||||
display: flex;
|
||||
justify-content: center; /* 水平居中 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
padding: 24rpx 24rpx 160rpx; /* bottom 预留给固定底部栏 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.text_6 {
|
||||
color: #ffffff;
|
||||
line-height: 28.11rpx;
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 通用卡片 */
|
||||
.card {
|
||||
background-color: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.04);
|
||||
}
|
||||
|
||||
.card + .card {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/* 商品信息卡片 */
|
||||
.product {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 260rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 12rpx;
|
||||
flex-shrink: 0;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-width: 0; /* 使多行省略生效 */
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #1f1f1f;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.ellipsis-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.price-line {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.price-now {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #ff5a1a; /* 与主题橙统一 */
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.price-origin {
|
||||
font-size: 26rpx;
|
||||
color: #9f9f9f;
|
||||
text-decoration: line-through; /* 用样式处理中划线 */
|
||||
}
|
||||
|
||||
/* 通用行(键值对) */
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.row-left {
|
||||
font-size: 30rpx;
|
||||
color: #4a4a4a;
|
||||
}
|
||||
|
||||
.row-right {
|
||||
font-size: 30rpx;
|
||||
color: #1f1f1f;
|
||||
}
|
||||
|
||||
.accent {
|
||||
color: #ff5a1a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 支付方式 */
|
||||
.pay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pay-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.pay-icon {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.pay-text {
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.pay-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 固定底部 */
|
||||
.footer {
|
||||
margin-top: auto;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
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);
|
||||
/* 兼容旧版 iOS */
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.footer-inner {
|
||||
height: 120rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24rpx;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.to-pay {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.to-pay-amount {
|
||||
font-size: 36rpx;
|
||||
color: #ff5a1a;
|
||||
font-weight: 700;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
/* 支付按钮:使用 view,自定义橙色主题 */
|
||||
.btn-pay {
|
||||
min-width: 260rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 999rpx;
|
||||
background: linear-gradient(180deg, #ffa64a 0%, #ff8d1a 100%);
|
||||
color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 6rpx 14rpx rgba(255, 141, 26, 0.35);
|
||||
active-opacity: 0.85;
|
||||
}
|
||||
|
||||
/* 遮罩层 */
|
||||
.page-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/* 旧样式中可能用到的零散类,若无依赖可移除 */
|
||||
.ml-11 { margin-left: 20rpx; }
|
||||
.mt-15 { margin-top: 28rpx; }
|
||||
.ml-1 { margin-left: 2rpx; }
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { baseUrl } from "../../../request";
|
||||
const { globalImgUrl } = require("../../../request")
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
|
||||
// pages/course/homepage/homepage.js
|
||||
Page({
|
||||
@ -57,10 +58,7 @@ Page({
|
||||
courseList: res.data.data
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.data.message || '获取课程数据失败',
|
||||
icon: 'none'
|
||||
});
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
|
@ -1,50 +1,64 @@
|
||||
<view class="flex-col page">
|
||||
<view class="flex-col self-stretch group">
|
||||
<view class="flex-row justify-center items-center section" bind:tap="gotoSearch">
|
||||
<image class="image" src="./image/sousuo.png" />
|
||||
<text class="text ml-3">搜索更多好课</text>
|
||||
</view>
|
||||
<swiper class="swiper" autoplay="true" circular="true" interval="3000" circular="true">
|
||||
<block wx:for="{{banners}}" wx:for-item="img" wx:key="index">
|
||||
<swiper-item>
|
||||
<image src="{{img}}" class="swiper-image" mode="aspectFill" />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view class="page">
|
||||
|
||||
<!-- 顶部内容:搜索 + 轮播 -->
|
||||
<view class="top">
|
||||
<view class="search-bar" bindtap="gotoSearch" hover-class="hover">
|
||||
<image class="search-icon" src="./image/sousuo.png" mode="aspectFit"/>
|
||||
<text class="search-text">搜索更多好课</text>
|
||||
</view>
|
||||
<view class="flex-row equal-division">
|
||||
<view class="flex-col items-center group_2 group_1" bind:tap="gotoCourseList" data-type="{{ '考编' }}">
|
||||
<image class="image_3" src="./image/kgky.png" />
|
||||
<text class="font text_1 mt-12">考编</text>
|
||||
</view>
|
||||
<view class="flex-col items-center group_2 group_3" bind:tap="gotoCourseList" data-type="{{ '考公' }}">
|
||||
<image class="image_3" src="./image/zmt.png" />
|
||||
<text class="font text_3 mt-12">考公</text>
|
||||
</view>
|
||||
<view class="flex-col items-center group_2 group_4" bind:tap="gotoCourseList" data-type="{{ '考证' }}">
|
||||
<image class="image_3" src="./image/cj.png" />
|
||||
<text class="font text_4 mt-12">考证</text>
|
||||
</view>
|
||||
|
||||
<swiper class="swiper" autoplay="true" interval="3000" circular="true" indicator-dots="true" indicator-active-color="#ff6a00">
|
||||
<block wx:for="{{banners}}" wx:for-item="img" wx:key="index">
|
||||
<swiper-item>
|
||||
<image src="{{img}}" class="swiper-image" mode="aspectFill" lazy-load="true"/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<!-- 三分类 -->
|
||||
<view class="category-row">
|
||||
<view class="category-card" bindtap="gotoCourseList" data-type="考编" hover-class="hover">
|
||||
<image class="category-icon" src="./image/考编.png" mode="aspectFit" lazy-load="true"/>
|
||||
<text class="category-text">考编</text>
|
||||
</view>
|
||||
<text class="self-start text_2">热门课程</text>
|
||||
<view class="flex-col self-stretch list">
|
||||
<!-- items 数组循环 -->
|
||||
<view class="flex-row relative group_5" wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="item.id">
|
||||
<view bind:tap="gotoCourseDetail" data-id="{{item.id}}">
|
||||
<view class="list-divider pos_3"></view>
|
||||
<!-- 绑定课程封面图 -->
|
||||
<image class="image_4 pos" src="{{ globalImgUrl + item.image}}" />
|
||||
<view class="flex-col group_6 pos_2">
|
||||
<!-- 绑定课程名称 -->
|
||||
<text class="font_2">{{item.name}}</text>
|
||||
<view class="flex-row justify-between items-baseline mt-17">
|
||||
<!-- 绑定卷后价格 -->
|
||||
<text class="font_3">券后{{item.discountPrice}}元起</text>
|
||||
<!-- 绑定下单/学习人数 -->
|
||||
<text class="font_4">{{item.orderCount}}人学习</text>
|
||||
<view class="category-card" bindtap="gotoCourseList" data-type="考公" hover-class="hover">
|
||||
<image class="category-icon" src="./image/考公.png" mode="aspectFit" lazy-load="true"/>
|
||||
<text class="category-text">考公</text>
|
||||
</view>
|
||||
<view class="category-card" bindtap="gotoCourseList" data-type="考证" hover-class="hover">
|
||||
<image class="category-icon" src="./image/考证.png" mode="aspectFit" lazy-load="true"/>
|
||||
<text class="category-text">考证</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 热门课程标题 -->
|
||||
<view class="section-head">
|
||||
<text class="section-title">热门课程</text>
|
||||
</view>
|
||||
|
||||
<!-- 热门课程两列宫格 -->
|
||||
<scroll-view scroll-y class="list no-scrollbar">
|
||||
<view class="grid">
|
||||
<block wx:for="{{courseList}}" wx:key="item.id" wx:for-item="item">
|
||||
<view class="grid-item" bindtap="gotoCourseDetail" data-id="{{item.id}}" hover-class="hover">
|
||||
<image class="grid-cover" src="{{ globalImgUrl + item.image }}" mode="aspectFill" lazy-load="true"/>
|
||||
<view class="grid-info">
|
||||
<text class="grid-title">{{item.name}}</text>
|
||||
<view class="grid-meta">
|
||||
<text class="grid-price">¥{{item.discountPrice}}</text>
|
||||
<text class="grid-people">{{item.orderCount}}人学习</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view wx:if="{{!courseList || courseList.length === 0}}" class="empty">
|
||||
<image class="empty-icon" src="./image/empty.png" mode="aspectFit"/>
|
||||
<text class="empty-text">暂无课程,去看看其他分类吧~</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
|
@ -1,142 +1,115 @@
|
||||
.ml-3 {
|
||||
margin-left: 5.63rpx;
|
||||
}
|
||||
.mt-17 {
|
||||
margin-top: 31.88rpx;
|
||||
}
|
||||
.page {
|
||||
padding: 0rpx 0 10.88rpx;
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #ffffff;
|
||||
overflow: hidden;
|
||||
font-family: SourceHanSansCN, PingFang SC, Microsoft YaHei, system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
.group {
|
||||
padding-left: 30rpx;
|
||||
padding-right: 28.13rpx;
|
||||
.hover { opacity: 0.8; transition: opacity .2s ease; }
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
background: transparent;
|
||||
}
|
||||
.section {
|
||||
padding: 15.25rpx 0;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 93.75rpx;
|
||||
}
|
||||
.image {
|
||||
width: 35.63rpx;
|
||||
height: 35.63rpx;
|
||||
}
|
||||
.text {
|
||||
color: #a8a8a8;
|
||||
font-size: 26.5rpx;
|
||||
font-family: SourceHanSerifCN;
|
||||
line-height: 20.83rpx;
|
||||
}
|
||||
.equal-division {
|
||||
align-self: stretch;
|
||||
margin: 21.88rpx 31.46rpx 0 29.48rpx;
|
||||
}
|
||||
.group_2 {
|
||||
flex: 1 1 229.69rpx;
|
||||
}
|
||||
.group_1 {
|
||||
padding: 13.56rpx 0 9.99rpx;
|
||||
}
|
||||
.image_3 {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.15rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.text_1 {
|
||||
line-height: 24.26rpx;
|
||||
}
|
||||
.group_3 {
|
||||
padding: 13.56rpx 0 10.09rpx;
|
||||
}
|
||||
.text_3 {
|
||||
line-height: 24.23rpx;
|
||||
}
|
||||
.group_4 {
|
||||
padding: 13.56rpx 0 10.13rpx;
|
||||
}
|
||||
.text_4 {
|
||||
line-height: 24.13rpx;
|
||||
}
|
||||
.text_2 {
|
||||
margin-left: 35.04rpx;
|
||||
margin-top: 38.16rpx;
|
||||
color: #000000;
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 27.75rpx;
|
||||
}
|
||||
.list {
|
||||
margin-top: 9.56rpx;
|
||||
}
|
||||
.group_5 {
|
||||
padding: 18.75rpx 29.46rpx 0 35.63rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
.list-divider {
|
||||
background-color: #d6d6d6;
|
||||
height: 1.88rpx;
|
||||
}
|
||||
.pos_3 {
|
||||
position: absolute;
|
||||
left: 35.63rpx;
|
||||
right: 33.81rpx;
|
||||
top: 178.13rpx;
|
||||
}
|
||||
.image_4 {
|
||||
border-radius: 9.38rpx;
|
||||
width: 208.13rpx;
|
||||
height: 133.13rpx;
|
||||
}
|
||||
.pos {
|
||||
position: absolute;
|
||||
left: 35.63rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.group_6 {
|
||||
width: 453.49rpx;
|
||||
}
|
||||
.pos_2 {
|
||||
position: absolute;
|
||||
right: 29.46rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.font_2 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 31.88rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.font_3 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 24.15rpx;
|
||||
color: #ff5733;
|
||||
}
|
||||
.font_4 {
|
||||
font-size: 22.5rpx;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 20.34rpx;
|
||||
color: #a6a6a6;
|
||||
|
||||
|
||||
/* 顶部 */
|
||||
.top { padding: 30rpx; }
|
||||
.search-bar {
|
||||
display: flex; align-items: center; gap: 14rpx;
|
||||
padding: 18rpx 22rpx; border-radius: 9999rpx;
|
||||
background: #f5f6f7;
|
||||
}
|
||||
.search-icon { width: 36rpx; height: 36rpx; }
|
||||
.search-text { font-size: 26rpx; color: #a8a8a8; }
|
||||
|
||||
.swiper {
|
||||
border-radius: 9.38rpx;
|
||||
width: 691.88rpx;
|
||||
height: 324.38rpx;
|
||||
margin-top: 22.5rpx;
|
||||
width: 100%; height: 324rpx; margin-top: 24rpx;
|
||||
border-radius: 16rpx; overflow: hidden;
|
||||
}
|
||||
/* 轮播图图片 */
|
||||
.swiper-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.swiper-image { width: 100%; height: 100%; }
|
||||
|
||||
/* 分类 */
|
||||
.category-row {
|
||||
display: flex; gap: 24rpx; padding: 0 30rpx; margin-top: 22rpx;
|
||||
}
|
||||
.category-card {
|
||||
flex: 1; background: #fff; border-radius: 20rpx;
|
||||
padding: 22rpx 0 18rpx;
|
||||
display: flex; flex-direction: column; align-items: center; gap: 12rpx;
|
||||
box-shadow: 0 6rpx 24rpx rgba(0,0,0,0.06);
|
||||
}
|
||||
.category-icon { width: 96rpx; height: 96rpx; }
|
||||
.category-text { font-size: 26rpx; color: #111; }
|
||||
|
||||
/* 标题 */
|
||||
.section-head { padding: 28rpx 30rpx 16rpx; }
|
||||
.section-title { font-size: 30rpx; font-weight: 600; }
|
||||
|
||||
/* 列表(滚动) */
|
||||
.list {
|
||||
flex: 1;
|
||||
padding: 0 20rpx 20rpx;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow: auto;
|
||||
}
|
||||
.no-scrollbar::-webkit-scrollbar { display: none; }
|
||||
.no-scrollbar { scrollbar-width: none; }
|
||||
|
||||
/* 宫格布局 */
|
||||
.grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.grid-item {
|
||||
width: calc(50% - 10rpx);
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.grid-cover {
|
||||
width: 100%; height: 200rpx;
|
||||
object-fit: cover;
|
||||
}
|
||||
.grid-info {
|
||||
padding: 14rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
}
|
||||
.grid-title {
|
||||
font-size: 26rpx;
|
||||
color: #111;
|
||||
line-height: 36rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.grid-meta {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
}
|
||||
.grid-price {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #ff6a00;
|
||||
}
|
||||
.grid-people {
|
||||
font-size: 22rpx;
|
||||
color: #9aa0a6;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
.empty {
|
||||
padding: 80rpx 0 60rpx;
|
||||
display: flex; flex-direction: column; align-items: center; gap: 18rpx;
|
||||
color: #9aa0a6;
|
||||
}
|
||||
.empty-icon { width: 220rpx; height: 220rpx; opacity: 0.7; }
|
||||
.empty-text { font-size: 24rpx; }
|
||||
|
Before Width: | Height: | Size: 8.4 KiB |
BIN
pages/course/homepage/image/empty.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 11 KiB |
BIN
pages/course/homepage/image/考公.png
Normal file
After Width: | Height: | Size: 454 KiB |
BIN
pages/course/homepage/image/考编.png
Normal file
After Width: | Height: | Size: 462 KiB |
BIN
pages/course/homepage/image/考证.png
Normal file
After Width: | Height: | Size: 445 KiB |
@ -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 等 */
|
||||
|
BIN
pages/course/searchCourses/images/empty.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
@ -1,26 +1,42 @@
|
||||
<!--pages/course/searchCourses/searchCourses.wxml-->
|
||||
<view class="flex-col page">
|
||||
<view class="flex-row items-center section">
|
||||
<image
|
||||
class="image"
|
||||
src="./images/sousuo.png"
|
||||
/>
|
||||
<input class="text ml-3" placeholder="搜索更多好课" bindinput="onSearchInput" confirm-type="search" bindconfirm="onSearch"/>
|
||||
</view>
|
||||
<view class="flex-col list mt-17">
|
||||
<view bind:tap="gotoCourseDetail" data-id="{{item.id}}" class="flex-row relative list-item" wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="list-divider pos_3"></view>
|
||||
<image
|
||||
class="image_2 pos"
|
||||
src="{{globalImgUrl + item.image}}"
|
||||
/>
|
||||
<view class="flex-col group_2 pos_2">
|
||||
<text class="font">{{item.name}}</text>
|
||||
<view class="flex-row justify-between items-baseline mt-17">
|
||||
<text class="font_2">券后{{item.discountPrice}}元起</text>
|
||||
<text class="font_3">{{item.orderCount}}人学习</text>
|
||||
<!-- pages/course/searchCourses/searchCourses.wxml -->
|
||||
<view class="page">
|
||||
|
||||
<!-- 顶部搜索条(固定) -->
|
||||
<view class="search-bar" hover-class="hover">
|
||||
<image class="search-icon" src="./images/sousuo.png" mode="aspectFit"/>
|
||||
<input
|
||||
class="search-input"
|
||||
placeholder="搜索更多好课"
|
||||
placeholder-class="search-ph"
|
||||
bindinput="onSearchInput"
|
||||
confirm-type="search"
|
||||
bindconfirm="onSearch"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 搜索结果(独立滚动,隐藏滚动条) -->
|
||||
<scroll-view scroll-y class="list no-scrollbar">
|
||||
<block wx:for="{{courseList}}" wx:key="item.id" wx:for-item="item">
|
||||
<view class="course-card" bindtap="gotoCourseDetail" data-id="{{item.id}}" hover-class="hover">
|
||||
<!-- 封面 -->
|
||||
<image class="cover" src="{{globalImgUrl + item.image}}" mode="aspectFill" lazy-load="true"/>
|
||||
|
||||
<!-- 文案 -->
|
||||
<view class="info">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<view class="meta">
|
||||
<text class="price-pill">券后{{item.discountPrice}}元起</text>
|
||||
<text class="people">{{item.orderCount}}人学习</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 空状态(可选) -->
|
||||
<view wx:if="{{!courseList || courseList.length === 0}}" class="empty">
|
||||
<image class="empty-icon" src="./images/empty.png" mode="aspectFit"/>
|
||||
<text class="empty-text">没找到相关课程,换个关键词试试~</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
|
@ -1,93 +1,132 @@
|
||||
/* pages/course/searchCourses/searchCourses.wxss */
|
||||
|
||||
.ml-3 {
|
||||
margin-left: 5.63rpx;
|
||||
}
|
||||
.mt-17 {
|
||||
margin-top: 31.88rpx;
|
||||
}
|
||||
/* ===== 页面骨架:整页固定,仅列表滚动 ===== */
|
||||
.page {
|
||||
padding: 26.25rpx 0 918.73rpx;
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #ffffff;
|
||||
overflow: hidden; /* 禁止整页滚动 */
|
||||
box-sizing: border-box;
|
||||
font-family: SourceHanSansCN, PingFang SC, Microsoft YaHei, system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
.section {
|
||||
margin-left: 28.13rpx;
|
||||
margin-right: 26.27rpx;
|
||||
padding: 11.25rpx 24.38rpx;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 93.75rpx;
|
||||
|
||||
/* 触摸反馈 */
|
||||
.hover { opacity: .86; transition: opacity .18s ease; }
|
||||
|
||||
/* ===== 顶部搜索条(固定) ===== */
|
||||
.search-bar {
|
||||
padding: 24rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.image {
|
||||
width: 35.63rpx;
|
||||
height: 35.63rpx;
|
||||
}
|
||||
input {
|
||||
height: 50rpx;
|
||||
width: 95%;
|
||||
}
|
||||
.text {
|
||||
color: #333333;
|
||||
font-size: 26.5rpx;
|
||||
font-family: SourceHanSerifCN;
|
||||
line-height: 20.83rpx;
|
||||
.search-icon { width: 36rpx; height: 36rpx; opacity: .9; }
|
||||
|
||||
/* 胶囊输入框 */
|
||||
.search-input {
|
||||
flex: 1;
|
||||
height: 72rpx;
|
||||
padding: 0 26rpx;
|
||||
border-radius: 9999rpx;
|
||||
background: #f5f6f7;
|
||||
font-size: 26rpx;
|
||||
color: #111;
|
||||
line-height: 72rpx;
|
||||
box-shadow: inset 0 0 0 1rpx rgba(0,0,0,.04);
|
||||
}
|
||||
.search-ph { color: #a8a8a8; font-size: 26rpx; }
|
||||
|
||||
/* ===== 列表:占满剩余高度,独立滚动,隐藏滚动条 ===== */
|
||||
.list {
|
||||
padding-top: 11.25rpx;
|
||||
border-top: solid 1.88rpx #d1d1d1;
|
||||
flex: 1;
|
||||
padding: 0 24rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: #fff;
|
||||
}
|
||||
.list-item {
|
||||
padding: 28.13rpx 29.46rpx 0 35.63rpx;
|
||||
height: 189.39rpx;
|
||||
.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; background: transparent; }
|
||||
.no-scrollbar { scrollbar-width: none; }
|
||||
|
||||
/* ===== 课程卡片(左图右文,更工整) ===== */
|
||||
.course-card {
|
||||
display: flex;
|
||||
gap: 22rpx;
|
||||
padding: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
border: 1rpx solid #f1f1f1;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0,0,0,.05);
|
||||
}
|
||||
.list-divider {
|
||||
background-color: #d6d6d6;
|
||||
height: 1.88rpx;
|
||||
|
||||
/* 封面:3:2 比例,圆角 */
|
||||
.cover {
|
||||
width: 280rpx;
|
||||
height: 186rpx;
|
||||
flex: 0 0 280rpx;
|
||||
border-radius: 14rpx;
|
||||
object-fit: cover;
|
||||
}
|
||||
.pos_3 {
|
||||
position: absolute;
|
||||
left: 35.63rpx;
|
||||
right: 33.81rpx;
|
||||
top: 187.52rpx;
|
||||
|
||||
/* 信息区 */
|
||||
.info {
|
||||
flex: 1;
|
||||
min-width: 0; /* 防文字溢出 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.image_2 {
|
||||
border-radius: 9.38rpx;
|
||||
width: 208.13rpx;
|
||||
height: 133.13rpx;
|
||||
|
||||
/* 标题:两行省略 */
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #111;
|
||||
font-weight: 600;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2; /* 两行省略 */
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
word-break: break-word;
|
||||
}
|
||||
.pos {
|
||||
position: absolute;
|
||||
left: 35.63rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
|
||||
/* 元信息:价格胶囊 + 学习人数 */
|
||||
.meta {
|
||||
margin-top: 12rpx;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.group_2 {
|
||||
width: 453.49rpx;
|
||||
.price-pill {
|
||||
padding: 6rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 9999rpx;
|
||||
background: linear-gradient(90deg, #ff6a00, #ff8a2a);
|
||||
box-shadow: 0 6rpx 16rpx rgba(255,106,0,.22);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.pos_2 {
|
||||
position: absolute;
|
||||
right: 29.46rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
.people {
|
||||
font-size: 22rpx;
|
||||
color: #9aa0a6;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 31.88rpx;
|
||||
color: #000000;
|
||||
|
||||
/* ===== 空状态 ===== */
|
||||
.empty {
|
||||
padding: 120rpx 0 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 18rpx;
|
||||
color: #9aa0a6;
|
||||
}
|
||||
.font_2 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 24.15rpx;
|
||||
color: #ff5733;
|
||||
}
|
||||
.font_3 {
|
||||
font-size: 22.5rpx;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 20.34rpx;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
.empty-icon { width: 240rpx; height: 240rpx; opacity: .7; }
|
||||
.empty-text { font-size: 24rpx; line-height: 34rpx; }
|
||||
|
||||
/* ===== 如你项目里已有的工具类,可保留或删除 ===== */
|
||||
.ml-3 { margin-left: 6rpx; }
|
||||
.mt-17 { margin-top: 12rpx; }
|
||||
|