Compare commits

67 Commits

Author SHA1 Message Date
2b48faf50d Merge branch 'yt' into dev 2025-08-13 10:52:19 +08:00
fab8d88faf 小程序修改代码 2025-08-13 10:52:02 +08:00
5fc1378051 -------- 2025-08-12 19:36:03 +08:00
12480f3706 Merge remote-tracking branch 'origin/dev' into dev 2025-08-10 16:22:31 +08:00
05af3d221c 修复了验证码bug 2025-08-10 16:22:02 +08:00
f17226cc97 小程序修改代码 2025-08-10 11:43:30 +08:00
d5e4f0d7eb 小程序修改代码 2025-08-10 11:28:38 +08:00
d17f6f09c5 修复了验证码bug 2025-08-10 11:25:09 +08:00
8a085da7dc 修复了验证码bug 2025-08-09 22:30:47 +08:00
f871831cbc 修复了禅道的一系列bug 2025-08-09 01:21:59 +08:00
c1817b6255 模拟了微信支付功能 2025-08-08 19:21:04 +08:00
85df7bfc4e 添加了修改头像的功能 2025-08-08 13:48:37 +08:00
990f1850b1 加入了搜索功能 2025-08-07 20:18:00 +08:00
c7dd90f669 修改部分bug 2025-08-07 19:56:53 +08:00
d1b4fa8ca3 修改了经理端部分代码 2025-08-07 11:45:28 +08:00
3996895c0d Merge remote-tracking branch 'origin/dev' into dev 2025-08-06 13:31:59 +08:00
c5f3287e80 ------- 2025-08-06 13:31:38 +08:00
b6a59ce3d8 小程序修改代码 2025-08-06 13:16:08 +08:00
2a1082fc9f Merge remote-tracking branch 'origin/dev' into dev 2025-08-04 20:16:18 +08:00
90162ad74f ------- 2025-08-04 20:15:51 +08:00
50e892adc4 小程序提交 2025-08-04 16:33:23 +08:00
0587539253 小程序提交 2025-08-04 16:31:21 +08:00
5c2082adf4 小程序提交 2025-08-04 16:27:52 +08:00
fa2a7b3499 小程序提交 2025-07-20 18:22:59 +08:00
a1d21c67b8 commission--yt-commit 2025-06-30 13:12:06 +08:00
53d0cc6767 commission--yt-commit 2025-06-25 15:45:25 +08:00
1a8bcbec9f commission--yt-commit 2025-06-25 15:44:12 +08:00
0e20be0425 commission--yt-commit 2025-06-23 10:03:08 +08:00
2350346d95 commission--yt-commit 2025-06-19 14:13:59 +08:00
b360697a37 Merge branch 'feture-yt' into dev
# Conflicts:
#	pages/loginModule/register/register.js
2025-06-17 19:27:36 +08:00
9241e3bce3 Merge remote-tracking branch 'origin/dev' into dev 2025-06-17 19:26:09 +08:00
8c0a108e8f commission--yt-commit 2025-06-17 19:25:58 +08:00
ade53fa60f Merge pull request '测试分支合并请求333' (#11) from feature-xxx into dev
Reviewed-on: http://154.8.193.216:3030/admin1/qingcheng-xiaochengxu/pulls/11
2025-06-17 11:13:11 +00:00
9b8b40d2ed 测试分支合并请求333 2025-06-17 19:10:59 +08:00
5093eb3058 Merge branch 'feature-xxx' into dev
# Conflicts:
#	app.js
2025-06-17 18:59:05 +08:00
3ce43e880d 测试分支合并请求2222 2025-06-17 18:43:08 +08:00
1e2593fd3b 测试分支合并请求 2025-06-17 18:17:05 +08:00
a5da14642b Merge branch 'dev' into feature-xxx 2025-06-17 01:10:09 +00:00
0de7e859c2 测试分支合并请求 2025-06-17 09:04:01 +08:00
152b4995ca Merge pull request 'feature-xxx' (#7) from feature-xxx into dev 2025-06-17 00:42:07 +00:00
a797150e3e 测试分支合并请求 2025-06-17 08:39:16 +08:00
3d1e60edc5 测试分支合并请求 2025-06-17 08:38:14 +08:00
c93b471625 测试分支合并请求 2025-06-17 08:26:41 +08:00
e608c02f8b Merge remote-tracking branch 'origin/feature-xxx' into feature-xxx 2025-06-16 23:33:12 +08:00
2399168f8e Merge pull request 'Merge pull request '测试分支合并请求' (#4) from feature-xxx into dev' (#5) from dev into feature-xxx
Reviewed-on: http://154.8.193.216:3030/admin1/qingcheng-xiaochengxu/pulls/5
2025-06-16 15:31:59 +00:00
949d39b1b9 测试分支合并请求 2025-06-16 23:30:02 +08:00
1ef99032ec Merge pull request '测试分支合并请求' (#4) from feature-xxx into dev
Reviewed-on: http://154.8.193.216:3030/admin1/qingcheng-xiaochengxu/pulls/4
2025-06-16 15:24:38 +00:00
d6761b460c Merge branch 'dev' into feature-xxx 2025-06-16 15:23:58 +00:00
d6bfd2d262 测试分支合并请求 2025-06-16 23:21:21 +08:00
bd98398c4e Merge branch 'feture-yt' into dev
# Conflicts:
#	app.json
2025-06-16 16:18:29 +08:00
ea403c8ed9 Merge branch 'feature-xxx' into dev 2025-06-16 16:17:23 +08:00
a8d326cc5f commission--yt-commit 2025-06-16 16:17:00 +08:00
a48fa01050 修改了查询推广码下的结算记录 2025-06-16 16:16:50 +08:00
8ea2d7a89e ------ 2025-06-16 13:18:08 +08:00
fc957770ce 补充了注册页面的小程序用户协议和隐私政策 2025-06-16 10:59:20 +08:00
6f06dfd826 补充了小程序用户协议和隐私政策 2025-06-15 22:28:50 +08:00
7603d8c96c 完成了小程序联系上级的功能(点击手机号跳转拨号页面) 2025-06-15 21:51:05 +08:00
0739bdcbb8 完成了小程序项目列表页,项目明细抽佣表,下级用户项目明细抽佣表的下拉刷新 2025-06-15 21:06:58 +08:00
dc3837dbff 修改了部分样式 2025-06-11 14:16:38 +08:00
a51f9bdea8 修复功能(用户申请提现) 2025-06-11 11:32:02 +08:00
ae9886635d 修复功能(用户申请提现) 2025-06-11 09:16:56 +08:00
a20fbe81e3 添加功能(用户申请提现) 2025-06-10 12:18:44 +08:00
4d40d86061 退出登录的修改密码添加响应式弹窗 2025-06-10 10:03:55 +08:00
7d63133f54 团队管理和下级用户抽佣明细的输入框搜索功能 2025-06-10 09:14:39 +08:00
8d95fb089d Merge branch 'feture-yt' into dev
# Conflicts:
#	pages/projectModule/projectDetail/projectDetail.js
#	pages/projectModule/projectDetail/projectDetail.wxml
#	pages/projectModule/projectList/projectList.js
#	pages/projectModule/projectList/projectList.wxml
#	pages/projectModule/userProject/userProject.js
2025-06-09 19:37:04 +08:00
179f70b65d commission--yt-commit 2025-06-09 19:33:21 +08:00
c0c6b5b61a 添加的功能:查看推广码对应的结算记录 2025-06-09 19:08:32 +08:00
175 changed files with 8734 additions and 912 deletions

4
app.js
View File

@ -1,6 +1,6 @@
const { checkLogin } = require('./utils/logcheck');
App({
onLaunch() {
// checkLogin();
onLaunch: function () {
}
});

View File

@ -1,7 +1,10 @@
{
"pages": [
"pages/welcome/homePage/homePage",
"pages/loginModule/pwdLogin/pwdLogin",
"pages/personCenter/mine/mine",
"pages/loginModule/agreement/agreement",
"pages/loginModule/privacyPolicy/privacyPolicy",
"pages/personCenter/subCommissionSetting/subCommissionSetting",
"pages/test/testVideo/testVideo",
"pages/personCenter/withdrawal/withdrawal",
@ -21,7 +24,26 @@
"pages/personCenter/commissionSetting/commissionSetting",
"pages/personCenter/resetPwd/resetPwd",
"pages/personCenter/bindBankCard/bindBankCard",
"pages/projectModule/settlement/settlement"
"pages/projectModule/settlement/settlement",
"pages/projectModule/subSettlement/subSettlement",
"pages/course/homepage/homepage",
"pages/course/searchCourses/searchCourses",
"pages/course/courseList/courseList",
"pages/course/courseDetail/courseDetail",
"pages/course/createCourseOrder/createCourseOrder",
"pages/course/orderDetail/orderDetail",
"pages/course/applyPromotion/applyPromotion",
"pages/course/recommendUser/recommendUser",
"pages/course/courseOrderList/courseOrderList",
"pages/course/courseSettlementRecord/courseSettlementRecord",
"pages/loginModule/employeeAccountApply/employeeAccountApply",
"pages/loginModule/employeeAccountNotice/employeeAccountNotice",
"pages/loginModule/employeeApplyQuery/employeeApplyQuery",
"pages/dashboardModule/overviewPerformance/overviewPerformance",
"pages/dashboardModule/supervisorPerformance/supervisorPerformance",
"pages/dashboardModule/staffPerformance/staffPerformance",
"pages/dashboardModule/userOrderPerformance/userOrderPerformance",
"pages/dashboardModule/performanceRanking/performanceRanking"
],
"window": {
"navigationBarTextStyle": "black",
@ -39,10 +61,10 @@
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/projectModule/projectList/projectList",
"text": "接单",
"iconPath": "/static/jd1.png",
"selectedIconPath": "/static/jd2.png"
"pagePath": "pages/course/homepage/homepage",
"text": "课程",
"iconPath": "/static/course.png",
"selectedIconPath": "/static/courseselected.png"
},
{
"pagePath": "pages/personCenter/mine/mine",

View File

@ -0,0 +1,160 @@
// pages/course/applyPromotion/applyPromotion.js
Page({
data: {
showCode: false,
buttonText: '生成推广码',
codeImageUrl: 'https://img.picui.cn/free/2025/06/24/685a8953cae83.png'
},
// 点击“生成推广码”或“查看推荐的用户”
handleGenerate() {
if (!this.data.showCode) {
// 1. 显示带遮罩的 loading防止用户点击其他地方
wx.showLoading({
title: '生成中...',
mask: true
});
// 2. 调用后端接口生成推广码图片
wx.request({
url: 'https://your-backend.com/api/generatePromotionCode', // TODO: 替换成你真实的接口地址
method: 'POST',
data: {
// 如果需要传用户信息或参数,在这里补充
},
success: res => {
if (1) {
// 3. 接口返回正确,更新图片地址并显示
this.setData({
codeImageUrl: res.data.imageUrl,
showCode: true,
buttonText: '查看推荐的用户'
});
} else {
wx.showToast({
title: '生成失败,请重试',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '网络错误,请检查连接',
icon: 'none'
});
},
complete: () => {
// 4. 隐藏 loading
wx.hideLoading();
}
});
} else {
// 已生成时,跳转到查看推荐用户页(如有)
wx.navigateTo({
url: '/pages/course/recommendUser/recommendUser',
})
}
},
// 保存图片到相册(与之前一致)
saveImage() {
const {
codeImageUrl
} = this.data;
wx.showLoading({
title: '保存中...',
mask: true
});
wx.downloadFile({
url: codeImageUrl,
success: res => {
if (res.statusCode === 200) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
wx.hideLoading();
wx.showToast({
title: '保存成功',
icon: 'success'
});
},
fail: err => {
wx.hideLoading();
wx.showToast({
title: '保存失败',
icon: 'none'
});
console.error('saveImageToPhotosAlbum 失败', err);
}
});
}
},
fail: err => {
wx.hideLoading();
wx.showToast({
title: '下载失败',
icon: 'none'
});
console.error('downloadFile 失败', err);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,36 @@
<!-- pages/course/applyPromotion/applyPromotion.wxml -->
<view class="flex-col page">
<view class="flex-col items-center group">
<!-- 生成推广码按钮,文字垂直居中,点击触发 handleGenerate -->
<view class="flex-col justify-center items-center text-wrapper" bindtap="handleGenerate">
<text class="font text">{{buttonText}}</text>
</view>
<!-- 只有当 showCode 为 true 时才显示推广码图片 -->
<image
wx:if="{{showCode}}"
class="mt-12 image"
src="{{codeImageUrl}}"
/>
<!-- 只有当 showCode 为 true 时才显示保存图片按钮,且垂直居中 -->
<view
wx:if="{{showCode}}"
class="mt-12 flex-col justify-center items-center text-wrapper_2"
bindtap="saveImage"
>
<text class="font">保存图片</text>
</view>
</view>
<view class="flex-col section">
<view class="flex-row items-center group_2">
<image
class="image_2"
src="./image/wenhao.png"
/>
<text class="ml-6 font text_2">推广码说明</text>
</view>
<view class="section_2"></view>
</view>
</view>

View File

@ -0,0 +1,61 @@
/* pages/course/applyPromotion/applyPromotion.wxss */
.page {
background-color: #f6f7f9;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.group {
padding: 69.38rpx 0 52.5rpx;
}
/* 上下居中改由 justify-center 控制,无需修改原有 padding */
.text-wrapper {
padding: 30rpx 0 30rpx;
background-color: #a5d63f;
border-radius: 46.07rpx;
width: 395.63rpx;
}
.image {
width: 667.5rpx;
height: 763.13rpx;
}
.text-wrapper_2 {
padding: 30rpx 0 30rpx;
background-color: #ff8d1a;
border-radius: 46.07rpx;
width: 395.63rpx;
}
.section {
padding: 0 30rpx 60rpx;
background-color: #ffffff;
}
.group_2 {
padding: 35.63rpx 0 30rpx;
}
.image_2 {
width: 45rpx;
height: 45rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.99rpx;
color: #ffffff;
}
.text {
line-height: 28.29rpx;
}
.text_2 {
color: #000000;
font-size: 28.13rpx;
line-height: 26.19rpx;
}
.section_2 {
background-color: #ffffff00;
height: 813.75rpx;
border-left: solid 1.88rpx #000000;
border-right: solid 1.88rpx #000000;
border-top: solid 1.88rpx #000000;
border-bottom: solid 1.88rpx #000000;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,95 @@
import { baseUrl, globalImgUrl } from "../../../request";
import { decodeBase64 } from "../../../utils/decodebase64";
// pages/course/courseDetail/courseDetail.js
Page({
data: {
activeTab: 'intro', // 默认选中“课程简介”
activeIndex: null, // 默认没有任何标题被选中
cid: 0, // 课程ID
courseObj: '', // 课程对象
richText: '', // 课程概述富文本
globalImgUrl,
},
// 获取课程详情
getCourseDetail() {
const cid = this.data.cid;
wx.request({
url: baseUrl + '/course/query/id',
method: 'POST',
data: {
id: cid
},
header: {
Authorization :wx.getStorageSync('token'),
},
success : res => {
console.log(res);
if (res.data.code === 1) {
this.setData({
courseObj: res.data.data,
richText: decodeBase64(res.data.data.detail)
})
}
}
})
},
/** 切换选项卡 */
selectTab(e) {
const tab = e.currentTarget.dataset.tab;
this.setData({ activeTab: tab });
},
/** 选择课程标题 */
selectCourse(e) {
const index = e.currentTarget.dataset.index;
this.setData({
activeIndex: index // 设置选中的课程标题索引
});
},
// 跳转课程订单创建页面
gotoCourseOrder(e) {
const courseId = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/course/createCourseOrder/createCourseOrder?id=${courseId}`,
})
},
// 好像不要了
// 跳转申请推广页面
gotoApplyPromotion(e) {
const courseId = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/course/applyPromotion/applyPromotion?id=${courseId}`,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options);
this.setData({
cid: options.id,
})
this.getCourseDetail()
},
onReady() {},
onShow() {},
onHide() {},
onUnload() {},
onPullDownRefresh() {},
onReachBottom() {},
onShareAppMessage() {}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,36 @@
<view class="flex-col page">
<view class="flex-col">
<view class="flex-col">
<image class="image" src="{{ globalImgUrl + courseObj.image }}" />
<view class="flex-col section">
<view class="flex-row items-center group">
<view class="shrink-0 group_2">
<text class="text">{{ courseObj.discountPrice }}</text>
<text class="font text_2">元券后价</text>
</view>
<view class="ml-4 flex-col justify-start items-start shrink-0 relative group_3">
<text class="font text_3">{{ courseObj.originPrice }}元</text>
<view class="divider pos"></view>
</view>
</view>
<text class="group text_4 mt-9">{{ courseObj.name }}</text>
</view>
</view>
<view class="mt-26 flex-col section_2">
<view class="flex-row items-center group_4">
<image class="image_2" src="./image/cal.png" />
<text class="ml-6 font text_5">课程概述</text>
</view>
<rich-text class="section_3" nodes="{{ richText }}"></rich-text>
</view>
</view>
<view class="flex-row justify-between items-center section_4 mt-37">
<view class="flex-col items-center">
<image class="image_3" src="./image/messge.png" />
<text class="text_7 mt-1">咨询</text>
</view>
<view class="flex-col justify-start items-center text-wrapper" bind:tap="gotoCourseOrder" data-id="{{ courseObj.id }}">
<text class="text_6">立即购买</text>
</view>
</view>
</view>

View File

@ -0,0 +1,131 @@
.mt-9 {
margin-top: 16.88rpx;
}
.mt-37 {
margin-top: 69.38rpx;
}
.mt-1 {
margin-top: 1.88rpx;
}
.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; /* 确保它在最上层 */
}
.image_3 {
width: 52.5rpx;
height: 52.5rpx;
}
.text_7 {
color: #000000;
font-size: 22.5rpx;
font-family: SourceHanSansCN;
line-height: 20.94rpx;
}
.text-wrapper {
padding: 22.5rpx 0 18.75rpx;
background-color: #ff8d1a;
border-radius: 75rpx;
width: 268.13rpx;
height: 71.25rpx;
}
.text_6 {
color: #ffffff;
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.11rpx;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,118 @@
import { baseUrl, globalImgUrl } from "../../../request";
// pages/course/courseList/courseList.js
Page({
/**
* 页面的初始数据
*/
data: {
courseList:[], // 课程列表
courseType: '', // 课程类别
globalImgUrl,
},
// 跳转课程详情页面
gotoCourseDetail(e) {
const courseId = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/course/courseDetail/courseDetail?id=${courseId}` ,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 接收路由参数 type 作为搜索关键字
const courseType = options.type || '';
this.setData({ courseType }, () => {
this.fetchCourseList();
});
},
// 从后端拉取课程列表
fetchCourseList() {
wx.request({
url: baseUrl + '/course/query/type',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
templateString: this.data.courseType
},
success: res => {
console.log('课程列表',res.data.data);
if (res.data.code === 1) {
this.setData({
courseList: res.data.data
});
} else {
wx.showToast({
icon: 'none',
title: res.data.message || '获取课程失败',
});
}
},
fail: err => {
console.error('request failed', err);
wx.showToast({
icon: 'none',
title: '网络请求失败',
});
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,39 @@
<view class="flex-col page">
<text class="self-center text">{{ courseType }}</text>
<image class="shrink-0 self-start image image_2" src="./image/line.png" />
<image class="shrink-0 self-end image image_3" src="./image/line.png" />
<view class="flex-col self-stretch list">
<!-- 遍历接口返回的 items 数组 -->
<view
class="flex-col list-item"
wx:for="{{courseList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="id"
>
<view
class="flex-row items-center relative group"
bindtap="gotoCourseDetail"
data-id="{{item.id}}"
>
<!-- 课程封面 -->
<image
class="shrink-0 image_4"
src="{{ globalImgUrl + item.image}}"
mode="aspectFill"
/>
<view class="flex-col flex-1 ml-12">
<!-- 课程名称 -->
<text class="font">{{item.name}}</text>
<view class="flex-row justify-between items-baseline mt-17">
<!-- 卷后价格 -->
<text class="font_2">券后{{item.discountPrice}}元起</text>
<!-- 已有下单人数 -->
<text class="font_3">{{item.orderCount}}人学习</text>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,63 @@
/* pages/course/courseList/courseList.wxss */
.mt-17 {
margin-top: 31.88rpx;
}
.page {
/* padding: 38.53rpx 0 ; */
background-color: #ffffff;
height: 100%;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
}
.text {
color: #000000;
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.64rpx;
}
.image {
width: 255rpx;
height: 1.88rpx;
}
.image_2 {
margin-left: 40.78rpx;
margin-top: -14.7rpx;
}
.image_3 {
margin-right: 37.97rpx;
}
.list {
padding-top: 20.21rpx;
}
.list-item {
height: 178.13rpx;
}
.group {
margin: -18.24rpx 29.46rpx 0 35.63rpx;
padding: 57.19rpx 0 26.27rpx;
border-bottom: solid 1.88rpx #d6d6d6;
}
.image_4 {
border-radius: 9.38rpx;
width: 208.13rpx;
height: 133.13rpx;
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 31.88rpx;
color: #000000;
}
.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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

View File

@ -0,0 +1,201 @@
import { baseUrl } from "../../../request";
// pages/course/courseOrderList/courseOrderList.js
Page({
data: {
orderList: [], // 后端返回的订单列表
hasModalShown: false, // 弹框只显示一次
isMaskVisible: false
},
onLoad(options) {
this.fetchOrders();
},
onHide() {
clearInterval(this._timer);
},
onUnload() {
clearInterval(this._timer);
},
onShow() {
this.fetchOrders()
},
// 拉取后端接口
fetchOrders() {
wx.request({
url: baseUrl + '/courseOrder/query/list', // 替换为真实接口
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
success: res => {
console.log('课程订单列表---->',res.data.data);
if (res.data.code === 1) {
const now = Date.now();
let list = res.data.data.map(item => {
// 计算从 createTime 到 now 剩余秒数
const createMs = new Date(item.createTime.replace(/-/g,'/')).getTime();
let diff = Math.floor((createMs + 15*60*1000 - now) / 1000);
// 只有“待支付”才需要倒计时、过期置“交易取消”
if (item.orderStatus === '待支付') {
if (diff <= 0) {
item.orderStatus = '交易取消';
diff = 0;
// 首次检测到过期就弹框
if (!this.data.hasModalShown) {
wx.showModal({
title: '提示',
content: '订单超时未支付,已取消',
showCancel: false
});
this.setData({ hasModalShown: true });
}
}
item.countDown = diff;
const m = Math.floor(diff / 60);
const s = diff % 60;
item.countDownStr = `${m}${s < 10 ? '0'+s : s}`;
} else {
item.countDown = 0;
item.countDownStr = '';
}
return item;
});
this.setData({ orderList: list }, () => {
// 初始处理完后启动全局定时器
this.startTimer();
});
} else {
wx.showToast({ title: res.data.message || '获取失败', icon: 'none' });
}
},
fail: () => {
wx.showToast({ title: '网络错误', icon: 'none' });
}
});
},
// 每秒更新所有待支付订单的倒计时
startTimer() {
// ← 新增:如果已有定时器,先清掉它
if (this._timer) {
clearInterval(this._timer);
}
this._timer = setInterval(() => {
const updated = this.data.orderList.map(item => {
if (item.orderStatus === '待支付' && item.countDown > 0) {
const cd = item.countDown - 1;
item.countDown = cd;
const m = Math.floor(cd / 60);
const s = cd % 60;
item.countDownStr = `${m}${s < 10 ? '0'+s : s}`;
if (cd <= 0) {
item.orderStatus = '交易取消';
item.countDownStr = '';
if (!this.data.hasModalShown) {
wx.showModal({
title: '提示',
content: '订单超时未支付,已取消',
showCancel: false
});
this.setData({ hasModalShown: true });
}
}
}
return item;
});
this.setData({ orderList: updated });
}, 1000);
},
showIsPayModal(e) {
const orderId = e.currentTarget.dataset.orderId;
wx.showModal({
title: '下单成功',
content: '您确定要支付吗?',
cancelText: '取消',
confirmText: '确定',
success: (res) => {
if (res.confirm) {
this.payOrder(orderId);
} else if (res.cancel) {
this.setData({ isMaskVisible: false });
}
},
fail: () => {
wx.hideLoading();
wx.showToast({
title: '网络错误,下单失败',
icon: 'none'
});
}
});
},
payOrder(orderId) {
// 同样先显示遮罩
this.setData({ isMaskVisible: true });
wx.showLoading({ title: '支付中...'});
wx.request({
url: baseUrl + '/courseOrder/payment',
method: 'POST',
header: { Authorization: wx.getStorageSync('token') },
data: { id: orderId},
success: res => {
wx.hideLoading();
if (res.data.code === 1) {
// 支付成功,跳转详情页
wx.redirectTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
success: res => {
// 先把遮罩关掉
this.setData({ isMaskVisible: false });
}
});
} else {
this.setData({ isMaskVisible: false });
wx.showToast({ title: res.data.message || '支付失败', icon: 'none' });
}
},
fail: () => {
wx.hideLoading();
this.setData({ isMaskVisible: false });
wx.showToast({ title: '网络错误,支付失败', icon: 'none' });
}
});
},
// 跳转订单详情
gotoOrderDetail(e) {
const orderId = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
})
},
// 取消订单
cancelOrder(e) {
// console.log(e);
const id = e.currentTarget.dataset.id;
wx.showModal({
title: '取消订单',
content: '是否要取消订单?',
success: res => {
if (res.confirm) {
wx.request({
url: baseUrl + "/courseOrder/cancel",
method: 'POST',
data: { courseId: id },
header: { Authorization: wx.getStorageSync('token') },
success: () => this.fetchOrders()
});
}
}
});
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,42 @@
<!-- pages/course/courseOrderList/courseOrderList.wxml -->
<view class="flex-col justify-start page">
<view class="flex-col group_1">
<view
class="flex-col list-item mt-17"
wx:for="{{orderList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="item"
bind:tap="gotoOrderDetail"
data-id="{{ item.id }}"
>
<view class="flex-row self-stretch group">
<text class="font text">订单号:{{item.orderNumber}}</text>
<text class="font_2">{{ item.orderStatus }}</text>
</view>
<text class="self-stretch font_3 text_2">{{ item.name }}</text>
<text class="self-end font_4 text_3">¥{{ item.totalAmount }}</text>
<!-- 倒计时,只在“待支付”时显示 -->
<text wx:if="{{ item.orderStatus === '待支付' }}" class="self-end font_5 text_4">
请在 {{ item.countDownStr }} 内完成支付
</text>
<view class="flex-row justify-between items-center self-stretch group_2">
<text class="font_6 text_5">{{ item.createTime }}</text>
<view class="flex-row">
<!-- 仅待支付时可操作 -->
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper" catch:tap="cancelOrder" data-id="{{ item.id }}">
<text class="font_7">取消订单</text>
</view>
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper_2 ml-11" catch:tap="showIsPayModal"
data-order-id="{{ item.id }}">
<text class="font_8">支付</text>
</view>
</view>
</view>
</view>
</view>
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
</view>

View File

@ -0,0 +1,134 @@
/* pages/course/courseOrderList/courseOrderList.wxss */
.mt-17 {
margin-top: 31.88rpx;
}
.ml-37 {
margin-left: 92.38rpx;
}
.ml-11 {
margin-left: 20.63rpx;
}
.page-mask {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background-color: rgba(0, 0, 0, 0.3);
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;
display: flex;
justify-content: space-between;
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #696969;
}
.text {
line-height: 24.02rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #f84947;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 35.63rpx;
color: #000000;
}
.text_2 {
margin-top: 25.69rpx;
}
.font_4 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #3d3d3d;
}
.text_3 {
margin-top: 58.09rpx;
line-height: 22.76rpx;
margin-right: 22rpx; /* 向左移动:增加右侧间距 */
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 26.32rpx;
color: #f84947;
}
.text_4 {
margin-right: 7.13rpx;
margin-top: 34.91rpx;
font-size: 28.13rpx;
}
.group_2 {
margin-right: 20.87rpx;
margin-top: 30.30rpx;
padding: 15.94rpx 0 17.81rpx;
border-top: solid 1.88rpx #e3e3e3;
}
.font_6 {
font-size: 22.5rpx;
font-family: SourceHanSansCN;
line-height: 26.25rpx;
color: #a1a1a1;
}
/* .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;
}
.font_7 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #ff8d1a;
}
.text-wrapper_2 {
padding: 11.89rpx 0 8.94rpx;
background-color: #ff8d1a;
border-radius: 9.38rpx;
width: 140.63rpx;
height: 45rpx;
}
.font_8 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #ffffff;
}

View File

@ -0,0 +1,66 @@
// pages/course/courseSettlementRecord/courseSettlementRecord.js
Page({
/**
* 页面的初始数据
*/
data: {
items: [null,null,null]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,55 @@
<!-- pages/course/courseSettlementRecord/courseSettlementRecord.wxml -->
<view class="flex-col page">
<text class="self-center text">结算记录</text>
<view class="mt-14 flex-col self-stretch">
<view class="flex-row items-center section">
<image
class="image"
src="https://ide.code.fun/api/image?token=685b63c64ae84d0012336c74&name=1e77401cdad84f355f02111ca86729e8.png"
/>
<text class="text_2 ml-3">请输入下单用户</text>
</view>
<view class="flex-col list">
<view class="flex-col list-item mt-13" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<!-- 课程标题区保持不变 -->
<view class="flex-row group">
<image
class="shrink-0 image_2"
src="https://ide.code.fun/api/image?token=685b63c64ae84d0012336c74&name=6ea8ffd561d2d1408e5cbb4f5ee10374.png"
/>
<text class="flex-1 self-start font text_3 ml-11">【早鸟42折】掌握CAD技能实战技能实战技能实战工作训练营</text>
</view>
<!-- 重新拆分为单行对齐 -->
<view class="flex-row justify-between group_row">
<text class="font_2">下单用户</text>
<text class="font text_5">{{item.user || 'user_cxz'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">课程价格</text>
<text class="font_3">{{item.price || '¥168'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">下单数量</text>
<text class="font_4">{{item.count || '×1'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">下单时间</text>
<text class="font text_11 nowrap">{{item.orderTime || '2025-06-14 18:30:00'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">抽成比例</text>
<text class="font_5 text_13">{{item.rate || '%10'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">抽成补贴</text>
<text class="font text_14">{{item.subsidy || '¥16.8'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">结算时间</text>
<text class="font text_11 nowrap">{{item.settlementTime || '2025-06-20 18:30:00'}}</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,117 @@
/* pages/course/courseSettlementRecord/courseSettlementRecord.wxss */
/* 新增统一行样式 */
.group_row {
margin-top: 22.5rpx;
/* 左右对齐 */
padding: 0 3.75rpx;
}
/* 取消 time 文本的宽度限制并防止换行 */
.text_11 {
/* 去掉原先 width: 240rpx; */
width: auto !important;
}
/* 防止文本换行 */
.nowrap {
white-space: nowrap;
}
/* 以下为原样式,未作改动 */
.ml-3 {
margin-left: 5.63rpx;
}
.mt-13 {
margin-top: 24.38rpx;
}
.ml-11 {
margin-left: 20.63rpx;
}
.page {
padding: 30rpx 37.5rpx 785.63rpx;
background-image: linear-gradient(180deg, #ff8d1a 0%, #ff8d1a00 31.5%);
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #ffffff;
font-size: 33.75rpx;
font-family: SourceHanSansCN;
line-height: 31.29rpx;
}
.section {
padding: 15rpx 18.75rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
}
.image {
width: 35.63rpx;
height: 35.63rpx;
}
.text_2 {
color: #b0b0b0;
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.94rpx;
}
.list {
padding-top: 22.5rpx;
}
.list-item {
padding: 22.5rpx 7.5rpx 22.5rpx 18.75rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
}
.list-item:first-child {
margin-top: 0;
}
.group {
margin-left: 3.75rpx;
margin-right: 22.5rpx;
}
.image_2 {
border-radius: 9.38rpx;
width: 196.88rpx;
height: 125.63rpx;
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 31.88rpx;
color: #000000;
}
.text_3 {
margin-top: 3.75rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.34rpx;
color: #000000;
}
.font_3 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 21.49rpx;
color: #fc2f35;
}
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 19.24rpx;
color: #000000;
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 21.49rpx;
color: #0ed062;
}
.text_13 {
/* margin-right: 15rpx; */
font-size: 28.13rpx;
}
.text_14 {
font-size: 28.13rpx;
}

View File

@ -0,0 +1,198 @@
import { baseUrl, globalImgUrl } from "../../../request";
// pages/course/createCourseOrder/createCourseOrder.js
Page({
/**
* 页面的初始数据
*/
data: {
courseId: 0, // 课程id
courseObj: '', // 课程对象
globalImgUrl, // 全局图片
isMaskVisible: false
},
// 创建订单方法
createOrder() {
const { courseId } = this.data;
// 1. 显示遮罩,阻止二次点击
this.setData({ isMaskVisible: true });
wx.showLoading({ title: '正在创建订单...' });
let orderId ;
wx.request({
url: baseUrl + '/courseOrder/add',
method: 'POST',
data: {
courseId: courseId
},
header: {
Authorization :wx.getStorageSync('token'),
},
success : res => {
orderId = res.data.data
this.setData({ orderId })
wx.hideLoading();
if (res.data.code === 1) {
this.showIsPayModal(orderId)
} else {
// 下单失败,关闭遮罩
this.setData({ isMaskVisible: false });
wx.showModal({
title: '下单失败',
content: res.data.message || '下单失败',
showCancel: false,
confirmText: '知道了'
});
}
},
fail: () => {
wx.hideLoading();
this.setData({ isMaskVisible: false });
wx.showToast({ title: '网络错误,下单失败', icon: 'none' });
}
})
},
showIsPayModal(orderId) {
wx.showModal({
title: '下单成功',
content: '您确定要支付吗?',
cancelText: '取消',
confirmText: '确定',
success: (res) => {
if (res.confirm) {
this.payOrder(orderId);
} else if (res.cancel) {
wx.navigateTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
success: res => {
// 先把遮罩关掉
this.setData({ isMaskVisible: false });
}
});
}
},
fail: () => {
wx.hideLoading();
wx.showToast({
title: '网络错误,下单失败',
icon: 'none'
});
}
});
},
payOrder(orderId) {
// 同样先显示遮罩
this.setData({ isMaskVisible: true });
wx.showLoading({ title: '支付中...'});
wx.request({
url: baseUrl + '/courseOrder/payment',
method: 'POST',
header: { Authorization: wx.getStorageSync('token') },
data: { id: orderId },
success: res => {
wx.hideLoading();
if (res.data.code === 1) {
// 支付成功,跳转详情页
wx.navigateTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
success: res => {
// 先把遮罩关掉
this.setData({ isMaskVisible: false });
}
});
} else {
this.setData({ isMaskVisible: false });
wx.showToast({ title: res.data.message || '支付失败', icon: 'none' });
}
},
fail: () => {
wx.hideLoading();
this.setData({ isMaskVisible: false });
wx.showToast({ title: '网络错误,支付失败', icon: 'none' });
}
});
},
// 获取课程详情
getCourseDetail() {
const cid = this.data.courseId;
wx.request({
url: baseUrl + '/course/detail/id',
method: 'POST',
data: {
id: cid
},
header: {
Authorization :wx.getStorageSync('token'),
},
success : res => {
console.log(res);
if (res.data.code === 1) {
this.setData({
courseObj: res.data.data,
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('课程id--->',options.id);
this.setData({
courseId: options.id,
})
this.getCourseDetail()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,48 @@
<!-- pages/course/createCourseOrder/createCourseOrder.wxml -->
<view class="flex-col page">
<view class="flex-col content">
<view class="flex-row items-center section">
<image
class="shrink-0 image"
src="{{ globalImgUrl + courseObj.image }}"
/>
<view class="flex-col flex-1 ml-11">
<text class="self-start text">{{ courseObj.name }}</text>
<view class="flex-row items-center self-stretch group mt-15">
<text class="text_2">¥{{ courseObj.discountPrice }}</text>
<view class="flex-col justify-start relative ml-1">
<text class="text_3">¥{{ courseObj.originPrice }}</text>
<view class="divider pos"></view>
</view>
</view>
</view>
</view>
<view class="flex-row justify-between items-center section_2 mt-14">
<text class="font">商品价格</text>
<text class="font text_4">¥{{ courseObj.discountPrice }}</text>
</view>
<view class="flex-row justify-between items-center section_3 mt-14">
<view class="flex-row items-center">
<image
class="shrink-0 image_2"
src="./image/wxpay.png"
/>
<text class="font ml-12">微信支付</text>
</view>
<radio-group class="image_3">
<radio checked="true"></radio>
</radio-group>
</view>
</view>
<!-- 固定在底部的区域 -->
<view class="footer">
<view class="flex-row justify-between items-center section_4">
<text class="font text_5">应付¥{{ courseObj.discountPrice }}</text>
<view class="flex-col justify-center items-center text-wrapper" bindtap="createOrder">
<text class="font text_6">立即支付</text>
</view>
</view>
</view>
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
</view>

View File

@ -0,0 +1,126 @@
.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;
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; /* 垂直居中 */
}
.text_6 {
color: #ffffff;
line-height: 28.11rpx;
}
.footer {
margin-top: auto;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,130 @@
import { baseUrl } from "../../../request";
const { globalImgUrl } = require("../../../request")
// pages/course/homepage/homepage.js
Page({
data: {
// 初始时置空,待接口返回后再渲染
banners: [
'./image/banner.png',
'./image/banner.png',
'./image/banner.png',
'./image/banner.png'
],
courseList: [],
globalImgUrl
},
// 跳转课程列表页
gotoCourseList(e) {
const courseType = e.currentTarget.dataset.type;
wx.navigateTo({
url: `/pages/course/courseList/courseList?type=${courseType}`,
});
},
// 跳转课程详情
gotoCourseDetail(e) {
const courseId = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/course/courseDetail/courseDetail?id=${courseId}`,
});
},
// 跳转课程搜索页面
gotoSearch() {
wx.navigateTo({
url: '/pages/course/searchCourses/searchCourses',
});
},
// 获取热门课程
getCourseList() {
// 请求后端接口
wx.request({
url: baseUrl + '/course/query/hot', // ← 替换为真实接口
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
success: (res) => {
if (res.data.code === 1) {
console.log('课程列表---->',res.data.data);
// 将后端的 data 数组绑定到 items
this.setData({
courseList: res.data.data
});
} else {
wx.showToast({
title: res.data.message || '获取课程数据失败',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '网络异常,请稍后重试',
icon: 'none'
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getCourseList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,50 @@
<view class="flex-col page">
<view class="flex-col self-stretch group">
<view class="flex-row justify-center items-center section" bind:tap="gotoSearch">
<image class="image" src="./image/sousuo.png" />
<text class="text ml-3">搜索更多好课</text>
</view>
<swiper class="swiper" autoplay="true" circular="true" interval="3000" circular="true">
<block wx:for="{{banners}}" wx:for-item="img" wx:key="index">
<swiper-item>
<image src="{{img}}" class="swiper-image" mode="aspectFill" />
</swiper-item>
</block>
</swiper>
</view>
<view class="flex-row equal-division">
<view class="flex-col items-center group_2 group_1" bind:tap="gotoCourseList" data-type="{{ '考编' }}">
<image class="image_3" src="./image/kgky.png" />
<text class="font text_1 mt-12">考编</text>
</view>
<view class="flex-col items-center group_2 group_3" bind:tap="gotoCourseList" data-type="{{ '考公' }}">
<image class="image_3" src="./image/zmt.png" />
<text class="font text_3 mt-12">考公</text>
</view>
<view class="flex-col items-center group_2 group_4" bind:tap="gotoCourseList" data-type="{{ '考证' }}">
<image class="image_3" src="./image/cj.png" />
<text class="font text_4 mt-12">考证</text>
</view>
</view>
<text class="self-start text_2">热门课程</text>
<view class="flex-col self-stretch list">
<!-- items 数组循环 -->
<view class="flex-row relative group_5" wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="item.id">
<view bind:tap="gotoCourseDetail" data-id="{{item.id}}">
<view class="list-divider pos_3"></view>
<!-- 绑定课程封面图 -->
<image class="image_4 pos" src="{{ globalImgUrl + item.image}}" />
<view class="flex-col group_6 pos_2">
<!-- 绑定课程名称 -->
<text class="font_2">{{item.name}}</text>
<view class="flex-row justify-between items-baseline mt-17">
<!-- 绑定卷后价格 -->
<text class="font_3">券后{{item.discountPrice}}元起</text>
<!-- 绑定下单/学习人数 -->
<text class="font_4">{{item.orderCount}}人学习</text>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,142 @@
.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%;
}
.group {
padding-left: 30rpx;
padding-right: 28.13rpx;
}
.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;
}
.swiper {
border-radius: 9.38rpx;
width: 691.88rpx;
height: 324.38rpx;
margin-top: 22.5rpx;
}
/* 轮播图图片 */
.swiper-image {
width: 100%;
height: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,194 @@
import { baseUrl, globalImgUrl } from "../../../request";
Page({
data: {
countdown: '',
orderId: 0,
orderObj: {}, // 订单详情对象
_secondsRemaining: 0, // 内部倒计时秒数
_hasShownTimeout: false, // 是否已弹过“超时未支付”弹窗
globalImgUrl,
isMaskVisible: false
},
onLoad(options) {
console.log('options---->',options);
this.setData({ orderId: options.id });
this.getOrderDetail();
},
showIsPayModal() {
const {orderId} = this.data
wx.showModal({
title: '下单成功',
content: '您确定要支付吗?',
cancelText: '取消',
confirmText: '确定',
success: (res) => {
if (res.confirm) {
this.payOrder(orderId);
} else if (res.cancel) {
this.setData({ isMaskVisible: false });
}
},
fail: () => {
wx.hideLoading();
wx.showToast({
title: '网络错误,下单失败',
icon: 'none'
});
}
});
},
payOrder(orderId) {
// 同样先显示遮罩
this.setData({ isMaskVisible: true });
wx.showLoading({ title: '支付中...'});
wx.request({
url: baseUrl + '/courseOrder/payment',
method: 'POST',
header: { Authorization: wx.getStorageSync('token') },
data: { id: orderId},
success: res => {
wx.hideLoading();
if (res.data.code === 1) {
// 支付成功,跳转详情页
wx.redirectTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
success: res => {
// 先把遮罩关掉
this.setData({ isMaskVisible: false });
}
});
} else {
this.setData({ isMaskVisible: false });
wx.showToast({ title: res.data.message || '支付失败', icon: 'none' });
}
},
fail: () => {
wx.hideLoading();
this.setData({ isMaskVisible: false });
wx.showToast({ title: '网络错误,支付失败', icon: 'none' });
}
});
},
onUnload() {
clearInterval(this._timer);
},
// 拉取订单详情并初始化倒计时
getOrderDetail() {
wx.request({
url: baseUrl + '/courseOrder/query/detail',
method: 'POST',
data: { id: this.data.orderId },
header: { Authorization: wx.getStorageSync('token') },
success: res => {
console.log('订单详情--->',res.data.data);
if (res.data.code !== 1) return wx.showToast({ title: res.data.message, icon: 'none' });
const order = res.data.data;
this.setData({ orderObj: order });
// 仅“待支付”需要倒计时
if (order.orderStatus === '待支付') {
this._initFromCreateTime(order.createTime);
}
},
fail: () => wx.showToast({ title: '网络错误', icon: 'none' })
});
},
// 计算剩余秒数并启动定时器
_initFromCreateTime(createTime) {
// 将 "2025-07-13 12:38:17" → 时间戳
const createMs = new Date(createTime.replace(/-/g, '/')).getTime();
const now = Date.now();
let diff = Math.floor((createMs + 15 * 60 * 1000 - now) / 1000);
if (diff <= 0) {
// 已超时
this._handleTimeout();
} else {
// 未超时,初始化秒数并启动倒计时
this.setData({
_secondsRemaining: diff,
countdown: this._format(diff)
});
this._startTimer();
}
},
// 每秒递减
_startTimer() {
this._timer = setInterval(() => {
let sec = this.data._secondsRemaining - 1;
if (sec <= 0) {
clearInterval(this._timer);
this._handleTimeout();
} else {
this.setData({
_secondsRemaining: sec,
countdown: this._format(sec)
});
}
}, 1000);
},
// 超时处理:弹窗 + 改状态
_handleTimeout() {
if (!this.data._hasShownTimeout) {
wx.showModal({
title: '提示',
content: '订单超时未支付,已取消',
showCancel: false
});
this.setData({ _hasShownTimeout: true });
}
// 更新状态并隐藏倒计时
const o = this.data.orderObj;
o.orderStatus = '交易取消';
this.setData({
orderObj: o,
countdown: '00分00秒'
});
},
// 秒数 → "MM分SS秒"
_format(sec) {
const m = Math.floor(sec / 60);
const s = sec % 60;
const mm = m < 10 ? '0' + m : m;
const ss = s < 10 ? '0' + s : s;
return `${mm}${ss}`;
},
// 取消订单
cancelOrder() {
wx.showModal({
title: '取消订单',
content: '是否要取消订单?',
success: res => {
if (res.confirm) {
wx.request({
url: baseUrl + "/courseOrder/cancel",
method: 'POST',
data: { courseId: this.data.orderId },
header: { Authorization: wx.getStorageSync('token') },
success: () => this.getOrderDetail()
});
}
}
});
},
// 去支付(示例跳转)
goPay() {
// wx.navigateTo({ url: `/pages/pay/pay?orderId=${this.data.orderId}` });
wx.showToast({ title: '支付功能稍后开放', icon: 'none' });
},
// 退款(示例弹窗)
refundOrder() {
wx.showToast({ title: '退款功能稍后开放', icon: 'none' });
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,88 @@
<view class="flex-col page">
<view class="flex-col group">
<view class="flex-col section">
<!-- 订单状态 + 倒计时 -->
<view class="flex-row justify-between self-stretch group_2">
<text class="font">订单状态</text>
<view class="flex-row group_3">
<text class="font_2 text" wx:if="{{ orderObj.orderStatus === '待支付' }}">请在{{countdown}}内完成支付</text>
<text class="font_2 text_2 ml-37">{{ orderObj.orderStatus }}</text>
</view>
</view>
<!-- 课程信息 -->
<view class="flex-row self-stretch group_4 mt-15">
<image
class="shrink-0 image"
src="{{ globalImgUrl + orderObj.image }}"
/>
<text class="flex-1 self-start font_3 text_3 ml-7">
{{ orderObj.name }}
</text>
</view>
<!-- 课程价格 -->
<text class="self-end font_3 text_4 mt-15">¥{{ orderObj.originPrice }}</text>
</view>
<!-- 订单详情 -->
<view class="mt-16 flex-col section_2">
<view class="self-start group_5">
<text class="font text_5">订单编号:</text>
<text class="font_4">{{ orderObj.orderNumber }}</text>
</view>
<view class="flex-row items-baseline self-start group_6">
<text class="shrink-0 font text_6">下单时间:</text>
<text class="flex-1 font_5 ml-3">{{ orderObj.createTime }}</text>
</view>
<view class="flex-col justify-start self-stretch relative group_7">
<view class="flex-col section_3">
<view class="self-stretch divider"></view>
<view class="flex-row self-stretch group_8 mt-17">
<text class="font text_7">支付方式:</text>
<text class="ml-8 font text_8">微信支付</text>
</view>
<view class="flex-row items-center self-stretch mt-17">
<text class="font text_9">交易号:</text>
<!-- TODO -->
<text class="font_4 ml-23">4002506191307440406460485418</text>
</view>
<text class="self-start font text_10 mt-17" wx:if="{{ orderObj.orderStatus === '交易成功' }}">交付时间:</text>
</view>
<text class="font_5 text_11 pos" wx:if="{{ orderObj.orderStatus === '交易成功' }}">{{ orderObj.updateTime }}</text>
</view>
</view>
<!-- 价格明细 -->
<view class="mt-16 flex-col section_4">
<view class="flex-row justify-between items-center">
<text class="font text_12">课程价格</text>
<text class="font_4">¥{{ orderObj.originPrice }}</text>
</view>
<view class="flex-row justify-between items-center mt-11">
<text class="font text_13">价格折扣</text>
<text class="font_4 text_14">-¥{{ orderObj.originPrice - orderObj.totalAmount }}</text>
</view>
<view class="flex-row justify-between items-center group_9 mt-11">
<text class="font_2 text_15">订单金额</text>
<text class="font_4 text_16">¥{{ orderObj.totalAmount }}</text>
</view>
</view>
</view>
<!-- 底部按钮:待支付 -->
<view class="flex-row bottom-buttons" wx:if="{{ orderObj.orderStatus === '待支付' }}">
<view class="flex-col justify-start items-center text-wrapper" bindtap="cancelOrder">
<text class="font_3 text_17">取消</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="showIsPayModal">
<text class="font_3 text_18">立即支付</text>
</view>
</view>
<!-- 底部按钮:已支付 -->
<view class="flex-row bottom-buttons" wx:if="{{ orderObj.orderStatus === '已支付' }}">
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="refundOrder">
<text class="font_3 text_18">退款</text>
</view>
</view>
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
</view>

View File

@ -0,0 +1,224 @@
.ml-37 {
margin-left: 69.38rpx;
}
.ml-7 {
margin-left: 13.13rpx;
}
.mt-15 {
margin-top: 28.13rpx;
}
.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);
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;
}
/* 调整首屏 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;
}
/* 订单详情区 */
.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%;
display: flex;
justify-content: space-between;
background-color: #ffffff; /* 可以根据需要设置背景色 */
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View File

@ -0,0 +1,67 @@
// pages/course/recommendUser/recommendUser.js
Page({
/**
* 页面的初始数据
*/
data: {
items: [null, null, null],
items_1: [null, null, null],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,78 @@
<view class="flex-col page">
<view class="flex-col">
<text class="self-center text">我推荐的用户</text>
<!-- 直推用户 -->
<text class="self-start font text_2">直推用户</text>
<view class="flex-col self-stretch section view">
<!-- 表头 -->
<view class="flex-row justify-between group">
<text class="font_2 text_3">用户名</text>
<text class="font_2">给我创造的收益</text>
<text class="font_2 text_4">绑定时间</text>
<text class="font_2 text_5">联系</text>
</view>
<!-- 列表项 -->
<view class="flex-col mt-13">
<view
class="list-item mt-13"
wx:for="{{items}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-row justify-between">
<!-- 用户名:固定宽度、任意字符处断行 -->
<text class="font_3 name">{{item.userName || 'user_cxzsdfdfs'}}</text>
<view class="flex-row items-center">
<text class="font_4">¥{{item.revenue || '160.00'}}</text>
<view class="flex-row items-center shrink-0 ml-35">
<text class="font_4">{{item.bindTime || '2025-06-20'}}</text>
<image
class="shrink-0 image ml-27"
src="./image/right.png"
/>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 间推用户 -->
<view class="mt-36 flex-col">
<text class="self-start font text_6">间推用户</text>
<view class="mt-14 flex-col self-stretch section">
<view class="flex-row justify-between group">
<text class="font_2 text_3">用户名</text>
<text class="font_2">给我创造的收益</text>
<text class="font_2 text_4">绑定时间</text>
<text class="font_2 text_5">联系</text>
</view>
<view class="flex-col mt-13">
<view
class="list-item_2 mt-13"
wx:for="{{items_1}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-row justify-between">
<text class="font_3 name">{{item.userName || 'user_cxzsdfdfs'}}</text>
<view class="flex-row items-center">
<text class="font_4">¥{{item.revenue || '160.00'}}</text>
<view class="flex-row items-center shrink-0 ml-35">
<text class="font_4">{{item.bindTime || '2025-06-20'}}</text>
<image
class="shrink-0 image ml-27"
src="./image/right.png"
/>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,122 @@
/*=========== 公共间距 ===========*/
.ml-35 {
margin-left: 65.63rpx;
}
.ml-27 {
margin-left: 50.63rpx;
}
.mt-13 {
margin-top: 24.38rpx;
}
/*=========== 页面整体 ===========*/
.page {
padding: 37.76rpx 41.25rpx 980.63rpx;
background-image: linear-gradient(180deg, #ff8d1a 0%, #ff8d1a00 27%);
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
/*=========== 文本样式,均放大一号 ===========*/
/* 主标题 “我推荐的用户” */
.text {
color: #ffffff;
font-size: 36rpx; /* 原 33.75rpx → 36rpx */
line-height: 34rpx; /* 对应行高 */
font-family: SourceHanSansCN;
}
/* 次级标题 “直推用户”/“间推用户” */
.text_2 {
margin-top: 40.42rpx;
color: #ffffff;
font-size: 36rpx; /* 新增字号 */
line-height: 34rpx;
font-family: SourceHanSansCN;
}
/* 通用白字 */
.font {
font-size: 33rpx; /* 原 30rpx → 33rpx */
line-height: 30rpx;
color: #ffffff;
font-family: SourceHanSansCN;
}
/* 卡片容器 */
.section {
padding: 27.66rpx 27.09rpx 22.67rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
}
.view {
margin-top: 25.58rpx;
}
.group {
padding-left: 14.06rpx;
}
/* 表头文字 */
.font_2 {
font-size: 30rpx; /* 原 26.25rpx → 30rpx */
line-height: 28rpx;
color: #323232;
font-family: SourceHanSansCN;
}
/* 表格内容:收益、时间 */
.font_4 {
font-size: 30rpx; /* 原 26.25rpx → 30rpx */
line-height: 23rpx;
color: #323232;
font-family: SourceHanSansCN;
}
/* 小图标 */
.image {
width: 30rpx;
height: 30rpx;
}
/* “间推用户”前缀 */
.text_6 {
margin-left: 2.74rpx;
color: #323232;
font-size: 30rpx; /* 新增字号 */
line-height: 28rpx;
font-family: SourceHanSansCN;
}
/* 用户名文字,放大一号 */
.font_3 {
font-size: 30rpx; /* 原 26.25rpx → 30rpx */
line-height: 36rpx; /* 支持两行 */
color: #323232;
font-family: SourceHanSansCN;
}
/*=========== 新增:用户名自动换行 ===========*/
/* 固定宽度在“sdfdfs”处自动断行 */
.name {
flex: none; /* 关闭 flex 自动拉伸 */
width: 127rpx; /* 根据字符长度微调200rpx 在 “user_cxz” 后换行 */
word-break: break-all; /* 任意字符处断行 */
white-space: normal; /* 允许多行 */
margin-right: 50rpx;
}
/* 列表条目顶部对齐,支持多行用户名 */
.list-item,
.list-item_2 {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
margin-right: 12.28rpx;
}
.list-item:first-child,
.list-item_2:first-child {
margin-top: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

View File

@ -0,0 +1,98 @@
// pages/course/searchCourses/searchCourses.js
import { baseUrl, globalImgUrl } from "../../../request";
Page({
/**
* 页面的初始数据
*/
data: {
courseList: [],
searchKeyword: '',
globalImgUrl,
},
// 每次用户输入都会进这里
onSearchInput(e) {
this.setData({
searchKeyword: e.detail.value
});
},
gotoCourseDetail(e) {
const courseId = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/course/courseDetail/courseDetail?id=${courseId}`,
});
},
onSearch() {
const token = wx.getStorageSync('token')
const { searchKeyword } = this.data
wx.request({
url: baseUrl + '/course/query/keyword',
header: {
Authorization: token
},
method: 'POST',
data: {
templateString: searchKeyword
},
success: res => {
let result = res.data.data
this.setData({courseList: result})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,26 @@
<!--pages/course/searchCourses/searchCourses.wxml-->
<view class="flex-col page">
<view class="flex-row items-center section">
<image
class="image"
src="./images/sousuo.png"
/>
<input class="text ml-3" placeholder="搜索更多好课" bindinput="onSearchInput" confirm-type="search" bindconfirm="onSearch"/>
</view>
<view class="flex-col list mt-17">
<view bind:tap="gotoCourseDetail" data-id="{{item.id}}" class="flex-row relative list-item" wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="list-divider pos_3"></view>
<image
class="image_2 pos"
src="{{globalImgUrl + item.image}}"
/>
<view class="flex-col group_2 pos_2">
<text class="font">{{item.name}}</text>
<view class="flex-row justify-between items-baseline mt-17">
<text class="font_2">券后{{item.discountPrice}}元起</text>
<text class="font_3">{{item.orderCount}}人学习</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,93 @@
/* 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%;
}
.section {
margin-left: 28.13rpx;
margin-right: 26.27rpx;
padding: 11.25rpx 24.38rpx;
background-color: #f2f2f2;
border-radius: 93.75rpx;
}
.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;
}
.list {
padding-top: 11.25rpx;
border-top: solid 1.88rpx #d1d1d1;
}
.list-item {
padding: 28.13rpx 29.46rpx 0 35.63rpx;
height: 189.39rpx;
}
.list-divider {
background-color: #d6d6d6;
height: 1.88rpx;
}
.pos_3 {
position: absolute;
left: 35.63rpx;
right: 33.81rpx;
top: 187.52rpx;
}
.image_2 {
border-radius: 9.38rpx;
width: 208.13rpx;
height: 133.13rpx;
}
.pos {
position: absolute;
left: 35.63rpx;
top: 50%;
transform: translateY(-50%);
}
.group_2 {
width: 453.49rpx;
}
.pos_2 {
position: absolute;
right: 29.46rpx;
top: 50%;
transform: translateY(-50%);
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 31.88rpx;
color: #000000;
}
.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;
}

View File

@ -0,0 +1,66 @@
// pages/course/waitPayOrder/waitPayOrder.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,2 @@
<!--pages/course/waitPayOrder/waitPayOrder.wxml-->
<text>pages/course/waitPayOrder/waitPayOrder.wxml</text>

View File

@ -0,0 +1,85 @@
import { baseUrl } from "../../../request";
// pages/dashboardModule/overviewPerformance/overviewPerformance.js
Page({
data: {
totalAmount: 0, // 订单总金额
netAmount: 0, // 净成交
promoCount: 0, // 客户数量
superCount: 0, // 主管数量
empCount: 0, // 员工数量
orderCount: 0, // 下单数量
toRelease: 0, // 待释放
toSettle: 0, // 可结算
settled: 0, // 已结算
refunded: 0, // 已退回
todayOrderCount: 0, // 今日下单数量
todayOrderAmount: 0, // 今日下单总金额
todayRefundCount: 0, // 今日退款数量
todayRefundAmount: 0, // 今日退款总金额
todayPromotionCount: 0, // 今日推广数量
monthOrderCount: 0, // 本月下单数量
monthOrderAmount: 0, // 本月下单总金额
monthRefundCount: 0, // 本月退款数量
monthRefundAmount: 0, // 本月退款总金额
monthPromotionCount: 0, // 本月推广数量
userRole: '', // 用户角色
isShowArr: [],
widthRate: '30%'
},
onLoad(options) {
console.log('--->',options);
this.fetchPerformance();
this.setData({
userRole: options.role
})
let showRole = '';
switch (options.role) {
case 'manager':
showRole = '经理';
break;
case 'supervisor':
showRole = '主管';
break;
case 'staff':
showRole = '员工';
break;
}
this.setData({ showRole });
if (options.role === 'manager') this.setData({isShowArr: [true, true, true]})
else if (options.role === 'supervisor') this.setData({isShowArr: [false, true, true]})
else if (options.role === 'staff') this.setData({isShowArr: [false, false, true]})
const trueCount = this.data.isShowArr.filter(v => v === true).length;
if (trueCount === 3) this.setData({widthRate: '30%'})
else if (trueCount === 2) this.setData({widthRate: '47.5%'})
else if (trueCount === 1) this.setData({widthRate: '100%'})
},
fetchPerformance() {
wx.request({
url: baseUrl + '/perform/mini/query/dashboard',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
success: (res) => {
if (res.data.code === 1) {
// 直接把后端 data 对象铺平到页面 data
this.setData(res.data.data);
} else {
wx.showToast({
title: res.data.message || '获取数据失败',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '请求失败',
icon: 'none'
});
}
});
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,96 @@
<view class="flex-col page">
<text class="self-center text">{{ showRole }}端绩效总览</text>
<view class="flex-col justify-start self-stretch relative group mt-41">
<view class="flex-col group_2">
<!-- 今日数据 -->
<view class="flex-row equal-division">
<view class="flex-col items-start equal-division-item section">
<text class="font_3 text_8">今日数据</text>
<text class="font text_10">今日下单数量</text>
<text class="font_2 text_12">{{todayOrderCount}}</text>
<text class="font text_14">今日订单总金额</text>
<text class="font_2 text_16">¥{{todayOrderAmount}}</text>
<text class="font text_18">今日退单数量</text>
<text class="font_2 text_20">{{todayRefundCount}}</text>
<text class="font text_22">今日退款总金额</text>
<text class="font_2 text_24">¥{{todayRefundAmount}}</text>
<text class="font_4 text_26">今日推广数量</text>
<text class="font_2 text_28">{{todayPromotionCount}}</text>
</view>
<!-- 本月数据 -->
<view class="flex-col items-start equal-division-item section_2 ml-19">
<text class="font_3 text_9">本月数据</text>
<text class="font text_11">本月下单数量</text>
<text class="font_2 text_13">{{monthOrderCount}}</text>
<text class="font text_15">本月订单总金额</text>
<text class="font_2 text_17">¥{{monthOrderAmount}}</text>
<text class="font text_19">本月退单数量</text>
<text class="font_2 text_21">{{monthRefundCount}}</text>
<text class="font text_23">本月退款总金额</text>
<text class="font_2 text_25">¥{{monthRefundAmount}}</text>
<text class="font_4 text_27">本月推广数量</text>
<text class="font_2 text_29">{{monthPromotionCount}}</text>
</view>
</view>
<!-- 财务状态 -->
<view class="mt-30 flex-col section_3">
<text class="self-start font_3">财务状态</text>
<view class="mt-26 flex-col self-stretch">
<view class="flex-row justify-between items-baseline">
<text class="font text_30">待释放</text>
<text class="font_2 text_31">{{toRelease}}</text>
</view>
<view class="flex-row justify-between items-baseline mt-19">
<text class="font text_32">可结算</text>
<text class="font_2 text_33">{{toSettle}}</text>
</view>
<view class="flex-row justify-between items-baseline mt-19">
<text class="font text_34">已结算</text>
<text class="font_2 text_35">{{settled}}</text>
</view>
<view class="flex-row justify-between items-baseline mt-19">
<text class="font text_36">已退回</text>
<text class="font_2 text_37">{{refunded}}</text>
</view>
</view>
</view>
</view>
<!-- 底部网格 -->
<view class="pos">
<view class="flex-row" style="justify-content: space-between;">
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[0]}}">
<text class="font text_2">主管数量</text>
<text class="mt-20 font_2">{{superCount}}</text>
</view>
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[1]}}">
<text class="font text_3">员工数量</text>
<text class="mt-20 font_2">{{empCount}}</text>
</view>
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[2]}}">
<text class="font text_4">客户数量</text>
<text class="mt-20 font_2">{{promoCount}}</text>
</view>
</view>
<view class="flex-row" style="justify-content: space-between;">
<view class="flex-col items-center grid-item_2" style="margin-right: 10rpx">
<text class="font text_5">订单总金额</text>
<text class="mt-20 font_2">¥{{totalAmount}}</text>
</view>
<view class="flex-col items-center grid-item_2" style="margin: 40rpx 10rpx 0">
<text class="font text_6">订单净成交</text>
<text class="mt-20 font_2">¥{{netAmount}}</text>
</view>
<view class="flex-col items-center grid-item_2" style="margin-left: 10rpx">
<text class="font text_7">下单数量</text>
<text class="mt-20 font_2">{{orderCount}}</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,254 @@
.mt-41 {
margin-top: 76.88rpx;
}
.ml-19 {
margin-left: 35.63rpx;
}
.mt-19 {
margin-top: 35.63rpx;
}
.page {
padding-top: 71.25rpx;
background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
font-weight: 700;
line-height: 42.71rpx;
}
.group {
padding-top: 168.75rpx;
}
.group_2 {
margin-right: 33.75rpx;
padding: 138.75rpx 0 120rpx 41.25rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
}
.equal-division {
padding-top: 48.75rpx;
}
.equal-division-item {
flex: 1 1 320.63rpx;
}
.section {
padding: 41.25rpx 33.75rpx 33.75rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
height: 684.38rpx;
border-left: solid 5.88rpx #e67e22;
/* border-right: solid 1.88rpx #e67e22; */
border-top: solid 5.88rpx #e67e22;
/* border-bottom: solid 1.88rpx #e67e22; */
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.01rpx;
color: #e67e22;
}
.text_8 {
line-height: 28.24rpx;
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 22.91rpx;
color: #666666;
}
.text_10 {
margin-top: 33.75rpx;
line-height: 24.69rpx;
}
.text_14 {
margin-top: 41.25rpx;
line-height: 24.75rpx;
}
.text_18 {
margin-top: 41.25rpx;
line-height: 24.69rpx;
}
.text_22 {
margin-top: 41.25rpx;
line-height: 24.75rpx;
}
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.92rpx;
color: #666666;
}
.text_26 {
margin-top: 41.25rpx;
}
.section_2 {
padding: 41.25rpx 33.75rpx 33.75rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
height: 684.38rpx;
border-left: solid 5.88rpx #f1c40f;
/* border-right: solid 1.88rpx #f1c40f; */
border-top: solid 5.88rpx #f1c40f;
/* border-bottom: solid 1.88rpx #f1c40f; */
}
.text_9 {
color: #f1c40f;
line-height: 27.99rpx;
}
.text_11 {
margin-top: 33.75rpx;
line-height: 24.69rpx;
}
.text_15 {
margin-top: 41.25rpx;
line-height: 24.75rpx;
}
.text_19 {
margin-top: 41.25rpx;
line-height: 24.69rpx;
}
.text_23 {
margin-top: 41.25rpx;
line-height: 24.75rpx;
}
.text_27 {
margin-top: 41.25rpx;
}
.section_3 {
padding: 37.5rpx 20rpx 37.5rpx 33.75rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border-left: solid 5.88rpx #e67e22;
/* border-right: solid 1.88rpx #e67e22; */
border-top: solid 5.88rpx #e67e22;
/* border-bottom: solid 1.88rpx #e67e22; */
}
.text_30 {
line-height: 24.3rpx;
}
.text_32 {
line-height: 24.3rpx;
}
.text_34 {
line-height: 24.3rpx;
}
.text_36 {
line-height: 24.3rpx;
}
.grid {
height: 306.56rpx;
display: grid;
grid-template-rows: repeat(2, minmax(0, 1fr));
grid-template-columns: repeat(3, minmax(0, 1fr));
row-gap: 32.94rpx;
column-gap: 50.19rpx;
}
.pos {
position: absolute;
left: 39.38rpx;
right: 33rpx;
top: 0;
}
.grid-item {
padding: 22.5rpx 0;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border-left: solid 5.88rpx #e67e22;
/* border-right: solid 1.88rpx #e67e22; */
border-top: solid 5.88rpx #e67e22;
/* border-bottom: solid 1.88rpx #e67e22; */
}
.text_2 {
line-height: 24.34rpx;
}
.font_2 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 22.91rpx;
color: #e67e22;
}
.text_37 {
margin-right: 7.5rpx;
}
.text_35 {
margin-right: 3.75rpx;
}
.text_33 {
margin-right: 3.75rpx;
}
.text_31 {
margin-right: 3.75rpx;
}
.text_29 {
margin-top: 26.25rpx;
}
.text_25 {
margin-left: 3.75rpx;
margin-top: 26.25rpx;
}
.text_21 {
margin-top: 26.25rpx;
line-height: 22.54rpx;
}
.text_17 {
margin-left: 3.75rpx;
margin-top: 26.25rpx;
}
.text_13 {
margin-top: 26.25rpx;
}
.text_28 {
margin-top: 26.25rpx;
}
.text_24 {
margin-left: 3.75rpx;
margin-top: 26.25rpx;
}
.text_20 {
margin-top: 26.25rpx;
line-height: 22.54rpx;
}
.text_16 {
margin-left: 3.75rpx;
margin-top: 26.25rpx;
}
.text_12 {
margin-top: 26.25rpx;
}
.text_3 {
line-height: 24.28rpx;
}
.text_4 {
line-height: 24.54rpx;
}
.grid-item_2 {
width: 30%;
margin-top: 40rpx;
padding: 22.5rpx 0;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border-left: solid 5.88rpx #f1c40f;
/* border-right: solid 1.88rpx #f1c40f; */
border-top: solid 5.88rpx #f1c40f;
/* border-bottom: solid 1.88rpx #f1c40f; */
}
.text_5 {
line-height: 24.49rpx;
}
.text_6 {
line-height: 24.56rpx;
}
.text_7 {
line-height: 24.26rpx;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

View File

@ -0,0 +1,197 @@
import { baseUrl } from "../../../request";
Page({
data: {
// 用于存储输入框数据
nickName: '',
phoneNumber: '',
selectedSortField: '员工数量', // 默认选择"待选择"
selectedSortOrder: '升序', // 默认选择升序
sortFieldsByManager: ['员工数量', '推广人数', '下单数量', '总订单金额', '净成交金额'],
sortFieldsBySupervisor: ['推广人数', '下单数量', '总订单金额', '净成交金额'],
sortOrders: ['升序', '降序'],
items: [], // 用于存储查询结果
role: '', // 假设初始为主管角色,可以根据实际情况动态设置
k: 1
},
// 主管名称输入
onNameInput(e) {
this.setData({
nickName: e.detail.value
});
},
// 手机号输入
onPhoneInput(e) {
this.setData({
phoneNumber: e.detail.value
});
},
// 选择排序字段
onSortFieldChange(e) {
const { role } = this.data;
const sortFieldsMap = {
'员工数量': 'empCount',
'推广人数': 'promoCount',
'下单数量': 'orderCount',
'总订单金额': 'totalAmount',
'净成交金额': 'netAmount'
};
const selectedField = this.data.sortFieldsByManager[e.detail.value] || this.data.sortFieldsBySupervisor[e.detail.value];
this.setData({
selectedSortField: selectedField,
sortField: sortFieldsMap[selectedField], // 默认是 id
});
},
// 选择排序顺序
onSortOrderChange(e) {
const selectedOrder = e.detail.value === '0' ? 'ascend' : 'descend';
this.setData({
selectedSortOrder: selectedOrder === 'ascend' ? '升序' : '降序',
sortOrder: selectedOrder,
});
},
// 搜索按钮点击
onSearch() {
const { role } = this.data;
// // —— 新增:校验主管名称 ——
// const nameRegex = /^[\u4e00-\u9fa5]+$/;
// if (!this.data.nickName) {
// wx.showToast({ title: '主管名称不能为空', icon: 'none' });
// return;
// }
// if (!nameRegex.test(this.data.nickName)) {
// wx.showToast({ title: '主管名称只能为汉字', icon: 'none' });
// return;
// }
// // —— 新增:校验手机号 ——
// if (!this.data.phoneNumber) {
// wx.showToast({ title: '手机号不能为空', icon: 'none' });
// return;
// }
// if (this.data.phoneNumber.length < 11) {
// wx.showToast({ title: '手机号不够11位', icon: 'none' });
// return;
// }
// 原排序条件校验,保持不变
// if (this.data.selectedSortField === '待选择') {
// wx.showToast({
// title: '排序条件不能为空',
// icon: 'none'
// });
// return;
// }
// 显示加载中
wx.showLoading({
title: '加载中...',
mask: true // 显示遮罩层
});
const requestData = {
nickName: this.data.nickName,
phoneNumber: this.data.phoneNumber,
sortField: this.data.sortField || '',
sortOrder: this.data.sortOrder || 'ascend'
};
if(role === 'manager') {
wx.request({
url: baseUrl + '/perform/rank/supervisor', // 替换为实际API地址
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: requestData,
success: (res) => {
console.log('看看后端--->', res.data);
// 请求成功后隐藏loading
wx.hideLoading();
if (res.data.code === 1) {
this.setData({
items: res.data.data
});
} else {
wx.showToast({
title: '没有数据',
icon: 'none'
});
}
},
fail: () => {
// 请求失败后隐藏loading
wx.hideLoading();
console.log('111');
wx.showToast({
title: '请求失败',
icon: 'none'
});
}
});
} else if( role === 'supervisor' || role === 'staff') {
wx.request({
url: baseUrl + '/perform/rank/staff', // 替换为实际API地址
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: requestData,
success: (res) => {
console.log('看看后端--->', res.data);
// 请求成功后隐藏loading
wx.hideLoading();
if (res.data.code === 1) {
this.setData({
items: res.data.data
});
} else {
wx.showToast({
title: '没有数据',
icon: 'none'
});
}
},
fail: () => {
// 请求失败后隐藏loading
wx.hideLoading();
wx.showToast({
title: '请求失败',
icon: 'none'
});
}
});
}
},
onLoad(options) {
// 根据身份确定角色
const role = options.role;
this.setData({k: options.k})
if (role === 'staff') this.setData({selectedSortField: '推广人数'})
console.log('角色---->',options.role);
this.setData({ role });
let showRole = '';
switch (options.role) {
case 'manager':
showRole = '主管';
break;
case 'supervisor':
showRole = '员工';
break;
case 'staff':
showRole = '员工'
}
this.setData({ showRole });
this.onSearch()
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,97 @@
<view class="flex-col page">
<!-- 页面标题 -->
<text class="self-center text">{{ showRole }}绩效排名</text>
<!-- 表单区域 -->
<view class="flex-col self-stretch mt-27">
<view class="flex-col section">
<!-- 主管名称 -->
<text class="self-start font text_2">{{ showRole }}名称</text>
<view class="flex-col justify-start items-start self-start text-wrapper">
<input class="text_3 font text_4" placeholder="请输入{{ showRole }}名称" bindinput="onNameInput"/>
</view>
<!-- 手机号 -->
<text class="self-start font text_5">手机号</text>
<view class="flex-col justify-start items-start self-start text-wrapper_1">
<input class="text_3 font text_6" placeholder="请输入手机号" bindinput="onPhoneInput"
maxLength="11" type="number"/>
</view>
<!-- 排序条件选择 -->
<text class="self-start font text_7">排序条件</text>
<view class="flex-row equal-division">
<view class="flex-row justify-between section_2 section_1">
<picker wx:if="{{ role === 'manager' }}" mode="selector" range="{{sortFieldsByManager}}" bindchange="onSortFieldChange">
<view class="flex-row justify-between section_2">
<text class="font text_1">{{selectedSortField}}</text>
<image class="image" src="./images/bottom.png"/>
</view>
</picker>
<picker mode="selector" wx:if="{{ role === 'supervisor' || role === 'staff'}}" range="{{sortFieldsBySupervisor}}" bindchange="onSortFieldChange">
<view class="flex-row justify-between section_2">
<text class="font text_1">{{selectedSortField}}</text>
<image class="image" src="./images/bottom.png"/>
</view>
</picker>
</view>
<!-- 排序顺序 -->
<view class="flex-row justify-between section_2 section_3 ml-16">
<picker mode="selector" range="{{sortOrders}}" bindchange="onSortOrderChange">
<view class="flex-row justify-between section_2">
<text class="font text_16">{{selectedSortOrder}}</text>
<image class="image" src="./images/bottom.png"/>
</view>
</picker>
</view>
</view>
<!-- 搜索按钮 -->
<view class="flex-col justify-start items-center self-stretch text-wrapper_2" bindtap="onSearch">
<text class="font text_8" >搜索</text>
</view>
</view>
</view>
<!-- 查询结果展示 -->
<view class="flex-col mt-26">
<view class="flex-col list-item mt-19" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<!-- 排名 -->
<view class="flex-row">
<view class="flex-col justify-start items-center text-wrapper_4">
<text class="font_2 text_9">{{index + 1}}</text>
</view>
<!-- 主管信息 -->
<view class="flex-row items-center self-start group ml-20">
<text class="font_3">{{item.nickName}}</text>
<text class="font_4 ml-7">{{item.phoneNumber}}</text>
</view>
</view>
<!-- 绩效数据 -->
<view class="flex-row mt-14">
<view class="flex-col justify-start items-center text-wrapper_5" wx:if="{{k === '1'}}">
<text class="font_5 text_11">员工:{{item.empCount}}</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_6">
<text class="font_5 text_12">推广:{{item.promoCount}}</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_7 ml-8">
<text class="font_5">下单:{{item.orderCount}}</text>
</view>
</view>
<!-- 订单金额 -->
<view class="flex-row mt-14">
<view class="flex-col justify-start text-wrapper_8">
<text class="font_5 text_13">总额:¥{{item.totalAmount}}</text>
</view>
<view class="flex-col justify-start text-wrapper_9 ml-16">
<text class="font_5 text_14">净成交:¥{{item.netAmount}}</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,220 @@
.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;
width: 100%;
position: fixed;
bottom: 0;
overflow: auto;
height: calc(100vh - 1rpx);
}
.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 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.14rpx;
color: #66666b;
}
.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 {
color: #ffffff;
line-height: 27.69rpx;
}
.list-item {
padding: 29.89rpx 29.87rpx 31.99rpx 33.62rpx;
background-color: #ffffff;
border-radius: 18.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.list-item:first-child {
margin-top: 0;
}
.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;
}
.font_2 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 24.02rpx;
font-weight: 700;
color: #ffa400;
}
.text_9 {
line-height: 22.24rpx;
}
.group {
margin-top: 22.18rpx;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.14rpx;
color: #000000;
}
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 19.93rpx;
color: #66666b;
}
.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;
}
.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 14.61rpx;
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;
}

View File

@ -0,0 +1,116 @@
import { baseUrl } from "../../../request";
// pages/dashboardModule/supervisorPerformance/supervisorPerformance.js
Page({
data: {
nickName: '', // 主管名称
phoneNumber: '', // 手机号
showList: false, // 是否显示绩效列表
performanceList: [], // 绩效列表数据,含 ratePercent 字段
supervisorUserId: 0, // 上级主管id
},
onNameInput(e) {
this.setData({ nickName: e.detail.value });
},
onPhoneInput(e) {
this.setData({ phoneNumber: e.detail.value });
},
onSearch() {
const nickName = this.data.nickName.trim();
const phoneNumber = this.data.phoneNumber.trim();
const { supervisorUserId } = this.data;
wx.request({
url: baseUrl + '/perform/query/staff',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
nickName: nickName,
phoneNumber: phoneNumber,
supervisorUserId: supervisorUserId,
},
success: (res) => {
console.log('--->后端返回记录',res.data);
if (res.data.code === 1) {
// 预处理:给每条记录加一个 ratePercent 字段
const listWithRate = res.data.data.map(item => {
const ratePercent = (item.rakeRewardsRate * 100).toFixed(2);
return Object.assign({}, item, { ratePercent });
});
// 分两次 setData不链
this.setData({ performanceList: listWithRate });
this.setData({ showList: true });
} else {
wx.showToast({ title: res.data.message || '查询失败', icon: 'none' });
}
},
fail: () => {
wx.showToast({ title: '网络错误', icon: 'none' });
}
});
},
// 全查
onSearchSupId() {
const { supervisorUserId } = this.data;
wx.request({
url: baseUrl + '/perform/query/staff',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: { supervisorUserId },
success: (res) => {
console.log('--->后端返回记录',res.data);
if (res.data.code === 1) {
// 预处理:给每条记录加一个 ratePercent 字段
const listWithRate = res.data.data.map(item => {
const ratePercent = (item.rakeRewardsRate * 100).toFixed(2);
return Object.assign({}, item, { ratePercent });
});
// 分两次 setData不链
this.setData({ performanceList: listWithRate });
this.setData({ showList: true });
} else {
wx.showToast({ title: res.data.message || '查询失败', icon: 'none' });
}
},
fail: () => {
wx.showToast({ title: '网络错误', icon: 'none' });
}
});
},
onCopyPhone(e) {
const phone = e.currentTarget.dataset.phone;
wx.setClipboardData({
data: phone,
success() {
wx.showToast({ title: '手机号已复制', icon: 'success' });
}
});
},
onLoad(options) {
console.log('========>', options)
this.setData({
supervisorUserId: options.supId,
})
this.onSearchSupId();
},
// 跳转用户订单
gotoUser(e) {
const { id } = e.currentTarget.dataset;
wx.navigateTo({
url: `/pages/dashboardModule/userOrderPerformance/userOrderPerformance?userId=${id}`,
})
},
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,132 @@
<!-- pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml -->
<view class="flex-col page">
<!-- 标题 -->
<text class="self-center text">员工业绩报表</text>
<!-- 搜索表单 -->
<view class="flex-col self-stretch mt-19">
<view class="flex-col section">
<!-- 主管名称 -->
<view class="flex-col items-start">
<text class="font text_2">员工名称</text>
<view class="flex-col justify-start items-start text-wrapper mt-7">
<input
class="text_3 font text_4"
placeholder="请输入员工名称"
bindinput="onNameInput"
value="{{nickName}}"
/>
</view>
</view>
<!-- 手机号 -->
<view class="flex-col items-start mt-24">
<text class="font text_1">手机号</text>
<view class="flex-col justify-start items-start text-wrapper_1 mt-8">
<input
class="text_3 font text_5"
placeholder="请输入手机号"
bindinput="onPhoneInput"
value="{{phoneNumber}}"
type="number"
maxLength="11"
/>
</view>
</view>
<!-- 搜索按钮 -->
<view
class="flex-col justify-start items-center text-wrapper_2 mt-24"
bindtap="onSearch"
>
<text class="font text_6">搜索</text>
</view>
</view>
</view>
<!-- 业绩列表,未搜索前不显示 -->
<block wx:if="{{showList}}">
<view class="flex-col justify-start mt-28">
<view class="flex-col">
<view
class="flex-col list-item mt-25"
wx:for="{{performanceList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="item.id"
>
<!-- 基本信息 -->
<view class="flex-row justify-between self-stretch group">
<view class="flex-col items-start self-center">
<text class="font_2">编号:{{index + 1}}</text>
<text class="font text_8 mt-13">员工:{{item.nickName}}</text>
</view>
<view class="flex-col justify-start self-start text-wrapper_4" bind:tap="gotoUser" data-id="{{ item.userId }}">
<text class="font_3 text_7">客户订单明细>></text>
</view>
</view>
<!-- 手机号 & 复制 -->
<view class="flex-row self-start section_3">
<text class="font_4">手机号:{{item.phoneNumber}}</text>
<text
class="font_3 text_9"
bindtap="onCopyPhone"
data-phone="{{item.phoneNumber}}"
>复制</text>
</view>
<!-- 员工数 & 抽成比例 -->
<view class="flex-row self-stretch group_2">
<view class="flex-col justify-start text-wrapper_5">
<text class="font_4 text_10">客户数:{{item.empCount}}</text>
</view>
<view class="flex-col justify-start text-wrapper_6 ml-10">
<text class="font_4 text_11">比例:{{item.ratePercent}}%</text>
</view>
</view>
<!-- 业绩网格 -->
<view class="self-stretch group_3">
<view class="flex-col items-start grid-item">
<text class="font_5 text_12">下单量</text>
<text class="font_6 mt-18">{{item.orderCount}}</text>
</view>
<view class="flex-col items-start grid-item_2">
<text class="font_5 text_13">总订单</text>
<text class="font_6 text_15 mt-18">¥{{item.totalAmount}}</text>
</view>
<view class="flex-col items-start grid-item_3">
<text class="font_5 text_14">净成交</text>
<text class="font_6 text_16 mt-17">¥{{item.netAmount}}</text>
</view>
<view class="flex-col items-start grid-item_4">
<text class="font_5 text_17">待释放</text>
<text class="font_6 text_18 mt-18">¥{{item.toRelease}}</text>
</view>
<view class="flex-col items-start grid-item_5">
<text class="font_5">可结算</text>
<text class="font_6 mt-18">{{item.toSettle}}</text>
</view>
<view class="flex-col items-start grid-item_6">
<text class="font_5">已结算</text>
<text class="font_6 text_19 mt-18">¥{{item.settled}}</text>
</view>
<view class="flex-col items-start grid-item_7">
<text class="font_5 text_20">推广数</text>
<text class="font_6 mt-17">{{item.promoCount}}</text>
</view>
<view class="flex-col items-start grid-item_8">
<text class="font_5 text_21">退款</text>
<text class="font_6 text_23 mt-18">¥{{item.refunded}}</text>
</view>
<view class="flex-col items-start grid-item_9">
<text class="font_5 text_22">已回退</text>
<text class="font_6 text_24 mt-18">¥0</text>
</view>
</view>
</view>
</view>
</view>
</block>
</view>

View File

@ -0,0 +1,290 @@
.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);
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
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;
}
.text-wrapper {
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 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.6rpx;
color: #66666b;
}
.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 {
color: #ffffff;
line-height: 27.69rpx;
}
.list-item {
padding-bottom: 38.57rpx;
background-color: #ffffff;
border-radius: 16.48rpx;
border: solid 1.88rpx #ffeaa7;
}
.list-item:first-child {
margin-top: 0;
}
.group {
padding: 33.62rpx 32.01rpx 31.22rpx 35.33rpx;
}
.font_2 {
font-size: 33.75rpx;
font-family: SourceHanSansCN;
line-height: 31.82rpx;
font-weight: 700;
color: #e88b38;
}
.text_8 {
line-height: 27.86rpx;
}
.text-wrapper_4 {
padding: 18.51rpx 0 15.28rpx;
background-color: #fefbf6;
border-radius: 9.38rpx;
height: 61.88rpx;
border: solid 1.88rpx #ffeaa7;
}
.font_3 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #e88b38;
}
.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-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;
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #66666b;
}
.text_12 {
line-height: 24.02rpx;
}
.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;
}

View File

@ -0,0 +1,94 @@
import { baseUrl } from "../../../request";
// pages/dashboardModule/supervisorPerformance/supervisorPerformance.js
Page({
data: {
nickName: '', // 主管名称
phoneNumber: '', // 手机号
showList: false, // 是否显示绩效列表
performanceList: [], // 绩效列表数据,含 ratePercent 字段
userRole: '', // 用户角色
id: 0,
},
onNameInput(e) {
this.setData({ nickName: e.detail.value });
},
onPhoneInput(e) {
this.setData({ phoneNumber: e.detail.value });
},
onSearch() {
const nickName = this.data.nickName.trim();
const phoneNumber = this.data.phoneNumber.trim();
wx.request({
url: baseUrl + '/perform/query/supervisor',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
nickName: nickName,
phoneNumber: phoneNumber,
},
success: (res) => {
console.log('--->后端返回记录',res.data);
if (res.data.code === 1) {
// 预处理:给每条记录加一个 ratePercent 字段
const listWithRate = res.data.data.map(item => {
const ratePercent = (item.rakeRewardsRate * 100).toFixed(2);
return Object.assign({}, item, { ratePercent });
});
// 分两次 setData不链
this.setData({ performanceList: listWithRate });
this.setData({ showList: true });
} else {
wx.showToast({ title: res.data.message || '查询失败', icon: 'none' });
}
},
fail: () => {
wx.showToast({ title: '网络错误', icon: 'none' });
}
});
},
onCopyPhone(e) {
const phone = e.currentTarget.dataset.phone;
wx.setClipboardData({
data: phone,
success() {
wx.showToast({ title: '手机号已复制', icon: 'success' });
}
});
},
onLoad(options) {
console.log('--->',options);
this.setData({
userRole: options.role,
id: options.id,
})
let showRole = '';
switch (options.role) {
case 'manager':
showRole = '主管';
break;
case 'supervisor':
showRole = '员工';
break;
}
this.setData({ showRole });
this.onSearch()
},
changeStaff(e) {
const { id } = e.currentTarget.dataset;
console.log(id)
wx.navigateTo({
url: `/pages/dashboardModule/staffPerformance/staffPerformance?supId=${id}`,
})
},
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,132 @@
<!-- pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml -->
<view class="flex-col page">
<!-- 标题 -->
<text class="self-center text">{{ showRole }}业绩报表</text>
<!-- 搜索表单 -->
<view class="flex-col self-stretch mt-19">
<view class="flex-col section">
<!-- 主管名称 -->
<view class="flex-col items-start">
<text class="font text_2">{{ showRole }}名称</text>
<view class="flex-col justify-start items-start text-wrapper mt-7">
<input
class="text_3 font text_4"
placeholder="请输入{{ showRole }}名称"
bindinput="onNameInput"
value="{{nickName}}"
/>
</view>
</view>
<!-- 手机号 -->
<view class="flex-col items-start mt-24">
<text class="font text_1">手机号</text>
<view class="flex-col justify-start items-start text-wrapper_1 mt-8">
<input
class="text_3 font text_5"
placeholder="请输入手机号"
bindinput="onPhoneInput"
value="{{phoneNumber}}"
type="number"
maxLength="11"
/>
</view>
</view>
<!-- 搜索按钮 -->
<view
class="flex-col justify-start items-center text-wrapper_2 mt-24"
bindtap="onSearch"
>
<text class="font text_6">搜索</text>
</view>
</view>
</view>
<!-- 业绩列表,未搜索前不显示 -->
<block wx:if="{{showList}}">
<view class="flex-col justify-start mt-28">
<view class="flex-col">
<view
class="flex-col list-item mt-25"
wx:for="{{performanceList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="item.id"
>
<!-- 基本信息 -->
<view class="flex-row justify-between self-stretch group">
<view class="flex-col items-start self-center">
<text class="font_2">编号:{{index + 1}}</text>
<text class="font text_8 mt-13">主管:{{item.nickName}}</text>
</view>
<view class="flex-col justify-start self-start text-wrapper_4" bind:tap="changeStaff" data-id="{{ item.userId }}">
<text class="font_3 text_7">员工绩效排名>></text>
</view>
</view>
<!-- 手机号 & 复制 -->
<view class="flex-row self-start section_3">
<text class="font_4">手机号:{{item.phoneNumber}}</text>
<text
class="font_3 text_9"
bindtap="onCopyPhone"
data-phone="{{item.phoneNumber}}"
>复制</text>
</view>
<!-- 员工数 & 抽成比例 -->
<view class="flex-row self-stretch group_2">
<view class="flex-col justify-start text-wrapper_5">
<text class="font_4 text_10">员工数:{{item.empCount}}</text>
</view>
<view class="flex-col justify-start text-wrapper_6 ml-10">
<text class="font_4 text_11">比例:{{item.ratePercent}}%</text>
</view>
</view>
<!-- 业绩网格 -->
<view class="self-stretch group_3">
<view class="flex-col items-start grid-item">
<text class="font_5 text_12">下单量</text>
<text class="font_6 mt-18">{{item.orderCount}}</text>
</view>
<view class="flex-col items-start grid-item_2">
<text class="font_5 text_13">总订单</text>
<text class="font_6 text_15 mt-18">¥{{item.totalAmount}}</text>
</view>
<view class="flex-col items-start grid-item_3">
<text class="font_5 text_14">净成交</text>
<text class="font_6 text_16 mt-17">¥{{item.netAmount}}</text>
</view>
<view class="flex-col items-start grid-item_4">
<text class="font_5 text_17">待释放</text>
<text class="font_6 text_18 mt-18">¥{{item.toRelease}}</text>
</view>
<view class="flex-col items-start grid-item_5">
<text class="font_5">可结算</text>
<text class="font_6 mt-18">{{item.toSettle}}</text>
</view>
<view class="flex-col items-start grid-item_6">
<text class="font_5">已结算</text>
<text class="font_6 text_19 mt-18">¥{{item.settled}}</text>
</view>
<view class="flex-col items-start grid-item_7">
<text class="font_5 text_20">推广数</text>
<text class="font_6 mt-17">{{item.promoCount}}</text>
</view>
<view class="flex-col items-start grid-item_8">
<text class="font_5 text_21">退款</text>
<text class="font_6 text_23 mt-18">¥{{item.refunded}}</text>
</view>
<view class="flex-col items-start grid-item_9">
<text class="font_5 text_22">已回退</text>
<text class="font_6 text_24 mt-18">¥0</text>
</view>
</view>
</view>
</view>
</view>
</block>
</view>

View File

@ -0,0 +1,290 @@
.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);
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
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;
}
.text-wrapper {
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 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.6rpx;
color: #66666b;
}
.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 {
color: #ffffff;
line-height: 27.69rpx;
}
.list-item {
padding-bottom: 38.57rpx;
background-color: #ffffff;
border-radius: 16.48rpx;
border: solid 1.88rpx #ffeaa7;
}
.list-item:first-child {
margin-top: 0;
}
.group {
padding: 33.62rpx 32.01rpx 31.22rpx 35.33rpx;
}
.font_2 {
font-size: 33.75rpx;
font-family: SourceHanSansCN;
line-height: 31.82rpx;
font-weight: 700;
color: #e88b38;
}
.text_8 {
line-height: 27.86rpx;
}
.text-wrapper_4 {
padding: 18.51rpx 0 15.28rpx;
background-color: #fefbf6;
border-radius: 9.38rpx;
height: 61.88rpx;
border: solid 1.88rpx #ffeaa7;
}
.font_3 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #e88b38;
}
.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-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;
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #66666b;
}
.text_12 {
line-height: 24.02rpx;
}
.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;
}

View File

@ -0,0 +1,108 @@
import { baseUrl } from "../../../request";
// pages/dashboardModule/userOrderPerformance/userOrderPerformance.js
Page({
data: {
orderNumber: '', // 双向绑定的输入框内容
staffUserId: 0, // 后期改为动态注入
OrderItems: [] // 接口返回的订单列表
},
onLoad(options) {
console.log('options-->',options);
this.setData({
staffUserId: options.userId
})
this.searchOrderByStaffId()
},
// 输入框内容变化
onOrderNumberInput(e) {
this.setData({
orderNumber: e.detail.value.trim()
});
},
// 点击搜索按钮
searchOrder() {
const { orderNumber, staffUserId } = this.data;
// 简单校验:非空
// if (!orderNumber) {
// return wx.showToast({
// title: '请输入订单号',
// icon: 'none'
// });
// }
// 发起 POST 请求
wx.request({
url: baseUrl + '/perform/query/user',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
orderNumber,
staffUserId
},
success: (res) => {
if (res.data.code === 1) {
// 更新列表
this.setData({
OrderItems: res.data.data
});
} else {
wx.showToast({
title: res.data.message || '未找到订单',
icon: 'none'
});
this.setData({ OrderItems: [] });
}
},
fail: () => {
wx.showToast({
title: '请求失败,请稍后重试',
icon: 'none'
});
}
});
},
// 根据上级订单搜索
searchOrderByStaffId() {
const { staffUserId } = this.data;
// 发起 POST 请求
wx.request({
url: baseUrl + '/perform/query/user',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
staffUserId
},
success: (res) => {
if (res.data.code === 1) {
// 更新列表
this.setData({
OrderItems: res.data.data
});
} else {
wx.showToast({
title: res.data.message || '未找到订单',
icon: 'none'
});
this.setData({ OrderItems: [] });
}
},
fail: () => {
wx.showToast({
title: '请求失败,请稍后重试',
icon: 'none'
});
}
});
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,93 @@
<!-- pages/dashboardModule/userOrderPerformance/userOrderPerformance.wxml -->
<view class="flex-col page">
<text class="self-center text">客户订单明细</text>
<view class="flex-col self-stretch mt-19">
<view class="flex-col section">
<view class="flex-col group">
<text class="self-start font text_2">订单号</text>
<view class="flex-col justify-start items-start self-stretch text-wrapper">
<input
class="text_3 font text_1"
placeholder="请输入订单号"
value="{{orderNumber}}"
type="number"
bindinput="onOrderNumberInput"
/>
</view>
</view>
<view
class="flex-col justify-start items-center text-wrapper_3"
bindtap="searchOrder"
>
<text class="font_2 text_7">搜索</text>
</view>
</view>
<view class="flex-col mt-35">
<!-- 有数据时渲染列表 -->
<block wx:if="{{OrderItems.length}}">
<view
class="flex-col list-item mt-22"
wx:for="{{OrderItems}}"
wx:for-item="item"
wx:for-index="index"
wx:key="id"
>
<view class="flex-row items-baseline" style="display: flex; justify-content: space-between;">
<text class="font_2 text_8">订单号:</text>
<text class="font_3">{{item.orderNumber}}</text>
</view>
<view class="flex-row justify-between mt-19">
<text class="font_2 text_9">用户:</text>
<text class="font_4 text_10">{{item.nickName}}</text>
</view>
<view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_11">手机号:</text>
<text class="font_3 text_12">{{item.phoneNumber}}</text>
</view>
<view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_13">金额:</text>
<text class="font_3 text_24">¥{{item.totalAmount}}</text>
</view>
<view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_15">状态:</text>
<text class="font_4 text_16">{{item.orderStatus}}</text>
</view>
<view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_17">抽成:</text>
<text class="font_4 text_18">主管:{{item.firstRate * 100}}%,员工:{{item.secondRate * 100}}%
</text>
</view>
<view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_19">奖励:</text>
<text class="font_4 text_20">主管:¥{{item.firstReward}},员工:¥{{item.secondReward}}
</text>
</view>
<view class="flex-row justify-between mt-19">
<text class="font_2 text_21">提成状态:</text>
<text class="font_4 text_23">{{item.commissionStatus}}</text>
</view>
<!-- <view class="flex-row justify-between mt-19">
<text class="font_2 text_4">创建时间:</text>
<text class="font_3 text_5">{{item.createTime}}</text>
</view> -->
</view>
</block>
<!-- 无数据时提示 -->
<block wx:else>
<text class="self-center font text_4">暂无数据</text>
</block>
</view>
</view>
</view>

View File

@ -0,0 +1,176 @@
.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);
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
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;
}
.group {
padding: 47.87rpx 0 51.56rpx;
}
.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;
}
.text_3 {
margin-left: 15.19rpx;
width: 500rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.54rpx;
color: #66666b;
}
.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 {
color: #ffffff;
line-height: 27.69rpx;
}
.list-item {
padding: 44.94rpx 7.14rpx 41.46rpx 29.68rpx;
background-color: #ffffff;
border-radius: 11.89rpx;
border: solid 1.88rpx #ffeaa7;
}
.list-item:first-child {
margin-top: 0;
}
.text_8 {
line-height: 27.66rpx;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 22.76rpx;
margin-right: 15rpx;
color: #444444;
}
.text_9 {
line-height: 28.24rpx;
}
.font_4 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.54rpx;
color: #444444;
}
.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;
}

View File

@ -0,0 +1,66 @@
// pages/loginModule/agreement/agreement.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,175 @@
<view class="myOne">
<view class="my-div">
<text class="yhxy">用户协议</text>
<view>
一、总则
<view>
1、用户在注册及使用前请认真阅读本协议确保充分理解本协议中所有条款。除非您接受本协议所有条款否则您无权注册、登录或使用本协议所涉服务。您的注册、登录、使用等行为将视为无条件接受本协议所有条款的约束。
2、除非另有明确规定本产品所推出的新功能、新服务均无条件的使用本协议。
3、我公司保留在任何时候修改本协议条款的权利且无需另行通知。在我公司修改协议条款后如果您不接受修改后的条款请立即停止使用本产品提供的服务继续使用本产品提供的服务将被视为接受修改后的协议。
</view>
</view>
<view>
二、用户注册
<view>
1、用户应当同意本协议的全部条款并按照页面提示完成全部注册程序(未成年人应与法定监护人共同完成)。用户在注册过程中点击“下一步”按钮即表示完全接受本协议全部条款。
2、用户在使用本服务前需要注册一个本产品账号。本产品账号应当使用手机号码绑定注册请用户使用尚未与本产品账号绑定且未被本产品根据本协议封禁的手机号码注册账号。本产品可以根据用户需求或产品需求对账号注册和绑定的方式进行更改而无须事先通知用户。
3、用户在使用本产品服务过程中应保证各项服务业务所需信息的真实性如果因信息不真实而引起的问题以及问题发生所带来的后果本公司不负任何责任。
4、在用户注册及使用本产品时要搜集能识别用户身份的个人信息以便系统可以在必要时联系用户或为用户提供更好的使用体验。系统搜集的信息包括但不限于用户的性别、年龄、出生日期、所在城市系统同意对这些信息的使用将受限于用户个人隐私信息保护的约束。
</view>
</view>
<view>
三、服务内容
<view>
1、本服务的具体内容由本产品根据实际情况提供包括但不限于用户使用本产品等。本产品可以对提供的服务予以变更且本产品提供的服务内容可能随时变更用户将会收到关于服务变更的通知。
2、除非本协议另有其他明示规定本公司所推出的新产品、新功能、新服务均受到本协议条款之规范。
</view>
</view>
<view>
四、服务变更、中断或终止
<view>
1、鉴于网络服务的特殊性(包括但不限于服务器的稳定性问题、恶意的网络攻击等行为的存在及其他无法控制的情形),用户同意我公司有权随时中断或终止部分或全部的服务。
2、我公司需要定期或不定期地对提供服务的系统或相关设备进行检修或维护如因此类情况而造成服务在合理时间内的中断我公司无需为此承担任何责任。
3、如发生下列任何一种情形我公司有权随时变更、中断或终止向用户提供本协议项下的服务而无需对用户或任何第三方承担任何责任
(1)根据法律规定用户应提交真实信息,而用户提供的个人资料不真实、或与注册时信息不一致又未能提供合理证明;
(2)用户违反相关法律法规或本协议的约定;
(3)按照法律规定或有权机关的要求;
(4)出于安全的原因或其他必要的情形。
</view>
</view>
<view>
五、用户个人隐私信息保护
<view>
1、依据法律的规定我们将在特定情形下收集、使用和披露您的个人信息。以下条款描述了我们如何收集、使用和披露您的个人信息。
2、信息收集
(1)用户提供
我们会对您直接提供的信息进行保存。比如:我们会记录您的注册信息、寻求客服或者其他和我们沟通的记录。记录信息的种类包括:头像、昵称、性别、出生日期、所在地区以及其他您选择提供的信息。我们收集、使用和披露个人信息是为了通过创建账户、识别用户、回应查询和邮件等方式来为您提供服务。
当你接触或者使用我们的服务时,我们将自动收集您的信息包括:
Log信息(我们记录所有您使用服务时的log信息包括浏览器信息、使用时间、浏览的网页、IP地址及来源)。我们使用多种技术记录信息包括但不限于向您的移动设备种Cookies。Cookies是一些存在您的硬件上的小数据包用以帮助我们提高服务的质量及您的使用体验了解在哪些区域和功能上受欢迎以及统计流量等。
</view>
</view>
<view>
3、信息使用
<view>
(1)除本隐私政策未载明或本隐私政策的更新未能首先通知您的情况下,您的个人信息将不会用于其他目的。
(2)匿名汇总统计数据不是我公司所定义的个人用户信息,我们将为多种目的,包括但不限于分析和使用模式的报告等,来保存和使用此类信息。我公司保留以任何目的或单方面许可第三方使用和披露匿名汇总统计数据的权利。
(3)您在本产品中上传的信息,有可能会损坏您或他人的合法权益,您必须充分意识此类风险的存在。您明确同意,自行承担因上传信息所存在的一切风险及后果,我公司无需承担任何责任。
</view>
</view>
<view>
4、法定披露
<view>
虽然我们会尽最大努力保护用户隐私,但当我们有理由相信只有公开个人信息才能遵循现行司法程序、 法院指令或其他法律程序或者保护我公司、我公司用户或第三方的权利、财产或安全时,我们可能披露个人信息。
</view>
</view>
<view>
5、信息安全
<view>
我们会采取合理的实际及电子手段以及规程保障措施来保护您的个人信息。 虽然通过因特网信息传输数据并非100% 安全,但我们已经采取并将继续采取商业范畴内合理的努力来确保您的个人信息得到保护。
</view>
</view>
<view>
6、未成年人隐私保护
<view>
我公司重视对未成年人个人隐私信息的保护。我公司将依赖用户提供的个人信息判断用户是否为未成年人。任何18岁以下的未成年人注册账号或使用本服务应事先取得家长或其法定监护人(以下简称“监护人”)的书面同意。除根据法律法规的规定及有权机关的指示披露外,我公司不会使用向任何第三方透露未成年人的个人隐私信息。
</view>
</view>
<view>
六、内容规范
<view>
1、本项规范所述内容是指用户使用本服务过程中所制作、上载、复制、发布、传播的任何内容包括但不限于账号头像、名称、个性签名等注册信息及认证资料或文字、语音、图片、图文等发送、回复消息和相关链接页面以及其他使用本产品账号或本服务所产生的内容。
2、用户承诺使用本产品的服务时必须符合中华人民共和国有关法律法规不得利用本产品的服务制作、上载、复制、发布、传播以下内容
<view>
(1)反对宪法所确定的基本原则的;(2)危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的; (3)损害国家荣誉和利益的;(4)煽动民族仇恨、民族歧视,破坏民族团结的;(5)破坏国家宗教政策,宣扬邪教和封建迷信的;(6)散布谣言,扰乱社会秩序,破坏社会稳定的;(7)散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;(8)侮辱或者诽谤他人,侵害他人合法权益的;(9)含有法律、行政法规禁止的其他内容的。
</view>
3、用户不得利用本产品账号或本服务制作、上载、复制、发布、传播下干扰本产品正常运营以及侵犯其他用户或第三方合作权益的内容
<view>
(1)含有任何性暗示的;
(2)含有辱骂、恐吓、威胁内容的;
(3)含有骚扰、垃圾广告、恶意信息、诱骗信息的;
(4)涉及他人隐私、个人信息或资料的;
(5)含有其他干扰本服务正常运营和侵犯其他用户或第三方合法权益的。
</view>
</view>
</view>
<view>
七、使用规则
<view>
1、用户在本服务中或通过本服务所传送、发布的任何内容并不反映或代表也不得被视为反映或代表我公司的观点、立场或政策我公司对此不承担任何责任。
2、用户在使用本产品时必须遵守中华人民共和国相关法律法规的规定同意将不会利用本产品进行任何违法或不正当的活动包括但不限于下列行为
(1)干扰或破坏有关服务,或与有关服务连接的任何服务器或网络,或与有关服务相关的任何政策、要求或规定;
(2)采集并存储涉及任何其他用户的个人信息,以用于任何被禁止的活动;
(3)故意或非故意违反任何相关的中国法律、法规、规章、条例等其他具有法律效力的规范。
3、用户须对利用本产品账号或本服务传送信息的真实性、合法性、无害性、准确性、有效性等全权负责与用户所传播信息相关的任何法律责任由用户自行承担与我公司无关。如因此给我公司或第三方造成损害的用户应当依法予以赔偿。
4、本产品提供的服务中可能包括广告用户同意在使用过程中显示本产品和第三方供应商、合作伙伴提供的广告。除法律法规明确规定外用户应自行对该广告信息进行的交易负责对用户因该广告信息进行的交易或前述广告商提供的内容或遭受的损失或损害我公司不承担任何责任。
5、用户为使用本产品须自行配备进入国际互联网所必需的设备包括电脑、手机及其他与接入国际互联网有关的装置并自行支付与此服务有关的费用。
</view>
</view>
<view>
八、免责声明
<view>
1、对于经由本产品服务而传送的内容我公司不保证前述内容的正确性、完整性或品质。用户在接受有关服务时有可能会接触到令人不快、不适当或令人厌恶的内容。在任何情况下我公司均不对任何内容负责包括但不限于任何内容发生任何错误或纰漏以及衍生的任何损失或损害。用户使用上述内容应自行承担风险。
2、用户明确同意其使用本产品所存在的风险及其后果将完全由其自己承担我公司对用户不承担任何责任。如因用户违反有关法律、法规或本协议项下的任何条款而给任何其他第三人造成损失用户同意承担由此造成的损害赔偿责任。
3、我公司尊重并保护用户的个人隐私权。但因恶意的网络攻击等行为及其他无法控制的情形导致用户隐私信息泄露的用户同意我公司不承担任何责任。
4、对于因电信系统或互联网网络故障、计算机故障、计算机系统问题或其它任何不可抗力原因而产生损失我公司不承担任何责任但将尽力减少因此给用户造成的损失和影响。
</view>
</view>
<view>
九、知识产权声明
<view>
1、本产品服务中包含的任何文字、图表、音频、视频和软件(包括但不限于软件中包含的图表、动画、音频、视频、界面实际、数据和程序、代码、文档)等信息或材料均受著作权法、商标法和其它法律法规保护,未经相关权利人书面同意,用户不得以任何方式使用该信息或材料。
2、本协议未授予用户使用本产品任何商标、服务标记、标识、域名和其他显著品牌特征的权利任何人不得擅自(包括但不限于:以非法的方式复制、传播、展示、镜像、上载、下载)使用,否则我公司将依法追究法律责任。
3、除本协议明确允许以外用户不得以任何形式或任何方式对本产品部分或全部内容进行修改、出租、租赁、出借、出售、分发、复制、创作衍生品或用于任何商业用途。
</view>
</view>
<view>
十、法律适用
<view>
1、本协议的订立、执行和解释及争议的解决均应适用中国法律并受中国法院管辖。如服务条款任何一部分与中华人民共和国法律相抵触则该部分条款应按法律规定重新解释部分条款无效或重新解释不影响其余条款法律效力。
2、用户和我公司一致同意本协议。在执行本协议过程中如发生纠纷双方应友好协商解决协商不成时任何一方可直接向所在地的人民法院提起诉讼。
</view>
</view>
<view>
十一、其他规定
<view>
1、本协议中的标题仅为方便而设在解释本协议时应被忽略。
2、本协议及其修改权、最终解释权归我公司所有。
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,17 @@
.myOne{
width: 100%;
display: flex;
justify-content: center;
padding-bottom: 60rpx;
}
.my-div{
width: 90%;
margin: auto;
}
.yhxy{
justify-content: center;
color: black;
font-size: 40rpx;
font-weight: 600;
}

View File

@ -0,0 +1,221 @@
const { baseUrl } = require('../../../request');
const { validate } = require('../../../utils/validate');
Page({
data: {
name: '',
phone: '',
code: '', // 验证码
idcard: '', // 身份证号
codeSent: false,
countdown: 0, // 剩余秒数
codeButtonText: '获取验证码',
_timer: null,
isUploading: false,
resumeUploaded: false,
resumeFilePath: '',
fileCode: '', // 上传文件后端返回的码
credential: '', // 用户申请后的唯一凭证,用于查询用户是否审核通过
},
onInput(e) {
const field = e.currentTarget.dataset.field;
this.setData({
[field]: e.detail.value
});
},
// 获取验证码(仅校验手机号)
getSmsCode() {
const { phone } = this.data;
// 1. 非空校验
if (!validate(this.data, { phone: '请输入手机号' })) {
return;
}
// 2. 格式校验
if (!/^1\d{10}$/.test(phone)) {
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
}
// 3. 发送验证码请求
wx.request({
url: baseUrl + '/userInfo/code/pwd',
method: 'POST',
data: { templateString: phone },
success: (res) => {
console.log('验证码发送--->',res.data);
if (res.data.code === 1) {
wx.showToast({ title: '验证码已发送', icon: 'none' });
this._startCountdown(60);
} else {
wx.showToast({ title: res.data.message, icon: 'none' });
}
},
fail: () => {
wx.showToast({ title: '发送失败,请重试', icon: 'none' });
}
});
},
// 开始倒计时
_startCountdown(seconds) {
this.setData({
countdown: seconds,
codeButtonText: `${seconds}s后重试`
});
// 如果已有定时器,不重复创建
if (this.data._timer) return;
this.data._timer = setInterval(() => {
const cd = this.data.countdown - 1;
if (cd <= 0) {
this._clearTimer();
this.setData({
countdown: 0,
codeButtonText: '获取验证码'
});
} else {
this.setData({
countdown: cd,
codeButtonText: `${cd}s后重试`
});
}
}, 1000);
},
// 清除倒计时定时器
_clearTimer() {
if (this.data._timer) {
clearInterval(this.data._timer);
this.data._timer = null;
}
},
// 选择并上传简历
chooseResume() {
if (this.data.resumeUploaded) return;
wx.chooseMessageFile({
count: 1,
type: 'file',
success: res => {
const file = res.tempFiles[0];
this.uploadResume(file);
}
});
},
// 上传简历
uploadResume(file) {
this.setData({ isUploading: true });
wx.uploadFile({
url: baseUrl + '/file/upload',
method: 'POST',
name: 'file',
header : {
Authorization: wx.getStorageSync('token'),
},
formData: {
biz: 'default', // 传 biz 文本字段
},
filePath: file.path,
success: res => {
console.log('简历上传后端返回--->',JSON.parse(res.data));
const data = JSON.parse(res.data);
console.log('后端返回文件码--->',data.data);
if (data.code === 1) {
wx.showToast({ title: '上传成功', icon: 'success' });
this.setData({
isUploading: false,
resumeUploaded: true,
resumeFilePath: file.path,
fileCode: data.data
});
} else {
wx.showToast({ title: data.message || '上传失败', icon: 'none' });
this.setData({ isUploading: false });
}
},
fail: () => {
wx.showToast({ title: '上传失败,请重试', icon: 'none' });
this.setData({ isUploading: false });
}
});
},
// 提交表单
handleSubmit() {
const { name, phone, code, idcard, fileCode } = this.data;
// 校验用户是否填写所有必要信息
if (!name || !phone || !code || !idcard || !fileCode) {
wx.showToast({ title: '请填写所有信息', icon: 'none' });
return;
}
// 姓名只能中文或英文
if (!/^[\u4e00-\u9fa5A-Za-z]+$/.test(name)) {
wx.showToast({ title: '姓名只能为中英文', icon: 'none' });
return;
}
// 校验身份证号
const idCardReg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
if (!idCardReg.test(idcard)) {
wx.showToast({
title: '身份证号格式不正确',
icon: 'none'
})
return ;
}
// 提交表单数据到后端
wx.request({
url: baseUrl + '/advancementApply/add',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
name: name,
phone: phone,
verificationCode: code,
idCard: idcard,
resume: fileCode
},
success: res => {
console.log('后端返回的申请---->', res);
if (res.data.code === 1) {
wx.showToast({ title: '提交成功', icon: 'success' });
// 清空表单内容
this.setData({
name: '',
phone: '',
code: '',
idcard: '',
fileCode: '',
resumeUploaded: false, // 重置简历上传状态
resumeFilePath: '', // 清空简历文件路径
credential: '' // 清空凭证
});
} else {
wx.showToast({ title: res.data.message, icon: 'none' });
}
}
});
},
// 跳转申请须知
gotoNotice() {
wx.navigateTo({
url: '/pages/loginModule/employeeAccountNotice/employeeAccountNotice',
})
},
// 跳转我的申请记录
gotoQuery() {
wx.navigateTo({
url: '/pages/loginModule/employeeApplyQuery/employeeApplyQuery',
})
},
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,104 @@
<view class="flex-col page">
<!-- 遮罩层(上传时显示) -->
<view wx:if="{{isUploading}}" class="mask">
<text class="loading-text">上传中...</text>
</view>
<image
class="self-center image"
src="./images/logo.png"
/>
<text class="self-center text">欢迎登陆—青橙校园</text>
<view class="flex-col self-stretch group">
<view class="flex-col">
<view class="flex-row justify-between group_1">
<text class="font text_2">员工账号申请</text>
<view class="flex-row items-center group_2" bind:tap="gotoNotice">
<image
class="shrink-0 image_2 image_3"
src="./images/right.png"
/>
<text class="font_2 text_3">员工账号申请须知</text>
</view>
</view>
<view class="flex-col mt-15">
<!-- 姓名输入 -->
<view class="flex-col justify-start section">
<input
class="flex-col justify-start items-start text-wrapper view input"
placeholder="请输入姓名"
maxlength="8"
bindinput="onInput"
data-field="name"
value="{{name}}"
/>
</view>
<!-- 手机号输入 -->
<view class="flex-col justify-start section_1 mt-21">
<input
class="flex-col justify-start items-start text-wrapper text-wrapper_1 input_1"
placeholder="请输入手机号"
maxlength="11"
type="number"
bindinput="onInput"
data-field="phone"
value="{{phone}}"
/>
</view>
<!-- 验证码输入 + 发送按钮 -->
<view class="flex-row items-center section_3 mt-21">
<input
class="flex-col justify-start items-start text-wrapper_2 view_3 input_2"
placeholder="请输入验证码"
type="number"
bindinput="onInput"
data-field="code"
value="{{code}}"
maxlength="6"
/>
<view
class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-16"
bindtap="getSmsCode"
>
<text class="text_8">
{{ codeButtonText }}
</text>
</view>
</view>
<!-- 身份证号输入 -->
<view class="flex-col justify-start items-start section_2 mt-21">
<input
class="flex-col justify-start items-start text-wrapper_4 view_4 input_3"
placeholder="请输入身份证号"
type="idcard"
bindinput="onInput"
data-field="idcard"
maxlength="18"
value="{{idcard}}"
/>
</view>
<!-- 上传简历 -->
<view class="flex-col items-center section_4 mt-21" bindtap="chooseResume">
<image
class="image_4"
src="./images/resume.png"
/>
<text class="{{resumeUploaded?'upload-success-text':'font_2 text_10 mt-12'}}">
{{ resumeUploaded ? '简历上传成功!' : '点击上传简历' }}
</text>
</view>
<!-- 提交按钮 -->
<view class="flex-col justify-start items-center text-wrapper_5 mt-21" bindtap="handleSubmit">
<text class="text_11">提交申请</text>
</view>
</view>
</view>
<view class="flex-row justify-center items-center relative group_4 mt-28" bind:tap="gotoQuery">
<image
class="image_2 pos"
src="./images/right.png"
/>
<text class="font_2 text_12">我的申请记录</text>
</view>
</view>
</view>

View File

@ -0,0 +1,205 @@
/* pages/loginModule/employeeAccountApply/employeeAccountApply.wxss */
.mt-15 {
margin-top: 28.13rpx;
}
.mt-21 {
margin-top: 39.38rpx;
}
.page {
padding: 67.5rpx 49.69rpx 84.38rpx 51.56rpx;
background-color: #ffffff;
width: 100%;
height: 100%;
position: fixed;
bottom: 0;
overflow: auto;
height: calc(100vh - 1rpx);
}
.image {
width: 232.5rpx;
height: 232.5rpx;
}
.text {
margin-top: 35.14rpx;
color: #1c2023;
font-size: 37.5rpx;
font-family: AlibabaPuHuiTi;
line-height: 35.21rpx;
}
.group {
margin-top: 62.77rpx;
}
.group_1 {
padding-left: 2.77rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.79rpx;
color: #b3b3b3;
}
.text_2 {
color: #1c2023;
line-height: 28.01rpx;
}
.group_2 {
width: 236.4rpx;
}
.image_2 {
width: 30rpx;
height: 30rpx;
}
.image_3 {
margin-left: 206.4rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #ff8d1a;
}
.text_3 {
margin-left: -236.4rpx;
}
.section {
padding: 20.63rpx 0 18.75rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
box-shadow: 0rpx 3.75rpx 11.25rpx #00000040;
}
.text-wrapper {
margin-left: 16.88rpx;
margin-right: 16.88rpx;
}
.view {
padding: 15.92rpx 0 12.67rpx;
background-color: #ffffff00;
}
.section_1 {
padding: 20.16rpx 0 19.22rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
}
.text-wrapper_1 {
padding: 12.64rpx 0 15.92rpx;
background-color: #ffffff00;
}
.section_3 {
padding: 30.69rpx 16.88rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
}
.text-wrapper_2 {
flex: 1 1 0;
}
.view_3 {
padding: 16.73rpx 0 11.74rpx;
background-color: #ffffff00;
height: 56.25rpx;
}
.text-wrapper_3 {
margin-right: 15rpx;
/* padding: 13.16rpx 0 10.93rpx; */
background-color: #ff8d1a;
border-radius: 9.38rpx;
width: 157.5rpx;
height: 45rpx;
}
.text_8 {
color: #ffffff;
font-size: 22.5rpx;
font-family: AlibabaPuHuiTi;
line-height: 15.91rpx;
}
.section_2 {
padding: 19.69rpx 0;
background-color: #ffffff;
border-radius: 9.38rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
}
.text-wrapper_4 {
margin-left: 16.88rpx;
}
.view_4 {
padding: 16.86rpx 0 11.46rpx;
background-color: #ffffff00;
width: 510.63rpx;
}
.section_4 {
padding: 30.81rpx 0 38.16rpx;
background-color: #ff8d1a1a;
border-radius: 9.38rpx;
border: dotted 1.88rpx #ff8d1a;
}
.image_4 {
width: 127.5rpx;
height: 127.5rpx;
}
.text_10 {
color: #000000;
line-height: 24.23rpx;
}
.text-wrapper_5 {
padding: 36.43rpx 0 33.58rpx;
background-color: #ff8d1a;
border-radius: 9.38rpx;
}
.text_11 {
color: #ffffff;
font-size: 30rpx;
font-family: AlibabaPuHuiTi;
line-height: 27.49rpx;
}
.group_4 {
padding: 2.66rpx 0 3rpx;
}
.pos {
position: absolute;
left: 402.19rpx;
top: 50%;
transform: translateY(-50%);
}
.text_12 {
line-height: 24.34rpx;
}
.input {
padding: 15rpx 16.26rpx 13.13rpx 16.26rpx;
}
.input_1 {
padding: 13.13rpx 16.26rpx 15rpx 16.26rpx;
}
.input_2 {
padding: 0 16.88rpx;
}
.input_3 {
padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx;
}
/* 遮罩层 */
.mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
}
/* 加载中文本 */
.loading-text {
color: #ffffff;
font-size: 34rpx;
font-family: AlibabaPuHuiTi;
}
/* 上传成功文字样式 */
.upload-success-text {
font-size: 30rpx;
font-weight: bold;
color: #ff8d1a;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View File

@ -0,0 +1,66 @@
// pages/loginModule/employeeAccountNotice/employeeAccountNotice.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,5 @@
<!--pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxml-->
<view class="flex-col page">
<text class="self-center text">员工账号申请须知</text>
<rich-text class="section view mt-20"></rich-text>
</view>

View File

@ -0,0 +1,23 @@
/* pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxss */
.page {
padding: 65.08rpx 42.19rpx 145.31rpx 44.06rpx;
background-color: #ffffff;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #000000;
font-size: 33.75rpx;
font-family: SourceHanSansCN;
line-height: 31.26rpx;
}
.section {
align-self: stretch;
}
.view {
background-color: #ffffff;
height: 1301.25rpx;
border: solid 1.88rpx #000000;
}

View File

@ -0,0 +1,146 @@
import { baseUrl } from "../../../request";
Page({
data: {
status: '', // 审核状态: 审核中、审核通过、审核失败
result: {} // 查询结果数据
},
// 输入框事件
onInput(e) {
this.setData({
inputIdCard: e.detail.value // 获取身份证输入
});
},
// 查询操作
onSearch() {
const inputIdCard = this.data.inputIdCard;
if (!inputIdCard) {
wx.showToast({
title: '请输入身份证',
icon: 'none'
});
return;
}
// 查询的接口
wx.request({
url: baseUrl + '/advancementApply/query/credential', // 替换为你的后端查询接口
method: 'POST',
data: { templateString: inputIdCard },
success: (res) => {
console.log('后端返回---->',res.data);
if (res.data.code === 1) {
// 假设返回的查询结果是以下格式
const result = res.data.data; // 获取返回的数据
// 更新审核状态和查询结果
this.setData({
status: result.reviewStatus, // 审核状态
result: {
name: result.name, // 姓名
phone: result.phone, // 手机号
idCard: result.idCard, // 身份证号
failureReason: result.rejectReason, // 失败原因
password: result.userPassword, // 密码(如果有的话)
userRole: result.userRole, // 用户级别
id: result.id
}
});
} else {
wx.showToast({
title: res.data.message,
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '请求失败,请重试',
icon: 'none'
});
}
});
},
// 重新申请操作
onReapply() {
wx.showToast({
title: '重新申请中...',
icon: 'none'
});
},
// 用户撤销申请
revokeApplication() {
const { id } = this.data.result
console.log('id--->',id);
wx.showModal({
title: '确认',
content: '是否撤销申请',
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
wx.request({
url: baseUrl + '/advancementApply/modify/status',
method: 'POST',
header: {
Authorization: wx.getStorageSync('token')
},
data: {
id: id
},
success: res => {
console.log('后端返回11---->',res.data);
if (res.data.code === 1 ) {
this.setData({
status: ''
})
} else {
wx.showToast({
title: '系统错误',
})
}
}
})
}
}
})
},
// 用户去登录
gotoLogin() {
wx.navigateBack({
delta: 2
})
},
// 用户重新申请
reapply() {
wx.navigateBack({
delta: 1
})
},
copyPassword() {
const { password } = this.data.result
wx.setClipboardData({
data: password, // 要复制的内容
success(res) {
wx.showToast({
title: '已复制到剪贴板',
icon: 'success'
});
},
fail() {
wx.showToast({
title: '复制失败',
icon: 'none'
});
}
});
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,98 @@
<view class="flex-col page">
<!-- 身份证输入框 -->
<view class="flex-row items-center section">
<image class="image" src="./images/find.png" />
<input class="font text ml-5" maxlength="18" placeholder="请输入身份证查询凭证" bindinput="onInput" bindconfirm="onSearch" />
</view>
<!-- 显示查询结果 -->
<view class="flex-col mt-18">
<!-- 审核失败 -->
<view wx:if="{{status === '已拒绝'}}" class="flex-col section_2">
<view class="flex-row justify-center self-start section_3">
<image class="image_2" src="./images/flase.png" />
<text class="font text_2 ml-8">审核失败</text>
</view>
<text class="self-start font_2 text_3">姓名</text>
<text class="self-start font_3 text_4">{{result.name}}</text>
<text class="self-start font_2 text_5">手机号</text>
<text class="self-start font_4 text_6">{{result.phone}}</text>
<view class="flex-col self-stretch relative group">
<view class="self-start section_4"></view>
<view class="flex-col justify-start items-center self-stretch text-wrapper" bind:tap="reapply">
<text class="font text_9">重新申请</text>
</view>
<view class="flex-col items-start section_5 pos">
<text class="font_5 text_7">原因:</text>
<text class="font_5 text_8 mt-11">{{result.failureReason}}</text>
</view>
</view>
</view>
<!-- 审核通过 -->
<view wx:if="{{status === '已通过'}}" class="flex-col section_6 mt-18">
<view class="flex-col group_2">
<view class="flex-row justify-between group_3">
<view class="flex-row items-center section_7">
<image class="shrink-0 image_3" src="./images/current.png" />
<text class="font text_11 ml-6">审核通过</text>
</view>
<view class="flex-col justify-start items-center self-start text-wrapper_2">
<text class="text_10">员工</text>
</view>
</view>
<view class="flex-col relative mt-21">
<view class="flex-row self-stretch section_8">
<text class="font_2 text_12">姓名</text>
<text class="font_3 ml-39">{{result.name}}</text>
</view>
<view class="flex-row self-stretch section_9">
<text class="font_2">手机号</text>
<text class="font_4 text_13 ml-23">{{result.phone}}</text>
</view>
<view class="self-start section_10"></view>
<view class="flex-row justify-between items-center section_11 pos_2">
<view class="flex-row items-center">
<text class="font_2 text_14">密码</text>
<text class="font_3 text_15 ml-37">{{result.password}}</text>
</view>
<text class="font_2 text_16" bind:tap="copyPassword">复制</text>
</view>
</view>
<view class="group_4 mt-21">
<text class="font_6 text_17">温馨提示:</text>
<text class="font_6">恭喜成为本公司的推广员工,请保存以上账号密码,用于登录员工端小程序。</text>
</view>
</view>
<view class="flex-col justify-start items-center text-wrapper_3" bind:tap="gotoLogin"><text class="font text_18">去登录</text></view>
</view>
<!-- 审核中 -->
<view wx:if="{{status === '待审核'}}" class="flex-col section_12 mt-18">
<view class="flex-row justify-center items-center self-start section_13">
<image class="image" src="./images/wait.png" />
<text class="font text_19 ml-6">审核中</text>
</view>
<text class="self-start font_2 text_20">姓名</text>
<text class="self-start font_3 text_21">{{result.name}}</text>
<text class="self-start font_2 text_22">手机号</text>
<text class="self-start font_4 text_23">{{result.phone}}</text>
<!-- <text class="self-start font_2 text_24">身份证号</text>
<view class="flex-row self-stretch group_5">
<view class="shrink-0 section_14"></view>
<view class="flex-col justify-start items-start flex-1 text-wrapper_4">
<text class="text_25">{{result.idCard}}</text>
</view>
</view> -->
<view class="flex-col self-stretch group_6">
<view class="group_7">
<text class="font_6 text_26">注:</text>
<text class="font_6">每次必须通过身份证来查看申请状态。</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_5 mt-14" bind:tap="revokeApplication">
<text class="font text_27">撤销申请</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,329 @@
.ml-5 {
margin-left: 9.38rpx;
}
.mt-11 {
margin-top: 20.63rpx;
}
.ml-39 {
margin-left: 73.13rpx;
}
.ml-23 {
margin-left: 43.13rpx;
}
.ml-37 {
margin-left: 69.38rpx;
}
.mt-21 {
margin-top: 39.38rpx;
}
.page {
padding: 45.94rpx 38.44rpx 140.91rpx;
background-color: #fafafa;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.section {
padding: 15.81rpx 13.93rpx 14.19rpx;
background-color: #ffffff;
border-radius: 93.75rpx;
border: solid 1.88rpx #e0e0e0;
}
.image {
width: 33.75rpx;
height: 33.75rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.84rpx;
color: #ffffff;
}
.text {
color: #919191;
line-height: 27.75rpx;
}
.section_2 {
padding: 33.75rpx 28.13rpx 35.63rpx;
background-color: #ffffff;
border-radius: 18.43rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
}
.section_3 {
padding: 15rpx 0 13.13rpx;
background-color: #e53935;
border-radius: 18.75rpx;
width: 211.88rpx;
}
.image_2 {
width: 30rpx;
height: 30rpx;
}
.text_2 {
margin-right: 3.28rpx;
line-height: 28.16rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.15rpx;
color: #999999;
}
.text_3 {
margin-left: 2.81rpx;
margin-top: 39rpx;
line-height: 24.21rpx;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.84rpx;
color: #333333;
}
.text_4 {
margin-left: 4.24rpx;
margin-top: 21rpx;
}
.text_5 {
margin-left: 3.19rpx;
margin-top: 41.4rpx;
}
.font_4 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 24.15rpx;
color: #333333;
}
.text_6 {
margin-left: 4.52rpx;
margin-top: 24.04rpx;
line-height: 22.76rpx;
}
.group {
margin-top: 43.73rpx;
}
.section_4 {
background-color: #d32f2f;
border-radius: 9.38rpx 0rpx 0rpx 9.38rpx;
width: 13.13rpx;
height: 120rpx;
}
.text-wrapper {
margin-top: 35.63rpx;
padding: 35.57rpx 0 30.49rpx;
background-color: #e53935;
border-radius: 9.38rpx;
}
.text_9 {
line-height: 27.69rpx;
}
.section_5 {
padding: 27.81rpx 21.47rpx 24.26rpx;
background-color: #fdecea;
border-radius: 8.01rpx;
}
.pos {
position: absolute;
left: 7.5rpx;
right: 0;
top: 0;
}
.font_5 {
font-size: 26.25rpx;
font-family: AlibabaPuHuiTi;
line-height: 24.15rpx;
}
.text_7 {
color: #d32f2f;
line-height: 23.25rpx;
}
.text_8 {
color: #555555;
line-height: 24.26rpx;
}
.section_6 {
padding: 0 28.13rpx 56.25rpx;
background-color: #ffffff;
border-radius: 22.24rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
}
.group_2 {
padding: 31.88rpx 0 54.17rpx;
}
.group_3 {
padding-left: 7.5rpx;
}
.section_7 {
padding: 11.25rpx 18.75rpx 9.38rpx;
background-color: #66bb6a;
border-radius: 18.75rpx;
height: 58.13rpx;
}
.image_3 {
width: 37.5rpx;
height: 37.5rpx;
}
.text_11 {
margin-right: 3.28rpx;
line-height: 28.16rpx;
}
.text-wrapper_2 {
padding: 11.47rpx 0 9.73rpx;
background-color: #66bb6a;
border-radius: 29.46rpx;
width: 99.38rpx;
height: 41.25rpx;
}
.text_10 {
color: #ffffff;
font-size: 22.5rpx;
font-family: SourceHanSansCN;
line-height: 20.04rpx;
}
.section_8 {
padding: 33.58rpx 27.19rpx 30.45rpx;
background-color: #f8f9fa;
border-radius: 9.38rpx;
}
.text_12 {
line-height: 24.21rpx;
}
.section_9 {
margin-top: 28.74rpx;
padding: 35.33rpx 27.56rpx 32.4rpx;
background-color: #f8f9fa;
border-radius: 9.38rpx;
}
.text_13 {
line-height: 22.76rpx;
}
.section_10 {
margin-top: 31.26rpx;
background-color: #66bb6a;
border-radius: 9.38rpx 0rpx 0rpx 9.38rpx;
width: 13.13rpx;
height: 91.88rpx;
}
.section_11 {
padding: 34.74rpx 21.62rpx 25.59rpx;
background-color: #e8f5e9;
border-radius: 9.38rpx;
}
.pos_2 {
position: absolute;
left: 5.63rpx;
right: 0;
top: 235.75rpx;
}
.text_14 {
line-height: 24.36rpx;
}
.text_15 {
line-height: 31.54rpx;
}
.text_16 {
margin-right: 7.52rpx;
color: #66bb6a;
}
.group_4 {
line-height: 31.88rpx;
}
.font_6 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 31.88rpx;
color: #999999;
}
.text_17 {
color: #66bb6a;
}
.text-wrapper_3 {
padding: 35.66rpx 0 30.39rpx;
background-color: #66bb6a;
border-radius: 9.38rpx;
}
.text_18 {
line-height: 27.69rpx;
}
.section_12 {
padding: 33.75rpx 28.13rpx 54.38rpx;
background-color: #ffffff;
border-radius: 22.24rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
}
.section_13 {
margin-left: 7.5rpx;
padding: 13.13rpx 0 11.25rpx;
background-color: #ff8d1a;
border-radius: 18.75rpx;
width: 183.75rpx;
}
.text_19 {
line-height: 28.16rpx;
}
.text_20 {
margin-left: 2.81rpx;
margin-top: 39rpx;
line-height: 24.21rpx;
}
.text_21 {
margin-left: 4.24rpx;
margin-top: 21rpx;
}
.text_22 {
margin-left: 3.19rpx;
margin-top: 41.4rpx;
}
.text_23 {
margin-left: 4.52rpx;
margin-top: 24.04rpx;
line-height: 22.76rpx;
}
.text_24 {
margin-left: 2.98rpx;
margin-top: 39.6rpx;
line-height: 24.43rpx;
}
.group_5 {
margin-top: 20.94rpx;
}
.section_14 {
background-color: #ff8d1a;
border-radius: 9.38rpx 0rpx 0rpx 9.38rpx;
width: 13.13rpx;
height: 91.88rpx;
}
.text-wrapper_4 {
margin-left: -7.5rpx;
padding: 38.04rpx 0 32.04rpx;
background-color: #fff4e5;
border-radius: 9.19rpx;
height: 91.88rpx;
}
.text_25 {
margin-left: 25.71rpx;
color: #ff8d1a;
font-size: 30rpx;
font-family: AlimamaShuHeiTi;
line-height: 21.79rpx;
}
.group_6 {
margin-top: 40.97rpx;
}
.group_7 {
margin-left: 2.74rpx;
margin-right: 10.33rpx;
line-height: 31.88rpx;
}
.text_26 {
color: #ff8d1a;
}
.text-wrapper_5 {
padding: 35.48rpx 0 30.41rpx;
background-color: #ff8d1a;
border-radius: 9.38rpx;
}
.text_27 {
line-height: 27.86rpx;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Some files were not shown because too many files have changed in this diff Show More