team-system.vue 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. <template>
  2. <view class="page-team-system" :style="{ '--font-scale': fontScale }">
  3. <!-- 团队切换器(T31 多团队管理;厂商卡片一行横排,超出可横向滚动) -->
  4. <view class="team-switcher-wrap" v-if="teamList.length > 0">
  5. <scroll-view class="team-switcher" scroll-x="true" :show-scrollbar="false">
  6. <view
  7. class="team-tab"
  8. v-for="team in teamList"
  9. :key="team.id"
  10. :class="{ 'team-tab-active': currentSystemId === team.id }"
  11. @click="switchTeam(team.id)"
  12. >
  13. <text class="team-tab-text">{{ team.name || '未命名团队' }}</text>
  14. </view>
  15. </scroll-view>
  16. </view>
  17. <!-- 头部:体系信息 -->
  18. <view class="system-header" v-if="systemInfo">
  19. <view class="system-info">
  20. <view class="system-icon">🏢</view>
  21. <view class="system-detail">
  22. <text class="system-name">{{ systemInfo.name || '我的供应商体系' }}</text>
  23. <text class="system-desc">服务商团队管理</text>
  24. </view>
  25. </view>
  26. <view class="system-status" :class="systemInfo.status">
  27. <text>{{ systemInfo.status === 'active' ? '活跃' : '未激活' }}</text>
  28. </view>
  29. </view>
  30. <!-- 层级关系 -->
  31. <view class="section" v-if="hierarchyInfo">
  32. <view class="section-header">
  33. <text class="section-title">层级关系</text>
  34. </view>
  35. <view class="hierarchy-grid">
  36. <!-- 上级 -->
  37. <view class="hierarchy-item" v-if="hierarchyInfo.parent">
  38. <view class="hierarchy-label">上级服务商</view>
  39. <view class="hierarchy-person">
  40. <image v-if="hierarchyInfo.parent.avatar" class="avatar-img" :src="hierarchyInfo.parent.avatar" mode="aspectFill"></image>
  41. <text v-else class="avatar-placeholder">👤</text>
  42. <view class="person-info">
  43. <text class="person-name">{{ hierarchyInfo.parent.nickname || '服务商' }}</text>
  44. <text class="person-level">上级</text>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 下级 -->
  49. <view class="hierarchy-item" v-else>
  50. <view class="hierarchy-label">下级服务商</view>
  51. <view class="hierarchy-empty">
  52. <text>暂无下级</text>
  53. </view>
  54. </view>
  55. <!-- 团队规模 -->
  56. <view class="hierarchy-stat">
  57. <text class="stat-value">{{ hierarchyInfo.totalChildren || 0 }}</text>
  58. <text class="stat-label">团队成员</text>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 团队统计 -->
  63. <view class="section">
  64. <view class="section-header">
  65. <text class="section-title">团队数据</text>
  66. </view>
  67. <view class="stats-grid">
  68. <view class="stat-card">
  69. <text class="stat-num">{{ teamStats.customerCount || 0 }}</text>
  70. <text class="stat-name">客户归属</text>
  71. </view>
  72. <view class="stat-card">
  73. <text class="stat-num">{{ teamStats.orderCount || 0 }}</text>
  74. <text class="stat-name">关联订单</text>
  75. </view>
  76. <view class="stat-card">
  77. <text class="stat-num">{{ teamStats.amount || 0 }}</text>
  78. <text class="stat-name">关联金额(元)</text>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 团队成员列表 -->
  83. <view class="section">
  84. <view class="section-header">
  85. <text class="section-title">团队成员</text>
  86. <view class="section-actions">
  87. <text class="section-action" @click="goToMembers">查看全部</text>
  88. <text class="section-action section-action-invite" @click="openInviteDialog">邀请成员</text>
  89. </view>
  90. </view>
  91. <view class="member-list">
  92. <view class="member-item" v-for="member in teamMembers.slice(0, 5)" :key="member.userId">
  93. <image v-if="member.avatar" class="member-avatar" :src="member.avatar" mode="aspectFill"></image>
  94. <text v-else class="member-avatar-placeholder">👤</text>
  95. <view class="member-info">
  96. <text class="member-name">{{ member.nickname || '微信用户' }}</text>
  97. <text class="member-role">{{ member.role || '成员' }}</text>
  98. </view>
  99. <view class="member-stats">
  100. <text class="member-count">{{ member.customerCount || 0 }}</text>
  101. <text class="member-label">客户</text>
  102. </view>
  103. </view>
  104. <view class="empty-tip" v-if="teamMembers.length === 0">
  105. <text>暂无团队成员</text>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 团队客户列表 -->
  110. <view class="section">
  111. <view class="section-header">
  112. <text class="section-title">团队客户</text>
  113. <text class="section-action" @click="goToCustomers">查看全部</text>
  114. </view>
  115. <view class="customer-list">
  116. <view class="customer-item" v-for="customer in teamCustomers.slice(0, 5)" :key="customer.id">
  117. <view class="customer-avatar">
  118. <text class="customer-icon">👥</text>
  119. </view>
  120. <view class="customer-info">
  121. <text class="customer-name">{{ customer.familyName || '未知家庭' }}</text>
  122. <text class="customer-meta">{{ customer.source === 'manual' ? '人工绑定' : customer.source === 'order' ? '下单自动' : '推荐码' }}</text>
  123. </view>
  124. <view class="customer-stats">
  125. <text class="customer-orders">{{ customer.orderCount || 0 }}</text>
  126. <text class="customer-label">订单</text>
  127. </view>
  128. </view>
  129. <view class="empty-tip" v-if="teamCustomers.length === 0">
  130. <text>暂无客户数据</text>
  131. </view>
  132. </view>
  133. </view>
  134. <!-- 操作按钮 -->
  135. <view class="action-bar">
  136. <button class="btn-manage" @click="goToManage">团队管理</button>
  137. <button class="btn-customers" @click="goToCustomers">客户列表</button>
  138. </view>
  139. <!-- 邀请成员弹窗(T38:生成/复制个人专属邀请码;小程序码可后置) -->
  140. <view class="invite-mask" v-if="showInviteDialog" @click="closeInviteDialog">
  141. <view class="invite-dialog" @click.stop>
  142. <view class="invite-header">
  143. <text class="invite-title">邀请成员加入团队</text>
  144. <text class="invite-close" @click="closeInviteDialog">✕</text>
  145. </view>
  146. <view class="invite-body">
  147. <text class="invite-tip">邀请码永久有效,好友凭码加入后成为你的下级成员</text>
  148. <view class="invite-code-box">
  149. <text class="invite-code" v-if="inviteInfo && inviteInfo.inviteCode">{{ inviteInfo.inviteCode }}</text>
  150. <text class="invite-code-placeholder" v-else>正在生成邀请码…</text>
  151. </view>
  152. <view class="invite-btns">
  153. <button class="invite-btn invite-btn-primary" :disabled="!inviteInfo || !inviteInfo.inviteCode" @click="copyInviteCode">复制邀请码</button>
  154. <button class="invite-btn invite-btn-ghost" @click="refreshInviteCode">刷新邀请码</button>
  155. </view>
  156. <text class="invite-share-text" v-if="inviteInfo && inviteInfo.shareText">{{ inviteInfo.shareText }}</text>
  157. <text class="invite-qr-hint">小程序码可后置,当前通过复制邀请码分享</text>
  158. <text class="invite-join-entry" @click="goToInviteJoin">收到邀请码?点这里加入团队</text>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import { getVendorSystemInfo, getVendorHierarchyInfo, getVendorTeamMembers, getVendorTeamCustomers, getVendorTeamList, getVendorInviteCode } from '@/utils/api.js'
  166. import fontScaleMixin from '@/mixins/font-scale.js'
  167. export default {
  168. mixins: [fontScaleMixin],
  169. data() {
  170. return {
  171. teamList: [], // 我的团队列表(切换器数据源,T31)
  172. currentSystemId: null, // 当前选中的团队
  173. systemInfo: null,
  174. hierarchyInfo: null,
  175. teamStats: {
  176. customerCount: 0,
  177. orderCount: 0,
  178. amount: 0
  179. },
  180. teamMembers: [],
  181. teamCustomers: [],
  182. customerTotal: 0, // 「客户归属」真实总数(后端 total,避免分页截断)
  183. showInviteDialog: false, // 邀请成员弹窗显隐(T38)
  184. inviteInfo: null // 我的邀请码信息 {inviteCode, teamName, shareText}
  185. }
  186. },
  187. onLoad() {
  188. this.loadData()
  189. this._onLoadFired = true
  190. },
  191. onShow() {
  192. if (this._onLoadFired) {
  193. // 首次进入:onLoad 已加载,跳过避免双发
  194. this._onLoadFired = false
  195. } else {
  196. this.loadData()
  197. }
  198. },
  199. methods: {
  200. async loadData() {
  201. try {
  202. // 1. 拉取我的团队列表,解析当前选中团队
  203. var teams = []
  204. try {
  205. const teamsRes = await getVendorTeamList()
  206. teams = teamsRes.data || []
  207. } catch (e) {
  208. teams = []
  209. }
  210. this.teamList = teams
  211. // 保持当前选中;失效(被移除/首次进入)则回退第一个团队
  212. var stillValid = false
  213. for (var i = 0; i < teams.length; i++) {
  214. if (teams[i].id === this.currentSystemId) {
  215. stillValid = true
  216. break
  217. }
  218. }
  219. if (!this.currentSystemId || !stillValid) {
  220. this.currentSystemId = teams.length > 0 ? teams[0].id : null
  221. }
  222. if (!this.currentSystemId) {
  223. // 无任何团队:清空数据
  224. this.systemInfo = null
  225. this.hierarchyInfo = null
  226. this.teamMembers = []
  227. this.teamCustomers = []
  228. this.updateStats()
  229. return
  230. }
  231. // 2. 并发加载当前团队数据(竞态防护:切换后旧响应不覆盖新团队)
  232. var seq = (this._teamLoadSeq || 0) + 1
  233. this._teamLoadSeq = seq
  234. const [systemRes, hierarchyRes, membersRes, customersRes] = await Promise.all([
  235. this.fetchSystemInfo(),
  236. this.fetchHierarchyInfo(),
  237. this.fetchTeamMembers(),
  238. this.fetchTeamCustomers()
  239. ])
  240. if (seq !== this._teamLoadSeq) return
  241. if (systemRes) {
  242. this.systemInfo = systemRes
  243. }
  244. if (hierarchyRes) {
  245. this.hierarchyInfo = hierarchyRes
  246. }
  247. if (membersRes) {
  248. this.teamMembers = membersRes
  249. }
  250. if (customersRes) {
  251. this.teamCustomers = customersRes.list || []
  252. this.customerTotal = customersRes.total || 0
  253. }
  254. // 更新统计
  255. this.updateStats()
  256. } catch (error) {
  257. console.error('加载团队数据失败:', error)
  258. }
  259. },
  260. // 切换团队:联动刷新成员/客户/统计(T31)
  261. switchTeam(systemId) {
  262. if (!systemId || systemId === this.currentSystemId) return
  263. this.currentSystemId = systemId
  264. this.systemInfo = null
  265. this.hierarchyInfo = null
  266. this.teamMembers = []
  267. this.teamCustomers = []
  268. this.inviteInfo = null
  269. this.loadTeamData()
  270. },
  271. // 按当前选中团队加载各数据源
  272. async loadTeamData() {
  273. // 竞态防护:仅应用最新一次切换的响应,避免快速切换时旧数据覆盖新团队
  274. var seq = (this._teamLoadSeq || 0) + 1
  275. this._teamLoadSeq = seq
  276. try {
  277. const [systemRes, hierarchyRes, membersRes, customersRes] = await Promise.all([
  278. this.fetchSystemInfo(),
  279. this.fetchHierarchyInfo(),
  280. this.fetchTeamMembers(),
  281. this.fetchTeamCustomers()
  282. ])
  283. if (seq !== this._teamLoadSeq) return
  284. if (systemRes) {
  285. this.systemInfo = systemRes
  286. }
  287. if (hierarchyRes) {
  288. this.hierarchyInfo = hierarchyRes
  289. }
  290. if (membersRes) {
  291. this.teamMembers = membersRes
  292. }
  293. if (customersRes) {
  294. this.teamCustomers = customersRes.list || []
  295. this.customerTotal = customersRes.total || 0
  296. }
  297. this.updateStats()
  298. } catch (error) {
  299. console.error('加载团队数据失败:', error)
  300. }
  301. },
  302. // 获取体系信息
  303. async fetchSystemInfo() {
  304. try {
  305. const res = await getVendorSystemInfo(this.currentSystemId)
  306. return res.data || null
  307. } catch (e) {
  308. return null
  309. }
  310. },
  311. // 获取层级关系
  312. async fetchHierarchyInfo() {
  313. try {
  314. const res = await getVendorHierarchyInfo(this.currentSystemId)
  315. return res.data || null
  316. } catch (e) {
  317. return null
  318. }
  319. },
  320. // 获取团队成员
  321. async fetchTeamMembers() {
  322. try {
  323. const res = await getVendorTeamMembers(this.currentSystemId)
  324. return res.data || []
  325. } catch (e) {
  326. return []
  327. }
  328. },
  329. // 获取团队客户(返回 { list, total };兼容旧后端数组形状)
  330. async fetchTeamCustomers() {
  331. try {
  332. const res = await getVendorTeamCustomers({
  333. systemId: this.currentSystemId,
  334. parentId: null,
  335. page: 1,
  336. size: 50
  337. })
  338. var data = res.data || {}
  339. if (data instanceof Array) {
  340. return { list: data, total: data.length }
  341. }
  342. return {
  343. list: data.list || [],
  344. total: data.total || 0
  345. }
  346. } catch (e) {
  347. return { list: [], total: 0 }
  348. }
  349. },
  350. // 更新统计数据(「客户归属」用后端返回的真实总数,避免分页截断)
  351. updateStats() {
  352. this.teamStats.customerCount = this.customerTotal || 0
  353. },
  354. // 跳转管理页面
  355. goToManage() {
  356. uni.navigateTo({
  357. url: '/pages/vendor/team-manage/team-manage'
  358. })
  359. },
  360. // 跳转客户列表(携带当前团队)
  361. goToCustomers() {
  362. var url = '/pages/vendor/team-customers/team-customers'
  363. if (this.currentSystemId) {
  364. url = url + '?systemId=' + this.currentSystemId
  365. }
  366. uni.navigateTo({
  367. url: url
  368. })
  369. },
  370. // ===== 邀请成员(T38)=====
  371. // 打开邀请弹窗:首次进入自动生成/获取我的邀请码
  372. async openInviteDialog() {
  373. if (!this.currentSystemId) {
  374. uni.showToast({ title: '请先选择团队', icon: 'none' })
  375. return
  376. }
  377. this.showInviteDialog = true
  378. if (!this.inviteInfo || !this.inviteInfo.inviteCode) {
  379. await this.loadInviteCode(false)
  380. }
  381. },
  382. // 生成/获取我的邀请码(refresh=true 重置旧码)
  383. async loadInviteCode(refresh) {
  384. try {
  385. const res = await getVendorInviteCode({
  386. systemId: this.currentSystemId,
  387. refresh: !!refresh
  388. })
  389. this.inviteInfo = res.data || null
  390. } catch (e) {
  391. // 生成失败(如非团队成员/团队停用):关闭弹窗并提示
  392. this.showInviteDialog = false
  393. uni.showToast({ title: (e && e.message) || '获取邀请码失败', icon: 'none' })
  394. }
  395. },
  396. closeInviteDialog() {
  397. this.showInviteDialog = false
  398. },
  399. copyInviteCode() {
  400. if (!this.inviteInfo || !this.inviteInfo.inviteCode) return
  401. uni.setClipboardData({
  402. data: this.inviteInfo.inviteCode,
  403. success: function () {
  404. uni.showToast({ title: '邀请码已复制', icon: 'none' })
  405. }
  406. })
  407. },
  408. async refreshInviteCode() {
  409. await this.loadInviteCode(true)
  410. if (this.inviteInfo && this.inviteInfo.inviteCode) {
  411. uni.showToast({ title: '已刷新,旧码失效', icon: 'none' })
  412. }
  413. },
  414. // 进入受邀确认页(可手动粘贴邀请码)
  415. goToInviteJoin() {
  416. uni.navigateTo({
  417. url: '/pages/vendor/team-invite/team-invite'
  418. })
  419. }
  420. }
  421. }
  422. </script>
  423. <style lang="scss">
  424. .page-team-system {
  425. background-color: $uni-primary-pale;
  426. min-height: 100vh;
  427. padding-bottom: 100rpx;
  428. }
  429. /* 体系头部 */
  430. .system-header {
  431. background-color: $app-surface;
  432. padding: $uni-space-page;
  433. margin-bottom: 24rpx;
  434. display: flex;
  435. justify-content: space-between;
  436. align-items: center;
  437. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  438. }
  439. /* 团队切换器(T31 多团队管理;厂商卡片一行横排,超出可横向滚动) */
  440. .team-switcher-wrap {
  441. background-color: $app-surface;
  442. padding: 20rpx 0;
  443. margin-bottom: 24rpx;
  444. }
  445. .team-switcher {
  446. width: 100%;
  447. white-space: nowrap;
  448. }
  449. .team-tab {
  450. display: inline-flex;
  451. align-items: center;
  452. justify-content: center;
  453. padding: 16rpx 28rpx;
  454. margin-left: $uni-space-lg;
  455. border-radius: 999rpx;
  456. background-color: $uni-primary-pale;
  457. }
  458. .team-tab:first-child {
  459. margin-left: $uni-space-page;
  460. }
  461. .team-tab:last-child {
  462. margin-right: $uni-space-page;
  463. }
  464. .team-tab-active {
  465. background-color: $brand-primary;
  466. }
  467. .team-tab-text {
  468. font-size: calc(26rpx * var(--font-scale, 1));
  469. color: $facade-text-body;
  470. white-space: nowrap;
  471. max-width: 100%;
  472. overflow: hidden;
  473. text-overflow: ellipsis;
  474. }
  475. .team-tab-active .team-tab-text {
  476. color: $app-surface;
  477. font-weight: bold;
  478. }
  479. .system-info {
  480. display: flex;
  481. align-items: center;
  482. }
  483. .system-icon {
  484. font-size: calc($uni-font-size-4xl * var(--font-scale, 1));
  485. margin-right: 20rpx;
  486. }
  487. .system-name {
  488. font-size: calc(32rpx * var(--font-scale, 1));
  489. font-weight: bold;
  490. color: $facade-text-strong;
  491. }
  492. .system-desc {
  493. font-size: calc(24rpx * var(--font-scale, 1));
  494. color: $app-text-subtle;
  495. margin-top: 4rpx;
  496. }
  497. .system-status {
  498. padding: 8rpx 20rpx;
  499. border-radius: 24rpx;
  500. font-size: calc(24rpx * var(--font-scale, 1));
  501. }
  502. .system-status.active {
  503. background-color: #E6F7EE;
  504. color: #65C29A;
  505. }
  506. .system-status.inactive {
  507. background-color: #FFF7EE;
  508. color: $brand-primary;
  509. }
  510. /* 区块 */
  511. .section {
  512. background-color: $app-surface;
  513. border-radius: 24rpx;
  514. padding: 24rpx;
  515. margin: 0 $uni-space-lg 24rpx;
  516. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  517. }
  518. .section-header {
  519. display: flex;
  520. justify-content: space-between;
  521. align-items: center;
  522. margin-bottom: 24rpx;
  523. }
  524. .section-title {
  525. font-size: calc(28rpx * var(--font-scale, 1));
  526. font-weight: bold;
  527. color: $facade-text-strong;
  528. }
  529. .section-action {
  530. font-size: calc(24rpx * var(--font-scale, 1));
  531. color: $brand-primary;
  532. }
  533. .section-actions {
  534. display: flex;
  535. align-items: center;
  536. }
  537. .section-action-invite {
  538. margin-left: 24rpx;
  539. padding: 6rpx 20rpx;
  540. border-radius: 999rpx;
  541. background-color: $brand-primary;
  542. color: $app-surface;
  543. }
  544. /* 邀请成员弹窗(T38) */
  545. .invite-mask {
  546. position: fixed;
  547. top: 0;
  548. left: 0;
  549. right: 0;
  550. bottom: 0;
  551. background-color: rgba(0, 0, 0, 0.45);
  552. display: flex;
  553. align-items: center;
  554. justify-content: center;
  555. z-index: 999;
  556. }
  557. .invite-dialog {
  558. width: 620rpx;
  559. max-width: 86%;
  560. background-color: $app-surface;
  561. border-radius: 24rpx;
  562. padding: 32rpx;
  563. box-sizing: border-box;
  564. }
  565. .invite-header {
  566. display: flex;
  567. justify-content: space-between;
  568. align-items: center;
  569. margin-bottom: 24rpx;
  570. }
  571. .invite-title {
  572. font-size: calc(32rpx * var(--font-scale, 1));
  573. font-weight: bold;
  574. color: $facade-text-strong;
  575. }
  576. .invite-close {
  577. font-size: calc(28rpx * var(--font-scale, 1));
  578. color: $app-text-subtle;
  579. padding: 0 12rpx;
  580. }
  581. .invite-tip {
  582. font-size: calc(24rpx * var(--font-scale, 1));
  583. color: $app-text-subtle;
  584. display: block;
  585. margin-bottom: 20rpx;
  586. }
  587. .invite-code-box {
  588. background-color: $uni-primary-pale;
  589. border-radius: 16rpx;
  590. padding: 32rpx 20rpx;
  591. text-align: center;
  592. margin-bottom: 24rpx;
  593. }
  594. .invite-code {
  595. font-size: calc(44rpx * var(--font-scale, 1));
  596. font-weight: bold;
  597. letter-spacing: 6rpx;
  598. color: $brand-primary;
  599. }
  600. .invite-code-placeholder {
  601. font-size: calc(26rpx * var(--font-scale, 1));
  602. color: $app-text-subtle;
  603. }
  604. .invite-btns {
  605. display: flex;
  606. margin-bottom: 20rpx;
  607. }
  608. .invite-btn {
  609. flex: 1;
  610. height: 76rpx;
  611. line-height: 76rpx;
  612. border-radius: 20rpx;
  613. font-size: calc(26rpx * var(--font-scale, 1));
  614. border: none;
  615. margin: 0 8rpx;
  616. padding: 0;
  617. }
  618. .invite-btn-primary {
  619. background-color: $brand-primary;
  620. color: $app-surface;
  621. }
  622. .invite-btn-primary[disabled] {
  623. opacity: 0.5;
  624. }
  625. .invite-btn-ghost {
  626. background-color: $app-surface;
  627. color: $brand-primary;
  628. border: 2rpx solid $brand-primary;
  629. }
  630. .invite-share-text {
  631. display: block;
  632. font-size: calc(22rpx * var(--font-scale, 1));
  633. color: $app-text-subtle;
  634. line-height: 1.6;
  635. margin-bottom: 12rpx;
  636. }
  637. .invite-qr-hint {
  638. display: block;
  639. font-size: calc(22rpx * var(--font-scale, 1));
  640. color: $app-text-subtle;
  641. margin-bottom: 16rpx;
  642. }
  643. .invite-join-entry {
  644. display: block;
  645. font-size: calc(24rpx * var(--font-scale, 1));
  646. color: $brand-primary;
  647. text-align: center;
  648. }
  649. /* 层级关系 */
  650. .hierarchy-grid {
  651. display: flex;
  652. flex-wrap: wrap;
  653. }
  654. .hierarchy-item {
  655. flex: 1;
  656. min-width: 48%;
  657. padding: 20rpx;
  658. background-color: $uni-primary-pale;
  659. border-radius: 16rpx;
  660. margin-bottom: 16rpx;
  661. box-sizing: border-box;
  662. }
  663. .hierarchy-label {
  664. font-size: calc(24rpx * var(--font-scale, 1));
  665. color: $facade-text-body;
  666. margin-bottom: 12rpx;
  667. }
  668. .hierarchy-person {
  669. display: flex;
  670. align-items: center;
  671. }
  672. .avatar-img {
  673. width: 64rpx;
  674. height: 64rpx;
  675. border-radius: 50%;
  676. margin-right: 16rpx;
  677. }
  678. .avatar-placeholder {
  679. width: 64rpx;
  680. height: 64rpx;
  681. border-radius: 50%;
  682. background-color: $facade-fill-blue-ghost;
  683. display: flex;
  684. align-items: center;
  685. justify-content: center;
  686. font-size: calc(32rpx * var(--font-scale, 1));
  687. margin-right: 16rpx;
  688. }
  689. .person-info {
  690. flex: 1;
  691. }
  692. .person-name {
  693. font-size: calc(26rpx * var(--font-scale, 1));
  694. color: $facade-text-strong;
  695. display: block;
  696. }
  697. .person-level {
  698. font-size: calc(20rpx * var(--font-scale, 1));
  699. color: $app-text-subtle;
  700. }
  701. .hierarchy-empty {
  702. font-size: calc(24rpx * var(--font-scale, 1));
  703. color: $app-text-subtle;
  704. }
  705. .hierarchy-stat {
  706. flex: 1;
  707. min-width: 48%;
  708. padding: 20rpx;
  709. background-color: $facade-fill-blue-ghost;
  710. border-radius: 16rpx;
  711. text-align: center;
  712. box-sizing: border-box;
  713. }
  714. .stat-value {
  715. font-size: calc(40rpx * var(--font-scale, 1));
  716. font-weight: bold;
  717. color: #2F5496;
  718. display: block;
  719. }
  720. .stat-label {
  721. font-size: calc(22rpx * var(--font-scale, 1));
  722. color: $facade-text-body;
  723. }
  724. /* 统计网格 */
  725. .stats-grid {
  726. display: flex;
  727. flex-wrap: wrap;
  728. }
  729. .stat-card {
  730. width: calc(100% / 3);
  731. padding: 20rpx 12rpx;
  732. text-align: center;
  733. box-sizing: border-box;
  734. border-right: 1rpx solid $brand-primary-light-2;
  735. }
  736. /* 三列布局:每第 3 张(最后一列)不画右边线,避免右侧多余分隔线 */
  737. .stat-card:nth-child(3n) {
  738. border-right: none;
  739. }
  740. .stat-num {
  741. font-size: calc(36rpx * var(--font-scale, 1));
  742. font-weight: bold;
  743. color: $brand-primary;
  744. display: block;
  745. }
  746. .stat-name {
  747. font-size: calc(22rpx * var(--font-scale, 1));
  748. color: $facade-text-body;
  749. }
  750. /* 成员列表 */
  751. .member-item {
  752. display: flex;
  753. align-items: center;
  754. padding: 16rpx 0;
  755. border-bottom: 1rpx solid $brand-primary-light-2;
  756. }
  757. .member-item:last-child {
  758. border-bottom: none;
  759. }
  760. .member-avatar {
  761. width: 64rpx;
  762. height: 64rpx;
  763. border-radius: 50%;
  764. margin-right: 16rpx;
  765. }
  766. .member-avatar-placeholder {
  767. width: 64rpx;
  768. height: 64rpx;
  769. border-radius: 50%;
  770. background-color: $facade-fill-blue-ghost;
  771. display: flex;
  772. align-items: center;
  773. justify-content: center;
  774. font-size: calc(32rpx * var(--font-scale, 1));
  775. margin-right: 16rpx;
  776. }
  777. .member-info {
  778. flex: 1;
  779. }
  780. .member-name {
  781. font-size: calc(26rpx * var(--font-scale, 1));
  782. color: $facade-text-strong;
  783. display: block;
  784. }
  785. .member-role {
  786. font-size: calc(20rpx * var(--font-scale, 1));
  787. color: $app-text-subtle;
  788. }
  789. .member-stats {
  790. text-align: right;
  791. }
  792. .member-count {
  793. font-size: calc(28rpx * var(--font-scale, 1));
  794. font-weight: bold;
  795. color: $brand-primary;
  796. display: block;
  797. }
  798. .member-label {
  799. font-size: calc(20rpx * var(--font-scale, 1));
  800. color: $facade-text-body;
  801. }
  802. .empty-tip {
  803. text-align: center;
  804. padding: 40rpx;
  805. color: $app-text-subtle;
  806. font-size: calc(26rpx * var(--font-scale, 1));
  807. }
  808. /* 客户列表 */
  809. .customer-item {
  810. display: flex;
  811. align-items: center;
  812. padding: 16rpx 0;
  813. border-bottom: 1rpx solid $brand-primary-light-2;
  814. }
  815. .customer-item:last-child {
  816. border-bottom: none;
  817. }
  818. .customer-avatar {
  819. width: 64rpx;
  820. height: 64rpx;
  821. border-radius: 50%;
  822. background-color: $facade-fill-blue-ghost;
  823. display: flex;
  824. align-items: center;
  825. justify-content: center;
  826. margin-right: 16rpx;
  827. }
  828. .customer-icon {
  829. font-size: calc(32rpx * var(--font-scale, 1));
  830. }
  831. .customer-info {
  832. flex: 1;
  833. }
  834. .customer-name {
  835. font-size: calc(26rpx * var(--font-scale, 1));
  836. color: $facade-text-strong;
  837. display: block;
  838. }
  839. .customer-meta {
  840. font-size: calc(20rpx * var(--font-scale, 1));
  841. color: $app-text-subtle;
  842. }
  843. .customer-stats {
  844. text-align: right;
  845. }
  846. .customer-orders {
  847. font-size: calc(28rpx * var(--font-scale, 1));
  848. font-weight: bold;
  849. color: $brand-primary;
  850. display: block;
  851. }
  852. .customer-label {
  853. font-size: calc(20rpx * var(--font-scale, 1));
  854. color: $facade-text-body;
  855. }
  856. /* 操作按钮 */
  857. .action-bar {
  858. position: fixed;
  859. bottom: 0;
  860. left: 0;
  861. right: 0;
  862. background-color: $app-surface;
  863. padding: 20rpx $uni-space-page;
  864. display: flex;
  865. gap: 20rpx;
  866. box-shadow: 0 -2rpx 12rpx rgba(0,0,0,0.05);
  867. }
  868. .btn-manage, .btn-customers {
  869. flex: 1;
  870. height: 80rpx;
  871. line-height: 80rpx;
  872. border-radius: 24rpx;
  873. font-size: calc(28rpx * var(--font-scale, 1));
  874. border: none;
  875. }
  876. .btn-manage {
  877. background-color: $brand-primary;
  878. color: $app-surface;
  879. }
  880. .btn-customers {
  881. background-color: $app-surface;
  882. color: $brand-primary;
  883. border: 2rpx solid $brand-primary;
  884. }
  885. </style>