diff --git a/app.js b/app.js index 89cc79e..8ddb57a 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,6 @@ const { checkLogin } = require('./utils/logcheck'); App({ - onLaunch: function () { + // checkLogin() } }); diff --git a/app.json b/app.json index e78de5e..e2f90a6 100644 --- a/app.json +++ b/app.json @@ -43,7 +43,8 @@ "pages/dashboardModule/supervisorPerformance/supervisorPerformance", "pages/dashboardModule/staffPerformance/staffPerformance", "pages/dashboardModule/userOrderPerformance/userOrderPerformance", - "pages/dashboardModule/performanceRanking/performanceRanking" + "pages/dashboardModule/performanceRanking/performanceRanking", + "pages/personCenter/component/modifyNamePop/modifyNamePop" ], "window": { "navigationBarTextStyle": "black", diff --git a/pages/course/courseDetail/courseDetail.js b/pages/course/courseDetail/courseDetail.js index f1f4720..0d2f892 100644 --- a/pages/course/courseDetail/courseDetail.js +++ b/pages/course/courseDetail/courseDetail.js @@ -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) } } }) diff --git a/pages/course/courseDetail/courseDetail.wxml b/pages/course/courseDetail/courseDetail.wxml index 662118d..9246ba4 100644 --- a/pages/course/courseDetail/courseDetail.wxml +++ b/pages/course/courseDetail/courseDetail.wxml @@ -1,36 +1,47 @@ - - - - - - - - {{ courseObj.discountPrice }} - 元券后价 - - - {{ courseObj.originPrice }}元 - - + + + + + + + + + + + + + + {{ courseObj.discountPrice }} + 元券后价 + + + {{ courseObj.originPrice }}元 - {{ courseObj.name }} + {{ courseObj.name }} - - - - 课程概述 + + + + + + 课程概述 - + + + + + + + + + + + + 咨询 + + + 立即购买 - - - - 咨询 - - - 立即购买 - - - \ No newline at end of file + diff --git a/pages/course/courseDetail/courseDetail.wxss b/pages/course/courseDetail/courseDetail.wxss index ed3df8d..4f41ec4 100644 --- a/pages/course/courseDetail/courseDetail.wxss +++ b/pages/course/courseDetail/courseDetail.wxss @@ -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; -} \ No newline at end of file diff --git a/pages/course/courseList/courseList.js b/pages/course/courseList/courseList.js index 31f175f..48c90af 100644 --- a/pages/course/courseList/courseList.js +++ b/pages/course/courseList/courseList.js @@ -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 => { diff --git a/pages/course/courseList/courseList.wxml b/pages/course/courseList/courseList.wxml index 207de98..7ccc20d 100644 --- a/pages/course/courseList/courseList.wxml +++ b/pages/course/courseList/courseList.wxml @@ -1,39 +1,38 @@ - - {{ courseType }} - - + + - - - - - - - - - {{item.name}} - - - 券后{{item.discountPrice}}元起 - - {{item.orderCount}}人学习 - + + + + + + + + + + + + + {{item.name}} + + 券后{{item.discountPrice}}元起 + {{item.orderCount}}人学习 + + + + + + 没找到相关课程,换个关键词试试~ + diff --git a/pages/course/courseList/courseList.wxss b/pages/course/courseList/courseList.wxss index 8269933..2be9a25 100644 --- a/pages/course/courseList/courseList.wxss +++ b/pages/course/courseList/courseList.wxss @@ -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; -} \ No newline at end of file +.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; } diff --git a/pages/course/courseList/image/empty.png b/pages/course/courseList/image/empty.png new file mode 100644 index 0000000..8596cb4 Binary files /dev/null and b/pages/course/courseList/image/empty.png differ diff --git a/pages/course/courseList/image/sousuo.png b/pages/course/courseList/image/sousuo.png new file mode 100644 index 0000000..d58893a Binary files /dev/null and b/pages/course/courseList/image/sousuo.png differ diff --git a/pages/course/courseOrderList/courseOrderList.js b/pages/course/courseOrderList/courseOrderList.js index cf8bcd6..a8b1355 100644 --- a/pages/course/courseOrderList/courseOrderList.js +++ b/pages/course/courseOrderList/courseOrderList.js @@ -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: () => { diff --git a/pages/course/courseOrderList/courseOrderList.wxml b/pages/course/courseOrderList/courseOrderList.wxml index d4fcef0..1f402db 100644 --- a/pages/course/courseOrderList/courseOrderList.wxml +++ b/pages/course/courseOrderList/courseOrderList.wxml @@ -1,42 +1,55 @@ - - - - - 订单号:{{item.orderNumber}} - {{ item.orderStatus }} + + + + + + + + + 暂无订单 + + + + + + + + 订单号:{{ item.orderNumber }} + + {{ item.orderStatus }} + - {{ item.name }} - ¥{{ item.totalAmount }} + + {{ item.name }} - - - 请在 {{ item.countDownStr }} 内完成支付 - + + + ¥{{ item.totalAmount }} + + 请在 {{ item.countDownStr }} 内完成支付 + + - - {{ item.createTime }} - - - - 取消订单 - - - 支付 - - + + + {{ item.createTime }} + + 取消订单 + 支付 - - \ No newline at end of file + + + + + + diff --git a/pages/course/courseOrderList/courseOrderList.wxss b/pages/course/courseOrderList/courseOrderList.wxss index 70512b8..262bf0d 100644 --- a/pages/course/courseOrderList/courseOrderList.wxss +++ b/pages/course/courseOrderList/courseOrderList.wxss @@ -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* 等 */ diff --git a/pages/course/courseOrderList/image/empty.png b/pages/course/courseOrderList/image/empty.png new file mode 100644 index 0000000..a4b31ad Binary files /dev/null and b/pages/course/courseOrderList/image/empty.png differ diff --git a/pages/course/createCourseOrder/createCourseOrder.js b/pages/course/createCourseOrder/createCourseOrder.js index 4bdf5ab..d0c93c2 100644 --- a/pages/course/createCourseOrder/createCourseOrder.js +++ b/pages/course/createCourseOrder/createCourseOrder.js @@ -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) } } }) diff --git a/pages/course/createCourseOrder/createCourseOrder.wxml b/pages/course/createCourseOrder/createCourseOrder.wxml index 838872d..27c9cb1 100644 --- a/pages/course/createCourseOrder/createCourseOrder.wxml +++ b/pages/course/createCourseOrder/createCourseOrder.wxml @@ -1,48 +1,53 @@ - - - + + + + + + + - - {{ courseObj.name }} - - ¥{{ courseObj.discountPrice }} - - ¥{{ courseObj.originPrice }} - - + + {{ courseObj.name }} + + ¥{{ courseObj.discountPrice }} + ¥{{ courseObj.originPrice }} - - 商品价格 - ¥{{ courseObj.discountPrice }} + + + + 商品价格 + ¥{{ courseObj.discountPrice }} - - - - 微信支付 + + + + + + 微信支付 - - + + - - + + + + - - 应付¥{{ courseObj.discountPrice }} - - 立即支付 - + + 应付 ¥{{ courseObj.discountPrice }} + 立即支付 + diff --git a/pages/course/createCourseOrder/createCourseOrder.wxss b/pages/course/createCourseOrder/createCourseOrder.wxss index 860af91..211d446 100644 --- a/pages/course/createCourseOrder/createCourseOrder.wxss +++ b/pages/course/createCourseOrder/createCourseOrder.wxss @@ -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; } diff --git a/pages/course/homepage/homepage.js b/pages/course/homepage/homepage.js index 8dc87b6..c22dcbf 100644 --- a/pages/course/homepage/homepage.js +++ b/pages/course/homepage/homepage.js @@ -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: () => { diff --git a/pages/course/homepage/homepage.wxml b/pages/course/homepage/homepage.wxml index 6a265e1..000791d 100644 --- a/pages/course/homepage/homepage.wxml +++ b/pages/course/homepage/homepage.wxml @@ -1,50 +1,64 @@ - - - - - 搜索更多好课 - - - - - - - - + + + + + + + 搜索更多好课 - - - - 考编 - - - - 考公 - - - - 考证 - + + + + + + + + + + + + + + + 考编 - 热门课程 - - - - - - - - - - {{item.name}} - - - 券后{{item.discountPrice}}元起 - - {{item.orderCount}}人学习 + + + 考公 + + + + 考证 + + + + + + 热门课程 + + + + + + + + + + {{item.name}} + + ¥{{item.discountPrice}} + {{item.orderCount}}人学习 - + - \ No newline at end of file + + + + + 暂无课程,去看看其他分类吧~ + + + + diff --git a/pages/course/homepage/homepage.wxss b/pages/course/homepage/homepage.wxss index 8d526db..377cbe0 100644 --- a/pages/course/homepage/homepage.wxss +++ b/pages/course/homepage/homepage.wxss @@ -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%; -} \ No newline at end of file +.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; } diff --git a/pages/course/homepage/image/cj.png b/pages/course/homepage/image/cj.png deleted file mode 100644 index 3047ad3..0000000 Binary files a/pages/course/homepage/image/cj.png and /dev/null differ diff --git a/pages/course/homepage/image/empty.png b/pages/course/homepage/image/empty.png new file mode 100644 index 0000000..8596cb4 Binary files /dev/null and b/pages/course/homepage/image/empty.png differ diff --git a/pages/course/homepage/image/kgky.png b/pages/course/homepage/image/kgky.png deleted file mode 100644 index f0b7253..0000000 Binary files a/pages/course/homepage/image/kgky.png and /dev/null differ diff --git a/pages/course/homepage/image/zmt.png b/pages/course/homepage/image/zmt.png deleted file mode 100644 index 382810f..0000000 Binary files a/pages/course/homepage/image/zmt.png and /dev/null differ diff --git a/pages/course/homepage/image/考公.png b/pages/course/homepage/image/考公.png new file mode 100644 index 0000000..2608ae4 Binary files /dev/null and b/pages/course/homepage/image/考公.png differ diff --git a/pages/course/homepage/image/考编.png b/pages/course/homepage/image/考编.png new file mode 100644 index 0000000..0d7232a Binary files /dev/null and b/pages/course/homepage/image/考编.png differ diff --git a/pages/course/homepage/image/考证.png b/pages/course/homepage/image/考证.png new file mode 100644 index 0000000..b487b4b Binary files /dev/null and b/pages/course/homepage/image/考证.png differ diff --git a/pages/course/orderDetail/orderDetail.wxml b/pages/course/orderDetail/orderDetail.wxml index aa927da..12949d7 100644 --- a/pages/course/orderDetail/orderDetail.wxml +++ b/pages/course/orderDetail/orderDetail.wxml @@ -1,88 +1,101 @@ - - - - - - 订单状态 - - 请在{{countdown}}内完成支付 - {{ orderObj.orderStatus }} + + + + + + + + + + + + {{ orderObj.orderStatus }} + + + 请在 {{ countdown }} 内完成支付 + + + + + + + + {{ orderObj.name }} + + ¥{{ orderObj.originPrice }} + 应付:¥{{ orderObj.totalAmount }} - - - - - {{ orderObj.name }} - - - - ¥{{ orderObj.originPrice }} - - - - - - 订单编号: - {{ orderObj.orderNumber }} - - - 下单时间: - {{ orderObj.createTime }} - - - - - - 支付方式: - 微信支付 - - - 交易号: - - 4002506191307440406460485418 - - 交付时间: - - {{ orderObj.updateTime }} - - - - - - - 课程价格 - ¥{{ orderObj.originPrice }} - - - 价格折扣 - -¥{{ orderObj.originPrice - orderObj.totalAmount }} - - - 订单金额 - ¥{{ orderObj.totalAmount }} - - - - - 取消 + + + + 订单编号 + {{ orderObj.orderNumber }} - - 立即支付 + + + 下单时间 + {{ orderObj.createTime }} + + + + + + 支付方式 + 微信支付 + + + + 交易号 + + 4002506191307440406460485418 + + + + 交付时间 + {{ orderObj.updateTime }} - - - - 退款 + + + + 课程价格 + ¥{{ orderObj.originPrice }} + + + + 价格折扣 + -¥{{ (orderObj.originPrice - orderObj.totalAmount) >= 0 ? (orderObj.originPrice - orderObj.totalAmount) : 0 }} + + + + + 订单金额 + ¥{{ orderObj.totalAmount }} - + + + + + + + 取消 + 立即支付 + + + + + + + 退款 + + + + + diff --git a/pages/course/orderDetail/orderDetail.wxss b/pages/course/orderDetail/orderDetail.wxss index 0d8a956..82bd4df 100644 --- a/pages/course/orderDetail/orderDetail.wxss +++ b/pages/course/orderDetail/orderDetail.wxss @@ -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 等 */ diff --git a/pages/course/searchCourses/images/empty.png b/pages/course/searchCourses/images/empty.png new file mode 100644 index 0000000..8596cb4 Binary files /dev/null and b/pages/course/searchCourses/images/empty.png differ diff --git a/pages/course/searchCourses/searchCourses.wxml b/pages/course/searchCourses/searchCourses.wxml index 0cdf969..174b536 100644 --- a/pages/course/searchCourses/searchCourses.wxml +++ b/pages/course/searchCourses/searchCourses.wxml @@ -1,26 +1,42 @@ - - - - - - - - - - - - {{item.name}} - - 券后{{item.discountPrice}}元起 - {{item.orderCount}}人学习 + + + + + + + + + + + + + + + + + + + {{item.name}} + + 券后{{item.discountPrice}}元起 + {{item.orderCount}}人学习 + + + + + + 没找到相关课程,换个关键词试试~ - \ No newline at end of file + + + diff --git a/pages/course/searchCourses/searchCourses.wxss b/pages/course/searchCourses/searchCourses.wxss index b17fb7b..a70c7ee 100644 --- a/pages/course/searchCourses/searchCourses.wxss +++ b/pages/course/searchCourses/searchCourses.wxss @@ -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; -} \ No newline at end of file +.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; } diff --git a/pages/dashboardModule/overviewPerformance/overviewPerformance.js b/pages/dashboardModule/overviewPerformance/overviewPerformance.js index 1081c49..78bdc4b 100644 --- a/pages/dashboardModule/overviewPerformance/overviewPerformance.js +++ b/pages/dashboardModule/overviewPerformance/overviewPerformance.js @@ -1,4 +1,5 @@ import { baseUrl } from "../../../request"; +const { notLogin } = require('../../../utils/util') // pages/dashboardModule/overviewPerformance/overviewPerformance.js Page({ @@ -68,10 +69,7 @@ Page({ // 直接把后端 data 对象铺平到页面 data this.setData(res.data.data); } else { - wx.showToast({ - title: res.data.message || '获取数据失败', - icon: 'none' - }); + notLogin(res.data.message) } }, fail: () => { diff --git a/pages/dashboardModule/performanceRanking/performanceRanking.js b/pages/dashboardModule/performanceRanking/performanceRanking.js index ea49a88..581b879 100644 --- a/pages/dashboardModule/performanceRanking/performanceRanking.js +++ b/pages/dashboardModule/performanceRanking/performanceRanking.js @@ -1,4 +1,5 @@ import { baseUrl } from "../../../request"; +const { notLogin } = require('../../../utils/util') Page({ data: { @@ -120,10 +121,7 @@ Page({ items: res.data.data }); } else { - wx.showToast({ - title: '没有数据', - icon: 'none' - }); + notLogin(res.data.message) } }, fail: () => { diff --git a/pages/dashboardModule/performanceRanking/performanceRanking.wxml b/pages/dashboardModule/performanceRanking/performanceRanking.wxml index 101e6a2..df1c074 100644 --- a/pages/dashboardModule/performanceRanking/performanceRanking.wxml +++ b/pages/dashboardModule/performanceRanking/performanceRanking.wxml @@ -1,97 +1,127 @@ - + + - {{ showRole }}绩效排名 - - - - - - - {{ showRole }}名称 - - - - - - 手机号 - - - - - - 排序条件 - - - - - {{selectedSortField}} - - - - - - {{selectedSortField}} - - - + + {{ showRole }}绩效排名 + + + + + + + + {{ showRole }}名称 + + - - - - - - {{selectedSortOrder}} - - - + + + + + 手机号 + + + + + + + + 排序条件 + + + + + + {{ selectedSortField }} + + + + + + + {{ selectedSortField }} + + + + + + + + + + {{ selectedSortOrder }} + + + + - - 搜索 - + 搜索 - - - - - - - - {{index + 1}} + + + + + + + + {{ index + 1 }} + + + + {{ item.nickName }} + {{ item.phoneNumber }} + - - - {{item.nickName}} - {{item.phoneNumber}} + + + + 员工:{{ item.empCount }} + 推广:{{ item.promoCount }} + 下单:{{ item.orderCount }} + + + + + 总额 + ¥{{ item.totalAmount }} + + + 净成交 + ¥{{ item.netAmount }} - - - - - 员工:{{item.empCount}} - - - 推广:{{item.promoCount}} - - - 下单:{{item.orderCount}} - - - - - - - 总额:¥{{item.totalAmount}} - - - 净成交:¥{{item.netAmount}} - + + + + + 暂无数据 - + diff --git a/pages/dashboardModule/performanceRanking/performanceRanking.wxss b/pages/dashboardModule/performanceRanking/performanceRanking.wxss index 5dd0ae8..a90c2cb 100644 --- a/pages/dashboardModule/performanceRanking/performanceRanking.wxss +++ b/pages/dashboardModule/performanceRanking/performanceRanking.wxss @@ -1,220 +1,188 @@ -.mt-27 { - margin-top: 50.63rpx; -} -.mt-19 { - margin-top: 35.63rpx; -} -.ml-7 { - margin-left: 13.13rpx; -} +/* ===== 页面框架 ===== */ .page { - padding: 71.06rpx 42.19rpx 199.69rpx 44.06rpx; - background-color: #fefbf6; - box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; + background: #fefbf6; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +.page-title { + padding: 24rpx 24rpx 0; +} +.title { + font-size: 40rpx; + font-weight: 700; + color: #e67e22; /* 主色:暖橙 */ +} + +.content { + flex: 1; + padding: 24rpx; + box-sizing: border-box; +} + +/* 隐藏滚动条 */ +.no-scrollbar::-webkit-scrollbar { + width: 0; + height: 0; + display: none; +} + +/* ===== 卡片通用 ===== */ +.card { + background: #ffffff; + border-radius: 18rpx; + padding: 24rpx; + border: 2rpx solid #ffeaa7; /* 与你项目的浅橙描边一致 */ + box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05); +} +.card + .card { margin-top: 20rpx; } + +/* ===== 表单区 ===== */ +.form-card .field + .field { margin-top: 20rpx; } + +.field-label { + font-size: 28rpx; + color: #555555; + margin-bottom: 12rpx; + display: block; +} + +/* 输入框 */ +.input-box { + height: 84rpx; + border-radius: 12rpx; + border: 2rpx solid #ffeaa7; + background: #ffffff; + padding: 0 20rpx; + display: flex; + align-items: center; +} +.input { + flex: 1; + font-size: 28rpx; + color: #1f1f1f; +} + +/* 选择器行 */ +.picker-row { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16rpx; +} +.picker-box { + height: 84rpx; + border-radius: 12rpx; + border: 2rpx solid #ffeaa7; + background: #ffffff; + display: flex; + align-items: center; +} +.picker-inner { + padding: 0 20rpx; width: 100%; - position: fixed; - bottom: 0; - overflow: auto; - height: calc(100vh - 1rpx); + height: 84rpx; + display: flex; + align-items: center; + justify-content: space-between; } -.text { - color: #e67e22; - font-size: 45rpx; - font-family: SourceHanSansCN; - font-weight: 700; - line-height: 42.84rpx; -} -.section { - padding: 45.75rpx 42.99rpx 34.82rpx; - background-color: #ffffff; - border-radius: 23.47rpx; - border: solid 1.88rpx #ffeaa7; -} -.text-wrapper { - margin-top: 14.49rpx; - padding: 17.63rpx 0 14.63rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 403.13rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_3 { - margin-left: 15.19rpx; -} -.font { +.picker-text { font-size: 28rpx; color: #1f1f1f; } +.arrow { width: 28rpx; height: 28rpx; } + +/* 搜索按钮 */ +.btn { + height: 88rpx; + border-radius: 999rpx; + display: flex; + align-items: center; + justify-content: center; font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 28.14rpx; - color: #66666b; + font-weight: 600; + margin-top: 24rpx; } -.text_2 { - margin-left: 2.63rpx; - line-height: 27.75rpx; -} -.text_4 { - line-height: 27.75rpx; -} -.text_5 { - margin-left: 2.44rpx; - margin-top: 41.32rpx; - line-height: 27.6rpx; -} -.text-wrapper_1 { - margin-top: 14.51rpx; - padding: 17.66rpx 0 14.64rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 403.13rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_6 { - line-height: 27.69rpx; -} -.text_7 { - margin-left: 2.19rpx; - margin-top: 41.18rpx; - line-height: 27.84rpx; -} -.equal-division { - align-self: stretch; - margin-right: 4.01rpx; - margin-top: 16.29rpx; -} -.section_2 { - flex: 1 1 270rpx; -} -.section_1 { - padding: 17.68rpx 14.19rpx 14.34rpx 14.89rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_1 { - line-height: 27.94rpx; -} -.image { - width: 26.25rpx; - height: 26.25rpx; -} -.section_3 { - padding: 17.61rpx 16.27rpx 14.55rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_16 { - line-height: 27.84rpx; -} -.text-wrapper_2 { - margin: 32.81rpx 4.97rpx 0 4.69rpx; - padding: 26.29rpx 0 21.02rpx; - background-color: #ffa400; - border-radius: 9.38rpx; -} -.text_8 { +.btn-primary { + background: linear-gradient(180deg, #ffa400 0%, #e67e22 100%); color: #ffffff; - line-height: 27.69rpx; + box-shadow: 0 6rpx 14rpx rgba(230,126,34,0.30); } -.list-item { - padding: 29.89rpx 29.87rpx 31.99rpx 33.62rpx; - background-color: #ffffff; - border-radius: 18.75rpx; - border: solid 1.88rpx #ffeaa7; + +/* ===== 列表与条目 ===== */ +.result-wrap { margin-top: 20rpx; } + +.item-card { padding-top: 20rpx; } + +/* 顶部信息 */ +.item-head { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 8rpx; } -.list-item:first-child { - margin-top: 0; +.rank-badge { + width: 64rpx; + height: 64rpx; + border-radius: 999rpx; + background: #f0f0f0; + border: 2rpx solid #e6e6e6; + display: flex; + align-items: center; + justify-content: center; } -.text-wrapper_4 { - padding: 17.93rpx 0 12.34rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 52.5rpx; - height: 56.25rpx; - border: solid 1.88rpx #ffa400; +.rank-top { + background: #fff6e6; + border-color: #ffd6b3; } -.font_2 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 24.02rpx; +.rank-text { + font-size: 28rpx; font-weight: 700; - color: #ffa400; + color: #333333; } -.text_9 { - line-height: 22.24rpx; + +.person-line { + display: flex; + align-items: baseline; + gap: 12rpx; + flex-wrap: wrap; } -.group { - margin-top: 22.18rpx; +.name { font-size: 30rpx; font-weight: 600; color: #1f1f1f; } +.phone { font-size: 26rpx; color: #666666; } + +/* 指标 Chips */ +.chips { + display: flex; + gap: 12rpx; + flex-wrap: wrap; + margin: 8rpx 0 4rpx; } -.font_3 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 28.14rpx; - color: #000000; +.chip { + padding: 10rpx 16rpx; + background: #f7f9fc; + color: #3d4f6e; + border: 1rpx solid #e6edf7; + border-radius: 12rpx; + font-size: 24rpx; } -.font_4 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 19.93rpx; - color: #66666b; + +/* 金额类键值行 */ +.kv { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12rpx 0; + border-top: 1rpx dashed #f0f0f0; } -.text-wrapper_5 { - padding: 16.71rpx 0 12.71rpx; - background-color: #ffffff; - border-radius: 28.13rpx; - width: 146.25rpx; - height: 56.25rpx; - border: solid 1.88rpx #ffa400; - margin-right: 15rpx; +.kv:first-of-type { border-top: 0; } +.kv-key { font-size: 26rpx; color: #666666; } +.kv-val { font-size: 28rpx; color: #1f1f1f; } +.money { color: #e67e22; font-weight: 700; } + +/* ===== 空状态 ===== */ +.empty { + padding: 120rpx 0 40rpx; + display: flex; + flex-direction: column; + align-items: center; + color: #999999; } -.font_5 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 24.02rpx; - color: #000000; -} -.text_11 { - line-height: 23.08rpx; -} -.text-wrapper_6 { - padding: 15.51rpx 0 12.56rpx; - background-color: #ffffff; - border-radius: 28.13rpx; - width: 146.25rpx; - height: 56.25rpx; - border: solid 1.88rpx #ffa400; -} -.text_12 { - line-height: 24.43rpx; -} -.text-wrapper_7 { - padding: 15.62rpx 0 12.86rpx; - background-color: #ffffff; - border-radius: 28.13rpx; - width: 146.25rpx; - height: 56.25rpx; - border: solid 1.88rpx #ffa400; -} -.text-wrapper_8 { - padding: 14.87rpx 0 13.41rpx; - background-color: #ffffff; - border-radius: 28.13rpx; - height: 56.25rpx; - border: solid 1.88rpx #ffa400; -} -.text_13 { - margin: 0 16.86rpx; - line-height: 24.23rpx; -} -.text-wrapper_9 { - padding: 14.61rpx 0 13.33rpx; - background-color: #ffffff; - border-radius: 28.13rpx; - height: 56.25rpx; - border: solid 1.88rpx #ffa400; -} -.text_14 { - margin: 0 18.86rpx; - line-height: 24.56rpx; -} \ No newline at end of file +.empty-img { width: 300rpx; height: 300rpx; margin-bottom: 16rpx; } +.empty-text { font-size: 26rpx; } diff --git a/pages/dashboardModule/staffPerformance/staffPerformance.js b/pages/dashboardModule/staffPerformance/staffPerformance.js index ebbec35..cf02a88 100644 --- a/pages/dashboardModule/staffPerformance/staffPerformance.js +++ b/pages/dashboardModule/staffPerformance/staffPerformance.js @@ -1,4 +1,5 @@ import { baseUrl } from "../../../request"; +const { notLogin } = require('../../../utils/util') // pages/dashboardModule/supervisorPerformance/supervisorPerformance.js Page({ @@ -45,7 +46,7 @@ Page({ this.setData({ performanceList: listWithRate }); this.setData({ showList: true }); } else { - wx.showToast({ title: res.data.message || '查询失败', icon: 'none' }); + notLogin(res.data.message) } }, fail: () => { diff --git a/pages/dashboardModule/staffPerformance/staffPerformance.wxml b/pages/dashboardModule/staffPerformance/staffPerformance.wxml index cd00b9a..9755453 100644 --- a/pages/dashboardModule/staffPerformance/staffPerformance.wxml +++ b/pages/dashboardModule/staffPerformance/staffPerformance.wxml @@ -1,132 +1,128 @@ - + - 员工业绩报表 + + 员工业绩报表 + - - - - - - 员工名称 - + + + + + + 员工名称 + - - 手机号 - + + 手机号 + - - - 搜索 - + + 搜索 - - - - - - - - - - 编号:{{index + 1}} - 员工:{{item.nickName}} - - - 客户订单明细>> - + + + + + + 暂无数据 + + + + + + + + + 编号:{{ index + 1 }} + 员工:{{ item.nickName }} - - - - 手机号:{{item.phoneNumber}} - 复制 + + 客户订单明细 >> + - - - - 客户数:{{item.empCount}} - - - 比例:{{item.ratePercent}}% - + + + 手机号 + + {{ item.phoneNumber }} + 复制 + - - - - 下单量 - {{item.orderCount}} - - - 总订单 - ¥{{item.totalAmount}} - - - 净成交 - ¥{{item.netAmount}} - - - 待释放 - ¥{{item.toRelease}} - - - 可结算 - {{item.toSettle}} - - - 已结算 - ¥{{item.settled}} - - - 推广数 - {{item.promoCount}} - - - 退款 - ¥{{item.refunded}} - - - 已回退 - ¥0 - + + + 客户数:{{ item.empCount }} + 比例:{{ item.ratePercent }}% + + + + + + 下单量 + {{ item.orderCount }} + + + 总订单 + ¥{{ item.totalAmount }} + + + 净成交 + ¥{{ item.netAmount }} + + + 待释放 + ¥{{ item.toRelease }} + + + 可结算 + {{ item.toSettle }} + + + 已结算 + ¥{{ item.settled }} + + + 推广数 + {{ item.promoCount }} + + + 退款 + ¥{{ item.refunded }} + + + 已回退 + ¥0 - - + + diff --git a/pages/dashboardModule/staffPerformance/staffPerformance.wxss b/pages/dashboardModule/staffPerformance/staffPerformance.wxss index 7f90532..e3190df 100644 --- a/pages/dashboardModule/staffPerformance/staffPerformance.wxss +++ b/pages/dashboardModule/staffPerformance/staffPerformance.wxss @@ -1,290 +1,176 @@ -.mt-19 { - margin-top: 35.63rpx; -} -.mt-7 { - margin-top: 13.13rpx; -} -.mt-25 { - margin-top: 46.88rpx; -} -.mt-13 { - margin-top: 24.38rpx; -} -.mt-17 { - margin-top: 31.88rpx; -} +/* 基础 */ .page { - padding: 71.06rpx 42.19rpx 117.19rpx 43.99rpx; - background-color: #fefbf6; - box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; - width: 100%; - position: fixed; - bottom: 0; - overflow: auto; - height: calc(100vh - 1rpx); + background: #fefbf6; /* 暖米黄背景 */ + min-height: 100vh; + display: flex; + flex-direction: column; } -.text { - color: #e67e22; - font-size: 45rpx; - font-family: SourceHanSansCN; + +.page-title { padding: 24rpx 24rpx 0; } +.title { + color: #e67e22; /* 暖橙主色 */ + font-size: 40rpx; font-weight: 700; - line-height: 42.75rpx; } -.section { - padding: 45.75rpx 39.26rpx 47.94rpx 42.99rpx; - background-color: #ffffff; - border-radius: 18.75rpx; - border: solid 1.88rpx #ffeaa7; + +.content { + flex: 1; + padding: 24rpx; + box-sizing: border-box; } -.text-wrapper { - padding: 17.63rpx 0 14.63rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 403.13rpx; - border: solid 1.88rpx #ffeaa7; + +/* 隐藏滚动条 */ +.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; display: none; } + +/* 卡片 */ +.card { + background: #ffffff; + border-radius: 18rpx; + padding: 24rpx; + border: 2rpx solid #ffeaa7; /* 浅橙描边 */ + box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05); } -.text_3 { - margin-left: 15.19rpx; +.card + .card { margin-top: 20rpx; } + +/* 表单 */ +.form-card .field + .field { margin-top: 20rpx; } + +.field-label { + font-size: 28rpx; + color: #555555; + margin-bottom: 12rpx; + display: block; } -.font { + +.input-box { + background: #ffffff; + border: 2rpx solid #ffeaa7; + border-radius: 12rpx; + padding: 0 20rpx; + height: 84rpx; + display: flex; + align-items: center; +} + +.input { + flex: 1; + font-size: 28rpx; + color: #1f1f1f; +} +.ph { color: #b8b8b8; } + +/* 按钮 */ +.btn { + height: 88rpx; + border-radius: 999rpx; + display: flex; + align-items: center; + justify-content: center; font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 27.6rpx; - color: #66666b; + font-weight: 600; + margin-top: 24rpx; } -.text_2 { - margin-left: 2.63rpx; - line-height: 27.75rpx; -} -.text_4 { - line-height: 27.75rpx; -} -.text_1 { - margin-left: 2.44rpx; -} -.text-wrapper_1 { - padding: 17.66rpx 0 14.64rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 403.13rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_5 { - line-height: 27.69rpx; -} -.text-wrapper_2 { - margin-right: 12.43rpx; - padding: 26.29rpx 0 21.02rpx; - background-color: #ffa400; - border-radius: 9.38rpx; -} -.text_6 { +.btn-primary { + background: linear-gradient(180deg, #ffa400 0%, #e67e22 100%); color: #ffffff; - line-height: 27.69rpx; + box-shadow: 0 6rpx 14rpx rgba(230,126,34,0.30); } -.list-item { - padding-bottom: 38.57rpx; - background-color: #ffffff; - border-radius: 16.48rpx; - border: solid 1.88rpx #ffeaa7; + +/* 空状态 */ +.empty { + padding: 120rpx 0 40rpx; + display: flex; + flex-direction: column; + align-items: center; + color: #999999; } -.list-item:first-child { - margin-top: 0; +.empty-img { width: 300rpx; height: 300rpx; margin-bottom: 16rpx; } +.empty-text { font-size: 26rpx; } + +/* 列表头部行 */ +.topline { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16rpx; + margin-bottom: 8rpx; } -.group { - padding: 33.62rpx 32.01rpx 31.22rpx 35.33rpx; +.id-and-name { + display: flex; + align-items: baseline; + gap: 16rpx; + flex-wrap: wrap; } -.font_2 { - font-size: 33.75rpx; - font-family: SourceHanSansCN; - line-height: 31.82rpx; - font-weight: 700; - color: #e88b38; +.no { font-size: 24rpx; color: #666666; } +.name { font-size: 28rpx; color: #1f1f1f; font-weight: 600; } + +.link-btn { + height: 56rpx; + padding: 0 18rpx; + border-radius: 999rpx; + background: #fff6e6; + display: inline-flex; + align-items: center; + justify-content: center; + border: 1rpx solid #ffd6b3; } -.text_8 { - line-height: 27.86rpx; +.link-text { font-size: 24rpx; color: #e67e22; font-weight: 600; } + +/* 键值行 */ +.row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12rpx 0; + border-top: 1rpx dashed #f0f0f0; } -.text-wrapper_4 { - padding: 18.51rpx 0 15.28rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - height: 61.88rpx; - border: solid 1.88rpx #ffeaa7; +.row-key { font-size: 26rpx; color: #666666; } +.row-val { display: flex; align-items: center; gap: 16rpx; } +.mono { font-size: 28rpx; color: #1f1f1f; font-family: monospace; letter-spacing: 1rpx; } +.copy { + font-size: 24rpx; + color: #e67e22; + padding: 8rpx 14rpx; + border-radius: 12rpx; + background: #fff4f2; + border: 1rpx solid #ffd6cc; } -.font_3 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 24.3rpx; - color: #e88b38; + +/* 徽章 Chips */ +.chips { display: flex; gap: 12rpx; flex-wrap: wrap; margin: 12rpx 0 4rpx; } +.chip { + padding: 10rpx 16rpx; + background: #f7f9fc; + color: #3d4f6e; + border: 1rpx solid #e6edf7; + border-radius: 12rpx; + font-size: 24rpx; } -.text_7 { - margin-left: 19.41rpx; - margin-right: 10.59rpx; - line-height: 24.34rpx; -} -.section_3 { - margin-left: 33.62rpx; - padding: 17.76rpx 16.14rpx 14.64rpx 17.61rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - border: solid 1.88rpx #ffeaa7; -} -.font_4 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 27.6rpx; - color: #333333; -} -.text_9 { - line-height: 24.15rpx; - margin-left: 20rpx; -} -.group_2 { - padding: 24.38rpx 33.75rpx 26.25rpx; - border-bottom: solid 1.88rpx #e88b38; -} -.text-wrapper_5 { - padding: 17.72rpx 0 14.53rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_10 { - margin-left: 17.08rpx; - margin-right: 7.29rpx; - line-height: 27.75rpx; -} -.text-wrapper_6 { - padding: 17.78rpx 0 14.63rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_11 { - margin-left: 13.93rpx; -} -.group_3 { - margin: 32.81rpx 29.19rpx 0 32.68rpx; - height: 487.5rpx; - display: grid; - grid-template-rows: repeat(3, minmax(0, 1fr)); - grid-template-columns: repeat(3, minmax(0, 1fr)); - row-gap: 29.19rpx; - column-gap: 31.07rpx; + +/* 九宫格 */ +.grid { + margin-top: 8rpx; + margin-left: -10rpx; + margin-right: -10rpx; + display: flex; + flex-wrap: wrap; } .grid-item { - padding: 32.49rpx 18.19rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; + width: 33.3333%; + padding: 14rpx 10rpx; + box-sizing: border-box; } -.font_5 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 24.3rpx; - color: #66666b; +.gi-label { font-size: 24rpx; color: #666666; } +.gi-value { + display: block; + margin-top: 10rpx; + font-size: 30rpx; + font-weight: 700; + color: #1f1f1f; } -.text_12 { - line-height: 24.02rpx; +.gi-value.money { color: #e67e22; } + +/* 小屏两列适配 */ +@media (max-width: 360px) { + .grid-item { width: 50%; } } -.font_6 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 20.06rpx; - color: #e88b38; -} -.grid-item_2 { - padding: 32.42rpx 17.87rpx 31.18rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_13 { - line-height: 24.09rpx; -} -.text_15 { - margin-left: 4.39rpx; -} -.grid-item_3 { - padding: 32.16rpx 18rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_14 { - line-height: 24.56rpx; -} -.text_16 { - margin-left: 3.32rpx; -} -.grid-item_4 { - padding: 32.34rpx 17.51rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_17 { - line-height: 24.26rpx; -} -.text_18 { - margin-left: 3.81rpx; -} -.grid-item_5 { - padding: 32.25rpx 18.21rpx 31.18rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.grid-item_6 { - padding: 32.25rpx 19.18rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_19 { - margin-left: 2.14rpx; -} -.grid-item_7 { - padding: 32.36rpx 17.59rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_20 { - line-height: 24.43rpx; -} -.grid-item_8 { - padding: 32.38rpx 17.81rpx 31.18rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_21 { - line-height: 24.17rpx; -} -.text_23 { - margin-left: 4.44rpx; -} -.grid-item_9 { - padding: 33.43rpx 19.18rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_22 { - line-height: 23.08rpx; -} -.text_24 { - margin-left: 2.14rpx; -} \ No newline at end of file diff --git a/pages/dashboardModule/supervisorPerformance/supervisorPerformance.js b/pages/dashboardModule/supervisorPerformance/supervisorPerformance.js index 84ebd09..bc6456c 100644 --- a/pages/dashboardModule/supervisorPerformance/supervisorPerformance.js +++ b/pages/dashboardModule/supervisorPerformance/supervisorPerformance.js @@ -1,4 +1,5 @@ import { baseUrl } from "../../../request"; +const { notLogin } = require('../../../utils/util') // pages/dashboardModule/supervisorPerformance/supervisorPerformance.js Page({ @@ -44,7 +45,7 @@ Page({ this.setData({ performanceList: listWithRate }); this.setData({ showList: true }); } else { - wx.showToast({ title: res.data.message || '查询失败', icon: 'none' }); + notLogin(res.data.message) } }, fail: () => { diff --git a/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml b/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml index 6dbc366..736421a 100644 --- a/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml +++ b/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml @@ -1,132 +1,128 @@ - + - {{ showRole }}业绩报表 + + {{ showRole }}业绩报表 + - - - + + + - - {{ showRole }}名称 - + + {{ showRole }}名称 + - - 手机号 - + + 手机号 + - - 搜索 - + 搜索 - - - - - - - - - - 编号:{{index + 1}} - 主管:{{item.nickName}} - - - 员工绩效排名>> - + + + + + + 暂无数据 + + + + + + + + + 编号:{{ index + 1 }} + 主管:{{ item.nickName }} - - - - 手机号:{{item.phoneNumber}} - 复制 + + 员工绩效排名 >> + - - - - 员工数:{{item.empCount}} - - - 比例:{{item.ratePercent}}% - + + + 手机号 + + {{ item.phoneNumber }} + 复制 + - - - - 下单量 - {{item.orderCount}} - - - 总订单 - ¥{{item.totalAmount}} - - - 净成交 - ¥{{item.netAmount}} - - - 待释放 - ¥{{item.toRelease}} - - - 可结算 - {{item.toSettle}} - - - 已结算 - ¥{{item.settled}} - - - 推广数 - {{item.promoCount}} - - - 退款 - ¥{{item.refunded}} - - - 已回退 - ¥0 - + + + 员工数:{{ item.empCount }} + 比例:{{ item.ratePercent }}% + + + + + + 下单量 + {{ item.orderCount }} + + + 总订单 + ¥{{ item.totalAmount }} + + + 净成交 + ¥{{ item.netAmount }} + + + 待释放 + ¥{{ item.toRelease }} + + + 可结算 + {{ item.toSettle }} + + + 已结算 + ¥{{ item.settled }} + + + 推广数 + {{ item.promoCount }} + + + 退款 + ¥{{ item.refunded }} + + + 已回退 + ¥0 - - + + diff --git a/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxss b/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxss index 7f90532..75902e8 100644 --- a/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxss +++ b/pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxss @@ -1,290 +1,237 @@ -.mt-19 { - margin-top: 35.63rpx; -} -.mt-7 { - margin-top: 13.13rpx; -} -.mt-25 { - margin-top: 46.88rpx; -} -.mt-13 { - margin-top: 24.38rpx; -} -.mt-17 { - margin-top: 31.88rpx; -} +/* ===== 页面与滚动 ===== */ .page { - padding: 71.06rpx 42.19rpx 117.19rpx 43.99rpx; - background-color: #fefbf6; - box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; - width: 100%; - position: fixed; - bottom: 0; - overflow: auto; - height: calc(100vh - 1rpx); + background: #fefbf6; + min-height: 100vh; + display: flex; + flex-direction: column; } -.text { - color: #e67e22; - font-size: 45rpx; - font-family: SourceHanSansCN; + +.page-title { + padding: 24rpx 24rpx 0; +} +.title { + color: #e67e22; /* 主标题暖橙 */ + font-size: 40rpx; font-weight: 700; - line-height: 42.75rpx; } -.section { - padding: 45.75rpx 39.26rpx 47.94rpx 42.99rpx; - background-color: #ffffff; - border-radius: 18.75rpx; - border: solid 1.88rpx #ffeaa7; + +.content { + flex: 1; + padding: 24rpx; + box-sizing: border-box; } -.text-wrapper { - padding: 17.63rpx 0 14.63rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 403.13rpx; - border: solid 1.88rpx #ffeaa7; + +.no-scrollbar::-webkit-scrollbar { + width: 0; + height: 0; + display: none; } -.text_3 { - margin-left: 15.19rpx; + +/* ===== 卡片通用 ===== */ +.card { + background: #ffffff; + border-radius: 18rpx; + padding: 24rpx; + border: 2rpx solid #ffeaa7; /* 浅橙描边 */ + box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05); } -.font { +.card + .card { margin-top: 20rpx; } + +/* ===== 表单 ===== */ +.form-card .field + .field { margin-top: 20rpx; } + +.field-label { + font-size: 28rpx; + color: #555555; + margin-bottom: 12rpx; + display: block; +} + +.input-box { + background: #ffffff; + border: 2rpx solid #ffeaa7; + border-radius: 12rpx; + padding: 0 20rpx; + height: 84rpx; + display: flex; + align-items: center; +} + +.input { + flex: 1; + font-size: 28rpx; + color: #1f1f1f; +} + +.ph { + color: #b8b8b8; +} + +/* 按钮 */ +.btn { + height: 88rpx; + border-radius: 999rpx; + display: flex; + align-items: center; + justify-content: center; font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 27.6rpx; - color: #66666b; + font-weight: 600; + margin-top: 24rpx; } -.text_2 { - margin-left: 2.63rpx; - line-height: 27.75rpx; -} -.text_4 { - line-height: 27.75rpx; -} -.text_1 { - margin-left: 2.44rpx; -} -.text-wrapper_1 { - padding: 17.66rpx 0 14.64rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 403.13rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_5 { - line-height: 27.69rpx; -} -.text-wrapper_2 { - margin-right: 12.43rpx; - padding: 26.29rpx 0 21.02rpx; - background-color: #ffa400; - border-radius: 9.38rpx; -} -.text_6 { + +.btn-primary { + background: linear-gradient(180deg, #ffa400 0%, #e67e22 100%); color: #ffffff; - line-height: 27.69rpx; + box-shadow: 0 6rpx 14rpx rgba(230, 126, 34, 0.30); } -.list-item { - padding-bottom: 38.57rpx; - background-color: #ffffff; - border-radius: 16.48rpx; - border: solid 1.88rpx #ffeaa7; + +/* ===== 空状态 ===== */ +.empty { + padding: 120rpx 0 40rpx; + display: flex; + flex-direction: column; + align-items: center; + color: #999999; } -.list-item:first-child { - margin-top: 0; +.empty-img { width: 300rpx; height: 300rpx; margin-bottom: 16rpx; } +.empty-text { font-size: 26rpx; } + +/* ===== 业绩卡片 ===== */ +.topline { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16rpx; + margin-bottom: 8rpx; } -.group { - padding: 33.62rpx 32.01rpx 31.22rpx 35.33rpx; + +.id-and-name { + display: flex; + align-items: baseline; + gap: 16rpx; + flex-wrap: wrap; } -.font_2 { - font-size: 33.75rpx; - font-family: SourceHanSansCN; - line-height: 31.82rpx; - font-weight: 700; - color: #e88b38; + +.no { + font-size: 24rpx; + color: #666666; } -.text_8 { - line-height: 27.86rpx; + +.name { + font-size: 28rpx; + color: #1f1f1f; + font-weight: 600; } -.text-wrapper_4 { - padding: 18.51rpx 0 15.28rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - height: 61.88rpx; - border: solid 1.88rpx #ffeaa7; + +.link-btn { + height: 56rpx; + padding: 0 18rpx; + border-radius: 999rpx; + background: #fff6e6; + display: inline-flex; + align-items: center; + justify-content: center; + border: 1rpx solid #ffd6b3; } -.font_3 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 24.3rpx; - color: #e88b38; + +.link-text { + font-size: 24rpx; + color: #e67e22; + font-weight: 600; } -.text_7 { - margin-left: 19.41rpx; - margin-right: 10.59rpx; - line-height: 24.34rpx; + +/* 行:键值对 */ +.row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12rpx 0; + border-top: 1rpx dashed #f0f0f0; } -.section_3 { - margin-left: 33.62rpx; - padding: 17.76rpx 16.14rpx 14.64rpx 17.61rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - border: solid 1.88rpx #ffeaa7; + +.row-key { + font-size: 26rpx; + color: #666666; } -.font_4 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 27.6rpx; - color: #333333; + +.row-val { + display: flex; + align-items: center; + gap: 16rpx; } -.text_9 { - line-height: 24.15rpx; - margin-left: 20rpx; + +.mono { + font-size: 28rpx; + color: #1f1f1f; + font-family: monospace; + letter-spacing: 1rpx; } -.group_2 { - padding: 24.38rpx 33.75rpx 26.25rpx; - border-bottom: solid 1.88rpx #e88b38; + +.copy { + font-size: 24rpx; + color: #e67e22; + padding: 8rpx 14rpx; + border-radius: 12rpx; + background: #fff4f2; + border: 1rpx solid #ffd6cc; } -.text-wrapper_5 { - padding: 17.72rpx 0 14.53rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; + +/* 徽标 chips */ +.chips { + display: flex; + gap: 12rpx; + flex-wrap: wrap; + margin: 12rpx 0 4rpx; } -.text_10 { - margin-left: 17.08rpx; - margin-right: 7.29rpx; - line-height: 27.75rpx; + +.chip { + padding: 10rpx 16rpx; + background: #f7f9fc; + color: #3d4f6e; + border: 1rpx solid #e6edf7; + border-radius: 12rpx; + font-size: 24rpx; } -.text-wrapper_6 { - padding: 17.78rpx 0 14.63rpx; - background-color: #fefbf6; - border-radius: 9.38rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_11 { - margin-left: 13.93rpx; -} -.group_3 { - margin: 32.81rpx 29.19rpx 0 32.68rpx; - height: 487.5rpx; - display: grid; - grid-template-rows: repeat(3, minmax(0, 1fr)); - grid-template-columns: repeat(3, minmax(0, 1fr)); - row-gap: 29.19rpx; - column-gap: 31.07rpx; + +/* 九宫格:3 列自适应 */ +.grid { + margin-top: 8rpx; + margin-left: -10rpx; + margin-right: -10rpx; + display: flex; + flex-wrap: wrap; } + .grid-item { - padding: 32.49rpx 18.19rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; + width: 33.3333%; + padding: 14rpx 10rpx; + box-sizing: border-box; } -.font_5 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 24.3rpx; - color: #66666b; + +.gi-label { + font-size: 24rpx; + color: #666666; } -.text_12 { - line-height: 24.02rpx; + +.gi-value { + display: block; + margin-top: 10rpx; + font-size: 30rpx; + font-weight: 700; + color: #1f1f1f; } -.font_6 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 20.06rpx; - color: #e88b38; + +/* 金额类,用主题橙强调 */ +.grid-item:nth-child(2) .gi-value, +.grid-item:nth-child(3) .gi-value, +.grid-item:nth-child(4) .gi-value, +.grid-item:nth-child(6) .gi-value, +.grid-item:nth-child(8) .gi-value, +.grid-item:nth-child(9) .gi-value { + color: #e67e22; } -.grid-item_2 { - padding: 32.42rpx 17.87rpx 31.18rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; + +/* 小屏两列适配 */ +@media (max-width: 360px) { + .grid-item { width: 50%; } } -.text_13 { - line-height: 24.09rpx; -} -.text_15 { - margin-left: 4.39rpx; -} -.grid-item_3 { - padding: 32.16rpx 18rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_14 { - line-height: 24.56rpx; -} -.text_16 { - margin-left: 3.32rpx; -} -.grid-item_4 { - padding: 32.34rpx 17.51rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_17 { - line-height: 24.26rpx; -} -.text_18 { - margin-left: 3.81rpx; -} -.grid-item_5 { - padding: 32.25rpx 18.21rpx 31.18rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.grid-item_6 { - padding: 32.25rpx 19.18rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_19 { - margin-left: 2.14rpx; -} -.grid-item_7 { - padding: 32.36rpx 17.59rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_20 { - line-height: 24.43rpx; -} -.grid-item_8 { - padding: 32.38rpx 17.81rpx 31.18rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_21 { - line-height: 24.17rpx; -} -.text_23 { - margin-left: 4.44rpx; -} -.grid-item_9 { - padding: 33.43rpx 19.18rpx 31.44rpx; - filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #f1c40f; -} -.text_22 { - line-height: 23.08rpx; -} -.text_24 { - margin-left: 2.14rpx; -} \ No newline at end of file diff --git a/pages/dashboardModule/userOrderPerformance/userOrderPerformance.js b/pages/dashboardModule/userOrderPerformance/userOrderPerformance.js index 62fa347..8d00ac4 100644 --- a/pages/dashboardModule/userOrderPerformance/userOrderPerformance.js +++ b/pages/dashboardModule/userOrderPerformance/userOrderPerformance.js @@ -1,4 +1,5 @@ import { baseUrl } from "../../../request"; +const { notLogin } = require('../../../utils/util') // pages/dashboardModule/userOrderPerformance/userOrderPerformance.js Page({ @@ -90,11 +91,8 @@ Page({ OrderItems: res.data.data }); } else { - wx.showToast({ - title: res.data.message || '未找到订单', - icon: 'none' - }); this.setData({ OrderItems: [] }); + notLogin(res.data.message) } }, fail: () => { diff --git a/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxml b/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxml index fbddf55..e70f1c6 100644 --- a/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxml +++ b/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxml @@ -1,93 +1,92 @@ - - 客户订单明细 + + + + 客户订单明细 + - - - - 订单号 - + + + + + 订单号 + - - 搜索 - + 搜索 - - - + + + + - - 订单号: - {{item.orderNumber}} + + + + 订单号 + {{ item.orderNumber }} + + + {{ item.orderStatus }} + - - 用户: - {{item.nickName}} + + + 用户 + {{ item.nickName }} - - 手机号: - {{item.phoneNumber}} + + 手机号 + {{ item.phoneNumber }} - - 金额: - ¥{{item.totalAmount}} + + 金额 + ¥{{ item.totalAmount }} - - 状态: - {{item.orderStatus}} + + 抽成 + 主管:{{ item.firstRate * 100 }}%,员工:{{ item.secondRate * 100 }}% - - 抽成: - 主管:{{item.firstRate * 100}}%,员工:{{item.secondRate * 100}}% - + + 奖励 + 主管:¥{{ item.firstReward }},员工:¥{{ item.secondReward }} - - 奖励: - 主管:¥{{item.firstReward}},员工:¥{{item.secondReward}} - + + 提成状态 + {{ item.commissionStatus }} - - - 提成状态: - {{item.commissionStatus}} - - - - + - 暂无数据 + + + 暂无数据 + - + diff --git a/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxss b/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxss index c750606..8e0dc00 100644 --- a/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxss +++ b/pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxss @@ -1,176 +1,133 @@ -.mt-19 { - margin-top: 35.63rpx; -} -.mt-35 { - margin-top: 65.63rpx; -} +/* ===== 页面与滚动 ===== */ .page { - padding: 70.84rpx 42.19rpx 152.81rpx 44.06rpx; - background-color: #fefbf6; - box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; - width: 100%; - position: fixed; - bottom: 0; - overflow: auto; - height: calc(100vh - 1rpx); + background: #fefbf6; /* 与你项目的暖米黄保持一致 */ + min-height: 100vh; + display: flex; + flex-direction: column; } -.text { - color: #e67e22; - font-size: 45rpx; - font-family: SourceHanSansCN; +.page-title { padding: 24rpx 24rpx 0; } +.title { + color: #e67e22; /* 暖橙主色 */ + font-size: 40rpx; font-weight: 700; - line-height: 43.16rpx; } -.section { - padding: 0 35.76rpx 47.94rpx 41.12rpx; - background-color: #ffffff; - border-radius: 18.75rpx; - border: solid 1.88rpx #ffeaa7; + +.content { + flex: 1; + padding: 24rpx; + box-sizing: border-box; } -.group { - padding: 47.87rpx 0 51.56rpx; +.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; display: none; } + +/* ===== 卡片 ===== */ +.card { + background: #ffffff; + border-radius: 18rpx; + padding: 24rpx; + border: 2rpx solid #ffeaa7; /* 浅橙描边,延续你原风格 */ + box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05); } -.text-wrapper { - margin-right: 3.77rpx; - margin-top: 14.55rpx; - padding: 17.66rpx 0 14.68rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - border: solid 1.88rpx #ffeaa7; +.card + .card { margin-top: 20rpx; } + +/* ===== 表单 ===== */ +.form-card .field + .field { margin-top: 20rpx; } +.field-label { + font-size: 28rpx; + color: #555555; + margin-bottom: 12rpx; + display: block; } -.text_3 { - margin-left: 15.19rpx; - width: 500rpx; +.input-box { + height: 84rpx; + border-radius: 12rpx; + border: 2rpx solid #ffeaa7; + background: #ffffff; + padding: 0 20rpx; + display: flex; + align-items: center; } -.font { +.input { + flex: 1; + font-size: 28rpx; + color: #1f1f1f; +} +.ph { color: #b8b8b8; } + +.btn { + height: 88rpx; + border-radius: 999rpx; + margin-top: 24rpx; + display: flex; + align-items: center; + justify-content: center; font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 28.54rpx; - color: #66666b; + font-weight: 600; } -.text_2 { - margin-left: 2.44rpx; - line-height: 27.45rpx; -} -.text_1 { - line-height: 27.66rpx; -} -.text_4 { - margin-left: 4.31rpx; - margin-top: 36.64rpx; - line-height: 27.6rpx; -} -.group_2 { - margin-top: 16.39rpx; -} -.text-wrapper_2 { - padding: 19.13rpx 0 11.68rpx; - background-color: #ffffff; - border-radius: 9.38rpx; - width: 258.75rpx; - height: 63.75rpx; - border: solid 1.88rpx #ffeaa7; -} -.text_5 { - margin-left: 17.01rpx; - line-height: 29.19rpx; -} -.text_6 { - margin-left: 20.42rpx; - margin-bottom: 26.04rpx; - color: #000000; - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 1.63rpx; -} -.view { - margin-left: 9.58rpx; -} -.text-wrapper_3 { - margin-left: 2.81rpx; - margin-right: 15.94rpx; - padding: 26.29rpx 0 21.02rpx; - background-color: #ffa400; - border-radius: 9.38rpx; -} -.font_2 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 28.54rpx; - color: #ffa500; -} -.text_7 { +.btn-primary { + background: linear-gradient(180deg, #ffa400 0%, #e67e22 100%); color: #ffffff; - line-height: 27.69rpx; + box-shadow: 0 6rpx 14rpx rgba(230,126,34,0.30); } -.list-item { - padding: 44.94rpx 7.14rpx 41.46rpx 29.68rpx; - background-color: #ffffff; - border-radius: 11.89rpx; - border: solid 1.88rpx #ffeaa7; + +/* ===== 列表容器 ===== */ +.result-wrap { margin-top: 20rpx; } + +/* 顶部行:订单号 + 状态徽标 */ +.topline { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16rpx; + margin-bottom: 6rpx; } -.list-item:first-child { - margin-top: 0; +.row-left { + display: flex; + align-items: baseline; + gap: 12rpx; + flex-wrap: wrap; } -.text_8 { - line-height: 27.66rpx; +.label { font-size: 26rpx; color: #666666; } +.mono { font-size: 28rpx; color: #1f1f1f; font-family: monospace; letter-spacing: 1rpx; } + +.badge { + height: 40rpx; + padding: 0 16rpx; + border-radius: 999rpx; + display: inline-flex; + align-items: center; + justify-content: center; } -.font_3 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 22.76rpx; - margin-right: 15rpx; - color: #444444; +.badge-text { font-size: 22rpx; font-weight: 600; } +.badge-pending{ background: #fff6e6; color: #ff8d1a; border: 1rpx solid #ffd6b3; } +.badge-success{ background: #e9fbef; color: #12b05b; border: 1rpx solid #b9f0cf; } +.badge-default{ background: #f0f0f0; color: #666666; border: 1rpx solid #e6e6e6; } + +/* 键值行 */ +.kv { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12rpx 0; + border-top: 1rpx dashed #f0f0f0; } -.text_9 { - line-height: 28.24rpx; +.kv:first-of-type { border-top: 0; } +.kv-key { font-size: 26rpx; color: #666666; } +.kv-val { + font-size: 28rpx; + color: #1f1f1f; + text-align: right; + max-width: 70%; + word-break: break-all; } -.font_4 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 28.54rpx; - color: #444444; +.money { color: #e67e22; font-weight: 700; } + +/* 空状态 */ +.empty { + padding: 120rpx 0 40rpx; + display: flex; + flex-direction: column; + align-items: center; + color: #999999; } -.text_10 { - margin-right: 15rpx; - line-height: 27.84rpx; -} -.text_11 { - line-height: 27.81rpx; -} -.text_12 { - margin-right: 15rpx; -} -.text_13 { - line-height: 28.29rpx; -} -.text_24 { - margin-right: 15rpx; -} -.text_15 { - line-height: 28.01rpx; -} -.text_16 { - margin-right: 15rpx; - line-height: 28.09rpx; -} -.text_17 { - line-height: 28.16rpx; -} -.text_18 { - margin-right: 15rpx; -} -.text_19 { - line-height: 28.2rpx; -} -.text_20 { - margin-right: 15rpx; -} -.text_21 { - line-height: 28.31rpx; -} -.text_23 { - margin-right: 15rpx; - margin-bottom: 2.04rpx; - line-height: 27.79rpx; -} \ No newline at end of file +.empty-img { width: 300rpx; height: 300rpx; margin-bottom: 16rpx; } +.empty-text { font-size: 26rpx; } diff --git a/pages/loginModule/employeeAccountApply/employeeAccountApply.js b/pages/loginModule/employeeAccountApply/employeeAccountApply.js index 3d40f8a..b843f2d 100644 --- a/pages/loginModule/employeeAccountApply/employeeAccountApply.js +++ b/pages/loginModule/employeeAccountApply/employeeAccountApply.js @@ -40,9 +40,12 @@ Page({ // 3. 发送验证码请求 wx.request({ - url: baseUrl + '/userInfo/code/pwd', + url: baseUrl + '/userInfo/code/register', method: 'POST', - data: { templateString: phone }, + data: { + phoneNumber: phone, + userRole: 'staff' + }, success: (res) => { console.log('验证码发送--->',res.data); if (res.data.code === 1) { diff --git a/pages/loginModule/forgetPwd/forgetPwd.js b/pages/loginModule/forgetPwd/forgetPwd.js index bbaf056..03711c8 100644 --- a/pages/loginModule/forgetPwd/forgetPwd.js +++ b/pages/loginModule/forgetPwd/forgetPwd.js @@ -40,7 +40,7 @@ Page({ // 发送验证码 getSmsCode() { - const { phone } = this.data; + const { phone, role } = this.data; // 1. 非空 if (!validate(this.data, { phone: '请输入手机号' })) return; // 2. 格式 @@ -51,7 +51,7 @@ Page({ wx.request({ url: baseUrl + '/userInfo/code/pwd', method: 'POST', - data: { templateString: phone }, + data: { phoneNumber: phone, userRole: role }, success: (res) => { if (res.data.code === 1) { wx.showToast({ title: '验证码已发送', icon: 'none' }); diff --git a/pages/personCenter/accountSetting/accountSetting.js b/pages/personCenter/accountSetting/accountSetting.js index 82dd30e..5c4a49b 100644 --- a/pages/personCenter/accountSetting/accountSetting.js +++ b/pages/personCenter/accountSetting/accountSetting.js @@ -1,5 +1,7 @@ // pages/personCenter/accountSetting/accountSetting.js const { baseUrl, globalImgUrl } = require("../../../request"); +const { notLogin } = require('../../../utils/util') + Page({ @@ -76,6 +78,8 @@ Page({ userAccount: res.data.data.userAccount, role:res.data.data.userRole, }) + } else { + notLogin(res.data.message) } }, fail: () => { diff --git a/pages/personCenter/accountSetting/accountSetting.wxml b/pages/personCenter/accountSetting/accountSetting.wxml index c6ece5a..14137a8 100644 --- a/pages/personCenter/accountSetting/accountSetting.wxml +++ b/pages/personCenter/accountSetting/accountSetting.wxml @@ -5,7 +5,7 @@ class="self-center image" src="{{globalImgUrl + userAvatar}}" /> - + {{ nickName }} {{ phoneNumber }} diff --git a/pages/personCenter/component/modifyNamePop/modifyNamePop.js b/pages/personCenter/component/modifyNamePop/modifyNamePop.js new file mode 100644 index 0000000..b712698 --- /dev/null +++ b/pages/personCenter/component/modifyNamePop/modifyNamePop.js @@ -0,0 +1,49 @@ +Component({ + properties: { + show: { + type: Boolean, + value: false + }, + nickname: { + type: String, + value: '' + } + }, + data: { + inputVal: '' + }, + methods: { + onInput(e) { + this.setData({ + inputVal: e.detail.value + }); + }, + onCancel() { + this.triggerEvent('cancel'); + }, + onConfirm() { + const newName = this.data.inputVal.trim(); + if (!newName) { + wx.showToast({ + title: '昵称不能为空', + icon: 'none' + }); + return; + } + + if (newName.length > 20) { + wx.showToast({ + title: '昵称最长不超过20个字符', + icon: 'none' + }) + return ; + } + this.triggerEvent('confirm', { nickname: newName }); + } + }, + observers: { + nickname(val) { + this.setData({ inputVal: val }); + } + } +}); diff --git a/pages/personCenter/component/modifyNamePop/modifyNamePop.json b/pages/personCenter/component/modifyNamePop/modifyNamePop.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/personCenter/component/modifyNamePop/modifyNamePop.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/personCenter/component/modifyNamePop/modifyNamePop.wxml b/pages/personCenter/component/modifyNamePop/modifyNamePop.wxml new file mode 100644 index 0000000..be58a63 --- /dev/null +++ b/pages/personCenter/component/modifyNamePop/modifyNamePop.wxml @@ -0,0 +1,15 @@ + + + 修改昵称 + + + + + + + diff --git a/pages/personCenter/component/modifyNamePop/modifyNamePop.wxss b/pages/personCenter/component/modifyNamePop/modifyNamePop.wxss new file mode 100644 index 0000000..0333873 --- /dev/null +++ b/pages/personCenter/component/modifyNamePop/modifyNamePop.wxss @@ -0,0 +1,57 @@ +.popup-mask { + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + background: rgba(0, 0, 0, 0.4); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.popup-container { + width: 80%; + background: #fff; + border-radius: 10px; + padding: 20rpx; + box-sizing: border-box; +} + +.popup-title { + display: block; + font-size: 32rpx; + font-weight: bold; + text-align: center; + margin-bottom: 20rpx; +} + +.popup-input { + width: 100%; + border: 1px solid #ddd; + border-radius: 6rpx; + padding: 10rpx; + box-sizing: border-box; + font-size: 28rpx; +} + +.popup-btns { + display: flex; + justify-content: space-around; + margin-top: 20rpx; +} + +.btn { + flex: 1; + margin: 0 10rpx; + padding: 12rpx 0; + border-radius: 6rpx; +} + +.cancel-btn { + background: #f5f5f5; + color: #333; +} + +.confirm-btn { + background: #f5f5f5; + color: #ff8d1a; +} diff --git a/pages/personCenter/mine/mine.js b/pages/personCenter/mine/mine.js index 50bb043..811cc60 100644 --- a/pages/personCenter/mine/mine.js +++ b/pages/personCenter/mine/mine.js @@ -1,6 +1,8 @@ // pages/personCenter/mine/mine.js const { baseUrl } = require("../../../request"); const { globalImgUrl } = require("../../../request") +const { notLogin } = require('../../../utils/util') + Page({ @@ -20,7 +22,8 @@ Page({ userRole: "", title: '查看绩效', id: 0, - globalImgUrl + globalImgUrl, + showNicknamePopup: false }, // 跳转课程订单页面 courseOrder() { @@ -170,10 +173,7 @@ Page({ qrcode: globalImgUrl + result.inviteQrCode }) } else { - wx.showToast({ - title: '获取个人信息失败', - icon: 'none' - }) + notLogin(res.data.message) } }, fail: () => { @@ -297,6 +297,41 @@ Page({ }) }, + + openNicknamePopup() { + this.setData({ showNicknamePopup: true }); + }, + closeNicknamePopup() { + this.setData({ showNicknamePopup: false }); + }, + updateNickname(e) { + const { nickname } = e.detail; + const token = wx.getStorageSync('token'); + wx.request({ + url: baseUrl + '/userInfo/modify/nickname', + method: 'POST', + header: { + Authorization: token + }, + data: { templateString: nickname }, + success: res => { + if (res.data.code === 1) { + wx.showToast({ title: '修改成功', icon: 'success' }); + this.setData({ + nickName: nickname, + showNicknamePopup: false + }); + } else { + wx.showToast({ title: res.data.message || '修改失败', icon: 'none' }); + } + }, + fail: () => { + wx.showToast({ title: '网络错误', icon: 'none' }); + } + }); + }, + + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/personCenter/mine/mine.json b/pages/personCenter/mine/mine.json index b996601..0387e41 100644 --- a/pages/personCenter/mine/mine.json +++ b/pages/personCenter/mine/mine.json @@ -1,5 +1,6 @@ { "usingComponents": { - "InvitationCodePop": "/pages/personCenter/component/InvitationCodePop/InvitationCodePop" + "InvitationCodePop": "/pages/personCenter/component/InvitationCodePop/InvitationCodePop", + "EditNicknamePopup": "/pages/personCenter/component/modifyNamePop/modifyNamePop" } } diff --git a/pages/personCenter/mine/mine.wxml b/pages/personCenter/mine/mine.wxml index eacb75e..cd1c045 100644 --- a/pages/personCenter/mine/mine.wxml +++ b/pages/personCenter/mine/mine.wxml @@ -219,8 +219,11 @@ mode="aspectFill" /> - - {{ nickName }} + + + {{ nickName }} + 修改 + - \ No newline at end of file + + + diff --git a/pages/personCenter/mine/mine.wxss b/pages/personCenter/mine/mine.wxss index e436410..fa9f84a 100644 --- a/pages/personCenter/mine/mine.wxss +++ b/pages/personCenter/mine/mine.wxss @@ -64,9 +64,10 @@ button { } .text_2 { color: #808080; - line-height: 17.08rpx; + line-height: 1.4; } .section_2 { + width: 230rpx; padding: 7.5rpx 13.13rpx 5.63rpx 14.03rpx; background-color: #fff6de; border-radius: 31.26rpx; @@ -136,7 +137,7 @@ button { width: 224.59rpx; } .list { - padding-top: 39.38rpx; + padding-top: 19.38rpx; } .section_4 { padding: 31.88rpx 31.88rpx 30rpx 33.75rpx; @@ -157,4 +158,11 @@ button { } .text_8 { line-height: 23.81rpx; +} +.nickname-wrap { + display: block; /* 让它单独占一行 */ + max-width: 250rpx; /* 不超过容器宽度 */ + white-space: normal; /* 允许正常换行 */ + word-break: break-all; /* 长字符串也能断行 */ + line-height: 1.4; } \ No newline at end of file diff --git a/pages/personCenter/resetPwd/resetPwd.js b/pages/personCenter/resetPwd/resetPwd.js index aafba4a..4958607 100644 --- a/pages/personCenter/resetPwd/resetPwd.js +++ b/pages/personCenter/resetPwd/resetPwd.js @@ -1,5 +1,6 @@ import { baseUrl } from "../../../request"; import { formatPassword } from "../../../utils/util" +const { notLogin } = require('../../../utils/util') // pages/personCenter/resetPwd/resetPwd.js Page({ @@ -45,15 +46,12 @@ Page({ }) setTimeout(() => { wx.reLaunch({ - url: '/pages/loginModule/pwdLogin/pwdLogin', + url: `/pages/loginModule/pwdLogin/pwdLogin?role=${role}`, }) }, 1000); // 1000ms = 1秒 } else { - wx.showModal({ - title: '提示', - content: res.data.message - }) + notLogin(res.data.message) } } }) diff --git a/pages/welcome/homePage/homePage.js b/pages/welcome/homePage/homePage.js index e24e36d..2e79715 100644 --- a/pages/welcome/homePage/homePage.js +++ b/pages/welcome/homePage/homePage.js @@ -22,11 +22,22 @@ Page({ */ onLoad() { let token = wx.getStorageSync('token') - if (token) { - wx.switchTab({ - url: '/pages/course/homepage/homepage' - }) - } + if (!token) return ; + wx.request({ + url: baseUrl + '/userInfo/verify/token', + method: 'POST', + header: { + 'Authorization': token + }, + success: res => { + console.log(res.data) + if (res.data.code === 1) { + wx.switchTab({ + url: '/pages/course/homepage/homepage' + }) + } + } + }) }, /** diff --git a/pages/welcome/homePage/homePage.wxss b/pages/welcome/homePage/homePage.wxss index 7b96ccb..79496fa 100644 --- a/pages/welcome/homePage/homePage.wxss +++ b/pages/welcome/homePage/homePage.wxss @@ -2,12 +2,12 @@ margin-top: 16.88rpx; } .page { - padding: 255rpx 0 566.25rpx; + padding: 255rpx 0 0; background-image: linear-gradient(180deg, #ffeed9 0%, #f5f5f500 125%); width: 100%; overflow-y: auto; overflow-x: hidden; - height: 100%; + height: 100vh; } .section { padding: 39.38rpx 52.5rpx 18.75rpx; diff --git a/project.private.config.json b/project.private.config.json index a38d28b..8255393 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,7 +3,7 @@ "projectname": "qingcheng-xiaochengxu", "setting": { "compileHotReLoad": true, - "urlCheck": true, + "urlCheck": false, "bigPackageSizeSupport": false }, "condition": {}, diff --git a/utils/logcheck.js b/utils/logcheck.js index 75d25e3..c807c0f 100644 --- a/utils/logcheck.js +++ b/utils/logcheck.js @@ -1,50 +1,47 @@ +const { baseUrl } = require('./request'); function checkLogin() { + const token = wx.getStorageSync('token'); try { - const user = wx.getStorageSync('usermessage'); - if (!user || (typeof user === 'object' && Object.keys(user).length === 0)) { - wx.showToast({ - title: '您未登录请先登录', - icon:'error', - duration:2000 - }) - setTimeout(() => { - wx.navigateTo({ - url: '/pages/logain/logain', + if (!token) { + wx.redirectTo({ + url: '/pages/welcome/homePage/homePage', }); - }, 2000); } } catch (e) { - wx.navigateTo({ - url: '/pages/logain/logain', + wx.redirectTo({ + url: '/pages/welcome/homePage/homePage', }); } -} - -function checkLogin2() { - try { - const user = wx.getStorageSync('usermessage'); - if (!user || (typeof user === 'object' && Object.keys(user).length === 0)) { - wx.showToast({ - title: '您未登录请先登录', - icon:'error', - duration:2000 - }) - setTimeout(() => { - wx.navigateTo({ - url: '/pages/logain/logain', - }); - }, 2000); - } - } catch (e) { - wx.navigateTo({ - url: '/pages/logain/logain', + wx.request({ + url: baseUrl + '/userInfo/verify/token', + method: 'POST', + header: { + 'Authorization': token + }, + success: res => { + console.log('登录校验=======>', res.data) + if (res.data.code === 1) { + wx.switchTab({ + url: '/pages/course/homepage/homepage' + }) + } else { + wx.redirectTo({ + url: '/pages/welcome/homePage/homePage', + }); + } + }, + fail: () => { + wx.redirectTo({ + url: '/pages/welcome/homePage/homePage', }); - } + } + }) } + module.exports = { - checkLogin, checkLogin2 + checkLogin }; diff --git a/utils/util.js b/utils/util.js index dc98657..d7c90bf 100644 --- a/utils/util.js +++ b/utils/util.js @@ -25,7 +25,7 @@ const formatPassword = (pwd , currentPwd) => { if (pwd.length < 6 || pwd.length > 10) { wx.showToast({ title: '密码长度必须在6-10位', - icon: 'error' + icon: 'none' }) return false; } @@ -44,19 +44,38 @@ const formatPassword = (pwd , currentPwd) => { return false; } // 纪文昊写的 密码必须包含字母和数字 - const hasLetter = /[a-zA-z]/.test(pwd); - const hasNumber = /[0-9]/.test(pwd); - if (!hasLetter || !hasNumber) { + const isValid = /^[A-Za-z0-9]+$/.test(pwd); // 只能是数字和字母 + if (!isValid) { wx.showToast({ - title: '密码必须包含字母和数字', + title: '密码只能包含字母和数字', icon: 'none' - }) + }); return false; } return true; } +const notLogin = (msg) => { + if (msg === '无权限' || msg === 'token为空' || msg === 'token已过期' || msg === '用户不存在') { + wx.showToast({ + title: '未登录', + icon: 'none' + }) + setTimeout(() => { + wx.redirectTo({ + url: '/pages/welcome/homePage/homePage', + }) + }, 1000) + } else { + wx.showToast({ + title: msg, + icon: 'none' + }); + } +} + module.exports = { formatTime, - formatPassword + formatPassword, + notLogin }