小程序提交

This commit is contained in:
2025-08-04 16:31:21 +08:00
parent 5c2082adf4
commit 0587539253
12 changed files with 1443 additions and 0 deletions

View File

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

View File

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

View File

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

View File

@ -0,0 +1,289 @@
.mt-19 {
margin-top: 35.63rpx;
}
.mt-7 {
margin-top: 13.13rpx;
}
.mt-25 {
margin-top: 46.88rpx;
}
.mt-13 {
margin-top: 24.38rpx;
}
.mt-17 {
margin-top: 31.88rpx;
}
.page {
padding: 71.06rpx 42.19rpx 117.19rpx 43.99rpx;
background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
font-weight: 700;
line-height: 42.75rpx;
}
.section {
padding: 45.75rpx 39.26rpx 47.94rpx 42.99rpx;
background-color: #ffffff;
border-radius: 18.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.text-wrapper {
padding: 17.63rpx 0 14.63rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
width: 403.13rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_3 {
margin-left: 15.19rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.6rpx;
color: #66666b;
}
.text_2 {
margin-left: 2.63rpx;
line-height: 27.75rpx;
}
.text_4 {
line-height: 27.75rpx;
}
.text_1 {
margin-left: 2.44rpx;
}
.text-wrapper_1 {
padding: 17.66rpx 0 14.64rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
width: 403.13rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_5 {
line-height: 27.69rpx;
}
.text-wrapper_2 {
margin-right: 12.43rpx;
padding: 26.29rpx 0 21.02rpx;
background-color: #ffa400;
border-radius: 9.38rpx;
}
.text_6 {
color: #ffffff;
line-height: 27.69rpx;
}
.list-item {
padding-bottom: 38.57rpx;
background-color: #ffffff;
border-radius: 16.48rpx;
border: solid 1.88rpx #ffeaa7;
}
.list-item:first-child {
margin-top: 0;
}
.group {
padding: 33.62rpx 32.01rpx 31.22rpx 35.33rpx;
}
.font_2 {
font-size: 33.75rpx;
font-family: SourceHanSansCN;
line-height: 31.82rpx;
font-weight: 700;
color: #e88b38;
}
.text_8 {
line-height: 27.86rpx;
}
.text-wrapper_4 {
padding: 18.51rpx 0 15.28rpx;
background-color: #fefbf6;
border-radius: 9.38rpx;
height: 61.88rpx;
border: solid 1.88rpx #ffeaa7;
}
.font_3 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #e88b38;
}
.text_7 {
margin-left: 19.41rpx;
margin-right: 10.59rpx;
line-height: 24.34rpx;
}
.section_3 {
margin-left: 33.62rpx;
padding: 17.76rpx 16.14rpx 14.64rpx 17.61rpx;
background-color: #fefbf6;
border-radius: 9.38rpx;
border: solid 1.88rpx #ffeaa7;
}
.font_4 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.6rpx;
color: #333333;
}
.text_9 {
line-height: 24.15rpx;
margin-left: 20rpx;
}
.group_2 {
padding: 24.38rpx 33.75rpx 26.25rpx;
border-bottom: solid 1.88rpx #e88b38;
}
.text-wrapper_5 {
padding: 17.72rpx 0 14.53rpx;
background-color: #fefbf6;
border-radius: 9.38rpx;
height: 63.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_10 {
margin-left: 17.08rpx;
margin-right: 7.29rpx;
line-height: 27.75rpx;
}
.text-wrapper_6 {
padding: 17.78rpx 0 14.63rpx;
background-color: #fefbf6;
border-radius: 9.38rpx;
height: 63.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_11 {
margin-left: 13.93rpx;
}
.group_3 {
margin: 32.81rpx 29.19rpx 0 32.68rpx;
height: 487.5rpx;
display: grid;
grid-template-rows: repeat(3, minmax(0, 1fr));
grid-template-columns: repeat(3, minmax(0, 1fr));
row-gap: 29.19rpx;
column-gap: 31.07rpx;
}
.grid-item {
padding: 32.49rpx 18.19rpx 31.44rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.3rpx;
color: #66666b;
}
.text_12 {
line-height: 24.02rpx;
}
.font_6 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 20.06rpx;
color: #e88b38;
}
.grid-item_2 {
padding: 32.42rpx 17.87rpx 31.18rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_13 {
line-height: 24.09rpx;
}
.text_15 {
margin-left: 4.39rpx;
}
.grid-item_3 {
padding: 32.16rpx 18rpx 31.44rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_14 {
line-height: 24.56rpx;
}
.text_16 {
margin-left: 3.32rpx;
}
.grid-item_4 {
padding: 32.34rpx 17.51rpx 31.44rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_17 {
line-height: 24.26rpx;
}
.text_18 {
margin-left: 3.81rpx;
}
.grid-item_5 {
padding: 32.25rpx 18.21rpx 31.18rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.grid-item_6 {
padding: 32.25rpx 19.18rpx 31.44rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_19 {
margin-left: 2.14rpx;
}
.grid-item_7 {
padding: 32.36rpx 17.59rpx 31.44rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_20 {
line-height: 24.43rpx;
}
.grid-item_8 {
padding: 32.38rpx 17.81rpx 31.18rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_21 {
line-height: 24.17rpx;
}
.text_23 {
margin-left: 4.44rpx;
}
.grid-item_9 {
padding: 33.43rpx 19.18rpx 31.44rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #f1c40f;
}
.text_22 {
line-height: 23.08rpx;
}
.text_24 {
margin-left: 2.14rpx;
}