小程序提交

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