美化了样式

This commit is contained in:
2025-08-15 00:36:04 +08:00
parent 5fc1378051
commit 1b4d3e310b
63 changed files with 2735 additions and 2411 deletions

View File

@ -1,4 +1,5 @@
import { baseUrl } from "../../../request";
const { notLogin } = require('../../../utils/util')
Page({
data: {
@ -120,10 +121,7 @@ Page({
items: res.data.data
});
} else {
wx.showToast({
title: '没有数据',
icon: 'none'
});
notLogin(res.data.message)
}
},
fail: () => {

View File

@ -1,97 +1,127 @@
<view class="flex-col page">
<!-- pages/dashboardModule/ranking/ranking.wxml按你的实际路径命名 -->
<view class="page">
<!-- 页面标题 -->
<text class="self-center text">{{ showRole }}绩效排名</text>
<!-- 表单区域 -->
<view class="flex-col self-stretch mt-27">
<view class="flex-col section">
<!-- 主管名称 -->
<text class="self-start font text_2">{{ showRole }}名称</text>
<view class="flex-col justify-start items-start self-start text-wrapper">
<input class="text_3 font text_4" placeholder="请输入{{ showRole }}名称" bindinput="onNameInput"/>
</view>
<!-- 手机号 -->
<text class="self-start font text_5">手机号</text>
<view class="flex-col justify-start items-start self-start text-wrapper_1">
<input class="text_3 font text_6" placeholder="请输入手机号" bindinput="onPhoneInput"
maxLength="11" type="number"/>
</view>
<!-- 排序条件选择 -->
<text class="self-start font text_7">排序条件</text>
<view class="flex-row equal-division">
<view class="flex-row justify-between section_2 section_1">
<picker wx:if="{{ role === 'manager' }}" mode="selector" range="{{sortFieldsByManager}}" bindchange="onSortFieldChange">
<view class="flex-row justify-between section_2">
<text class="font text_1">{{selectedSortField}}</text>
<image class="image" src="./images/bottom.png"/>
</view>
</picker>
<picker mode="selector" wx:if="{{ role === 'supervisor' || role === 'staff'}}" range="{{sortFieldsBySupervisor}}" bindchange="onSortFieldChange">
<view class="flex-row justify-between section_2">
<text class="font text_1">{{selectedSortField}}</text>
<image class="image" src="./images/bottom.png"/>
</view>
</picker>
<view class="page-title">
<text class="title">{{ showRole }}绩效排名</text>
</view>
<scroll-view scroll-y class="content no-scrollbar">
<!-- 表单卡片 -->
<view class="card form-card">
<!-- 名称 -->
<view class="field">
<text class="field-label">{{ showRole }}名称</text>
<view class="input-box">
<input
class="input"
placeholder="请输入{{ showRole }}名称"
bindinput="onNameInput"
/>
</view>
<!-- 排序顺序 -->
<view class="flex-row justify-between section_2 section_3 ml-16">
<picker mode="selector" range="{{sortOrders}}" bindchange="onSortOrderChange">
<view class="flex-row justify-between section_2">
<text class="font text_16">{{selectedSortOrder}}</text>
<image class="image" src="./images/bottom.png"/>
</view>
</picker>
</view>
<!-- 手机号 -->
<view class="field">
<text class="field-label">手机号</text>
<view class="input-box">
<input
class="input"
placeholder="请输入手机号"
bindinput="onPhoneInput"
maxlength="11"
type="number"
/>
</view>
</view>
<!-- 排序条件 -->
<view class="field">
<text class="field-label">排序条件</text>
<view class="picker-row">
<!-- 排序字段 -->
<view class="picker-box">
<picker wx:if="{{ role === 'manager' }}"
mode="selector"
range="{{ sortFieldsByManager }}"
bindchange="onSortFieldChange">
<view class="picker-inner">
<text class="picker-text">{{ selectedSortField }}</text>
<image class="arrow" src="./images/bottom.png" />
</view>
</picker>
<picker wx:if="{{ role === 'supervisor' || role === 'staff' }}"
mode="selector"
range="{{ sortFieldsBySupervisor }}"
bindchange="onSortFieldChange">
<view class="picker-inner">
<text class="picker-text">{{ selectedSortField }}</text>
<image class="arrow" src="./images/bottom.png" />
</view>
</picker>
</view>
<!-- 排序顺序 -->
<view class="picker-box">
<picker mode="selector"
range="{{ sortOrders }}"
bindchange="onSortOrderChange">
<view class="picker-inner">
<text class="picker-text">{{ selectedSortOrder }}</text>
<image class="arrow" src="./images/bottom.png" />
</view>
</picker>
</view>
</view>
</view>
<!-- 搜索按钮 -->
<view class="flex-col justify-start items-center self-stretch text-wrapper_2" bindtap="onSearch">
<text class="font text_8" >搜索</text>
</view>
<view class="btn btn-primary" bindtap="onSearch">搜索</view>
</view>
</view>
<!-- 查询结果展示 -->
<view class="flex-col mt-26">
<view class="flex-col list-item mt-19" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<!-- 排名 -->
<view class="flex-row">
<view class="flex-col justify-start items-center text-wrapper_4">
<text class="font_2 text_9">{{index + 1}}</text>
<!-- 结果列表 -->
<view class="result-wrap">
<view class="card item-card"
wx:for="{{ items }}"
wx:for-item="item"
wx:for-index="index"
wx:key="index">
<!-- 头部:排名 + 基本信息 -->
<view class="item-head">
<view class="rank-badge {{ index < 3 ? 'rank-top' : '' }}">
<text class="rank-text">{{ index + 1 }}</text>
</view>
<view class="person-line">
<text class="name">{{ item.nickName }}</text>
<text class="phone">{{ item.phoneNumber }}</text>
</view>
</view>
<!-- 主管信息 -->
<view class="flex-row items-center self-start group ml-20">
<text class="font_3">{{item.nickName}}</text>
<text class="font_4 ml-7">{{item.phoneNumber}}</text>
<!-- 指标 chips -->
<view class="chips">
<view wx:if="{{ k === '1' }}" class="chip">员工:{{ item.empCount }}</view>
<view class="chip">推广:{{ item.promoCount }}</view>
<view class="chip">下单:{{ item.orderCount }}</view>
</view>
<!-- 金额类键值行 -->
<view class="kv">
<text class="kv-key">总额</text>
<text class="kv-val money">¥{{ item.totalAmount }}</text>
</view>
<view class="kv">
<text class="kv-key">净成交</text>
<text class="kv-val money">¥{{ item.netAmount }}</text>
</view>
</view>
<!-- 绩效数据 -->
<view class="flex-row mt-14">
<view class="flex-col justify-start items-center text-wrapper_5" wx:if="{{k === '1'}}">
<text class="font_5 text_11">员工:{{item.empCount}}</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_6">
<text class="font_5 text_12">推广:{{item.promoCount}}</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_7 ml-8">
<text class="font_5">下单:{{item.orderCount}}</text>
</view>
</view>
<!-- 订单金额 -->
<view class="flex-row mt-14">
<view class="flex-col justify-start text-wrapper_8">
<text class="font_5 text_13">总额:¥{{item.totalAmount}}</text>
</view>
<view class="flex-col justify-start text-wrapper_9 ml-16">
<text class="font_5 text_14">净成交:¥{{item.netAmount}}</text>
</view>
<!-- 空状态 -->
<view wx:if="{{ !items || !items.length }}" class="empty">
<image class="empty-img" src="/assets/empty-list.png" mode="aspectFit" />
<text class="empty-text">暂无数据</text>
</view>
</view>
</view>
</scroll-view>
</view>

View File

@ -1,220 +1,188 @@
.mt-27 {
margin-top: 50.63rpx;
}
.mt-19 {
margin-top: 35.63rpx;
}
.ml-7 {
margin-left: 13.13rpx;
}
/* ===== 页面框架 ===== */
.page {
padding: 71.06rpx 42.19rpx 199.69rpx 44.06rpx;
background-color: #fefbf6;
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
background: #fefbf6;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.page-title {
padding: 24rpx 24rpx 0;
}
.title {
font-size: 40rpx;
font-weight: 700;
color: #e67e22; /* 主色:暖橙 */
}
.content {
flex: 1;
padding: 24rpx;
box-sizing: border-box;
}
/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
width: 0;
height: 0;
display: none;
}
/* ===== 卡片通用 ===== */
.card {
background: #ffffff;
border-radius: 18rpx;
padding: 24rpx;
border: 2rpx solid #ffeaa7; /* 与你项目的浅橙描边一致 */
box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.05);
}
.card + .card { margin-top: 20rpx; }
/* ===== 表单区 ===== */
.form-card .field + .field { margin-top: 20rpx; }
.field-label {
font-size: 28rpx;
color: #555555;
margin-bottom: 12rpx;
display: block;
}
/* 输入框 */
.input-box {
height: 84rpx;
border-radius: 12rpx;
border: 2rpx solid #ffeaa7;
background: #ffffff;
padding: 0 20rpx;
display: flex;
align-items: center;
}
.input {
flex: 1;
font-size: 28rpx;
color: #1f1f1f;
}
/* 选择器行 */
.picker-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16rpx;
}
.picker-box {
height: 84rpx;
border-radius: 12rpx;
border: 2rpx solid #ffeaa7;
background: #ffffff;
display: flex;
align-items: center;
}
.picker-inner {
padding: 0 20rpx;
width: 100%;
position: fixed;
bottom: 0;
overflow: auto;
height: calc(100vh - 1rpx);
height: 84rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.text {
color: #e67e22;
font-size: 45rpx;
font-family: SourceHanSansCN;
font-weight: 700;
line-height: 42.84rpx;
}
.section {
padding: 45.75rpx 42.99rpx 34.82rpx;
background-color: #ffffff;
border-radius: 23.47rpx;
border: solid 1.88rpx #ffeaa7;
}
.text-wrapper {
margin-top: 14.49rpx;
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 {
.picker-text { font-size: 28rpx; color: #1f1f1f; }
.arrow { width: 28rpx; height: 28rpx; }
/* 搜索按钮 */
.btn {
height: 88rpx;
border-radius: 999rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.14rpx;
color: #66666b;
font-weight: 600;
margin-top: 24rpx;
}
.text_2 {
margin-left: 2.63rpx;
line-height: 27.75rpx;
}
.text_4 {
line-height: 27.75rpx;
}
.text_5 {
margin-left: 2.44rpx;
margin-top: 41.32rpx;
line-height: 27.6rpx;
}
.text-wrapper_1 {
margin-top: 14.51rpx;
padding: 17.66rpx 0 14.64rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
width: 403.13rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_6 {
line-height: 27.69rpx;
}
.text_7 {
margin-left: 2.19rpx;
margin-top: 41.18rpx;
line-height: 27.84rpx;
}
.equal-division {
align-self: stretch;
margin-right: 4.01rpx;
margin-top: 16.29rpx;
}
.section_2 {
flex: 1 1 270rpx;
}
.section_1 {
padding: 17.68rpx 14.19rpx 14.34rpx 14.89rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
height: 63.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_1 {
line-height: 27.94rpx;
}
.image {
width: 26.25rpx;
height: 26.25rpx;
}
.section_3 {
padding: 17.61rpx 16.27rpx 14.55rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
height: 63.75rpx;
border: solid 1.88rpx #ffeaa7;
}
.text_16 {
line-height: 27.84rpx;
}
.text-wrapper_2 {
margin: 32.81rpx 4.97rpx 0 4.69rpx;
padding: 26.29rpx 0 21.02rpx;
background-color: #ffa400;
border-radius: 9.38rpx;
}
.text_8 {
.btn-primary {
background: linear-gradient(180deg, #ffa400 0%, #e67e22 100%);
color: #ffffff;
line-height: 27.69rpx;
box-shadow: 0 6rpx 14rpx rgba(230,126,34,0.30);
}
.list-item {
padding: 29.89rpx 29.87rpx 31.99rpx 33.62rpx;
background-color: #ffffff;
border-radius: 18.75rpx;
border: solid 1.88rpx #ffeaa7;
/* ===== 列表与条目 ===== */
.result-wrap { margin-top: 20rpx; }
.item-card { padding-top: 20rpx; }
/* 顶部信息 */
.item-head {
display: flex;
align-items: center;
gap: 16rpx;
margin-bottom: 8rpx;
}
.list-item:first-child {
margin-top: 0;
.rank-badge {
width: 64rpx;
height: 64rpx;
border-radius: 999rpx;
background: #f0f0f0;
border: 2rpx solid #e6e6e6;
display: flex;
align-items: center;
justify-content: center;
}
.text-wrapper_4 {
padding: 17.93rpx 0 12.34rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
width: 52.5rpx;
height: 56.25rpx;
border: solid 1.88rpx #ffa400;
.rank-top {
background: #fff6e6;
border-color: #ffd6b3;
}
.font_2 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 24.02rpx;
.rank-text {
font-size: 28rpx;
font-weight: 700;
color: #ffa400;
color: #333333;
}
.text_9 {
line-height: 22.24rpx;
.person-line {
display: flex;
align-items: baseline;
gap: 12rpx;
flex-wrap: wrap;
}
.group {
margin-top: 22.18rpx;
.name { font-size: 30rpx; font-weight: 600; color: #1f1f1f; }
.phone { font-size: 26rpx; color: #666666; }
/* 指标 Chips */
.chips {
display: flex;
gap: 12rpx;
flex-wrap: wrap;
margin: 8rpx 0 4rpx;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 28.14rpx;
color: #000000;
.chip {
padding: 10rpx 16rpx;
background: #f7f9fc;
color: #3d4f6e;
border: 1rpx solid #e6edf7;
border-radius: 12rpx;
font-size: 24rpx;
}
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 19.93rpx;
color: #66666b;
/* 金额类键值行 */
.kv {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12rpx 0;
border-top: 1rpx dashed #f0f0f0;
}
.text-wrapper_5 {
padding: 16.71rpx 0 12.71rpx;
background-color: #ffffff;
border-radius: 28.13rpx;
width: 146.25rpx;
height: 56.25rpx;
border: solid 1.88rpx #ffa400;
margin-right: 15rpx;
.kv:first-of-type { border-top: 0; }
.kv-key { font-size: 26rpx; color: #666666; }
.kv-val { font-size: 28rpx; color: #1f1f1f; }
.money { color: #e67e22; font-weight: 700; }
/* ===== 空状态 ===== */
.empty {
padding: 120rpx 0 40rpx;
display: flex;
flex-direction: column;
align-items: center;
color: #999999;
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.02rpx;
color: #000000;
}
.text_11 {
line-height: 23.08rpx;
}
.text-wrapper_6 {
padding: 15.51rpx 0 12.56rpx;
background-color: #ffffff;
border-radius: 28.13rpx;
width: 146.25rpx;
height: 56.25rpx;
border: solid 1.88rpx #ffa400;
}
.text_12 {
line-height: 24.43rpx;
}
.text-wrapper_7 {
padding: 15.62rpx 0 12.86rpx;
background-color: #ffffff;
border-radius: 28.13rpx;
width: 146.25rpx;
height: 56.25rpx;
border: solid 1.88rpx #ffa400;
}
.text-wrapper_8 {
padding: 14.87rpx 0 13.41rpx;
background-color: #ffffff;
border-radius: 28.13rpx;
height: 56.25rpx;
border: solid 1.88rpx #ffa400;
}
.text_13 {
margin: 0 16.86rpx;
line-height: 24.23rpx;
}
.text-wrapper_9 {
padding: 14.61rpx 0 13.33rpx;
background-color: #ffffff;
border-radius: 28.13rpx;
height: 56.25rpx;
border: solid 1.88rpx #ffa400;
}
.text_14 {
margin: 0 18.86rpx;
line-height: 24.56rpx;
}
.empty-img { width: 300rpx; height: 300rpx; margin-bottom: 16rpx; }
.empty-text { font-size: 26rpx; }