小程序提交

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

View File

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

View File

@ -0,0 +1,131 @@
<!-- pages/dashboardModule/supervisorPerformance/supervisorPerformance.wxml -->
<view class="flex-col page">
<!-- 标题 -->
<text class="self-center text">员工业绩报表</text>
<!-- 搜索表单 -->
<view class="flex-col self-stretch mt-19">
<view class="flex-col section">
<!-- 主管名称 -->
<view class="flex-col items-start">
<text class="font text_2">员工名称</text>
<view class="flex-col justify-start items-start text-wrapper mt-7">
<input
class="text_3 font text_4"
placeholder="请输入员工名称"
bindinput="onNameInput"
value="{{nickName}}"
/>
</view>
</view>
<!-- 手机号 -->
<view class="flex-col items-start mt-24">
<text class="font text_1">手机号</text>
<view class="flex-col justify-start items-start text-wrapper_1 mt-8">
<input
class="text_3 font text_5"
placeholder="请输入手机号"
bindinput="onPhoneInput"
value="{{phoneNumber}}"
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="gotoUser" data-id="{{ item.userId }}">
<text class="font_3 text_7">客户订单明细>></text>
</view>
</view>
<!-- 手机号 & 复制 -->
<view class="flex-row self-start section_3">
<text class="font_4">手机号:{{item.phoneNumber}}</text>
<text
class="font_3 text_9"
bindtap="onCopyPhone"
data-phone="{{item.phoneNumber}}"
>复制</text>
</view>
<!-- 员工数 & 抽成比例 -->
<view class="flex-row self-stretch group_2">
<view class="flex-col justify-start text-wrapper_5">
<text class="font_4 text_10">客户数:{{item.empCount}}</text>
</view>
<view class="flex-col justify-start text-wrapper_6 ml-10">
<text class="font_4 text_11">比例:{{item.ratePercent}}%</text>
</view>
</view>
<!-- 业绩网格 -->
<view class="self-stretch group_3">
<view class="flex-col items-start grid-item">
<text class="font_5 text_12">下单量</text>
<text class="font_6 mt-18">{{item.orderCount}}</text>
</view>
<view class="flex-col items-start grid-item_2">
<text class="font_5 text_13">总订单</text>
<text class="font_6 text_15 mt-18">¥{{item.totalAmount}}</text>
</view>
<view class="flex-col items-start grid-item_3">
<text class="font_5 text_14">净成交</text>
<text class="font_6 text_16 mt-17">¥{{item.netAmount}}</text>
</view>
<view class="flex-col items-start grid-item_4">
<text class="font_5 text_17">待释放</text>
<text class="font_6 text_18 mt-18">¥{{item.toRelease}}</text>
</view>
<view class="flex-col items-start grid-item_5">
<text class="font_5">可结算</text>
<text class="font_6 mt-18">{{item.toSettle}}</text>
</view>
<view class="flex-col items-start grid-item_6">
<text class="font_5">已结算</text>
<text class="font_6 text_19 mt-18">¥{{item.settled}}</text>
</view>
<view class="flex-col items-start grid-item_7">
<text class="font_5 text_20">推广数</text>
<text class="font_6 mt-17">{{item.promoCount}}</text>
</view>
<view class="flex-col items-start grid-item_8">
<text class="font_5 text_21">退款</text>
<text class="font_6 text_23 mt-18">¥{{item.refunded}}</text>
</view>
<view class="flex-col items-start grid-item_9">
<text class="font_5 text_22">已回退</text>
<text class="font_6 text_24 mt-18">¥0</text>
</view>
</view>
</view>
</view>
</view>
</block>
</view>

View File

@ -0,0 +1,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;
}

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;
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,174 @@
.mt-19 {
margin-top: 35.63rpx;
}
.mt-35 {
margin-top: 65.63rpx;
}
.page {
padding: 70.84rpx 42.19rpx 152.81rpx 44.06rpx;
background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
font-weight: 700;
line-height: 43.16rpx;
}
.section {
padding: 0 35.76rpx 47.94rpx 41.12rpx;
background-color: #ffffff;
border-radius: 18.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.group {
padding: 47.87rpx 0 51.56rpx;
}
.text-wrapper {
margin-right: 3.77rpx;
margin-top: 14.55rpx;
padding: 17.66rpx 0 14.68rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_3 {
margin-left: 15.19rpx;
width: 500rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.54rpx;
color: #66666b;
}
.text_2 {
margin-left: 2.44rpx;
line-height: 27.45rpx;
}
.text_1 {
line-height: 27.66rpx;
}
.text_4 {
margin-left: 4.31rpx;
margin-top: 36.64rpx;
line-height: 27.6rpx;
}
.group_2 {
margin-top: 16.39rpx;
}
.text-wrapper_2 {
padding: 19.13rpx 0 11.68rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
width: 258.75rpx;
height: 63.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_5 {
margin-left: 17.01rpx;
line-height: 29.19rpx;
}
.text_6 {
margin-left: 20.42rpx;
margin-bottom: 26.04rpx;
color: #000000;
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 1.63rpx;
}
.view {
margin-left: 9.58rpx;
}
.text-wrapper_3 {
margin-left: 2.81rpx;
margin-right: 15.94rpx;
padding: 26.29rpx 0 21.02rpx;
background-color: #ffa400;
border-radius: 9.38rpx;
}
.font_2 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.54rpx;
color: #ffa500;
}
.text_7 {
color: #ffffff;
line-height: 27.69rpx;
}
.list-item {
padding: 44.94rpx 7.14rpx 41.46rpx 29.68rpx;
background-color: #ffffff;
border-radius: 11.89rpx;
border: solid 1.88rpx #ffeaa7;
}
.list-item:first-child {
margin-top: 0;
}
.text_8 {
line-height: 27.66rpx;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 22.76rpx;
color: #444444;
}
.text_9 {
line-height: 28.24rpx;
}
.font_4 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.54rpx;
color: #444444;
}
.text_10 {
margin-right: 19.69rpx;
line-height: 27.84rpx;
}
.text_11 {
line-height: 27.81rpx;
}
.text_12 {
margin-right: 15.06rpx;
}
.text_13 {
line-height: 28.29rpx;
}
.text_24 {
margin-right: 6.41rpx;
}
.text_15 {
line-height: 28.01rpx;
}
.text_16 {
margin-right: 18.77rpx;
line-height: 28.09rpx;
}
.text_17 {
line-height: 28.16rpx;
}
.text_18 {
margin-right: 11.44rpx;
}
.text_19 {
line-height: 28.2rpx;
}
.text_20 {
margin-right: 7.76rpx;
}
.text_21 {
line-height: 28.31rpx;
}
.text_23 {
margin-right: 19.31rpx;
margin-bottom: 2.04rpx;
line-height: 27.79rpx;
}