4 Commits

Author SHA1 Message Date
f122640068 毕设-dev-8.21 2025-08-21 10:39:12 +08:00
4807d0547b 毕设-dev-first 2025-08-19 13:41:17 +08:00
3dc4d64215 青橙1.1.2 2025-08-16 22:14:42 +08:00
a3ffe71ccb ------1.0.2----- 2025-08-15 15:34:05 +08:00
46 changed files with 752 additions and 759 deletions

View File

@ -66,6 +66,12 @@
"iconPath": "/static/kc1.png", "iconPath": "/static/kc1.png",
"selectedIconPath": "/static/kc2.png" "selectedIconPath": "/static/kc2.png"
}, },
{
"pagePath": "pages/projectModule/projectList/projectList",
"text": "接单",
"iconPath": "/static/kc1.png",
"selectedIconPath": "/static/kc2.png"
},
{ {
"pagePath": "pages/personCenter/mine/mine", "pagePath": "pages/personCenter/mine/mine",
"text": "我的", "text": "我的",

View File

@ -91,7 +91,11 @@ Page({
onUnload() {}, onUnload() {},
onPullDownRefresh() {}, onPullDownRefresh() {
this.getCourseDetail()
// 停止下拉刷新动画
wx.stopPullDownRefresh();
},
onReachBottom() {}, onReachBottom() {},

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -74,7 +74,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12rpx; gap: 12rpx;
margin-bottom: 12rpx; margin-bottom: 22rpx;
} }
.head-icon { width: 34rpx; height: 34rpx; } .head-icon { width: 34rpx; height: 34rpx; }
.head-text { font-size: 28rpx; color: #111; font-weight: 600; } .head-text { font-size: 28rpx; color: #111; font-weight: 600; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

View File

@ -4,104 +4,135 @@ const { notLogin } = require('../../../utils/util')
// pages/course/courseOrderList/courseOrderList.js // pages/course/courseOrderList/courseOrderList.js
Page({ Page({
data: { data: {
orderList: [], // 后端返回的订单列表 orderList: [], // 后端返回的订单列表
hasModalShown: false, // 弹框只显示一次 hasModalShown: false, // 本次停留页面只弹一次
isMaskVisible: false isMaskVisible: false
}, },
onLoad(options) { // —— 内部状态(不放 data避免多余 setData
_timer: null,
_isActive: false, // 页面是否处于“可见/激活”状态
_justEnteredAt: 0, // 进入页面时刻(可按需使用)
onLoad() {
this._isActive = true;
this._justEnteredAt = Date.now();
this.fetchOrders(); this.fetchOrders();
}, },
onShow() {
this._isActive = true;
this.fetchOrders(); // 如不想重复拉取可注释
},
onHide() { onHide() {
clearInterval(this._timer); this._isActive = false;
this._clearTimer();
}, },
onUnload() { onUnload() {
clearInterval(this._timer); this._isActive = false;
}, this._clearTimer();
onShow() {
this.fetchOrders()
}, },
// 拉取后端接口 onPullDownRefresh() {
this.fetchOrders(); // stopPullDownRefresh 在 complete 里
},
// ========= 工具函数 =========
_clearTimer() {
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
},
_pad2(n) {
return String(n).padStart(2, '0');
},
_fmtCountDownStr(totalSec) {
const sec = Math.max(0, totalSec | 0);
const m = Math.floor(sec / 60);
const s = sec % 60;
return `${this._pad2(m)}${this._pad2(s)}`;
},
// ========= 拉单 =========
fetchOrders() { fetchOrders() {
wx.request({ wx.request({
url: baseUrl + '/courseOrder/query/list', // 替换为真实接口 url: baseUrl + '/courseOrder/query/list',
method: 'POST', method: 'POST',
header: { header: { Authorization: wx.getStorageSync('token') },
Authorization: wx.getStorageSync('token')
},
success: res => { success: res => {
console.log('课程订单列表---->',res.data.data);
if (res.data.code === 1) { if (res.data.code === 1) {
const now = Date.now(); const now = Date.now();
let list = res.data.data.map(item => { const list = (res.data.data || []).map(it => {
// 计算从 createTime 到 now 剩余秒数 // 解析时间iOS 兼容 + NaN 兜底)
const createMs = new Date(item.createTime.replace(/-/g,'/')).getTime(); const ts = new Date(String(it.createTime).replace(/-/g, '/')).getTime();
let diff = Math.floor((createMs + 15*60*1000 - now) / 1000); const createMs = Number.isFinite(ts) ? ts : now;
// 只有“待支付”才需要倒计时、过期置“交易取消” // 统一按 15 分钟有效期(若后端返回 expireTime建议直接用
if (item.orderStatus === '待支付') { const ttlMs = 15 * 60 * 1000;
if (diff <= 0) { let diff = Math.floor((createMs + ttlMs - now) / 1000);
item.orderStatus = '交易取消'; diff = Math.max(0, diff);
diff = 0;
// 首次检测到过期就弹框 if (it.orderStatus === '待支付') {
if (!this.data.hasModalShown) { it.countDown = diff;
wx.showModal({ it.countDownStr = this._fmtCountDownStr(diff);
title: '提示', it._expiredNotified = false; // 每单的本地防重复标记
content: '订单超时未支付,已取消',
showCancel: false // 初始化阶段如果已经超时diff=0静默转关闭不弹窗
}); if (diff === 0) {
this.setData({ hasModalShown: true }); it.orderStatus = '交易关闭';
} it.countDownStr = '';
} }
item.countDown = diff;
const m = Math.floor(diff / 60);
const s = diff % 60;
item.countDownStr = `${m}${s < 10 ? '0'+s : s}`;
} else { } else {
item.countDown = 0; it.countDown = 0;
item.countDownStr = ''; it.countDownStr = '';
} }
return item; return it;
});
this.setData({ orderList: list }, () => {
// 初始处理完后启动全局定时器
this.startTimer();
}); });
// 渲染 + 启动定时器
this.setData({ orderList: list }, () => this._startTimer());
} else { } else {
notLogin(res.data.message) notLogin(res.data.message);
} }
}, },
fail: () => { fail: () => {
wx.showToast({ title: '网络错误', icon: 'none' }); wx.showToast({ title: '网络错误', icon: 'none' });
},
complete: () => {
wx.stopPullDownRefresh();
} }
}); });
}, },
// 每秒更新所有待支付订单的倒计时 // ========= 定时器刷新 =========
startTimer() { _startTimer() {
// ← 新增:如果已有定时器,先清掉它 this._clearTimer();
if (this._timer) { // 如果已经没有“待支付”的订单,就不启动定时器
clearInterval(this._timer); const hasPending = this.data.orderList.some(o => o.orderStatus === '待支付' && o.countDown > 0);
} if (!hasPending) return;
this._timer = setInterval(() => { this._timer = setInterval(() => {
// 不在激活页时不做任何 UI 相关动作(同时兜底不弹窗)
if (!this._isActive) return;
let needRerender = false;
const updated = this.data.orderList.map(item => { const updated = this.data.orderList.map(item => {
if (item.orderStatus === '待支付' && item.countDown > 0) { if (item.orderStatus === '待支付' && item.countDown > 0) {
const cd = item.countDown - 1; const next = item.countDown - 1;
item.countDown = cd; item.countDown = next;
const m = Math.floor(cd / 60); item.countDownStr = this._fmtCountDownStr(next);
const s = cd % 60; needRerender = true;
item.countDownStr = `${m}${s < 10 ? '0'+s : s}`;
if (cd <= 0) { if (next <= 0) {
item.orderStatus = '交易取消'; item.orderStatus = '交易关闭';
item.countDownStr = ''; item.countDownStr = '';
if (!this.data.hasModalShown) {
// —— 仅在“当前页面可见”时弹一次,并且每单只弹一次;本页全局也只弹一次
if (this._isActive && !item._expiredNotified && !this.data.hasModalShown) {
item._expiredNotified = true;
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '订单超时未支付,已取消', content: '订单超时未支付,已关闭',
showCancel: false showCancel: false
}); });
this.setData({ hasModalShown: true }); this.setData({ hasModalShown: true });
@ -110,17 +141,28 @@ Page({
} }
return item; return item;
}); });
this.setData({ orderList: updated });
if (needRerender) {
this.setData({ orderList: updated }, () => {
// 如果已经没有可继续倒计时的订单,关掉定时器
const stillPending = this.data.orderList.some(o => o.orderStatus === '待支付' && o.countDown > 0);
if (!stillPending) this._clearTimer();
});
} else {
// 没有需要更新的也关掉
this._clearTimer();
}
}, 1000); }, 1000);
}, },
// ========= 支付相关 =========
showIsPayModal(e) { showIsPayModal(e) {
const orderId = e.currentTarget.dataset.orderId; const orderId = e.currentTarget.dataset.orderId;
wx.showModal({ wx.showModal({
title: '下单成功', title: '确认支付',
content: '您确定要支付吗', content: '是否立即支付该订单',
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '去支付',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.payOrder(orderId); this.payOrder(orderId);
@ -130,73 +172,71 @@ Page({
}, },
fail: () => { fail: () => {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({ title: '网络错误', icon: 'none' });
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' });
}
});
},
// 跳转订单详情 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 }, // 与后端约定:支付接口传 id若传 orderId 则改键名
success: res => {
wx.hideLoading();
if (res.data.code === 1) {
wx.redirectTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
complete: () => {
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) { gotoOrderDetail(e) {
const orderId = e.currentTarget.dataset.id; const orderId = e.currentTarget.dataset.id;
wx.navigateTo({ wx.navigateTo({
url: `/pages/course/orderDetail/orderDetail?id=${orderId}`, url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
}) });
}, },
// 取消订单
cancelOrder(e) { cancelOrder(e) {
// console.log(e);
const id = e.currentTarget.dataset.id; const id = e.currentTarget.dataset.id;
wx.showModal({ wx.showModal({
title: '取消订单', title: '取消订单',
content: '是否要取消订单?', content: '是否要取消订单?',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
wx.request({ wx.request({
url: baseUrl + "/courseOrder/cancel", url: baseUrl + "/courseOrder/cancel",
method: 'POST', method: 'POST',
data: { courseId: id },
header: { Authorization: wx.getStorageSync('token') }, header: { Authorization: wx.getStorageSync('token') },
success: () => this.fetchOrders() data: { id }, // 如果后端需要 { orderId: id },改这里的键名即可
success: r => {
if (r.data && r.data.code !== 1) {
wx.showToast({ title: r.data.message || '取消失败', icon: 'none' });
}
this.fetchOrders();
},
fail: () => wx.showToast({ title: '网络错误', icon: 'none' })
}); });
} }
} }
}); });
} }
}); });

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -14,7 +14,7 @@
<view wx:for="{{ orderList }}" <view wx:for="{{ orderList }}"
wx:for-item="item" wx:for-item="item"
wx:for-index="index" wx:for-index="index"
wx:key="item.id" wx:key="id"
class="card order-item" class="card order-item"
bind:tap="gotoOrderDetail" bind:tap="gotoOrderDetail"
data-id="{{ item.id }}"> data-id="{{ item.id }}">

View File

@ -130,7 +130,10 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {
this.getBannerList()
this.getCourseList()
// 停止下拉刷新动画
wx.stopPullDownRefresh();
}, },
/** /**

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -51,7 +51,7 @@
/* 列表(滚动) */ /* 列表(滚动) */
.list { .list {
flex: 1; flex: 1;
padding: 0 20rpx 20rpx; padding: 0 30rpx;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
overflow: auto; overflow: auto;
} }
@ -61,11 +61,13 @@
/* 宫格布局 */ /* 宫格布局 */
.grid { .grid {
display: flex; display: flex;
justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
gap: 20rpx; gap: 20rpx;
padding-bottom: 30rpx;
} }
.grid-item { .grid-item {
width: calc(50% - 10rpx); width: 335rpx;
background: #fff; background: #fff;
border-radius: 16rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
@ -87,6 +89,7 @@
font-size: 26rpx; font-size: 26rpx;
color: #111; color: #111;
line-height: 36rpx; line-height: 36rpx;
min-height: 72rpx;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;

View File

@ -2,27 +2,165 @@ import { baseUrl, globalImgUrl } from "../../../request";
Page({ Page({
data: { data: {
countdown: '', countdown: "",
orderId: 0, orderId: 0,
orderObj: {}, // 订单详情对象 orderObj: {}, // 订单详情对象
_secondsRemaining: 0, // 内部倒计时秒数 _secondsRemaining: 0, // 内部倒计时秒数
_hasShownTimeout: false, // 是否已弹过“超时未支付”弹窗 _hasShownTimeout: false, // 是否已弹过“超时未支付”弹窗(本次页面停留期内)
globalImgUrl, globalImgUrl,
isMaskVisible: false isMaskVisible: false,
_isActive: false // 页面是否处于可见状态
}, },
// —— 非 data 状态,避免无谓 setData
_timer: null,
onLoad(options) { onLoad(options) {
console.log('options---->',options); this.setData({ orderId: options.id || 0 });
this.setData({ orderId: options.id });
this.getOrderDetail(); this.getOrderDetail();
}, },
onShow() {
this.setData({ _isActive: true });
},
onHide() {
this.setData({ _isActive: false });
this._clearTimer();
},
onUnload() {
this.setData({ _isActive: false });
this._clearTimer();
},
onPullDownRefresh() {
this.getOrderDetail(); // stopPullDownRefresh 放到 complete 里,更稳
},
// ====== 工具函数 ======
_clearTimer() {
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
},
_pad2(n) {
return String(n).padStart(2, "0");
},
_format(sec) {
const m = Math.floor(sec / 60);
const s = sec % 60;
return `${this._pad2(m)}${this._pad2(s)}`;
},
// ====== 拉取订单详情并初始化倒计时 ======
getOrderDetail() {
wx.request({
url: baseUrl + "/courseOrder/query/detail",
method: "POST",
data: { id: this.data.orderId },
header: { Authorization: wx.getStorageSync("token") },
success: (res) => {
if (res.data.code !== 1) {
wx.showToast({ title: res.data.message || "获取失败", icon: "none" });
return;
}
const order = res.data.data || {};
this.setData({ orderObj: order });
// 只有“待支付”才需要倒计时;其它状态关掉计时器并清空文案
if (order.orderStatus === "待支付") {
this._initFromCreateTime(order.createTime);
} else {
this._clearTimer();
this.setData({ countdown: "" });
}
},
fail: () => wx.showToast({ title: "网络错误", icon: "none" }),
complete: () => wx.stopPullDownRefresh(),
});
},
// 计算剩余秒数并启动定时器
_initFromCreateTime(createTime) {
const ts = new Date(String(createTime).replace(/-/g, "/")).getTime();
const createMs = Number.isFinite(ts) ? ts : Date.now();
const ttlMs = 15 * 60 * 1000; // 15分钟有效
const now = Date.now();
let diff = Math.floor((createMs + ttlMs - now) / 1000);
diff = Math.max(0, diff);
// 初始化阶段:如果已过期,静默转“交易关闭”(不弹窗,避免干扰)
if (diff === 0) {
const o = { ...this.data.orderObj, orderStatus: "交易关闭" };
this._clearTimer();
this.setData({ orderObj: o, countdown: "" });
return;
}
// 未过期:初始化倒计时并启动
this._clearTimer();
this.setData({
_secondsRemaining: diff,
countdown: this._format(diff),
_hasShownTimeout: false, // 重置本页弹窗标记
});
this._startTimer();
},
// 每秒递减
_startTimer() {
this._clearTimer();
this._timer = setInterval(() => {
const sec = this.data._secondsRemaining - 1;
if (sec <= 0) {
this._clearTimer();
this._handleTimeout(); // 到点且在当前页,才弹窗
return;
}
this.setData({
_secondsRemaining: sec,
countdown: this._format(sec),
});
}, 1000);
},
// 超时处理:仅在当前页可见时弹一次,并把状态改为“交易关闭”
_handleTimeout() {
const { _isActive, _hasShownTimeout } = this.data;
// 更新状态并隐藏倒计时
const o = { ...this.data.orderObj, orderStatus: "交易关闭" };
this.setData({ orderObj: o, countdown: "" });
// 只在当前页面 & 未弹过 时弹一次
if (_isActive && !_hasShownTimeout) {
wx.showModal({
title: "提示",
content: "订单超时未支付,已关闭",
showCancel: false,
complete: () => {
// 标记已弹
this.setData({ _hasShownTimeout: true });
},
});
} else {
this.setData({ _hasShownTimeout: true });
}
},
// ====== 支付相关 ======
showIsPayModal() { showIsPayModal() {
const {orderId} = this.data const { orderId } = this.data;
wx.showModal({ wx.showModal({
title: '下单成功', title: "确认支付",
content: '您确定要支付吗?', content: "是否立即支付该订单?",
cancelText: '取消', cancelText: "取消",
confirmText: '确定', confirmText: "去支付",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.payOrder(orderId); this.payOrder(orderId);
@ -32,163 +170,70 @@ Page({
}, },
fail: () => { fail: () => {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({ title: "网络错误", icon: "none" });
title: '网络错误,下单失败', },
icon: 'none'
});
}
}); });
}, },
payOrder(orderId) { payOrder(orderId) {
// 同样先显示遮罩 this.setData({ isMaskVisible: true });
this.setData({ isMaskVisible: true }); wx.showLoading({ title: "支付中..." });
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({ wx.request({
url: baseUrl + '/courseOrder/query/detail', url: baseUrl + "/courseOrder/payment",
method: 'POST', method: "POST",
data: { id: this.data.orderId }, header: { Authorization: wx.getStorageSync("token") },
header: { Authorization: wx.getStorageSync('token') }, data: { id: orderId }, // 若后端用 orderId则把键名改为 orderId
success: res => { success: (res) => {
console.log('订单详情--->',res.data.data); wx.hideLoading();
if (res.data.code !== 1) return wx.showToast({ title: res.data.message, icon: 'none' }); if (res.data.code === 1) {
wx.redirectTo({
const order = res.data.data; url: `/pages/course/orderDetail/orderDetail?id=${orderId}`,
this.setData({ orderObj: order }); complete: () => this.setData({ isMaskVisible: false }),
});
// 仅“待支付”需要倒计时 } else {
if (order.orderStatus === '待支付') { this.setData({ isMaskVisible: false });
this._initFromCreateTime(order.createTime); wx.showToast({ title: res.data.message || "支付失败", icon: "none" });
} }
}, },
fail: () => wx.showToast({ title: '网络错误', icon: 'none' }) fail: () => {
wx.hideLoading();
this.setData({ isMaskVisible: false });
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() { cancelOrder() {
wx.showModal({ wx.showModal({
title: '取消订单', title: "取消订单",
content: '是否要取消订单?', content: "是否要取消订单?",
success: res => { success: (res) => {
if (res.confirm) { if (res.confirm) {
wx.request({ wx.request({
url: baseUrl + "/courseOrder/cancel", url: baseUrl + "/courseOrder/cancel",
method: 'POST', method: "POST",
data: { courseId: this.data.orderId }, header: { Authorization: wx.getStorageSync("token") },
header: { Authorization: wx.getStorageSync('token') }, data: { id: this.data.orderId }, // 后端如果需要 { orderId },改键名
success: () => this.getOrderDetail() success: (r) => {
if (!r.data || r.data.code !== 1) {
wx.showToast({ title: (r.data && r.data.message) || "取消失败", icon: "none" });
}
this.getOrderDetail();
},
fail: () => wx.showToast({ title: "网络错误", icon: "none" }),
}); });
} }
} },
}); });
}, },
// 去支付(示例跳转)
goPay() { goPay() {
// wx.navigateTo({ url: `/pages/pay/pay?orderId=${this.data.orderId}` }); wx.showToast({ title: "支付功能稍后开放", icon: "none" });
wx.showToast({ title: '支付功能稍后开放', icon: 'none' });
}, },
// 退款(示例弹窗)
refundOrder() { refundOrder() {
wx.showToast({ title: '退款功能稍后开放', icon: 'none' }); wx.showToast({ title: "退款功能稍后开放", icon: "none" });
} },
}); });

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -130,3 +130,9 @@
/* ===== 如你项目里已有的工具类,可保留或删除 ===== */ /* ===== 如你项目里已有的工具类,可保留或删除 ===== */
.ml-3 { margin-left: 6rpx; } .ml-3 { margin-left: 6rpx; }
.mt-17 { margin-top: 12rpx; } .mt-17 { margin-top: 12rpx; }
::-webkit-scrollbar {
width: 0;
height: 0;
background: transparent;
}

View File

@ -57,6 +57,11 @@ Page({
else if (trueCount === 1) this.setData({widthRate: '100%'}) else if (trueCount === 1) this.setData({widthRate: '100%'})
}, },
onPullDownRefresh() {
this.fetchPerformance()
wx.stopPullDownRefresh();
},
fetchPerformance() { fetchPerformance() {
wx.request({ wx.request({
url: baseUrl + '/perform/mini/query/dashboard', url: baseUrl + '/perform/mini/query/dashboard',

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -6,14 +6,17 @@ Page({
// 用于存储输入框数据 // 用于存储输入框数据
nickName: '', nickName: '',
phoneNumber: '', phoneNumber: '',
selectedSortField: '员工数量', // 默认选择"待选择" selectedSortField: '员工数量', // 默认选择"员工数量"
selectedSortOrder: '序', // 默认选择升序 selectedSortOrder: '序', // 默认选择升序
sortFieldsByManager: ['员工数量', '推广人数', '下单数量', '总订单金额', '净成交金额'], sortFieldsByManager: ['员工数量', '推广人数', '下单数量', '总订单金额', '净成交金额'],
sortFieldsBySupervisor: ['推广人数', '下单数量', '总订单金额', '净成交金额'], sortFieldsBySupervisor: ['推广人数', '下单数量', '总订单金额', '净成交金额'],
sortField: 'empCount',
sortOrder: 'descend',
sortOrders: ['升序', '降序'], sortOrders: ['升序', '降序'],
items: [], // 用于存储查询结果 items: [], // 用于存储查询结果
role: '', // 假设初始为主管角色,可以根据实际情况动态设置 role: '', // 假设初始为主管角色,可以根据实际情况动态设置
k: 1 k: 1,
showRole: ''
}, },
// 主管名称输入 // 主管名称输入
@ -32,7 +35,6 @@ Page({
// 选择排序字段 // 选择排序字段
onSortFieldChange(e) { onSortFieldChange(e) {
const { role } = this.data;
const sortFieldsMap = { const sortFieldsMap = {
'员工数量': 'empCount', '员工数量': 'empCount',
'推广人数': 'promoCount', '推广人数': 'promoCount',
@ -40,8 +42,8 @@ Page({
'总订单金额': 'totalAmount', '总订单金额': 'totalAmount',
'净成交金额': 'netAmount' '净成交金额': 'netAmount'
}; };
const { showRole, sortFieldsByManager, sortFieldsBySupervisor } = this.data
const selectedField = this.data.sortFieldsByManager[e.detail.value] || this.data.sortFieldsBySupervisor[e.detail.value]; let selectedField = showRole === '主管' ? sortFieldsByManager[e.detail.value] : sortFieldsBySupervisor[e.detail.value];
this.setData({ this.setData({
selectedSortField: selectedField, selectedSortField: selectedField,
sortField: sortFieldsMap[selectedField], // 默认是 id sortField: sortFieldsMap[selectedField], // 默认是 id
@ -61,7 +63,7 @@ Page({
// 搜索按钮点击 // 搜索按钮点击
onSearch() { onSearch() {
const { role } = this.data; const { showRole, role } = this.data;
// // —— 新增:校验主管名称 —— // // —— 新增:校验主管名称 ——
// const nameRegex = /^[\u4e00-\u9fa5]+$/; // const nameRegex = /^[\u4e00-\u9fa5]+$/;
// if (!this.data.nickName) { // if (!this.data.nickName) {
@ -98,12 +100,17 @@ Page({
mask: true // 显示遮罩层 mask: true // 显示遮罩层
}); });
if (showRole === '员工') {
this.setData({ sortField: 'promoCount' })
}
const requestData = { const requestData = {
nickName: this.data.nickName, nickName: this.data.nickName,
phoneNumber: this.data.phoneNumber, phoneNumber: this.data.phoneNumber,
sortField: this.data.sortField || '', sortField: this.data.sortField || '',
sortOrder: this.data.sortOrder || 'ascend' sortOrder: this.data.sortOrder || 'ascend'
}; };
console.log('requestData====>', requestData)
if(role === 'manager') { if(role === 'manager') {
wx.request({ wx.request({
@ -129,7 +136,6 @@ Page({
fail: () => { fail: () => {
// 请求失败后隐藏loading // 请求失败后隐藏loading
wx.hideLoading(); wx.hideLoading();
console.log('111');
wx.showToast({ wx.showToast({
title: '请求失败', title: '请求失败',
icon: 'none' icon: 'none'
@ -193,5 +199,11 @@ Page({
} }
this.setData({ showRole }); this.setData({ showRole });
this.onSearch() this.onSearch()
} },
onPullDownRefresh() {
this.onSearch()
wx.stopPullDownRefresh();
},
}); });

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -46,7 +46,7 @@
bindchange="onSortFieldChange"> bindchange="onSortFieldChange">
<view class="picker-inner"> <view class="picker-inner">
<text class="picker-text">{{ selectedSortField }}</text> <text class="picker-text">{{ selectedSortField }}</text>
<image class="arrow" src="./images/bottom.png" /> <image class="arrow" src="./images/bottom.png"/>
</view> </view>
</picker> </picker>

View File

@ -77,17 +77,18 @@
background: #ffffff; background: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative;
} }
.picker-inner { .picker-inner {
padding: 0 20rpx; padding: 0 20rpx;
width: 100%; width: 270rpx;
height: 84rpx; height: 84rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.picker-text { font-size: 28rpx; color: #1f1f1f; } .picker-text { font-size: 28rpx; color: #1f1f1f;}
.arrow { width: 28rpx; height: 28rpx; } .arrow { width: 28rpx; height: 28rpx; position: absolute; right: 20rpx;}
/* 搜索按钮 */ /* 搜索按钮 */
.btn { .btn {

View File

@ -106,6 +106,11 @@ Page({
this.onSearchSupId(); this.onSearchSupId();
}, },
onPullDownRefresh() {
this.onSearchSupId()
wx.stopPullDownRefresh();
},
// 跳转用户订单 // 跳转用户订单
gotoUser(e) { gotoUser(e) {
const { id } = e.currentTarget.dataset; const { id } = e.currentTarget.dataset;

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -126,7 +126,7 @@
} }
.row-key { font-size: 26rpx; color: #666666; } .row-key { font-size: 26rpx; color: #666666; }
.row-val { display: flex; align-items: center; gap: 16rpx; } .row-val { display: flex; align-items: center; gap: 16rpx; }
.mono { font-size: 28rpx; color: #1f1f1f; font-family: monospace; letter-spacing: 1rpx; } .mono { font-size: 28rpx; color: #1f1f1f; }
.copy { .copy {
font-size: 24rpx; font-size: 24rpx;
color: #ff8a00; color: #ff8a00;

View File

@ -83,6 +83,11 @@ Page({
this.onSearch() this.onSearch()
}, },
onPullDownRefresh() {
this.onSearch()
wx.stopPullDownRefresh();
},
changeStaff(e) { changeStaff(e) {
const { id } = e.currentTarget.dataset; const { id } = e.currentTarget.dataset;

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -163,8 +163,6 @@
.mono { .mono {
font-size: 28rpx; font-size: 28rpx;
color: #1f1f1f; color: #1f1f1f;
font-family: monospace;
letter-spacing: 1rpx;
} }
.copy { .copy {

View File

@ -17,6 +17,11 @@ Page({
this.searchOrderByStaffId() this.searchOrderByStaffId()
}, },
onPullDownRefresh() {
this.searchOrderByStaffId()
wx.stopPullDownRefresh();
},
// 输入框内容变化 // 输入框内容变化
onOrderNumberInput(e) { onOrderNumberInput(e) {
this.setData({ this.setData({

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true
} }

View File

@ -87,7 +87,7 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.label { font-size: 26rpx; color: #666666; } .label { font-size: 26rpx; color: #666666; }
.mono { font-size: 28rpx; color: #1f1f1f; font-family: monospace; letter-spacing: 1rpx; } .mono { font-size: 28rpx; color: #1f1f1f; }
.badge { .badge {
height: 40rpx; height: 40rpx;

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="self-start group mt-17"> <view class="self-start group mt-17">
<text class="font_2 text_4">注意:最高抽成比例</text> <text class="font_2 text_4">注意:最高抽成比例</text>
<text class="font_2 text_5">5%</text> <text class="font_2 text_5">10%</text>
</view> </view>
<view class="flex-col justify-start items-center self-center text-wrapper mt-17" bindtap="submit"> <view class="flex-col justify-start items-center self-center text-wrapper mt-17" bindtap="submit">
<text class="font_2 text_6">确认设置</text> <text class="font_2 text_6">确认设置</text>

View File

@ -12,12 +12,40 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad() {
this.fetchSupervisorInfo(); const role = wx.getStorageSync('role')
if (role === 'manager') {
this.getManagerInfo();
} else {
this.fetchSupervisorInfo();
}
}, },
/** /**
* 请求后端接口,获取上级联系人信息 * 请求后端接口,获取上级联系人信息
*/ */
getManagerInfo() {
const token = wx.getStorageSync('token')
wx.request({
url: baseUrl + '/userInfo/get/jwt',
method: 'GET',
header: {
Authorization: token
},
success: res => {
console.log('用户信息---->',res.data);
if (res.data.code === 1) {
let result = res.data.data
this.setData({
nickName: result.nickName,
phoneNumber: result.phoneNumber
})
}
}
})
},
fetchSupervisorInfo() { fetchSupervisorInfo() {
const token = wx.getStorageSync('token'); const token = wx.getStorageSync('token');
wx.request({ wx.request({

View File

@ -14,7 +14,7 @@
</view> </view>
<image <image
class="self-start image" class="self-start image"
src="./images/logo.png" src="/static/logo.jpg"
/> />
</view> </view>
</view> </view>

View File

@ -5,7 +5,7 @@
margin-left: 39.38rpx; margin-left: 39.38rpx;
} }
.page { .page {
padding: 43.13rpx 0 1346.25rpx; padding: 43.13rpx 0 0;
background-image: linear-gradient(180deg, #ff8d1a -7.3%, #ffffff00 33.5%); background-image: linear-gradient(180deg, #ff8d1a -7.3%, #ffffff00 33.5%);
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -22,7 +22,11 @@ Page({
title: '查看绩效', title: '查看绩效',
id: 0, id: 0,
globalImgUrl, globalImgUrl,
showNicknamePopup: false showNicknamePopup: false,
totalIncome: 0,
withdrawaledAmount: 0,
withdrawalingBalance: 0,
currentBalance: 0
}, },
// 跳转课程订单页面 // 跳转课程订单页面
courseOrder() { courseOrder() {
@ -165,11 +169,15 @@ Page({
Authorization: token Authorization: token
}, },
success: res => { success: res => {
console.log('用户主要信息=====>', res.data)
if (res.data.code === 1) { if (res.data.code === 1) {
let result = res.data.data let result = res.data.data
console.log('====fdfs>', res)
this.setData({ this.setData({
qrcode: globalImgUrl + result.inviteQrCode qrcode: globalImgUrl + result.inviteQrCode,
totalIncome: result.totalIncome,
withdrawaledAmount: result.withdrawnAmount,
withdrawalingBalance: result.withdrawalAmount,
currentBalance: result.currentBalance
}) })
} else { } else {
notLogin(res.data.message) notLogin(res.data.message)

View File

@ -1,331 +1,149 @@
<!-- <view class="flex-col page"> <wxs src="../../../utils/addmul.wxs" module="filters" />
<view class="flex-col relative section">
<view class="flex-row justify-between items-center group">
<view class="flex-col">
<text class="self-start font text">{{ nickName }}</text>
<view class="flex-row items-center self-stretch group_2 mt-9" bind:tap="gotoCall">
<image
class="image_3"
src="./images/dianhua.png"
mode="aspectFill"
/>
<text class="font_2 text_2 ml-7">{{ phoneNumber }}</text>
</view>
<view class="flex-row items-center self-stretch section_2 mt-9" bindtap="copyInvitationCode">
<text class="font_3 text_3">邀请码:{{ invitationCode }}</text>
<image
class="shrink-0 image_4"
src="./images/fuzhi.png"
mode="aspectFill"
/>
</view>
</view>
<view class="flex-col items-center">
<image
class="image_2"
src="./images/erweima.png"
mode="aspectFill"
bindtap="showPromoPopup"
/>
<text class="font_3 text_4 mt-6">二维码邀请</text>
</view>
</view>
<view class="flex-col group_3">
<view class="flex-row justify-between items-center group_4">
<view class="group_5">
<text class="font_2 text_6">当前金额:</text>
<text class="text_5">¥{{ currentBalance }}</text>
</view>
<view class="flex-row items-center section_3" bind:tap="lijitixian">
<image
class="image_5 image_6"
src="./images/jiantou.png"
/>
<text class="font_3 text_7">立即提现</text>
</view>
</view>
<view class="flex-row items-start equal-division section_4">
<view class="flex-col items-center equal-division-item_8">
<text class="font_2 text_8">提现中</text>
<text class="font_4 mt-15">¥{{ withdrawalingBalance }}</text>
</view>
<view class="flex-col items-center group_6 equal-division-item">
<text class="font_2 text_9">已提现</text>
<text class="font_4 mt-15">¥{{ withdrawaledAmount }}</text>
</view>
<view class="flex-col items-center group_7 equal-division-item_8">
<text class="font_2 text_10">累计收入</text>
<text class="font_4 mt-15">¥{{ totalIncome }}</text>
</view>
</view>
</view>
<image
class="image pos"
src="./images/logo.png"
mode="aspectFill"
/>
</view>
<view class="flex-row items-start equal-division_2 section_5">
<view class="flex-col items-center equal-division-item_1 equal-division-item_2" bind:tap="mingxi">
<image
class="image_7"
src="./images/zhijinxiangqing.png"
/>
<text class="font text_11 mt-6">资金明细</text>
</view>
<view class="flex-col items-center group_6 group_1" bind:tap="tixianzhanghu">
<image
class="image_7"
src="./images/tixianzhanghu.png"
mode="aspectFill"
/>
<text class="font text_12 mt-6">提现账户</text>
</view>
<view class="flex-col items-center group_9 group_10" bind:tap="zhijin">
<image
class="image_7"
src="./images/tixianjilu.png"
mode="aspectFill"
/>
<text class="font text_13 mt-6">提现记录</text>
</view>
</view> -->
<!-- 接单相关 -->
<!-- <view class="flex-col list"> -->
<!-- <view
class="flex-row equal-division equal-division_3 mt-15"
wx:for="{{items}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-col items-center equal-division-item_3" bind:tap="xiangmu">
<image
class="image_8"
src="./images/wodxiangmu.png"
mode="aspectFill"
/>
<text class="font text_14 mt-10">我的项目</text>
</view>
<view class="flex-col items-center group_15 equal-division-item_6" bind:tap="myteam">
<image
class="image_8"
src="./images/tuanduiguanli.png"
mode="aspectFill"
/>
<text class="font text_15 mt-10">团队管理</text>
</view>
<view class="flex-col items-center group_11 equal-division-item_3" bind:tap="szcy">
<image
class="image_8"
src="./images/choucheng.png"
mode="aspectFill"
/>
<text class="font text_16 mt-11">设置抽佣</text>
</view>
<view class="flex-col items-center group_12 equal-division-item_7" bind:tap="lxsj">
<image
class="image_8"
src="./images/shangji.png"
mode="aspectFill"
/>
<text class="font mt-11">联系上级</text>
</view>
</view> -->
<!-- 课程相关 -->
<!-- <view
class="flex-row equal-division equal-division_3 mt-15"
wx:for="{{items}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-col items-center equal-division-item_3" bind:tap="courseOrder">
<image
class="image_8"
src="./images/wodxiangmu.png"
mode="aspectFill"
/>
<text class="font text_14 mt-10">课程订单</text>
</view>
<view class="flex-col items-center group_15 equal-division-item_6" bind:tap="gotoSettlementRecord">
<image
class="image_8"
src="./images/tuanduiguanli.png"
mode="aspectFill"
/>
<text class="font text_15 mt-10">结算记录</text>
</view>
<view class="flex-col items-center group_11 equal-division-item_3" bind:tap="szcy">
<image
class="image_8"
src="./images/choucheng.png"
mode="aspectFill"
/>
<text class="font text_16 mt-11">我的课程</text>
</view>
<view class="flex-col items-center group_12 equal-division-item_7" bind:tap="">
<image
class="image_8"
src="./images/shangji.png"
mode="aspectFill"
/>
<text class="font mt-11">联系上级</text>
</view>
</view>
</view>
<view class="flex-col list_2">
<view class="flex-row justify-between items-center self-stretch group_13" bind:tap="zhshezhi">
<view class="flex-row items-center">
<image
class="shrink-0 image_9"
src="./images/zhanghaoshezhi.png"
mode="aspectFill"
/>
<text class="font text_17 ml-5">账号设置</text>
</view>
<image
class="image_5"
src="./images/xiajiantou.png"
mode="aspectFill"
/>
</view>
<view class="self-end list-divider"></view>
<view class="flex-row justify-between items-center self-stretch group_14">
<view class="flex-row items-center">
<image
class="shrink-0 image_9"
src="./images/lianxikefu.png"
mode="aspectFill"
/>
<text class="font text_18 ml-5">联系客服</text>
</view>
<image
class="image_5"
src="./images/xiajiantou.png"
mode="aspectFill"
/>
</view>
</view>
</view> -->
<view class="flex-col page"> <view class="flex-col page">
<!-- 顶部:头像 / 昵称 / 电话 / 邀请码 / 二维码 -->
<view class="flex-row justify-between section"> <view class="flex-row justify-between section">
<view class="flex-row items-center self-center"> <view class="flex-row items-center self-center">
<button open-type="chooseAvatar" bind:chooseavatar="updateAvatar"> <button class="avatar-btn" open-type="chooseAvatar" bind:chooseavatar="updateAvatar">
<image <image class="image" src="{{globalImgUrl + userAvatar}}" mode="aspectFill" />
class="image" </button>
src="{{globalImgUrl + userAvatar}}" <view class="flex-col ml-6">
mode="aspectFill" <view class="flex-row items-center justify-between" style="width: 250rpx;">
/> <text class="self-start font text nickname-wrap">{{ nickName }}</text>
</button> <text class="self-start font text_2 ml-16" bindtap="openNicknamePopup">修改</text>
<view class="flex-col ml-6"> </view>
<view class="flex-row items-center justify-between" style="width: 250rpx;">
<text class="self-start font text nickname-wrap">{{ nickName }}</text>
<text class="self-start font text_2 ml-16" bindtap="openNicknamePopup">修改</text>
</view>
<view class="flex-row items-center self-stretch group_2 mt-9" bindtap="gotoCall"> <view class="flex-row items-center self-stretch group_2 mt-9" bindtap="gotoCall">
<image <image class="image_3" src="./images/dianhua.png" mode="aspectFill" />
class="image_3"
src="./images/dianhua.png"
mode="aspectFill"
/>
<text class="font_2 text_2 ml-7">{{ phoneNumber }}</text> <text class="font_2 text_2 ml-7">{{ phoneNumber }}</text>
</view> </view>
<view class="flex-row items-center self-stretch section_2 mt-9" bind:tap="copyInvitationCode">
<text class="font_2 text_3">邀请码:{{ invitationCode }}</text> <view class="flex-row items-center invite-pill section_2 mt-9" bind:tap="copyInvitationCode">
<image <text class="font_2 text_3 invite-text">邀请码:{{ invitationCode }}</text>
class="shrink-0 image_4" <image class="shrink-0 image_4" src="./images/fuzhi.png" mode="aspectFill" />
src="./images/fuzhi.png"
mode="aspectFill"
/>
</view> </view>
</view> </view>
</view> </view>
<view class="flex-col items-start self-start group"> <view class="flex-col items-start self-start group">
<image <image class="image_2" src="./images/erweima.png" mode="aspectFill" bind:tap="showPromoPopup" />
class="image_2"
src="./images/erweima.png"
mode="aspectFill"
bind:tap="showPromoPopup"
/>
<text class="font_2 text_4 mt-6">二维码邀请</text> <text class="font_2 text_4 mt-6">二维码邀请</text>
</view> </view>
</view> </view>
<view class="flex-col mt-22" >
<view class="flex-row items-start equal-division section_3" wx:if="{{ userRole != 'user' }}"> <!-- ===== 查看绩效 / 排名(已上移到金额卡片前) ===== -->
<view class="flex-col items-center equal-division-item_1 group_3" bindtap="checkPerformance"> <view class="flex-row items-start equal-division section_3 mt-22" wx:if="{{ userRole != 'user' }}">
<image <view class="flex-col items-center equal-division-item_1 group_3" bindtap="checkPerformance">
class="image_5" <image class="image_5" src="./images/jixiao.png" />
src="./images/jixiao.png" <text class="font text_5 mt-6">{{title}}</text>
/> </view>
<text class="font text_5 mt-6">{{title}}</text> <view class="flex-col items-center equal-division-item_2 equal-division-item" bindtap="gotoSupervisorRank" data-userRole="{{ 'manager' }}">
<image class="image_5" src="./images/zgpm.png" />
<text class="font text_6 mt-6">主管排名</text>
</view>
<view class="flex-col items-center equal-division-item_3 group_5" bindtap="gotoStaffRank" data-userRole="{{ 'supervisor' }}">
<image class="image_5" src="./images/ygpm.png" />
<text class="font mt-6">员工排名</text>
</view>
</view>
<!-- ===== 当前金额卡片(已美化) ===== -->
<view class="wallet-card mt-22">
<view class="wallet-head">
<view class="wallet-head-left">
<text class="wallet-head-label">当前金额:</text>
<text class="wallet-head-amount">¥{{ filters.toFix2(currentBalance) }}</text>
</view> </view>
<view class="flex-col items-center equal-division-item_2 equal-division-item" bindtap="gotoSupervisorRank" data-userRole="{{ 'manager' }}"> <view class="wallet-head-right" bind:tap="lijitixian">
<image <text class="wallet-withdraw-text">立即提现</text>
class="image_5"
src="./images/zgpm.png"
/>
<text class="font text_6 mt-6">主管排名</text>
</view>
<view class="flex-col items-center equal-division-item_3 group_5" bindtap="gotoStaffRank" data-userRole="{{ 'supervisor' }}">
<image
class="image_5"
src="./images/ygpm.png"
/>
<text class="font mt-6">员工排名</text>
</view> </view>
</view> </view>
<view class="flex-col list">
<view class="flex-row justify-between items-center section_4" wx:if="{{isShowOrder}}" bindtap="courseOrder"> <view class="wallet-stats">
<view class="flex-row items-center"> <view class="wallet-stat">
<image <text class="wallet-stat-label">提现中</text>
class="shrink-0 image_6" <text class="wallet-stat-value">¥{{ filters.toFix2(withdrawalingBalance) }}</text>
src="./images/order.png"
/>
<text class="font ml-8">我的订单</text>
</view>
<image
class="image_7"
src="./images/xiajiantou.png"
/>
</view> </view>
<view class="flex-row justify-between items-center section_4 mt-11" bindtap="gotoDashboard" wx:if="{{ userRole !== 'user' }}"> <view class="wallet-stat">
<view class="flex-row items-center"> <text class="wallet-stat-label">已提现</text>
<image <text class="wallet-stat-value">¥{{ filters.toFix2(withdrawaledAmount) }}</text>
class="shrink-0 image_6"
src="./images/dash.png"
/>
<text class="font text_7 ml-8">仪表盘</text>
</view>
<image
class="image_7"
src="./images/xiajiantou.png"
/>
</view> </view>
<view class="flex-row justify-between items-center section_4 mt-11" bindtap="zhshezhi"> <view class="wallet-stat">
<view class="flex-row items-center"> <text class="wallet-stat-label">累计收入</text>
<image <text class="wallet-stat-value">¥{{ filters.toFix2(totalIncome) }}</text>
class="shrink-0 image_6"
src="./images/setting.png"
/>
<text class="font text_8 ml-8">账号设置</text>
</view>
<image
class="image_7"
src="./images/xiajiantou.png"
/>
</view> </view>
</view> </view>
</view> </view>
<!-- ===== 三入口快捷区 ===== -->
<view class="shortcut-row">
<view class="shortcut-item" bind:tap="mingxi">
<image class="shortcut-icon" src="./images/zhijinxiangqing.png" />
<text class="shortcut-text">资金明细</text>
</view>
<view class="shortcut-item" bind:tap="tixianzhanghu">
<image class="shortcut-icon" src="./images/tixianzhanghu.png" />
<text class="shortcut-text">提现账户</text>
</view>
<view class="shortcut-item" bind:tap="zhijin">
<image class="shortcut-icon" src="./images/tixianjilu.png" />
<text class="shortcut-text">提现记录</text>
</view>
</view>
<!-- ===== 接单四宫格 ===== -->
<view class="grid-row">
<view class="grid-item" bind:tap="xiangmu">
<image class="grid-icon" src="./images/wodxiangmu.png" />
<text class="grid-text">我的项目</text>
</view>
<view class="grid-item" bind:tap="myteam">
<image class="grid-icon" src="./images/tuanduiguanli.png" />
<text class="grid-text">团队管理</text>
</view>
<view class="grid-item" bind:tap="szcy">
<image class="grid-icon" src="./images/choucheng.png" />
<text class="grid-text">设置抽佣</text>
</view>
<view class="grid-item" bind:tap="lxsj">
<image class="grid-icon" src="./images/shangji.png" />
<text class="grid-text">联系上级</text>
</view>
</view>
<!-- ===== 你的原有列表区(订单 / 仪表盘 / 账号设置) ===== -->
<view class="flex-col list">
<view class="flex-row justify-between items-center section_4" wx:if="{{isShowOrder}}" bindtap="courseOrder">
<view class="flex-row items-center">
<image class="shrink-0 image_6" src="./images/order.png" />
<text class="font ml-8">我的订单</text>
</view>
<image class="image_7" src="./images/xiajiantou.png" />
</view>
<view class="flex-row justify-between items-center section_4 mt-11" bindtap="gotoDashboard" wx:if="{{ userRole !== 'user' }}">
<view class="flex-row items-center">
<image class="shrink-0 image_6" src="./images/dash.png" />
<text class="font text_7 ml-8">仪表盘</text>
</view>
<image class="image_7" src="./images/xiajiantou.png" />
</view>
<view class="flex-row justify-between items-center section_4 mt-11" bindtap="zhshezhi">
<view class="flex-row items-center">
<image class="shrink-0 image_6" src="./images/setting.png" />
<text class="font text_8 ml-8">账号设置</text>
</view>
<image class="image_7" src="./images/xiajiantou.png" />
</view>
</view>
</view> </view>
<!-- 调用弹窗组件 --> <!-- 弹窗组件 -->
<InvitationCodePop show="{{showPopup}}" bind:close="closePopup" qrcode="{{qrcode}}"/> <InvitationCodePop show="{{showPopup}}" bind:close="closePopup" qrcode="{{qrcode}}"/>
<EditNicknamePopup
<EditNicknamePopup show="{{showNicknamePopup}}"
show="{{showNicknamePopup}}" nickname="{{nickName}}"
nickname="{{nickName}}" bind:cancel="closeNicknamePopup"
bind:cancel="closeNicknamePopup"
bind:confirm="updateNickname" bind:confirm="updateNickname"
/> />

View File

@ -1,168 +1,164 @@
.ml-7 { /* ===== 工具类 ===== */
margin-left: 13.13rpx; .ml-7 { margin-left: 13.13rpx; }
} .mt-9 { margin-top: 16.88rpx; }
.mt-9 { .mt-11 { margin-top: 20.63rpx; }
margin-top: 16.88rpx; .mt-22{ margin-top:22rpx; }
} .ml-5 { margin-left: 9.38rpx; }
.mt-11 { .ml-6{ margin-left:12rpx; }
margin-top: 20.63rpx; .ml-8{ margin-left:16rpx; }
} .ml-16{ margin-left:32rpx; }
.ml-5 { .mt-10{ margin-top:10rpx; }
margin-left: 9.38rpx; .mt-15{ margin-top:15rpx; }
}
/* 页面容器 */
page { height: 100vh; }
.page { .page {
padding: 65.63rpx 28.13rpx 0; padding: 35.63rpx 28.13rpx 0;
background-image: linear-gradient(180deg, #ff8d1a -7.3%, #ffffff00 92.1%); background-image: linear-gradient(180deg, #ff8d1a -7.3%, #ffffff00 120.1%);
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
height: 100%; height: 100%;
padding-top: calc(35.63rpx + constant(safe-area-inset-top));
padding-top: calc(35.63rpx + env(safe-area-inset-top));
} }
.section {
padding: 15rpx 13.13rpx; /* 顶部卡片 */
background-color: #ffffff; .section { padding: 15rpx 13.13rpx; background-color: #ffffff; border-radius: 8.33rpx; }
border-radius: 8.33rpx;
/* 头像与昵称 */
.image { margin: 20rpx; width: 141.25rpx; height: 141.25rpx; border-radius: 50%; }
.avatar-btn{
min-width:0!important; width:auto!important; background:transparent!important;
border:none!important; padding:0!important; margin:0!important;
} }
.image { .font { font-size: 26.25rpx; font-family: SourceHanSansCN; line-height: 24.34rpx; color: #000000; }
margin: 20rpx; .text { line-height: 24.21rpx; }
width: 141.25rpx; .nickname-wrap{
height: 141.25rpx; display:block; max-width: 250rpx; white-space: normal; word-break: break-all; line-height:1.4;
border-radius: 30rpx; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
} }
button {
/* 去掉默认最小宽度 */ /* 电话与邀请码行 */
min-width: 0 !important; .group_2 { padding: 0 7.26rpx; }
/* 确保宽度随内容自适应 */ .image_3 { width: 22.5rpx; height: 22.5rpx; }
width: auto !important; .font_2 { font-size: 22.5rpx; font-family: SourceHanSansCN; line-height: 20.68rpx; color: #ff8d1a; }
/* 下面是其他重置,保证“隐形” */ .text_2 { color: #808080; line-height: 1.4; }
background: transparent !important; .section_2{
border: none !important; display:inline-flex; align-items:center; max-width:100%;
padding: 0 !important; padding: 7.5rpx 13.13rpx 5.63rpx 14.03rpx; background-color: #fff6de; border-radius: 31.26rpx;
margin: 0 !important;
} }
.font { .image_4 { width: 24.38rpx; height: 24.38rpx; }
font-size: 26.25rpx; .text_3 { margin-right: 10.6rpx; white-space:nowrap; }
font-family: SourceHanSansCN;
line-height: 24.34rpx; .group { margin-top: 33.75rpx; width: 133.72rpx; }
color: #000000; .image_2 { margin-left: 17.48rpx; width: 76.88rpx; height: 76.88rpx; }
.text_4 { line-height: 20.72rpx; }
/* 查看绩效 / 排名(等分宫格) */
.equal-division { display:flex; gap: 12rpx; }
.section_3 { padding: 6.88rpx 0 13.59rpx; background-color: #ffffff; border-radius: 18.75rpx; }
.equal-division-item_1 { margin-left: 8.06rpx; }
.group_3 { padding: 11.76rpx 0 10.01rpx; width: 224.59rpx; }
.image_5 { width: 63.99rpx; height: 63.99rpx; }
.text_5 { line-height: 24.26rpx; }
.equal-division-item_2 { position: static; transform:none; }
.equal-division-item { padding: 11.76rpx 0 10.09rpx; width: 224.59rpx; }
.text_6 { line-height: 24.28rpx; }
.equal-division-item_3 { position: static; transform:none; }
.group_5 { padding: 11.76rpx 0 9.99rpx; width: 224.59rpx; }
/* 列表卡片(你的原有区) */
.list { padding-top: 19.38rpx; }
.section_4 { padding: 31.88rpx 31.88rpx 30rpx 33.75rpx; background-color: #ffffff; border-radius: 9.47rpx; min-height:88rpx; }
.image_6 { border-radius: 9.38rpx; width: 41.25rpx; height: 41.25rpx; }
.image_7 { width: 30rpx; height: 30rpx; }
.text_7 { line-height: 24.47rpx; }
.text_8 { line-height: 23.81rpx; }
/* ===== 当前金额卡片(美化后) ===== */
.wallet-card {
background: #fff;
border-radius: 20rpx;
padding: 28rpx 24rpx;
box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.06);
} }
.text {
line-height: 24.21rpx; /* 金额行 */
.wallet-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
} }
.group_2 { .wallet-head-left { display: flex; align-items: baseline; }
padding: 0 7.26rpx; .wallet-head-label { font-size: 26rpx; color: #666; }
.wallet-head-amount { margin-left: 8rpx; font-size: 38rpx; color: #ff8d1a; font-weight: 700; }
/* 立即提现按钮 */
.wallet-head-right {
background: linear-gradient(135deg, #ffae3d, #ff8d1a);
border-radius: 999rpx;
padding: 12rpx 28rpx;
box-shadow: 0 4rpx 12rpx rgba(255, 141, 26, 0.3);
display: flex; /* 水平+垂直居中 */
align-items: center;
justify-content: center;
} }
.image_3 { .wallet-withdraw-text { font-size: 26rpx; color: #fff; font-weight: 600; }
width: 22.5rpx;
height: 22.5rpx; /* 三统计(轻量分隔线风格) */
.wallet-stats {
display: flex;
justify-content: space-between;
margin-top: 12rpx;
border-top: 1rpx solid #f2f2f2;
padding-top: 20rpx;
} }
.font_2 { .wallet-stat {
font-size: 22.5rpx; flex: 1 0 0;
font-family: SourceHanSansCN; display: flex;
line-height: 20.68rpx; flex-direction: column;
color: #ff8d1a; align-items: center;
} }
.text_2 { .wallet-stat:not(:last-child) { border-right: 1rpx solid #f2f2f2; }
color: #808080; .wallet-stat-label { font-size: 24rpx; color: #888; }
line-height: 1.4; .wallet-stat-value { margin-top: 6rpx; font-size: 30rpx; color: #333; font-weight: 600; }
/* ===== 三入口快捷区 ===== */
.shortcut-row{
margin-top: 18rpx; background:#fff; border-radius: 16rpx; padding: 18rpx 10rpx;
display:flex; justify-content:space-between;
} }
.section_2 { .shortcut-item{ flex:1 0 0; display:flex; flex-direction:column; align-items:center; }
width: 230rpx; .shortcut-icon{ width: 72rpx; height: 72rpx; }
.shortcut-text{ margin-top: 10rpx; font-size: 24rpx; color: #333; }
/* ===== 接单四宫格 ===== */
.grid-row{
margin-top: 18rpx; background:#fff; border-radius: 16rpx; padding: 18rpx 8rpx 6rpx;
display:flex; flex-wrap:wrap; justify-content:space-between;
}
.grid-item{ width: 25%; display:flex; flex-direction:column; align-items:center; margin-bottom: 18rpx; }
.grid-icon{ width: 64rpx; height: 64rpx; border-radius: 12rpx; }
.grid-text{ margin-top: 8rpx; font-size: 24rpx; color:#333; }
/* 自适应宽的胶囊 */
.invite-pill{
display: inline-flex; /* 关键:让容器只包裹内容 */
align-items: center;
max-width: 100%; /* 不超过父容器 */
padding: 7.5rpx 13.13rpx 5.63rpx 14.03rpx; padding: 7.5rpx 13.13rpx 5.63rpx 14.03rpx;
background-color: #fff6de; background-color: #fff6de;
border-radius: 31.26rpx; border-radius: 31.26rpx;
/* 可选,让它靠左不被两端对齐挤开 */
align-self: flex-start;
} }
.image_4 {
width: 24.38rpx; /* 文本超长时省略,不把胶囊撑爆 */
height: 24.38rpx; .invite-text{
max-width: 520rpx; /* 按你页面宽度调,或用 60% 等比例 */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.text_3 {
margin-right: 21.6rpx;
}
.group {
margin-top: 33.75rpx;
width: 133.72rpx;
}
.image_2 {
margin-left: 17.48rpx;
width: 76.88rpx;
height: 76.88rpx;
}
.text_4 {
line-height: 20.72rpx;
}
.equal-division {
position: relative;
}
.section_3 {
padding: 6.88rpx 0 13.59rpx;
background-color: #ffffff;
border-radius: 18.75rpx;
}
.equal-division-item_1 {
margin-left: 8.06rpx;
}
.group_3 {
padding: 11.76rpx 0 10.01rpx;
width: 224.59rpx;
}
.image_5 {
width: 63.99rpx;
height: 63.99rpx;
}
.text_5 {
line-height: 24.26rpx;
}
.equal-division-item_2 {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.equal-division-item {
padding: 11.76rpx 0 10.09rpx;
width: 224.59rpx;
}
.text_6 {
line-height: 24.28rpx;
}
.equal-division-item_3 {
position: absolute;
right: 10.03rpx;
top: 50%;
transform: translateY(-50%);
}
.group_5 {
padding: 11.76rpx 0 9.99rpx;
width: 224.59rpx;
}
.list {
padding-top: 19.38rpx;
}
.section_4 {
padding: 31.88rpx 31.88rpx 30rpx 33.75rpx;
background-color: #ffffff;
border-radius: 9.47rpx;
}
.image_6 {
border-radius: 9.38rpx;
width: 41.25rpx;
height: 41.25rpx;
}
.image_7 {
width: 30rpx;
height: 30rpx;
}
.text_7 {
line-height: 24.47rpx;
}
.text_8 {
line-height: 23.81rpx;
}
.nickname-wrap {
display: block; /* 让它单独占一行 */
max-width: 250rpx; /* 不超过容器宽度 */
white-space: normal; /* 允许正常换行 */
word-break: break-all; /* 长字符串也能断行 */
line-height: 1.4;
}

View File

@ -14,7 +14,7 @@
margin-top: 24.38rpx; margin-top: 24.38rpx;
} }
.page { .page {
padding: 39.38rpx 24.38rpx 510rpx; padding: 39.38rpx 24.38rpx 70rpx;
background-image: linear-gradient(180deg, #ff8d1a -7.3%, #f5f5f5 39.3%); background-image: linear-gradient(180deg, #ff8d1a -7.3%, #f5f5f5 39.3%);
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;

View File

@ -51,7 +51,7 @@
</view> </view>
<view class="flex-col mt-13"> <view class="flex-col mt-13">
<view <view
class="flex-row justify-center items-center relative list-item_1 mt-8" class="flex-row justify-start items-center relative list-item_1 mt-8"
wx:for="{{notificationList}}" wx:for="{{notificationList}}"
wx:key="id" wx:key="id"
bindtap="goToNotificationDetail" bindtap="goToNotificationDetail"
@ -60,7 +60,7 @@
<view class="flex-col justify-start items-center text-wrapper pos"> <view class="flex-col justify-start items-center text-wrapper pos">
<text class="font_3 text_9">最新</text> <text class="font_3 text_9">最新</text>
</view> </view>
<text class="font_6 text_10">{{item.notificationTitle}}</text> <text class="font_6 text_10 ml-50">{{item.notificationTitle}}</text>
</view> </view>
</view> </view>
</view> </view>

View File

@ -169,7 +169,6 @@
.text_10 { .text_10 {
font-size: 26.25rpx; font-size: 26.25rpx;
line-height: 24.49rpx; line-height: 24.49rpx;
margin-left: -30%;
} }
.section_4 { .section_4 {
margin-top: 41.25rpx; margin-top: 41.25rpx;
@ -435,3 +434,4 @@
.line-active { .line-active {
background-color: #ff8d1a !important; background-color: #ff8d1a !important;
} }

View File

@ -8,10 +8,7 @@ Page({
data: { data: {
// 四张轮播图(已统一为同一 URL // 四张轮播图(已统一为同一 URL
banners: [ banners: [
'./images/banner.png', '/static/logo.jpg'
'./images/banner.png',
'./images/banner.png',
'./images/banner.png'
], ],
// 后端返回的项目列表 // 后端返回的项目列表
items: [], items: [],

View File

@ -17,7 +17,7 @@
<!-- 项目列表 --> <!-- 项目列表 -->
<view class="mt-20 flex-col list"> <view class="mt-20 flex-col list">
<view <view bindtap="gotoPromotion" data-id="{{item.id}}"
class="flex-row justify-between items-center relative list-item mt-17" class="flex-row justify-between items-center relative list-item mt-17"
wx:for="{{items}}" wx:for="{{items}}"
wx:for-item="item" wx:for-item="item"
@ -51,8 +51,6 @@
</view> </view>
</view> </view>
<view <view
bindtap="gotoPromotion"
data-id="{{item.id}}"
class="flex-col justify-start items-center text-wrapper_2"> class="flex-col justify-start items-center text-wrapper_2">
<text class="font_3 text_2">参与推广</text> <text class="font_3 text_2">参与推广</text>
</view> </view>

View File

@ -4,6 +4,7 @@ export const dev = 'http://160.202.242.36:9091';
export const test = 'http://160.202.242.36:9092'; export const test = 'http://160.202.242.36:9092';
export const localTest = 'http://localhost:9092'; export const localTest = 'http://localhost:9092';
export const ssl = 'https://www.chenxinzhi.top' export const ssl = 'https://www.chenxinzhi.top'
export const baseUrl = ssl; export const graduation = 'http://160.202.242.36:9099'
export const baseUrl = graduation;
export const globalImgUrl = baseUrl + '/file/download/' export const globalImgUrl = baseUrl + '/file/download/'

BIN
static/kc2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB