青橙1.1.2

This commit is contained in:
2025-08-16 22:14:42 +08:00
parent a3ffe71ccb
commit 3dc4d64215
33 changed files with 430 additions and 289 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -106,6 +106,11 @@ Page({
this.onSearchSupId();
},
onPullDownRefresh() {
this.onSearchSupId()
wx.stopPullDownRefresh();
},
// 跳转用户订单
gotoUser(e) {
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-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 {
font-size: 24rpx;
color: #ff8a00;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -87,7 +87,7 @@
flex-wrap: wrap;
}
.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 {
height: 40rpx;