Compare commits

...

14 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
46 changed files with 574 additions and 156 deletions

View File

@ -90,7 +90,8 @@
font-size: 28.13rpx; font-size: 28.13rpx;
} }
.section_3 { .section_3 {
height: 791.25rpx; height: auto;
padding-bottom: 40rpx;
/* 以下是新增 */ /* 以下是新增 */
white-space: normal; /* 允许换行 */ white-space: normal; /* 允许换行 */
word-break: break-all; /* 在任意字符处断行,数字也会换行 */ word-break: break-all; /* 在任意字符处断行,数字也会换行 */

View File

@ -5,6 +5,7 @@ Page({
data: { data: {
orderList: [], // 后端返回的订单列表 orderList: [], // 后端返回的订单列表
hasModalShown: false, // 弹框只显示一次 hasModalShown: false, // 弹框只显示一次
isMaskVisible: false
}, },
onLoad(options) { onLoad(options) {
@ -35,7 +36,7 @@ Page({
let list = res.data.data.map(item => { let list = res.data.data.map(item => {
// 计算从 createTime 到 now 剩余秒数 // 计算从 createTime 到 now 剩余秒数
const createMs = new Date(item.createTime.replace(/-/g,'/')).getTime(); const createMs = new Date(item.createTime.replace(/-/g,'/')).getTime();
let diff = Math.floor((createMs + 30*60*1000 - now) / 1000); let diff = Math.floor((createMs + 15*60*1000 - now) / 1000);
// 只有“待支付”才需要倒计时、过期置“交易取消” // 只有“待支付”才需要倒计时、过期置“交易取消”
if (item.orderStatus === '待支付') { if (item.orderStatus === '待支付') {
@ -80,6 +81,10 @@ Page({
// 每秒更新所有待支付订单的倒计时 // 每秒更新所有待支付订单的倒计时
startTimer() { startTimer() {
// ← 新增:如果已有定时器,先清掉它
if (this._timer) {
clearInterval(this._timer);
}
this._timer = setInterval(() => { this._timer = setInterval(() => {
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) {
@ -108,6 +113,62 @@ Page({
}, 1000); }, 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) { gotoOrderDetail(e) {
const orderId = e.currentTarget.dataset.id; const orderId = e.currentTarget.dataset.id;
@ -135,11 +196,6 @@ Page({
} }
} }
}); });
}, }
// 支付订单
payOrder() {
// wx.navigateTo({ url: `/pages/pay/pay?orderId=${this.data.orderId}` });
wx.showToast({ title: '支付功能稍后开放', icon: 'none' });
},
}); });

View File

@ -12,7 +12,7 @@
> >
<view class="flex-row self-stretch group"> <view class="flex-row self-stretch group">
<text class="font text">订单号:{{item.orderNumber}}</text> <text class="font text">订单号:{{item.orderNumber}}</text>
<text class="font_2 ml-37">{{ item.orderStatus }}</text> <text class="font_2">{{ item.orderStatus }}</text>
</view> </view>
<text class="self-stretch font_3 text_2">{{ item.name }}</text> <text class="self-stretch font_3 text_2">{{ item.name }}</text>
@ -30,11 +30,13 @@
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper" catch:tap="cancelOrder" data-id="{{ item.id }}"> <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> <text class="font_7">取消订单</text>
</view> </view>
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper_2 ml-11" catch:tap="payOrder"> <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> <text class="font_8">支付</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
</view> </view>

View File

@ -9,6 +9,13 @@
.ml-11 { .ml-11 {
margin-left: 20.63rpx; 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 { .page {
padding: 26.25rpx 0 50.63rpx; padding: 26.25rpx 0 50.63rpx;
background-color: #f8f8f8; background-color: #f8f8f8;
@ -32,8 +39,10 @@
margin-top: 0; margin-top: 0;
} }
.group { .group {
padding: 32.51rpx 0 25.82rpx; padding: 32.51rpx 15rpx 25.82rpx 0;
border-bottom: solid 1.88rpx #e3e3e3; border-bottom: solid 1.88rpx #e3e3e3;
display: flex;
justify-content: space-between;
} }
.font { .font {
font-size: 26.25rpx; font-size: 26.25rpx;

View File

@ -9,11 +9,15 @@ Page({
courseId: 0, // 课程id courseId: 0, // 课程id
courseObj: '', // 课程对象 courseObj: '', // 课程对象
globalImgUrl, // 全局图片 globalImgUrl, // 全局图片
isMaskVisible: false
}, },
// 创建订单方法 // 创建订单方法
createOrder() { createOrder() {
const { courseId } = this.data; const { courseId } = this.data;
// 1. 显示遮罩,阻止二次点击
this.setData({ isMaskVisible: true });
wx.showLoading({ title: '正在创建订单...' });
let orderId ; let orderId ;
wx.request({ wx.request({
url: baseUrl + '/courseOrder/add', url: baseUrl + '/courseOrder/add',
@ -25,16 +29,88 @@ Page({
Authorization :wx.getStorageSync('token'), Authorization :wx.getStorageSync('token'),
}, },
success : res => { success : res => {
console.log(res); orderId = res.data.data
this.setData({ this.setData({ orderId })
orderId: res.data.data wx.hideLoading();
}) if (res.data.code === 1) {
wx.navigateTo({ this.showIsPayModal(orderId)
url: `/pages/course/orderDetail/orderDetail?id=${this.data.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' });
}
});
}, },
// 获取课程详情 // 获取课程详情

View File

@ -38,9 +38,11 @@
<view class="footer"> <view class="footer">
<view class="flex-row justify-between items-center section_4"> <view class="flex-row justify-between items-center section_4">
<text class="font text_5">应付¥{{ courseObj.discountPrice }}</text> <text class="font text_5">应付¥{{ courseObj.discountPrice }}</text>
<view class="flex-col justify-center items-center text-wrapper" bind:tap="createOrder"> <view class="flex-col justify-center items-center text-wrapper" bindtap="createOrder">
<text class="font text_6">立即支付</text> <text class="font text_6">立即支付</text>
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
</view> </view>

View File

@ -7,6 +7,14 @@
.ml-1 { .ml-1 {
margin-left: 1.88rpx; 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 { .page {
background-color: #f7f7f7; background-color: #f7f7f7;
width: 100%; width: 100%;

View File

@ -13,9 +13,9 @@
</swiper> </swiper>
</view> </view>
<view class="flex-row equal-division"> <view class="flex-row equal-division">
<view class="flex-col items-center group_2 group_1" bind:tap="gotoCourseList" data-type="{{ '考' }}"> <view class="flex-col items-center group_2 group_1" bind:tap="gotoCourseList" data-type="{{ '考' }}">
<image class="image_3" src="./image/kgky.png" /> <image class="image_3" src="./image/kgky.png" />
<text class="font text_1 mt-12">考</text> <text class="font text_1 mt-12">考</text>
</view> </view>
<view class="flex-col items-center group_2 group_3" bind:tap="gotoCourseList" data-type="{{ '考公' }}"> <view class="flex-col items-center group_2 group_3" bind:tap="gotoCourseList" data-type="{{ '考公' }}">
<image class="image_3" src="./image/zmt.png" /> <image class="image_3" src="./image/zmt.png" />

View File

@ -17,7 +17,7 @@
padding-right: 28.13rpx; padding-right: 28.13rpx;
} }
.section { .section {
padding: 11.25rpx 0; padding: 15.25rpx 0;
background-color: #f2f2f2; background-color: #f2f2f2;
border-radius: 93.75rpx; border-radius: 93.75rpx;
} }
@ -27,7 +27,7 @@
} }
.text { .text {
color: #a8a8a8; color: #a8a8a8;
font-size: 22.5rpx; font-size: 26.5rpx;
font-family: SourceHanSerifCN; font-family: SourceHanSerifCN;
line-height: 20.83rpx; line-height: 20.83rpx;
} }

View File

@ -8,6 +8,7 @@ Page({
_secondsRemaining: 0, // 内部倒计时秒数 _secondsRemaining: 0, // 内部倒计时秒数
_hasShownTimeout: false, // 是否已弹过“超时未支付”弹窗 _hasShownTimeout: false, // 是否已弹过“超时未支付”弹窗
globalImgUrl, globalImgUrl,
isMaskVisible: false
}, },
onLoad(options) { onLoad(options) {
@ -15,7 +16,61 @@ Page({
this.setData({ orderId: options.id }); this.setData({ orderId: options.id });
this.getOrderDetail(); 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() { onUnload() {
clearInterval(this._timer); clearInterval(this._timer);
}, },
@ -48,7 +103,7 @@ Page({
// 将 "2025-07-13 12:38:17" → 时间戳 // 将 "2025-07-13 12:38:17" → 时间戳
const createMs = new Date(createTime.replace(/-/g, '/')).getTime(); const createMs = new Date(createTime.replace(/-/g, '/')).getTime();
const now = Date.now(); const now = Date.now();
let diff = Math.floor((createMs + 30 * 60 * 1000 - now) / 1000); let diff = Math.floor((createMs + 15 * 60 * 1000 - now) / 1000);
if (diff <= 0) { if (diff <= 0) {
// 已超时 // 已超时

View File

@ -73,7 +73,7 @@
<view class="flex-col justify-start items-center text-wrapper" bindtap="cancelOrder"> <view class="flex-col justify-start items-center text-wrapper" bindtap="cancelOrder">
<text class="font_3 text_17">取消</text> <text class="font_3 text_17">取消</text>
</view> </view>
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="goPay"> <view class="flex-col justify-start items-center text-wrapper_2" bindtap="showIsPayModal">
<text class="font_3 text_18">立即支付</text> <text class="font_3 text_18">立即支付</text>
</view> </view>
</view> </view>
@ -84,4 +84,5 @@
<text class="font_3 text_18">退款</text> <text class="font_3 text_18">退款</text>
</view> </view>
</view> </view>
<view wx:if="{{isMaskVisible}}" class="page-mask"></view>
</view> </view>

View File

@ -22,7 +22,14 @@
.mt-389 { .mt-389 {
margin-top: 729.38rpx; 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 { .page {
padding-top: 26.25rpx; padding-top: 26.25rpx;

View File

@ -1,13 +1,45 @@
// pages/course/searchCourses/searchCourses.js // pages/course/searchCourses/searchCourses.js
import { baseUrl, globalImgUrl } from "../../../request";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { 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})
}
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

View File

@ -5,20 +5,20 @@
class="image" class="image"
src="./images/sousuo.png" src="./images/sousuo.png"
/> />
<input class="text ml-3" placeholder="搜索更多好课" /> <input class="text ml-3" placeholder="搜索更多好课" bindinput="onSearchInput" confirm-type="search" bindconfirm="onSearch"/>
</view> </view>
<view class="flex-col list mt-17"> <view class="flex-col list mt-17">
<view class="flex-row relative list-item" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <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> <view class="list-divider pos_3"></view>
<image <image
class="image_2 pos" class="image_2 pos"
src="https://ide.code.fun/api/image?token=6854f3c94ae84d0012332367&name=9c2a22f14e2bd768cbd40d939693e4a8.png" src="{{globalImgUrl + item.image}}"
/> />
<view class="flex-col group_2 pos_2"> <view class="flex-col group_2 pos_2">
<text class="font">区块链和加密数字货币(随报随学认证班)</text> <text class="font">{{item.name}}</text>
<view class="flex-row justify-between items-baseline mt-17"> <view class="flex-row justify-between items-baseline mt-17">
<text class="font_2">券后99元起</text> <text class="font_2">券后{{item.discountPrice}}元起</text>
<text class="font_3">18523人学习</text> <text class="font_3">{{item.orderCount}}人学习</text>
</view> </view>
</view> </view>
</view> </view>

View File

@ -25,9 +25,13 @@
width: 35.63rpx; width: 35.63rpx;
height: 35.63rpx; height: 35.63rpx;
} }
input {
height: 50rpx;
width: 95%;
}
.text { .text {
color: #a8a8a8; color: #333333;
font-size: 22.5rpx; font-size: 26.5rpx;
font-family: SourceHanSerifCN; font-family: SourceHanSerifCN;
line-height: 20.83rpx; line-height: 20.83rpx;
} }

View File

@ -24,6 +24,8 @@ Page({
monthRefundAmount: 0, // 本月退款总金额 monthRefundAmount: 0, // 本月退款总金额
monthPromotionCount: 0, // 本月推广数量 monthPromotionCount: 0, // 本月推广数量
userRole: '', // 用户角色 userRole: '', // 用户角色
isShowArr: [],
widthRate: '30%'
}, },
onLoad(options) { onLoad(options) {
@ -45,6 +47,13 @@ Page({
break; break;
} }
this.setData({ showRole }); 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() { fetchPerformance() {

View File

@ -61,31 +61,36 @@
</view> </view>
<!-- 底部网格 --> <!-- 底部网格 -->
<view class="grid pos"> <view class="pos">
<view class="flex-col items-center grid-item"> <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="font text_2">主管数量</text>
<text class="mt-20 font_2">{{superCount}}</text> <text class="mt-20 font_2">{{superCount}}</text>
</view> </view>
<view class="flex-col items-center grid-item"> <view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[1]}}">
<text class="font text_3">员工数量</text> <text class="font text_3">员工数量</text>
<text class="mt-20 font_2">{{empCount}}</text> <text class="mt-20 font_2">{{empCount}}</text>
</view> </view>
<view class="flex-col items-center grid-item"> <view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[2]}}">
<text class="font text_4">客户数量</text> <text class="font text_4">客户数量</text>
<text class="mt-20 font_2">{{promoCount}}</text> <text class="mt-20 font_2">{{promoCount}}</text>
</view> </view>
<view class="flex-col items-center grid-item_2"> </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="font text_5">订单总金额</text>
<text class="mt-20 font_2">¥{{totalAmount}}</text> <text class="mt-20 font_2">¥{{totalAmount}}</text>
</view> </view>
<view class="flex-col items-center grid-item_2"> <view class="flex-col items-center grid-item_2" style="margin: 40rpx 10rpx 0">
<text class="font text_6">订单净成交</text> <text class="font text_6">订单净成交</text>
<text class="mt-20 font_2">¥{{netAmount}}</text> <text class="mt-20 font_2">¥{{netAmount}}</text>
</view> </view>
<view class="flex-col items-center grid-item_2"> <view class="flex-col items-center grid-item_2" style="margin-left: 10rpx">
<text class="font text_7">下单数量</text> <text class="font text_7">下单数量</text>
<text class="mt-20 font_2">{{orderCount}}</text> <text class="mt-20 font_2">{{orderCount}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>

View File

@ -232,6 +232,8 @@
line-height: 24.54rpx; line-height: 24.54rpx;
} }
.grid-item_2 { .grid-item_2 {
width: 30%;
margin-top: 40rpx;
padding: 22.5rpx 0; padding: 22.5rpx 0;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040); filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff; background-color: #ffffff;

View File

@ -12,6 +12,7 @@ Page({
sortOrders: ['升序', '降序'], sortOrders: ['升序', '降序'],
items: [], // 用于存储查询结果 items: [], // 用于存储查询结果
role: '', // 假设初始为主管角色,可以根据实际情况动态设置 role: '', // 假设初始为主管角色,可以根据实际情况动态设置
k: 1
}, },
// 主管名称输入 // 主管名称输入
@ -128,14 +129,14 @@ Page({
fail: () => { fail: () => {
// 请求失败后隐藏loading // 请求失败后隐藏loading
wx.hideLoading(); wx.hideLoading();
console.log('111');
wx.showToast({ wx.showToast({
title: '请求失败', title: '请求失败',
icon: 'none' icon: 'none'
}); });
} }
}); });
} else if( role === 'supervisor' ) { } else if( role === 'supervisor' || role === 'staff') {
wx.request({ wx.request({
url: baseUrl + '/perform/rank/staff', // 替换为实际API地址 url: baseUrl + '/perform/rank/staff', // 替换为实际API地址
method: 'POST', method: 'POST',
@ -175,6 +176,8 @@ Page({
onLoad(options) { onLoad(options) {
// 根据身份确定角色 // 根据身份确定角色
const role = options.role; const role = options.role;
this.setData({k: options.k})
if (role === 'staff') this.setData({selectedSortField: '推广人数'})
console.log('角色---->',options.role); console.log('角色---->',options.role);
this.setData({ role }); this.setData({ role });
let showRole = ''; let showRole = '';
@ -185,6 +188,8 @@ Page({
case 'supervisor': case 'supervisor':
showRole = '员工'; showRole = '员工';
break; break;
case 'staff':
showRole = '员工'
} }
this.setData({ showRole }); this.setData({ showRole });
this.onSearch() this.onSearch()

View File

@ -15,7 +15,8 @@
<!-- 手机号 --> <!-- 手机号 -->
<text class="self-start font text_5">手机号</text> <text class="self-start font text_5">手机号</text>
<view class="flex-col justify-start items-start self-start text-wrapper_1"> <view class="flex-col justify-start items-start self-start text-wrapper_1">
<input class="text_3 font text_6" placeholder="请输入手机号" bindinput="onPhoneInput"/> <input class="text_3 font text_6" placeholder="请输入手机号" bindinput="onPhoneInput"
maxLength="11" type="number"/>
</view> </view>
<!-- 排序条件选择 --> <!-- 排序条件选择 -->
@ -28,7 +29,7 @@
<image class="image" src="./images/bottom.png"/> <image class="image" src="./images/bottom.png"/>
</view> </view>
</picker> </picker>
<picker mode="selector" wx:if="{{ role === 'supervisor' }}" range="{{sortFieldsBySupervisor}}" bindchange="onSortFieldChange"> <picker mode="selector" wx:if="{{ role === 'supervisor' || role === 'staff'}}" range="{{sortFieldsBySupervisor}}" bindchange="onSortFieldChange">
<view class="flex-row justify-between section_2"> <view class="flex-row justify-between section_2">
<text class="font text_1">{{selectedSortField}}</text> <text class="font text_1">{{selectedSortField}}</text>
<image class="image" src="./images/bottom.png"/> <image class="image" src="./images/bottom.png"/>
@ -71,10 +72,10 @@
<!-- 绩效数据 --> <!-- 绩效数据 -->
<view class="flex-row mt-14"> <view class="flex-row mt-14">
<view class="flex-col justify-start items-center text-wrapper_5"> <view class="flex-col justify-start items-center text-wrapper_5" wx:if="{{k === '1'}}">
<text class="font_5 text_11">员工:{{item.empCount}}</text> <text class="font_5 text_11">员工:{{item.empCount}}</text>
</view> </view>
<view class="flex-col justify-start items-center text-wrapper_6 ml-8"> <view class="flex-col justify-start items-center text-wrapper_6">
<text class="font_5 text_12">推广:{{item.promoCount}}</text> <text class="font_5 text_12">推广:{{item.promoCount}}</text>
</view> </view>
<view class="flex-col justify-start items-center text-wrapper_7 ml-8"> <view class="flex-col justify-start items-center text-wrapper_7 ml-8">

View File

@ -12,9 +12,10 @@
background-color: #fefbf6; background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%; width: 100%;
overflow-y: auto; position: fixed;
overflow-x: hidden; bottom: 0;
height: 100%; overflow: auto;
height: calc(100vh - 1rpx);
} }
.text { .text {
color: #e67e22; color: #e67e22;
@ -165,6 +166,7 @@
width: 146.25rpx; width: 146.25rpx;
height: 56.25rpx; height: 56.25rpx;
border: solid 1.88rpx #ffa400; border: solid 1.88rpx #ffa400;
margin-right: 15rpx;
} }
.font_5 { .font_5 {
font-size: 26.25rpx; font-size: 26.25rpx;
@ -202,19 +204,17 @@
border: solid 1.88rpx #ffa400; border: solid 1.88rpx #ffa400;
} }
.text_13 { .text_13 {
margin-left: 16.86rpx; margin: 0 16.86rpx;
margin-right: 11.27rpx;
line-height: 24.23rpx; line-height: 24.23rpx;
} }
.text-wrapper_9 { .text-wrapper_9 {
padding: 14.61rpx 0 13.33rpx; padding: 14.61rpx 0 14.61rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 28.13rpx; border-radius: 28.13rpx;
height: 56.25rpx; height: 56.25rpx;
border: solid 1.88rpx #ffa400; border: solid 1.88rpx #ffa400;
} }
.text_14 { .text_14 {
margin-left: 18.86rpx; margin: 0 18.86rpx;
margin-right: 9.26rpx;
line-height: 24.56rpx; line-height: 24.56rpx;
} }

View File

@ -98,6 +98,7 @@ Page({
}, },
onLoad(options) { onLoad(options) {
console.log('========>', options)
this.setData({ this.setData({
supervisorUserId: options.supId, supervisorUserId: options.supId,
}) })

View File

@ -28,6 +28,7 @@
placeholder="请输入手机号" placeholder="请输入手机号"
bindinput="onPhoneInput" bindinput="onPhoneInput"
value="{{phoneNumber}}" value="{{phoneNumber}}"
type="number"
maxLength="11" maxLength="11"
/> />
</view> </view>

View File

@ -18,9 +18,10 @@
background-color: #fefbf6; background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%; width: 100%;
overflow-y: auto; position: fixed;
overflow-x: hidden; bottom: 0;
height: 100%; overflow: auto;
height: calc(100vh - 1rpx);
} }
.text { .text {
color: #e67e22; color: #e67e22;

View File

@ -28,6 +28,7 @@
placeholder="请输入手机号" placeholder="请输入手机号"
bindinput="onPhoneInput" bindinput="onPhoneInput"
value="{{phoneNumber}}" value="{{phoneNumber}}"
type="number"
maxLength="11" maxLength="11"
/> />
</view> </view>

View File

@ -18,9 +18,10 @@
background-color: #fefbf6; background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%; width: 100%;
overflow-y: auto; position: fixed;
overflow-x: hidden; bottom: 0;
height: 100%; overflow: auto;
height: calc(100vh - 1rpx);
} }
.text { .text {
color: #e67e22; color: #e67e22;

View File

@ -28,12 +28,12 @@ Page({
const { orderNumber, staffUserId } = this.data; const { orderNumber, staffUserId } = this.data;
// 简单校验:非空 // 简单校验:非空
if (!orderNumber) { // if (!orderNumber) {
return wx.showToast({ // return wx.showToast({
title: '请输入订单号', // title: '请输入订单号',
icon: 'none' // icon: 'none'
}); // });
} // }
// 发起 POST 请求 // 发起 POST 请求
wx.request({ wx.request({

View File

@ -11,6 +11,7 @@
class="text_3 font text_1" class="text_3 font text_1"
placeholder="请输入订单号" placeholder="请输入订单号"
value="{{orderNumber}}" value="{{orderNumber}}"
type="number"
bindinput="onOrderNumberInput" bindinput="onOrderNumberInput"
/> />
</view> </view>
@ -34,9 +35,9 @@
wx:for-index="index" wx:for-index="index"
wx:key="id" wx:key="id"
> >
<view class="flex-row items-baseline"> <view class="flex-row items-baseline" style="display: flex; justify-content: space-between;">
<text class="font_2 text_8">订单号:</text> <text class="font_2 text_8">订单号:</text>
<text class="font_3 ml-26">{{item.orderNumber}}</text> <text class="font_3">{{item.orderNumber}}</text>
</view> </view>
<view class="flex-row justify-between mt-19"> <view class="flex-row justify-between mt-19">
@ -54,22 +55,20 @@
<text class="font_3 text_24">¥{{item.totalAmount}}</text> <text class="font_3 text_24">¥{{item.totalAmount}}</text>
</view> </view>
<view class="flex-row justify-between mt-19"> <view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_15">状态:</text> <text class="font_2 text_15">状态:</text>
<text class="font_4 text_16">{{item.orderStatus}}</text> <text class="font_4 text_16">{{item.orderStatus}}</text>
</view> </view>
<view class="flex-row justify-between mt-19"> <view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_17">抽成:</text> <text class="font_2 text_17">抽成:</text>
<text class="font_4 text_18"> <text class="font_4 text_18">主管:{{item.firstRate * 100}}%,员工:{{item.secondRate * 100}}%
主管:{{item.firstRate * 100}}%,员工:{{item.secondRate * 100}}%
</text> </text>
</view> </view>
<view class="flex-row justify-between mt-19"> <view class="flex-row justify-between items-center mt-19">
<text class="font_2 text_19">奖励:</text> <text class="font_2 text_19">奖励:</text>
<text class="font_4 text_20"> <text class="font_4 text_20">主管:¥{{item.firstReward}},员工:¥{{item.secondReward}}
主管:¥{{item.firstReward}},员工:¥{{item.secondReward}}
</text> </text>
</view> </view>

View File

@ -9,9 +9,10 @@
background-color: #fefbf6; background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%; width: 100%;
overflow-y: auto; position: fixed;
overflow-x: hidden; bottom: 0;
height: 100%; overflow: auto;
height: calc(100vh - 1rpx);
} }
.text { .text {
color: #e67e22; color: #e67e22;
@ -118,6 +119,7 @@
font-size: 30rpx; font-size: 30rpx;
font-family: SourceHanSansCN; font-family: SourceHanSansCN;
line-height: 22.76rpx; line-height: 22.76rpx;
margin-right: 15rpx;
color: #444444; color: #444444;
} }
.text_9 { .text_9 {
@ -130,45 +132,45 @@
color: #444444; color: #444444;
} }
.text_10 { .text_10 {
margin-right: 19.69rpx; margin-right: 15rpx;
line-height: 27.84rpx; line-height: 27.84rpx;
} }
.text_11 { .text_11 {
line-height: 27.81rpx; line-height: 27.81rpx;
} }
.text_12 { .text_12 {
margin-right: 15.06rpx; margin-right: 15rpx;
} }
.text_13 { .text_13 {
line-height: 28.29rpx; line-height: 28.29rpx;
} }
.text_24 { .text_24 {
margin-right: 6.41rpx; margin-right: 15rpx;
} }
.text_15 { .text_15 {
line-height: 28.01rpx; line-height: 28.01rpx;
} }
.text_16 { .text_16 {
margin-right: 18.77rpx; margin-right: 15rpx;
line-height: 28.09rpx; line-height: 28.09rpx;
} }
.text_17 { .text_17 {
line-height: 28.16rpx; line-height: 28.16rpx;
} }
.text_18 { .text_18 {
margin-right: 11.44rpx; margin-right: 15rpx;
} }
.text_19 { .text_19 {
line-height: 28.2rpx; line-height: 28.2rpx;
} }
.text_20 { .text_20 {
margin-right: 7.76rpx; margin-right: 15rpx;
} }
.text_21 { .text_21 {
line-height: 28.31rpx; line-height: 28.31rpx;
} }
.text_23 { .text_23 {
margin-right: 19.31rpx; margin-right: 15rpx;
margin-bottom: 2.04rpx; margin-bottom: 2.04rpx;
line-height: 27.79rpx; line-height: 27.79rpx;
} }

View File

@ -158,6 +158,16 @@ Page({
return; 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({ wx.request({
url: baseUrl + '/advancementApply/add', url: baseUrl + '/advancementApply/add',
@ -175,7 +185,7 @@ Page({
success: res => { success: res => {
console.log('后端返回的申请---->', res); console.log('后端返回的申请---->', res);
if (res.data.code === 1) { if (res.data.code === 1) {
wx.showToast({ title: '验证通过,提交成功', icon: 'success' }); wx.showToast({ title: '提交成功', icon: 'success' });
// 清空表单内容 // 清空表单内容
this.setData({ this.setData({
@ -189,7 +199,7 @@ Page({
credential: '' // 清空凭证 credential: '' // 清空凭证
}); });
} else { } else {
wx.showToast({ title: '系统错误', icon: 'error' }); wx.showToast({ title: res.data.message, icon: 'none' });
} }
} }
}); });

View File

@ -54,6 +54,7 @@
bindinput="onInput" bindinput="onInput"
data-field="code" data-field="code"
value="{{code}}" value="{{code}}"
maxlength="6"
/> />
<view <view
class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-16" class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-16"

View File

@ -9,9 +9,11 @@
padding: 67.5rpx 49.69rpx 84.38rpx 51.56rpx; padding: 67.5rpx 49.69rpx 84.38rpx 51.56rpx;
background-color: #ffffff; background-color: #ffffff;
width: 100%; width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%; height: 100%;
position: fixed;
bottom: 0;
overflow: auto;
height: calc(100vh - 1rpx);
} }
.image { .image {
width: 232.5rpx; width: 232.5rpx;
@ -84,7 +86,7 @@
background-color: #ffffff00; background-color: #ffffff00;
} }
.section_3 { .section_3 {
padding: 19.69rpx 16.88rpx; padding: 30.69rpx 16.88rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 9.38rpx; border-radius: 9.38rpx;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
@ -169,7 +171,7 @@
padding: 13.13rpx 16.26rpx 15rpx 16.26rpx; padding: 13.13rpx 16.26rpx 15rpx 16.26rpx;
} }
.input_2 { .input_2 {
padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx; padding: 0 16.88rpx;
} }
.input_3 { .input_3 {
padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx; padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx;

View File

@ -125,8 +125,7 @@ Page({
verificationCode: code, verificationCode: code,
userPassword: newPwd, userPassword: newPwd,
userConfirmPassword: confirmPwd, userConfirmPassword: confirmPwd,
sourceToken: null, userRole: role
role: role
}, },
success: res => { success: res => {
if (res.data.code === 1) { if (res.data.code === 1) {

View File

@ -68,7 +68,7 @@ Page({
// 获取验证码(仅校验手机号) // 获取验证码(仅校验手机号)
getSmsCode() { getSmsCode() {
const { phone } = this.data; const { phone, role } = this.data;
// 1. 非空校验 // 1. 非空校验
if (!validate(this.data, { phone: '请输入手机号' })) { if (!validate(this.data, { phone: '请输入手机号' })) {
@ -83,7 +83,10 @@ Page({
wx.request({ wx.request({
url: baseUrl + '/userInfo/code/pwd', url: baseUrl + '/userInfo/code/pwd',
method: 'POST', method: 'POST',
data: { templateString: phone }, data: {
phoneNumber: phone,
userRole: role
},
success: (res) => { success: (res) => {
console.log('验证码发送--->',res.data); console.log('验证码发送--->',res.data);
if (res.data.code === 1) { if (res.data.code === 1) {
@ -163,7 +166,7 @@ Page({
: baseUrl + '/userInfo/mini/vcd/login'; : baseUrl + '/userInfo/mini/vcd/login';
const payload = loginType === 'password' const payload = loginType === 'password'
? { phoneNumber: phone, userPassword: credential, userRole: role } ? { phoneNumber: phone, userPassword: credential, userRole: role }
: { phoneNumber: phone, verificationCode: credential }; : { phoneNumber: phone, verificationCode: credential, userRole: role };
wx.request({ wx.request({
url, url,
@ -176,7 +179,7 @@ Page({
const token = res.data.data.token || res.data.data; const token = res.data.data.token || res.data.data;
// ← 新增:将 token 存到本地缓存 // ← 新增:将 token 存到本地缓存
wx.setStorageSync('token', token); wx.setStorageSync('token', token);
wx.setStorageSync('role', role)
wx.showToast({ wx.showToast({
title: '登录成功', title: '登录成功',
icon: 'success', icon: 'success',

View File

@ -18,7 +18,17 @@ Page({
this.setData({ this.setData({
role: options.role role: options.role
}) })
if (options.role === 'supervisor') { const scene = decodeURIComponent(options.scene)
if (scene !== 'undefined') {
let [key, value] = scene.split('=');
console.log(key, value)
if (value === 'manager') value = 'supervisor'
else if (value === 'supervisor') value = 'staff'
else if (value === 'staff') value = 'user'
this.setData({inviteCode: key, role: value})
}
if (this.data.role === 'supervisor') {
this.setData({ this.setData({
placeholder: '请输入学校名称' placeholder: '请输入学校名称'
}) })
@ -27,9 +37,6 @@ Page({
placeholder : '请输入昵称' placeholder : '请输入昵称'
}) })
} }
const scene = decodeURIComponent(options.scene)
let [key, value] = scene.split('=');
this.setData({inviteCode: value})
}, },
/** /**
@ -47,7 +54,7 @@ Page({
}, },
sendSmsCode() { sendSmsCode() {
const { phone } = this.data; const { phone, role } = this.data;
if (!phone.trim()) { if (!phone.trim()) {
wx.showToast({ title: '请输入手机号', icon: 'none' }); wx.showToast({ title: '请输入手机号', icon: 'none' });
return; return;
@ -61,7 +68,8 @@ Page({
method: 'POST', method: 'POST',
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
data: { data: {
templateString: phone phoneNumber: phone,
userRole: role
}, },
success: res => { success: res => {
// 假设后端返回 { success: true, ... } // 假设后端返回 { success: true, ... }
@ -156,7 +164,6 @@ Page({
}) })
const { role } = this.data; const { role } = this.data;
const res = await requestAsync({ const res = await requestAsync({
url: baseUrl + '/userInfo/register', url: baseUrl + '/userInfo/register',
method: 'POST', method: 'POST',
@ -177,21 +184,22 @@ Page({
icon: 'success', icon: 'success',
duration: 1000, duration: 1000,
}); });
wx.hideLoading()
setTimeout(() => { setTimeout(() => {
wx.navigateBack()({ wx.navigateTo({
// url: '/pages/loginModule/pwdLogin/pwdLogin', url: `/pages/loginModule/pwdLogin/pwdLogin?role=${role}`,
success: () => { success: () => {
this.setData({ nickname:'', phone:'', captcha:'', inviteCode:'', password:'', agree:false }); this.setData({ nickname:'', phone:'', captcha:'', inviteCode:'', password:'', agree:false });
} }
}); });
}, 1000); }, 1000);
} else { } else {
console.log(res.data)
wx.showToast({ wx.showToast({
title: res.data.message || '注册失败', title: res.data.message || '注册失败',
icon: 'none' icon: 'none',
duration: 1000
}); });
wx.hideLoading() // wx.hideLoading()
} }
}, },

View File

@ -1,5 +1,5 @@
// pages/personCenter/accountSetting/accountSetting.js // pages/personCenter/accountSetting/accountSetting.js
const { baseUrl } = require("../../../request"); const { baseUrl, globalImgUrl } = require("../../../request");
Page({ Page({
@ -9,12 +9,15 @@ Page({
data: { data: {
nickName: "", nickName: "",
userAvatar: "", userAvatar: "",
phoneNumber: "" phoneNumber: "",
globalImgUrl,
role: '',
}, },
gotoResetPwd() { gotoResetPwd() {
const { role } = this.data;
wx.navigateTo({ wx.navigateTo({
url: '/pages/personCenter/resetPwd/resetPwd', url: `/pages/personCenter/resetPwd/resetPwd?role=${ role }`,
}) })
}, },
@ -32,6 +35,7 @@ Page({
icon: 'success' icon: 'success'
}) })
wx.removeStorageSync('token') wx.removeStorageSync('token')
wx.removeStorageSync('role')
setTimeout(() => { setTimeout(() => {
wx.reLaunch({ wx.reLaunch({
url: '/pages/welcome/homePage/homePage', url: '/pages/welcome/homePage/homePage',
@ -63,13 +67,14 @@ Page({
Authorization: token Authorization: token
}, },
success: res => { success: res => {
console.log('用户信息---->',res.data.data);
if (res.data.code === 1) { if (res.data.code === 1) {
this.setData({ this.setData({
nickName: res.data.data.nickName, nickName: res.data.data.nickName,
// TODO 头像未连接
userAvatar: res.data.data.userAvatar, userAvatar: res.data.data.userAvatar,
phoneNumber: res.data.data.phoneNumber, phoneNumber: res.data.data.phoneNumber,
userAccount: res.data.data.userAccount userAccount: res.data.data.userAccount,
role:res.data.data.userRole,
}) })
} }
}, },

View File

@ -3,7 +3,7 @@
<view class="flex-row self-stretch section"> <view class="flex-row self-stretch section">
<image <image
class="self-center image" class="self-center image"
src="./images/logo.png" src="{{globalImgUrl + userAvatar}}"
/> />
<view class="flex-col items-start flex-1 self-start group_2 ml-8"> <view class="flex-col items-start flex-1 self-start group_2 ml-8">
<text class="text">{{ nickName }}</text> <text class="text">{{ nickName }}</text>

View File

@ -20,6 +20,7 @@
.image { .image {
width: 121.88rpx; width: 121.88rpx;
height: 121.88rpx; height: 121.88rpx;
border-radius: 30rpx;
} }
.group_2 { .group_2 {
margin-top: 21.84rpx; margin-top: 21.84rpx;

View File

@ -18,16 +18,69 @@ Page({
isShowOrder: true, isShowOrder: true,
qrcode: "", // 设置二维码图片的路径 qrcode: "", // 设置二维码图片的路径
userRole: "", userRole: "",
title: '查看绩效',
id: 0, id: 0,
globalImgUrl
}, },
// 跳转课程订单页面 // 跳转课程订单页面
courseOrder() { courseOrder() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/course/courseOrderList/courseOrderList', url: '/pages/course/courseOrderList/courseOrderList',
}) })
}, },
updateAvatar(e) {
const { avatarUrl } = e.detail
this.uploadAvatar(avatarUrl)
},
uploadAvatar(filePath) {
wx.showLoading({ title: '上传中...' });
wx.uploadFile({
url: baseUrl + '/file/upload',
filePath,
name: 'file',
formData: {
biz: 'default'
},
success: res => {
wx.hideLoading();
let result = JSON.parse(res.data);
console.log(result)
if (result.code === 1) {
this.setData({userAvatar: result.data})
this.updateUserInfo(result.data)
} else {
wx.showToast({
title: result.message || '上传失败',
icon: 'none'
});
}
},
fail: err => {
wx.hideLoading();
console.error('uploadFile fail', err);
wx.showToast({ title: '网络错误,上传失败', icon: 'none' });
}
});
},
updateUserInfo(view) {
const token = wx.getStorageSync('token')
wx.request({
url: baseUrl + '/userInfo/modify/avatar',
method: 'POST',
header: {
Authorization: token
},
data: {
templateString: view
},
success: res => {
console.log(res.data)
},
fail: err => {
wx.showToast({ title: '用户头像更新失败', icon: 'none' });
}
})
},
// 跳转结算记录页面 // 跳转结算记录页面
gotoSettlementRecord() { gotoSettlementRecord() {
wx.navigateTo({ wx.navigateTo({
@ -141,7 +194,6 @@ Page({
let result = res.data.data let result = res.data.data
this.setData({ this.setData({
nickName: result.nickName, nickName: result.nickName,
// TODO 头像未连接
userAvatar: result.userAvatar, userAvatar: result.userAvatar,
phoneNumber: result.phoneNumber, phoneNumber: result.phoneNumber,
userAccount: result.userAccount, userAccount: result.userAccount,
@ -149,7 +201,9 @@ Page({
userRole: result.userRole, userRole: result.userRole,
id: result.id, id: result.id,
}) })
console.log(result.userRole)
if (result.userRole !== 'user') this.setData({ isShowOrder: false}); if (result.userRole !== 'user') this.setData({ isShowOrder: false});
if (result.userRole === 'staff') this.setData({title: '客户订单'});
} }
} }
}) })
@ -198,19 +252,48 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: `/pages/dashboardModule/supervisorPerformance/supervisorPerformance?role=${userRole}&id=${id}`, url: `/pages/dashboardModule/supervisorPerformance/supervisorPerformance?role=${userRole}&id=${id}`,
}) })
} else if (userRole === 'staff') {
wx.navigateTo({
url: `/pages/dashboardModule/userOrderPerformance/userOrderPerformance?userId=${id}`,
})
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: `/pages/dashboardModule/staffPerformance/staffPerformance?role=${userRole}&id=${id}`, url: `/pages/dashboardModule/staffPerformance/staffPerformance?role=${userRole}&supId=${id}`,
}) })
} }
}, },
// 跳转排名 // 跳转主管排名
gotoRank(e) { gotoSupervisorRank(e) {
console.log(e); console.log(e)
const userRole = e.currentTarget.dataset.userrole; const {userRole} = this.data
console.log('===========>', userRole)
if (userRole === 'staff') {
wx.showToast({
title: '无权限',
icon: 'error'
})
return ;
}
wx.navigateTo({ wx.navigateTo({
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=${userRole}`, url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=manager&k=1`,
})
},
// 跳转员工排名
gotoStaffRank(e) {
console.log(e);
const {userRole} = this.data
console.log('===========>', userRole)
if (userRole === 'user') {
wx.showToast({
title: '无权限',
icon: 'error'
})
return ;
}
wx.navigateTo({
url: `/pages/dashboardModule/performanceRanking/performanceRanking?role=staff&k=0`,
}) })
}, },

View File

@ -212,13 +212,16 @@
<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">
<image <image
class="image" class="image"
src="./images/logo.png" src="{{globalImgUrl + userAvatar}}"
mode="aspectFill"
/> />
</button>
<view class="flex-col ml-6"> <view class="flex-col ml-6">
<text class="self-start font text">{{ nickName }}</text> <text class="self-start font text">{{ nickName }}</text>
<view class="flex-row items-center self-stretch group_2 mt-9" bind:tap="gotoCall"> <view class="flex-row items-center self-stretch group_2 mt-9" bindtap="gotoCall">
<image <image
class="image_3" class="image_3"
src="./images/dianhua.png" src="./images/dianhua.png"
@ -248,21 +251,21 @@
</view> </view>
<view class="flex-col mt-22" > <view class="flex-col mt-22" >
<view class="flex-row items-start equal-division section_3" wx:if="{{ userRole != 'user' }}"> <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" bind:tap="checkPerformance"> <view class="flex-col items-center equal-division-item_1 group_3" bindtap="checkPerformance">
<image <image
class="image_5" class="image_5"
src="./images/zhijinxiangqing.png" src="./images/zhijinxiangqing.png"
/> />
<text class="font text_5 mt-6">查看绩效</text> <text class="font text_5 mt-6">{{title}}</text>
</view> </view>
<view class="flex-col items-center equal-division-item_2 equal-division-item" bind:tap="gotoRank" data-userRole="{{ 'manager' }}"> <view class="flex-col items-center equal-division-item_2 equal-division-item" bindtap="gotoSupervisorRank" data-userRole="{{ 'manager' }}">
<image <image
class="image_5" class="image_5"
src="./images/tixianzhanghu.png" src="./images/tixianzhanghu.png"
/> />
<text class="font text_6 mt-6">主管排名</text> <text class="font text_6 mt-6">主管排名</text>
</view> </view>
<view class="flex-col items-center equal-division-item_3 group_5" bind:tap="gotoRank" data-userRole="{{ 'supervisor' }}"> <view class="flex-col items-center equal-division-item_3 group_5" bindtap="gotoStaffRank" data-userRole="{{ 'supervisor' }}">
<image <image
class="image_5" class="image_5"
src="./images/tixianjilu.png" src="./images/tixianjilu.png"
@ -271,8 +274,8 @@
</view> </view>
</view> </view>
<view class="flex-col list"> <view class="flex-col list">
<view class="flex-row justify-between items-center section_4" wx:if="{{isShowOrder}}"> <view class="flex-row justify-between items-center section_4" wx:if="{{isShowOrder}}" bindtap="courseOrder">
<view class="flex-row items-center" bind:tap="courseOrder"> <view class="flex-row items-center">
<image <image
class="shrink-0 image_6" class="shrink-0 image_6"
src="./images/zhanghaoshezhi.png" src="./images/zhanghaoshezhi.png"
@ -284,7 +287,7 @@
src="./images/xiajiantou.png" src="./images/xiajiantou.png"
/> />
</view> </view>
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="gotoDashboard"> <view class="flex-row justify-between items-center section_4 mt-11" bindtap="gotoDashboard" wx:if="{{ userRole !== 'user' }}">
<view class="flex-row items-center"> <view class="flex-row items-center">
<image <image
class="shrink-0 image_6" class="shrink-0 image_6"
@ -297,7 +300,7 @@
src="./images/xiajiantou.png" src="./images/xiajiantou.png"
/> />
</view> </view>
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="zhshezhi"> <view class="flex-row justify-between items-center section_4 mt-11" bindtap="zhshezhi">
<view class="flex-row items-center"> <view class="flex-row items-center">
<image <image
class="shrink-0 image_6" class="shrink-0 image_6"

View File

@ -19,13 +19,26 @@
height: 100%; height: 100%;
} }
.section { .section {
padding: 15rpx 13.13rpx 26.25rpx; padding: 15rpx 13.13rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 8.33rpx; border-radius: 8.33rpx;
} }
.image { .image {
width: 161.25rpx; margin: 20rpx;
height: 161.25rpx; width: 141.25rpx;
height: 141.25rpx;
border-radius: 30rpx;
}
button {
/* 去掉默认最小宽度 */
min-width: 0 !important;
/* 确保宽度随内容自适应 */
width: auto !important;
/* 下面是其他重置,保证“隐形” */
background: transparent !important;
border: none !important;
padding: 0 !important;
margin: 0 !important;
} }
.font { .font {
font-size: 26.25rpx; font-size: 26.25rpx;
@ -67,7 +80,7 @@
} }
.group { .group {
margin-top: 33.75rpx; margin-top: 33.75rpx;
width: 163.72rpx; width: 133.72rpx;
} }
.image_2 { .image_2 {
margin-left: 17.48rpx; margin-left: 17.48rpx;

View File

@ -13,11 +13,12 @@ Page({
count: 60, count: 60,
password: '', // 第一次输入的密码 password: '', // 第一次输入的密码
currentPwd: '', // 再次确认密码 currentPwd: '', // 再次确认密码
verificationCode: '' // 验证码 verificationCode: '', // 验证码
role: '',
}, },
resetPwd() { resetPwd() {
const { phone, verificationCode, password, currentPwd } = this.data; const { phone, verificationCode, password, currentPwd, role } = this.data;
if( !formatPassword(password,currentPwd) ) { if( !formatPassword(password,currentPwd) ) {
return; return;
} }
@ -32,7 +33,8 @@ Page({
verificationCode: verificationCode, verificationCode: verificationCode,
userPassword: password, userPassword: password,
userConfirmPassword: currentPwd, userConfirmPassword: currentPwd,
sourceToken: wx.getStorageSync('token') sourceToken: wx.getStorageSync('token'),
userRole: role,
}, },
success: res => { success: res => {
console.log('修改密码--->',res); console.log('修改密码--->',res);
@ -43,7 +45,7 @@ Page({
}) })
setTimeout(() => { setTimeout(() => {
wx.reLaunch({ wx.reLaunch({
url: '/pages/loginModule/pwdLogin/pwdLogin', url: '/pages/welcome/homePage/homePage',
}) })
}, 1000); // 1000ms = 1秒 }, 1000); // 1000ms = 1秒
@ -67,7 +69,8 @@ Page({
Authorization: wx.getStorageSync('token') Authorization: wx.getStorageSync('token')
}, },
data: { data: {
templateString: phone phoneNumber: phone,
userRole: wx.getStorageSync('role')
}, },
success: res => { success: res => {
if (res.data.code === 1) { if (res.data.code === 1) {
@ -111,6 +114,10 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log('---->',options);
this.setData({
role: options.role
})
// 获取用户信息 —— 用于渲染手机号 // 获取用户信息 —— 用于渲染手机号
wx.request({ wx.request({
url: baseUrl + '/userInfo/get/jwt', url: baseUrl + '/userInfo/get/jwt',

View File

@ -20,7 +20,7 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad() {
let token = wx.getStorageSync('token') let token = wx.getStorageSync('token')
if (token) { if (token) {
wx.switchTab({ wx.switchTab({

View File

@ -25,5 +25,5 @@
"tabIndent": "auto", "tabIndent": "auto",
"tabSize": 2 "tabSize": 2
}, },
"appid": "wx3f968a09e31d6bed" "appid": "wx8711c8d4fb04fef9"
} }

View File

@ -3,7 +3,7 @@
"projectname": "qingcheng-xiaochengxu", "projectname": "qingcheng-xiaochengxu",
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false, "urlCheck": true,
"bigPackageSizeSupport": false "bigPackageSizeSupport": false
}, },
"condition": {}, "condition": {},

View File

@ -1,7 +1,9 @@
export const local='http://localhost:9091'; export const local='http://localhost:9091';
export const caozhe = 'http://160.202.242.36:9093'
export const dev = 'http://160.202.242.36:9091'; 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 baseUrl = test; export const ssl = 'https://www.chenxinzhi.top'
export const baseUrl = ssl;
export const globalImgUrl = baseUrl + '/file/download/' export const globalImgUrl = baseUrl + '/file/download/'