| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003 |
- <template>
- <view class="page-team-system" :style="{ '--font-scale': fontScale }">
- <!-- 团队切换器(T31 多团队管理;厂商卡片一行横排,超出可横向滚动) -->
- <view class="team-switcher-wrap" v-if="teamList.length > 0">
- <scroll-view class="team-switcher" scroll-x="true" :show-scrollbar="false">
- <view
- class="team-tab"
- v-for="team in teamList"
- :key="team.id"
- :class="{ 'team-tab-active': currentSystemId === team.id }"
- @click="switchTeam(team.id)"
- >
- <text class="team-tab-text">{{ team.name || '未命名团队' }}</text>
- </view>
- </scroll-view>
- </view>
- <!-- 头部:体系信息 -->
- <view class="system-header" v-if="systemInfo">
- <view class="system-info">
- <view class="system-icon">🏢</view>
- <view class="system-detail">
- <text class="system-name">{{ systemInfo.name || '我的供应商体系' }}</text>
- <text class="system-desc">服务商团队管理</text>
- </view>
- </view>
- <view class="system-status" :class="systemInfo.status">
- <text>{{ systemInfo.status === 'active' ? '活跃' : '未激活' }}</text>
- </view>
- </view>
- <!-- 层级关系 -->
- <view class="section" v-if="hierarchyInfo">
- <view class="section-header">
- <text class="section-title">层级关系</text>
- </view>
- <view class="hierarchy-grid">
- <!-- 上级 -->
- <view class="hierarchy-item" v-if="hierarchyInfo.parent">
- <view class="hierarchy-label">上级服务商</view>
- <view class="hierarchy-person">
- <image v-if="hierarchyInfo.parent.avatar" class="avatar-img" :src="hierarchyInfo.parent.avatar" mode="aspectFill"></image>
- <text v-else class="avatar-placeholder">👤</text>
- <view class="person-info">
- <text class="person-name">{{ hierarchyInfo.parent.nickname || '服务商' }}</text>
- <text class="person-level">上级</text>
- </view>
- </view>
- </view>
- <!-- 下级 -->
- <view class="hierarchy-item" v-else>
- <view class="hierarchy-label">下级服务商</view>
- <view class="hierarchy-empty">
- <text>暂无下级</text>
- </view>
- </view>
- <!-- 团队规模 -->
- <view class="hierarchy-stat">
- <text class="stat-value">{{ hierarchyInfo.totalChildren || 0 }}</text>
- <text class="stat-label">团队成员</text>
- </view>
- </view>
- </view>
- <!-- 团队统计 -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">团队数据</text>
- </view>
- <view class="stats-grid">
- <view class="stat-card">
- <text class="stat-num">{{ teamStats.customerCount || 0 }}</text>
- <text class="stat-name">客户归属</text>
- </view>
- <view class="stat-card">
- <text class="stat-num">{{ teamStats.orderCount || 0 }}</text>
- <text class="stat-name">关联订单</text>
- </view>
- <view class="stat-card">
- <text class="stat-num">{{ teamStats.amount || 0 }}</text>
- <text class="stat-name">关联金额(元)</text>
- </view>
- </view>
- </view>
- <!-- 团队成员列表 -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">团队成员</text>
- <view class="section-actions">
- <text class="section-action" @click="goToMembers">查看全部</text>
- <text class="section-action section-action-invite" @click="openInviteDialog">邀请成员</text>
- </view>
- </view>
- <view class="member-list">
- <view class="member-item" v-for="member in teamMembers.slice(0, 5)" :key="member.userId">
- <image v-if="member.avatar" class="member-avatar" :src="member.avatar" mode="aspectFill"></image>
- <text v-else class="member-avatar-placeholder">👤</text>
- <view class="member-info">
- <text class="member-name">{{ member.nickname || '微信用户' }}</text>
- <text class="member-role">{{ member.role || '成员' }}</text>
- </view>
- <view class="member-stats">
- <text class="member-count">{{ member.customerCount || 0 }}</text>
- <text class="member-label">客户</text>
- </view>
- </view>
- <view class="empty-tip" v-if="teamMembers.length === 0">
- <text>暂无团队成员</text>
- </view>
- </view>
- </view>
- <!-- 团队客户列表 -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">团队客户</text>
- <text class="section-action" @click="goToCustomers">查看全部</text>
- </view>
- <view class="customer-list">
- <view class="customer-item" v-for="customer in teamCustomers.slice(0, 5)" :key="customer.id">
- <view class="customer-avatar">
- <text class="customer-icon">👥</text>
- </view>
- <view class="customer-info">
- <text class="customer-name">{{ customer.familyName || '未知家庭' }}</text>
- <text class="customer-meta">{{ customer.source === 'manual' ? '人工绑定' : customer.source === 'order' ? '下单自动' : '推荐码' }}</text>
- </view>
- <view class="customer-stats">
- <text class="customer-orders">{{ customer.orderCount || 0 }}</text>
- <text class="customer-label">订单</text>
- </view>
- </view>
- <view class="empty-tip" v-if="teamCustomers.length === 0">
- <text>暂无客户数据</text>
- </view>
- </view>
- </view>
- <!-- 操作按钮 -->
- <view class="action-bar">
- <button class="btn-manage" @click="goToManage">团队管理</button>
- <button class="btn-customers" @click="goToCustomers">客户列表</button>
- </view>
- <!-- 邀请成员弹窗(T38:生成/复制个人专属邀请码;小程序码可后置) -->
- <view class="invite-mask" v-if="showInviteDialog" @click="closeInviteDialog">
- <view class="invite-dialog" @click.stop>
- <view class="invite-header">
- <text class="invite-title">邀请成员加入团队</text>
- <text class="invite-close" @click="closeInviteDialog">✕</text>
- </view>
- <view class="invite-body">
- <text class="invite-tip">邀请码永久有效,好友凭码加入后成为你的下级成员</text>
- <view class="invite-code-box">
- <text class="invite-code" v-if="inviteInfo && inviteInfo.inviteCode">{{ inviteInfo.inviteCode }}</text>
- <text class="invite-code-placeholder" v-else>正在生成邀请码…</text>
- </view>
- <view class="invite-btns">
- <button class="invite-btn invite-btn-primary" :disabled="!inviteInfo || !inviteInfo.inviteCode" @click="copyInviteCode">复制邀请码</button>
- <button class="invite-btn invite-btn-ghost" @click="refreshInviteCode">刷新邀请码</button>
- </view>
- <text class="invite-share-text" v-if="inviteInfo && inviteInfo.shareText">{{ inviteInfo.shareText }}</text>
- <text class="invite-qr-hint">小程序码可后置,当前通过复制邀请码分享</text>
- <text class="invite-join-entry" @click="goToInviteJoin">收到邀请码?点这里加入团队</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { getVendorSystemInfo, getVendorHierarchyInfo, getVendorTeamMembers, getVendorTeamCustomers, getVendorTeamList, getVendorInviteCode } from '@/utils/api.js'
- import fontScaleMixin from '@/mixins/font-scale.js'
- export default {
- mixins: [fontScaleMixin],
- data() {
- return {
- teamList: [], // 我的团队列表(切换器数据源,T31)
- currentSystemId: null, // 当前选中的团队
- systemInfo: null,
- hierarchyInfo: null,
- teamStats: {
- customerCount: 0,
- orderCount: 0,
- amount: 0
- },
- teamMembers: [],
- teamCustomers: [],
- customerTotal: 0, // 「客户归属」真实总数(后端 total,避免分页截断)
- showInviteDialog: false, // 邀请成员弹窗显隐(T38)
- inviteInfo: null // 我的邀请码信息 {inviteCode, teamName, shareText}
- }
- },
- onLoad() {
- this.loadData()
- this._onLoadFired = true
- },
- onShow() {
- if (this._onLoadFired) {
- // 首次进入:onLoad 已加载,跳过避免双发
- this._onLoadFired = false
- } else {
- this.loadData()
- }
- },
- methods: {
- async loadData() {
- try {
- // 1. 拉取我的团队列表,解析当前选中团队
- var teams = []
- try {
- const teamsRes = await getVendorTeamList()
- teams = teamsRes.data || []
- } catch (e) {
- teams = []
- }
- this.teamList = teams
- // 保持当前选中;失效(被移除/首次进入)则回退第一个团队
- var stillValid = false
- for (var i = 0; i < teams.length; i++) {
- if (teams[i].id === this.currentSystemId) {
- stillValid = true
- break
- }
- }
- if (!this.currentSystemId || !stillValid) {
- this.currentSystemId = teams.length > 0 ? teams[0].id : null
- }
- if (!this.currentSystemId) {
- // 无任何团队:清空数据
- this.systemInfo = null
- this.hierarchyInfo = null
- this.teamMembers = []
- this.teamCustomers = []
- this.updateStats()
- return
- }
- // 2. 并发加载当前团队数据(竞态防护:切换后旧响应不覆盖新团队)
- var seq = (this._teamLoadSeq || 0) + 1
- this._teamLoadSeq = seq
- const [systemRes, hierarchyRes, membersRes, customersRes] = await Promise.all([
- this.fetchSystemInfo(),
- this.fetchHierarchyInfo(),
- this.fetchTeamMembers(),
- this.fetchTeamCustomers()
- ])
- if (seq !== this._teamLoadSeq) return
- if (systemRes) {
- this.systemInfo = systemRes
- }
- if (hierarchyRes) {
- this.hierarchyInfo = hierarchyRes
- }
- if (membersRes) {
- this.teamMembers = membersRes
- }
- if (customersRes) {
- this.teamCustomers = customersRes.list || []
- this.customerTotal = customersRes.total || 0
- }
- // 更新统计
- this.updateStats()
- } catch (error) {
- console.error('加载团队数据失败:', error)
- }
- },
- // 切换团队:联动刷新成员/客户/统计(T31)
- switchTeam(systemId) {
- if (!systemId || systemId === this.currentSystemId) return
- this.currentSystemId = systemId
- this.systemInfo = null
- this.hierarchyInfo = null
- this.teamMembers = []
- this.teamCustomers = []
- this.inviteInfo = null
- this.loadTeamData()
- },
- // 按当前选中团队加载各数据源
- async loadTeamData() {
- // 竞态防护:仅应用最新一次切换的响应,避免快速切换时旧数据覆盖新团队
- var seq = (this._teamLoadSeq || 0) + 1
- this._teamLoadSeq = seq
- try {
- const [systemRes, hierarchyRes, membersRes, customersRes] = await Promise.all([
- this.fetchSystemInfo(),
- this.fetchHierarchyInfo(),
- this.fetchTeamMembers(),
- this.fetchTeamCustomers()
- ])
- if (seq !== this._teamLoadSeq) return
- if (systemRes) {
- this.systemInfo = systemRes
- }
- if (hierarchyRes) {
- this.hierarchyInfo = hierarchyRes
- }
- if (membersRes) {
- this.teamMembers = membersRes
- }
- if (customersRes) {
- this.teamCustomers = customersRes.list || []
- this.customerTotal = customersRes.total || 0
- }
- this.updateStats()
- } catch (error) {
- console.error('加载团队数据失败:', error)
- }
- },
- // 获取体系信息
- async fetchSystemInfo() {
- try {
- const res = await getVendorSystemInfo(this.currentSystemId)
- return res.data || null
- } catch (e) {
- return null
- }
- },
- // 获取层级关系
- async fetchHierarchyInfo() {
- try {
- const res = await getVendorHierarchyInfo(this.currentSystemId)
- return res.data || null
- } catch (e) {
- return null
- }
- },
- // 获取团队成员
- async fetchTeamMembers() {
- try {
- const res = await getVendorTeamMembers(this.currentSystemId)
- return res.data || []
- } catch (e) {
- return []
- }
- },
- // 获取团队客户(返回 { list, total };兼容旧后端数组形状)
- async fetchTeamCustomers() {
- try {
- const res = await getVendorTeamCustomers({
- systemId: this.currentSystemId,
- parentId: null,
- page: 1,
- size: 50
- })
- var data = res.data || {}
- if (data instanceof Array) {
- return { list: data, total: data.length }
- }
- return {
- list: data.list || [],
- total: data.total || 0
- }
- } catch (e) {
- return { list: [], total: 0 }
- }
- },
- // 更新统计数据(「客户归属」用后端返回的真实总数,避免分页截断)
- updateStats() {
- this.teamStats.customerCount = this.customerTotal || 0
- },
- // 跳转管理页面
- goToManage() {
- uni.navigateTo({
- url: '/pages/vendor/team-manage/team-manage'
- })
- },
- // 跳转客户列表(携带当前团队)
- goToCustomers() {
- var url = '/pages/vendor/team-customers/team-customers'
- if (this.currentSystemId) {
- url = url + '?systemId=' + this.currentSystemId
- }
- uni.navigateTo({
- url: url
- })
- },
- // ===== 邀请成员(T38)=====
- // 打开邀请弹窗:首次进入自动生成/获取我的邀请码
- async openInviteDialog() {
- if (!this.currentSystemId) {
- uni.showToast({ title: '请先选择团队', icon: 'none' })
- return
- }
- this.showInviteDialog = true
- if (!this.inviteInfo || !this.inviteInfo.inviteCode) {
- await this.loadInviteCode(false)
- }
- },
- // 生成/获取我的邀请码(refresh=true 重置旧码)
- async loadInviteCode(refresh) {
- try {
- const res = await getVendorInviteCode({
- systemId: this.currentSystemId,
- refresh: !!refresh
- })
- this.inviteInfo = res.data || null
- } catch (e) {
- // 生成失败(如非团队成员/团队停用):关闭弹窗并提示
- this.showInviteDialog = false
- uni.showToast({ title: (e && e.message) || '获取邀请码失败', icon: 'none' })
- }
- },
- closeInviteDialog() {
- this.showInviteDialog = false
- },
- copyInviteCode() {
- if (!this.inviteInfo || !this.inviteInfo.inviteCode) return
- uni.setClipboardData({
- data: this.inviteInfo.inviteCode,
- success: function () {
- uni.showToast({ title: '邀请码已复制', icon: 'none' })
- }
- })
- },
- async refreshInviteCode() {
- await this.loadInviteCode(true)
- if (this.inviteInfo && this.inviteInfo.inviteCode) {
- uni.showToast({ title: '已刷新,旧码失效', icon: 'none' })
- }
- },
- // 进入受邀确认页(可手动粘贴邀请码)
- goToInviteJoin() {
- uni.navigateTo({
- url: '/pages/vendor/team-invite/team-invite'
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .page-team-system {
- background-color: $uni-primary-pale;
- min-height: 100vh;
- padding-bottom: 100rpx;
- }
- /* 体系头部 */
- .system-header {
- background-color: $app-surface;
- padding: $uni-space-page;
- margin-bottom: 24rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
- }
- /* 团队切换器(T31 多团队管理;厂商卡片一行横排,超出可横向滚动) */
- .team-switcher-wrap {
- background-color: $app-surface;
- padding: 20rpx 0;
- margin-bottom: 24rpx;
- }
- .team-switcher {
- width: 100%;
- white-space: nowrap;
- }
- .team-tab {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- padding: 16rpx 28rpx;
- margin-left: $uni-space-lg;
- border-radius: 999rpx;
- background-color: $uni-primary-pale;
- }
- .team-tab:first-child {
- margin-left: $uni-space-page;
- }
- .team-tab:last-child {
- margin-right: $uni-space-page;
- }
- .team-tab-active {
- background-color: $brand-primary;
- }
- .team-tab-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-body;
- white-space: nowrap;
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .team-tab-active .team-tab-text {
- color: $app-surface;
- font-weight: bold;
- }
- .system-info {
- display: flex;
- align-items: center;
- }
- .system-icon {
- font-size: calc($uni-font-size-4xl * var(--font-scale, 1));
- margin-right: 20rpx;
- }
- .system-name {
- font-size: calc(32rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $facade-text-strong;
- }
- .system-desc {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- margin-top: 4rpx;
- }
- .system-status {
- padding: 8rpx 20rpx;
- border-radius: 24rpx;
- font-size: calc(24rpx * var(--font-scale, 1));
- }
- .system-status.active {
- background-color: #E6F7EE;
- color: #65C29A;
- }
- .system-status.inactive {
- background-color: #FFF7EE;
- color: $brand-primary;
- }
- /* 区块 */
- .section {
- background-color: $app-surface;
- border-radius: 24rpx;
- padding: 24rpx;
- margin: 0 $uni-space-lg 24rpx;
- box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
- }
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24rpx;
- }
- .section-title {
- font-size: calc(28rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $facade-text-strong;
- }
- .section-action {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $brand-primary;
- }
- .section-actions {
- display: flex;
- align-items: center;
- }
- .section-action-invite {
- margin-left: 24rpx;
- padding: 6rpx 20rpx;
- border-radius: 999rpx;
- background-color: $brand-primary;
- color: $app-surface;
- }
- /* 邀请成员弹窗(T38) */
- .invite-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.45);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 999;
- }
- .invite-dialog {
- width: 620rpx;
- max-width: 86%;
- background-color: $app-surface;
- border-radius: 24rpx;
- padding: 32rpx;
- box-sizing: border-box;
- }
- .invite-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24rpx;
- }
- .invite-title {
- font-size: calc(32rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $facade-text-strong;
- }
- .invite-close {
- font-size: calc(28rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- padding: 0 12rpx;
- }
- .invite-tip {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- display: block;
- margin-bottom: 20rpx;
- }
- .invite-code-box {
- background-color: $uni-primary-pale;
- border-radius: 16rpx;
- padding: 32rpx 20rpx;
- text-align: center;
- margin-bottom: 24rpx;
- }
- .invite-code {
- font-size: calc(44rpx * var(--font-scale, 1));
- font-weight: bold;
- letter-spacing: 6rpx;
- color: $brand-primary;
- }
- .invite-code-placeholder {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- }
- .invite-btns {
- display: flex;
- margin-bottom: 20rpx;
- }
- .invite-btn {
- flex: 1;
- height: 76rpx;
- line-height: 76rpx;
- border-radius: 20rpx;
- font-size: calc(26rpx * var(--font-scale, 1));
- border: none;
- margin: 0 8rpx;
- padding: 0;
- }
- .invite-btn-primary {
- background-color: $brand-primary;
- color: $app-surface;
- }
- .invite-btn-primary[disabled] {
- opacity: 0.5;
- }
- .invite-btn-ghost {
- background-color: $app-surface;
- color: $brand-primary;
- border: 2rpx solid $brand-primary;
- }
- .invite-share-text {
- display: block;
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- line-height: 1.6;
- margin-bottom: 12rpx;
- }
- .invite-qr-hint {
- display: block;
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- margin-bottom: 16rpx;
- }
- .invite-join-entry {
- display: block;
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $brand-primary;
- text-align: center;
- }
- /* 层级关系 */
- .hierarchy-grid {
- display: flex;
- flex-wrap: wrap;
- }
- .hierarchy-item {
- flex: 1;
- min-width: 48%;
- padding: 20rpx;
- background-color: $uni-primary-pale;
- border-radius: 16rpx;
- margin-bottom: 16rpx;
- box-sizing: border-box;
- }
- .hierarchy-label {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $facade-text-body;
- margin-bottom: 12rpx;
- }
- .hierarchy-person {
- display: flex;
- align-items: center;
- }
- .avatar-img {
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- margin-right: 16rpx;
- }
- .avatar-placeholder {
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- background-color: $facade-fill-blue-ghost;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: calc(32rpx * var(--font-scale, 1));
- margin-right: 16rpx;
- }
- .person-info {
- flex: 1;
- }
- .person-name {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-strong;
- display: block;
- }
- .person-level {
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- }
- .hierarchy-empty {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- }
- .hierarchy-stat {
- flex: 1;
- min-width: 48%;
- padding: 20rpx;
- background-color: $facade-fill-blue-ghost;
- border-radius: 16rpx;
- text-align: center;
- box-sizing: border-box;
- }
- .stat-value {
- font-size: calc(40rpx * var(--font-scale, 1));
- font-weight: bold;
- color: #2F5496;
- display: block;
- }
- .stat-label {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $facade-text-body;
- }
- /* 统计网格 */
- .stats-grid {
- display: flex;
- flex-wrap: wrap;
- }
- .stat-card {
- width: calc(100% / 3);
- padding: 20rpx 12rpx;
- text-align: center;
- box-sizing: border-box;
- border-right: 1rpx solid $brand-primary-light-2;
- }
- /* 三列布局:每第 3 张(最后一列)不画右边线,避免右侧多余分隔线 */
- .stat-card:nth-child(3n) {
- border-right: none;
- }
- .stat-num {
- font-size: calc(36rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $brand-primary;
- display: block;
- }
- .stat-name {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $facade-text-body;
- }
- /* 成员列表 */
- .member-item {
- display: flex;
- align-items: center;
- padding: 16rpx 0;
- border-bottom: 1rpx solid $brand-primary-light-2;
- }
- .member-item:last-child {
- border-bottom: none;
- }
- .member-avatar {
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- margin-right: 16rpx;
- }
- .member-avatar-placeholder {
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- background-color: $facade-fill-blue-ghost;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: calc(32rpx * var(--font-scale, 1));
- margin-right: 16rpx;
- }
- .member-info {
- flex: 1;
- }
- .member-name {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-strong;
- display: block;
- }
- .member-role {
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- }
- .member-stats {
- text-align: right;
- }
- .member-count {
- font-size: calc(28rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $brand-primary;
- display: block;
- }
- .member-label {
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $facade-text-body;
- }
- .empty-tip {
- text-align: center;
- padding: 40rpx;
- color: $app-text-subtle;
- font-size: calc(26rpx * var(--font-scale, 1));
- }
- /* 客户列表 */
- .customer-item {
- display: flex;
- align-items: center;
- padding: 16rpx 0;
- border-bottom: 1rpx solid $brand-primary-light-2;
- }
- .customer-item:last-child {
- border-bottom: none;
- }
- .customer-avatar {
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- background-color: $facade-fill-blue-ghost;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- }
- .customer-icon {
- font-size: calc(32rpx * var(--font-scale, 1));
- }
- .customer-info {
- flex: 1;
- }
- .customer-name {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-strong;
- display: block;
- }
- .customer-meta {
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- }
- .customer-stats {
- text-align: right;
- }
- .customer-orders {
- font-size: calc(28rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $brand-primary;
- display: block;
- }
- .customer-label {
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $facade-text-body;
- }
- /* 操作按钮 */
- .action-bar {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: $app-surface;
- padding: 20rpx $uni-space-page;
- display: flex;
- gap: 20rpx;
- box-shadow: 0 -2rpx 12rpx rgba(0,0,0,0.05);
- }
- .btn-manage, .btn-customers {
- flex: 1;
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 24rpx;
- font-size: calc(28rpx * var(--font-scale, 1));
- border: none;
- }
- .btn-manage {
- background-color: $brand-primary;
- color: $app-surface;
- }
- .btn-customers {
- background-color: $app-surface;
- color: $brand-primary;
- border: 2rpx solid $brand-primary;
- }
- </style>
|