index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. <template>
  2. <scroll-view class="container" scroll-y scroll-with-animation>
  3. <!-- 家庭公共收益总览 -->
  4. <view class="family-earnings-card" v-if="familySummary">
  5. <view class="fe-header">
  6. <view class="fe-title-row">
  7. <text class="fe-title">🏠 家庭公共收益</text>
  8. <text class="fe-badge" v-if="isAdmin">管理员</text>
  9. </view>
  10. <text class="fe-subtitle">家庭成员共同努力的成果</text>
  11. </view>
  12. <view class="fe-grid">
  13. <view class="fe-item">
  14. <text class="fe-value orange">{{ fenToYuan(familySummary.totalEarned) }}</text>
  15. <text class="fe-label">累计推荐收入</text>
  16. </view>
  17. <view class="fe-item">
  18. <text class="fe-value blue">{{ fenToYuan(familySummary.availableAmount) }}</text>
  19. <text class="fe-label">可支配余额</text>
  20. </view>
  21. <view class="fe-item">
  22. <text class="fe-value green">{{ fenToYuan(familySummary.withdrawnAmount) }}</text>
  23. <text class="fe-label">已提现</text>
  24. </view>
  25. <view class="fe-item">
  26. <text class="fe-value purple">{{ fenToYuan(familySummary.distributedAmount) }}</text>
  27. <text class="fe-label">已分配</text>
  28. </view>
  29. </view>
  30. <!-- 管理员操作按钮(仅管理员可见) -->
  31. <view class="fe-actions" v-if="isAdmin">
  32. <button class="fe-btn fe-btn-distribute" @click="showDistributeSheet = true">分配收益</button>
  33. </view>
  34. </view>
  35. <!-- 成员贡献榜 -->
  36. <view class="members-card" v-if="members && members.length > 0">
  37. <view class="members-header">
  38. <text class="members-title">👥 成员贡献榜</text>
  39. <text class="members-toggle" @click="membersExpanded = !membersExpanded">
  40. {{ membersExpanded ? '收起' : '展开全部(' + members.length + ')' }}
  41. </text>
  42. </view>
  43. <view class="member-list">
  44. <view class="member-item" v-for="(m, idx) in displayMembers" :key="m.userId">
  45. <view class="member-rank">
  46. <text class="rank-num" v-if="idx < 3 && !showAllRanks">🏅</text>
  47. <text class="rank-num rank-plain" v-else>{{ idx + 1 }}</text>
  48. </view>
  49. <image v-if="m.avatar" class="member-avatar" :src="m.avatar" mode="aspectFill"></image>
  50. <text v-else class="member-avatar-placeholder">{{ m.nickname ? m.nickname.charAt(0) : '?' }}</text>
  51. <view class="member-info">
  52. <text class="member-name">{{ m.nickname || '用户' }}</text>
  53. <text class="member-role-tag" v-if="m.isAdmin">管理员</text>
  54. <text class="member-balance-tag" v-if="m.canUseFamilyBalance">池可用</text>
  55. <text class="member-balance-tag disabled-tag" v-else>池关闭</text>
  56. </view>
  57. <view class="member-amounts">
  58. <text class="member-amount allocated">+{{ fenToYuan(m.allocatedAmount) }}</text>
  59. <text class="member-amount consumed">-{{ fenToYuan(m.consumedAmount) }}</text>
  60. <text class="member-amount available">={{ fenToYuan(m.availableAmount) }}</text>
  61. </view>
  62. <!-- 管理员可切换成员池权限 -->
  63. <switch v-if="isAdmin && !m.isAdmin" class="member-switch" :checked="m.canUseFamilyBalance" @change="toggleMemberAccess(m)" color="#F97316"></switch>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 提现弹窗(暂屏蔽) -->
  68. <!-- <view class="sheet-mask" v-if="showWithdrawSheet" @click="showWithdrawSheet = false">
  69. <view class="sheet-content" @click.stop>
  70. <text class="sheet-title">家庭收益提现</text>
  71. <text class="sheet-hint">可提现余额: {{ fenToYuan(familySummary ? familySummary.availableAmount : 0) }}</text>
  72. <input class="sheet-input" type="digit" v-model="withdrawAmount" placeholder="输入提现金额(分)" />
  73. <view class="sheet-actions">
  74. <button class="sheet-cancel" @click="showWithdrawSheet = false">取消</button>
  75. <button class="sheet-confirm" @click="doWithdraw" :disabled="!withdrawAmount || withdrawAmount <= 0">确认提现</button>
  76. </view>
  77. </view>
  78. </view> -->
  79. <!-- 分配弹窗 -->
  80. <view class="sheet-mask" v-if="showDistributeSheet" @click="showDistributeSheet = false">
  81. <view class="sheet-content" @click.stop>
  82. <text class="sheet-title">分配收益</text>
  83. <text class="sheet-hint">选择成员并输入分配金额(分)</text>
  84. <picker class="sheet-picker" mode="selector" :range="memberOptions" :value="distributeMemberIdx" @change="onDistributeMemberChange">
  85. <text>{{ distributeMemberIdx >= 0 ? memberOptions[distributeMemberIdx] : '选择成员' }}</text>
  86. </picker>
  87. <input class="sheet-input" type="digit" v-model="distributeAmount" placeholder="输入分配金额(分)" />
  88. <view class="sheet-actions">
  89. <button class="sheet-cancel" @click="showDistributeSheet = false">取消</button>
  90. <button class="sheet-confirm" @click="doDistribute" :disabled="distributeMemberIdx < 0 || !distributeAmount || distributeAmount <= 0">确认分配</button>
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 统计卡片 -->
  95. <view class="stats-cards">
  96. <view class="stat-card today-card">
  97. <text class="stat-value">{{ stats.todayCommission || 0 }}</text>
  98. <text class="stat-label">今日佣金(分)</text>
  99. </view>
  100. <view class="stat-card month-card">
  101. <text class="stat-value">{{ stats.monthCommission || 0 }}</text>
  102. <text class="stat-label">本月佣金(分)</text>
  103. </view>
  104. <view class="stat-card total-card">
  105. <text class="stat-value">{{ stats.totalCommission || 0 }}</text>
  106. <text class="stat-label">累计佣金(分)</text>
  107. </view>
  108. </view>
  109. <!-- 转化漏斗 -->
  110. <view class="funnel-section" v-if="funnelSteps && funnelSteps.length > 0">
  111. <text class="section-title">转化漏斗</text>
  112. <view class="funnel">
  113. <view class="funnel-step" v-for="(step, index) in funnelSteps" :key="index" :style="{width: step.width + '%'}">
  114. <text class="funnel-label">{{ step.label }}</text>
  115. <text class="funnel-count">{{ step.count }}</text>
  116. </view>
  117. </view>
  118. </view>
  119. <!-- 收益总览 -->
  120. <view class="earnings-card">
  121. <view class="earnings-header">
  122. <text class="earnings-title">收益总览</text>
  123. </view>
  124. <view class="earnings-body">
  125. <view class="earning-item">
  126. <text class="earning-label">累计佣金</text>
  127. <text class="earning-value orange" v-if="summary">{{ formatPriceWithSymbol(summary.totalCommission) }}</text>
  128. <text class="earning-value orange" v-else>{{ formatPriceWithSymbol(0) }}</text>
  129. </view>
  130. <view class="earning-divider"></view>
  131. <view class="earning-item">
  132. <text class="earning-label">可提现</text>
  133. <text class="earning-value blue" v-if="summary">{{ formatPriceWithSymbol(summary.availableAmount) }}</text>
  134. <text class="earning-value blue" v-else>{{ formatPriceWithSymbol(0) }}</text>
  135. </view>
  136. <view class="earning-divider"></view>
  137. <view class="earning-item">
  138. <text class="earning-label">待结算</text>
  139. <text class="earning-value green" v-if="summary">{{ formatPriceWithSymbol(summary.pendingAmount) }}</text>
  140. <text class="earning-value green" v-else>{{ formatPriceWithSymbol(0) }}</text>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 功能入口 -->
  145. <view class="menu-grid">
  146. <view class="menu-item" @click="goCommission">
  147. <view class="menu-icon-wrap icon-commission">
  148. <text class="menu-icon-text">📋</text>
  149. </view>
  150. <text class="menu-text">佣金明细</text>
  151. </view>
  152. <!-- 立即提现(暂屏蔽) -->
  153. <!-- <view class="menu-item" @click="goWithdraw" v-if="!isChild">
  154. <view class="menu-icon-wrap icon-withdraw">
  155. <text class="menu-icon-text">💰</text>
  156. </view>
  157. <text class="menu-text">立即提现</text>
  158. </view> -->
  159. <view class="menu-item" @click="goInvite">
  160. <view class="menu-icon-wrap icon-invite">
  161. <text class="menu-icon-text">👥</text>
  162. </view>
  163. <text class="menu-text">邀请好友</text>
  164. </view>
  165. <view class="menu-item" @click="goTeam">
  166. <view class="menu-icon-wrap icon-team">
  167. <text class="menu-icon-text">🤝</text>
  168. </view>
  169. <text class="menu-text">推广团队</text>
  170. </view>
  171. <view class="menu-item" @click="goLeaderboard">
  172. <view class="menu-icon-wrap icon-leaderboard">
  173. <text class="menu-icon-text">🏆</text>
  174. </view>
  175. <text class="menu-text">推广排行榜</text>
  176. </view>
  177. <view class="menu-item" @click="goRecords" v-if="isAdmin">
  178. <view class="menu-icon-wrap icon-records">
  179. <text class="menu-icon-text">📊</text>
  180. </view>
  181. <text class="menu-text">家庭流水</text>
  182. </view>
  183. </view>
  184. <!-- 底部安全区 -->
  185. <view style="height:40rpx"></view>
  186. </scroll-view>
  187. </template>
  188. <script>
  189. import { getReferralSummary, getCommissionSummary, getFamilyEarningsSummary, getFamilyEarningsMembers, getFamilyEarningsRecords, distributeToMember, toggleMemberBalance, withdrawFamilyEarnings } from '../../utils/api.js'
  190. export default {
  191. components: {},
  192. data() {
  193. return {
  194. totalEarnings: '0.00',
  195. availableAmount: '0.00',
  196. summary: null,
  197. stats: {},
  198. funnelData: {},
  199. funnelSteps: [],
  200. // 家庭收益
  201. familySummary: null,
  202. members: [],
  203. membersExpanded: false,
  204. showAllRanks: false,
  205. // 弹窗
  206. showWithdrawSheet: false,
  207. showDistributeSheet: false,
  208. withdrawAmount: '',
  209. distributeAmount: '',
  210. distributeMemberIdx: -1,
  211. memberOptions: []
  212. }
  213. },
  214. computed: {
  215. isLoggedIn() {
  216. return !!uni.getStorageSync('token')
  217. },
  218. role() {
  219. return uni.getStorageSync('role') || ''
  220. },
  221. isAdmin() {
  222. // 管理员 = parent 或 teacher 角色
  223. var r = this.role
  224. return r === 'parent' || r === 'teacher'
  225. },
  226. isChild() {
  227. return this.role === 'child'
  228. },
  229. displayMembers() {
  230. if (this.membersExpanded || this.showAllRanks) {
  231. return this.members
  232. }
  233. return this.members.slice(0, 5)
  234. }
  235. },
  236. onLoad() {
  237. this.loadData()
  238. },
  239. onShow() {
  240. this.loadStats()
  241. this.loadFunnelData()
  242. this.loadFamilyData()
  243. },
  244. onShareAppMessage() {
  245. var path = '/pages/invite/join'
  246. return {
  247. title: '我在浠艾福发现了好用的家庭成长工具,快来加入!',
  248. path: path,
  249. imageUrl: ''
  250. }
  251. },
  252. methods: {
  253. async loadData() {
  254. try {
  255. var summaryRes = await getReferralSummary()
  256. if (summaryRes.data) {
  257. this.totalEarnings = summaryRes.data.totalEarnings || '0.00'
  258. }
  259. } catch (e) {
  260. console.error('获取邀请统计失败', e)
  261. }
  262. try {
  263. var comRes = await getCommissionSummary()
  264. if (comRes.data) {
  265. this.summary = comRes.data
  266. this.availableAmount = comRes.data.availableAmount || '0.00'
  267. }
  268. } catch (e) {
  269. console.error('获取佣金总览失败', e)
  270. }
  271. },
  272. async loadFamilyData() {
  273. if (this.isChild) {
  274. // 孩子只读:仅加载概要,不加载管理员功能
  275. try {
  276. var sRes = await getFamilyEarningsSummary()
  277. if (sRes.data) {
  278. this.familySummary = sRes.data
  279. this.members = sRes.data.members || []
  280. }
  281. } catch (e) {
  282. console.error('获取家庭收益概览失败', e)
  283. }
  284. return
  285. }
  286. try {
  287. var sRes = await getFamilyEarningsSummary()
  288. if (sRes.data) {
  289. this.familySummary = sRes.data
  290. this.members = sRes.data.members || []
  291. // 构建picker选项
  292. var opts = []
  293. var arr = this.members
  294. for (var i = 0; i < arr.length; i++) {
  295. opts.push((arr[i].nickname || '用户' + arr[i].userId) + ' (余额:' + this.fenToYuan(arr[i].availableAmount) + ')')
  296. }
  297. this.memberOptions = opts
  298. }
  299. } catch (e) {
  300. console.error('获取家庭收益概览失败', e)
  301. }
  302. },
  303. loadStats() {
  304. var self = this
  305. var token = uni.getStorageSync('token')
  306. var baseUrl = ''
  307. try {
  308. var config = require('../../config.js')
  309. baseUrl = config.default.baseUrl || config.baseUrl || ''
  310. } catch (e) {
  311. baseUrl = ''
  312. }
  313. uni.request({
  314. url: baseUrl + '/api/commission/stats',
  315. method: 'POST',
  316. header: { 'Authorization': 'Bearer ' + token },
  317. success: function(res) {
  318. if (res.data && res.data.code === 200) {
  319. self.stats = res.data.data || {}
  320. }
  321. }
  322. })
  323. },
  324. loadFunnelData() {
  325. var self = this
  326. var token = uni.getStorageSync('token')
  327. var baseUrl = ''
  328. try {
  329. var config = require('../../config.js')
  330. baseUrl = config.default.baseUrl || config.baseUrl || ''
  331. } catch (e) {
  332. baseUrl = ''
  333. }
  334. uni.request({
  335. url: baseUrl + '/api/commission/funnel',
  336. method: 'POST',
  337. header: { 'Authorization': 'Bearer ' + token },
  338. success: function(res) {
  339. if (res.data && res.data.code === 200) {
  340. self.funnelData = res.data.data || {}
  341. self.buildFunnelSteps()
  342. }
  343. }
  344. })
  345. },
  346. buildFunnelSteps() {
  347. var data = this.funnelData
  348. var max = Math.max(data.invites || 1, data.registered || 0, data.purchased || 0, data.repeatPurchased || 0, data.totalOrders || 0)
  349. if (max < 1) max = 1
  350. this.funnelSteps = [
  351. { label: '邀请', count: data.invites || 0, width: 100 },
  352. { label: '注册', count: data.registered || 0, width: Math.round(((data.registered || 0) / max) * 100) },
  353. { label: '首购', count: data.purchased || 0, width: Math.round(((data.purchased || 0) / max) * 100) },
  354. { label: '复购', count: data.repeatPurchased || 0, width: Math.round(((data.repeatPurchased || 0) / max) * 100) },
  355. { label: '订单', count: data.totalOrders || 0, width: Math.round(((data.totalOrders || 0) / max) * 100) }
  356. ]
  357. },
  358. fenToYuan(fen) {
  359. if (fen === null || fen === undefined) return '0.00'
  360. var num = Number(fen)
  361. if (isNaN(num)) return '0.00'
  362. return (num / 100).toFixed(2)
  363. },
  364. formatPriceWithSymbol(val) {
  365. if (!val && val !== 0) return '¥0.00'
  366. var num = Number(val)
  367. if (isNaN(num)) return '¥0.00'
  368. // val 已经是元单位(后端返回的 commission summary 是元)
  369. return '¥' + Number(num).toFixed(2)
  370. },
  371. // 管理员操作
  372. toggleMemberAccess(m) {
  373. var self = this
  374. var enabled = !m.canUseFamilyBalance
  375. uni.showLoading({ title: '操作中...' })
  376. toggleMemberBalance({ userId: m.userId, enabled: enabled }).then(function(res) {
  377. uni.hideLoading()
  378. if (res.code === 200) {
  379. m.canUseFamilyBalance = enabled
  380. uni.showToast({ title: '操作成功', icon: 'success' })
  381. } else {
  382. uni.showToast({ title: res.message || '操作失败', icon: 'none' })
  383. }
  384. }).catch(function(e) {
  385. uni.hideLoading()
  386. uni.showToast({ title: '操作失败', icon: 'none' })
  387. })
  388. },
  389. onDistributeMemberChange(e) {
  390. this.distributeMemberIdx = e.detail.value
  391. },
  392. doDistribute() {
  393. var idx = this.distributeMemberIdx
  394. if (idx < 0 || !this.members[idx]) {
  395. uni.showToast({ title: '请选择成员', icon: 'none' })
  396. return
  397. }
  398. var amount = Number(this.distributeAmount)
  399. if (!amount || amount <= 0) {
  400. uni.showToast({ title: '请输入有效金额', icon: 'none' })
  401. return
  402. }
  403. var self = this
  404. uni.showLoading({ title: '分配中...' })
  405. distributeToMember({ userId: this.members[idx].userId, amount: amount }).then(function(res) {
  406. uni.hideLoading()
  407. if (res.code === 200) {
  408. uni.showToast({ title: '分配成功', icon: 'success' })
  409. self.showDistributeSheet = false
  410. self.distributeAmount = ''
  411. self.distributeMemberIdx = -1
  412. self.loadFamilyData()
  413. } else {
  414. uni.showToast({ title: res.message || '分配失败', icon: 'none' })
  415. }
  416. }).catch(function(e) {
  417. uni.hideLoading()
  418. uni.showToast({ title: '分配失败', icon: 'none' })
  419. })
  420. },
  421. doWithdraw() {
  422. var amount = Number(this.withdrawAmount)
  423. if (!amount || amount <= 0) {
  424. uni.showToast({ title: '请输入有效金额', icon: 'none' })
  425. return
  426. }
  427. var self = this
  428. uni.showLoading({ title: '提现中...' })
  429. withdrawFamilyEarnings({ amount: amount }).then(function(res) {
  430. uni.hideLoading()
  431. if (res.code === 200) {
  432. uni.showToast({ title: '提现申请已提交', icon: 'success' })
  433. self.showWithdrawSheet = false
  434. self.withdrawAmount = ''
  435. self.loadFamilyData()
  436. } else {
  437. uni.showToast({ title: res.message || '提现失败', icon: 'none' })
  438. }
  439. }).catch(function(e) {
  440. uni.hideLoading()
  441. uni.showToast({ title: '提现失败', icon: 'none' })
  442. })
  443. },
  444. goRecords() {
  445. uni.navigateTo({ url: '/pages/promotion/records' })
  446. },
  447. goCommission() {
  448. uni.navigateTo({ url: '/pages/promotion/commission' })
  449. },
  450. goWithdraw() {
  451. uni.navigateTo({ url: '/pages/promotion/withdraw' })
  452. },
  453. goInvite() {
  454. uni.navigateTo({ url: '/pages/promotion/invite' })
  455. },
  456. goTeam() {
  457. uni.navigateTo({ url: '/pages/promotion/team' })
  458. },
  459. goLeaderboard() {
  460. uni.navigateTo({ url: '/pages/promotion/leaderboard' })
  461. }
  462. }
  463. }
  464. </script>
  465. <style scoped>
  466. .container {
  467. padding: 30rpx;
  468. min-height: 100vh;
  469. background: #FFF7ED;
  470. }
  471. .invite-card {
  472. background: linear-gradient(135deg, #F97316, #EA580C);
  473. border-radius: 20rpx;
  474. padding: 40rpx;
  475. color: #fff;
  476. margin-bottom: 30rpx;
  477. }
  478. .code-section {
  479. margin-bottom: 30rpx;
  480. }
  481. .code-label {
  482. font-size: 24rpx;
  483. opacity: 0.85;
  484. }
  485. .code-value {
  486. display: flex;
  487. align-items: center;
  488. margin-top: 12rpx;
  489. }
  490. .code-text {
  491. font-size: 44rpx;
  492. font-weight: bold;
  493. letter-spacing: 6rpx;
  494. }
  495. .copy-icon {
  496. font-size: 36rpx;
  497. margin-left: 16rpx;
  498. opacity: 0.9;
  499. }
  500. .code-hint {
  501. font-size: 22rpx;
  502. opacity: 0.7;
  503. margin-top: 8rpx;
  504. display: block;
  505. }
  506. .share-btn {
  507. background: rgba(255,255,255,0.2);
  508. color: #fff;
  509. font-size: 28rpx;
  510. border-radius: 40rpx;
  511. height: 72rpx;
  512. line-height: 72rpx;
  513. border: 1rpx solid rgba(255,255,255,0.3);
  514. }
  515. .share-btn::after { border: none; }
  516. .share-btn:active { opacity: 0.8; }
  517. /* ===== 家庭公共收益卡 ===== */
  518. .family-earnings-card {
  519. background: #fff;
  520. border-radius: 20rpx;
  521. padding: 30rpx;
  522. margin-bottom: 30rpx;
  523. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  524. border-left: 6rpx solid #F97316;
  525. }
  526. .fe-header {
  527. margin-bottom: 24rpx;
  528. }
  529. .fe-title-row {
  530. display: flex;
  531. align-items: center;
  532. justify-content: space-between;
  533. }
  534. .fe-title {
  535. font-size: 30rpx;
  536. font-weight: 600;
  537. color: #1E293B;
  538. }
  539. .fe-badge {
  540. font-size: 20rpx;
  541. color: #F97316;
  542. background: #FFF7ED;
  543. padding: 4rpx 14rpx;
  544. border-radius: 20rpx;
  545. }
  546. .fe-subtitle {
  547. font-size: 22rpx;
  548. color: #94A3B8;
  549. margin-top: 6rpx;
  550. display: block;
  551. }
  552. .fe-grid {
  553. display: flex;
  554. flex-wrap: wrap;
  555. margin-bottom: 20rpx;
  556. }
  557. .fe-item {
  558. width: 50%;
  559. text-align: center;
  560. padding: 16rpx 0;
  561. }
  562. .fe-value {
  563. font-size: 36rpx;
  564. font-weight: bold;
  565. display: block;
  566. }
  567. .fe-value.orange { color: #F97316; }
  568. .fe-value.blue { color: #0EA5E9; }
  569. .fe-value.green { color: #10B981; }
  570. .fe-value.purple { color: #8B5CF6; }
  571. .fe-label {
  572. font-size: 22rpx;
  573. color: #94A3B8;
  574. margin-top: 6rpx;
  575. display: block;
  576. }
  577. .fe-actions {
  578. display: flex;
  579. gap: 20rpx;
  580. padding-top: 16rpx;
  581. border-top: 1rpx solid #FED7AA;
  582. }
  583. .fe-btn {
  584. flex: 1;
  585. height: 64rpx;
  586. line-height: 64rpx;
  587. font-size: 26rpx;
  588. border-radius: 32rpx;
  589. text-align: center;
  590. }
  591. .fe-btn::after { border: none; }
  592. .fe-btn-withdraw {
  593. background: #F97316;
  594. color: #fff;
  595. }
  596. .fe-btn-distribute {
  597. background: #FFF7ED;
  598. color: #F97316;
  599. border: 1rpx solid #FED7AA;
  600. }
  601. /* ===== 成员贡献榜 ===== */
  602. .members-card {
  603. background: #fff;
  604. border-radius: 20rpx;
  605. padding: 30rpx;
  606. margin-bottom: 30rpx;
  607. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  608. }
  609. .members-header {
  610. display: flex;
  611. align-items: center;
  612. justify-content: space-between;
  613. margin-bottom: 20rpx;
  614. }
  615. .members-title {
  616. font-size: 30rpx;
  617. font-weight: 600;
  618. color: #1E293B;
  619. }
  620. .members-toggle {
  621. font-size: 24rpx;
  622. color: #F97316;
  623. }
  624. .member-list {
  625. display: flex;
  626. flex-direction: column;
  627. }
  628. .member-item {
  629. display: flex;
  630. align-items: center;
  631. padding: 16rpx 0;
  632. border-bottom: 1rpx solid #FFF7ED;
  633. }
  634. .member-item:last-child {
  635. border-bottom: none;
  636. }
  637. .member-rank {
  638. width: 48rpx;
  639. flex-shrink: 0;
  640. text-align: center;
  641. }
  642. .rank-num {
  643. font-size: 28rpx;
  644. }
  645. .rank-plain {
  646. font-size: 24rpx;
  647. color: #94A3B8;
  648. font-weight: 500;
  649. }
  650. .member-avatar {
  651. width: 56rpx;
  652. height: 56rpx;
  653. border-radius: 50%;
  654. margin-right: 16rpx;
  655. flex-shrink: 0;
  656. background: #FEF3C7;
  657. }
  658. .member-avatar-placeholder {
  659. width: 56rpx;
  660. height: 56rpx;
  661. border-radius: 50%;
  662. margin-right: 16rpx;
  663. flex-shrink: 0;
  664. background: #FEF3C7;
  665. display: flex;
  666. align-items: center;
  667. justify-content: center;
  668. font-size: 24rpx;
  669. color: #F97316;
  670. text-align: center;
  671. line-height: 56rpx;
  672. }
  673. .member-info {
  674. flex: 1;
  675. min-width: 0;
  676. display: flex;
  677. flex-wrap: wrap;
  678. align-items: center;
  679. gap: 8rpx;
  680. }
  681. .member-name {
  682. font-size: 26rpx;
  683. color: #1E293B;
  684. font-weight: 500;
  685. max-width: 140rpx;
  686. overflow: hidden;
  687. text-overflow: ellipsis;
  688. white-space: nowrap;
  689. }
  690. .member-role-tag {
  691. font-size: 18rpx;
  692. color: #fff;
  693. background: #F97316;
  694. padding: 2rpx 10rpx;
  695. border-radius: 12rpx;
  696. }
  697. .member-balance-tag {
  698. font-size: 18rpx;
  699. color: #10B981;
  700. background: #D1FAE5;
  701. padding: 2rpx 10rpx;
  702. border-radius: 12rpx;
  703. }
  704. .member-balance-tag.disabled-tag {
  705. color: #94A3B8;
  706. background: #F1F5F9;
  707. }
  708. .member-amounts {
  709. display: flex;
  710. flex-direction: column;
  711. align-items: flex-end;
  712. margin-right: 12rpx;
  713. flex-shrink: 0;
  714. }
  715. .member-amount {
  716. font-size: 20rpx;
  717. line-height: 1.6;
  718. }
  719. .member-amount.allocated { color: #10B981; }
  720. .member-amount.consumed { color: #EF4444; }
  721. .member-amount.available { color: #F97316; font-weight: 600; }
  722. .member-switch {
  723. transform: scale(0.7);
  724. flex-shrink: 0;
  725. }
  726. /* ===== 弹窗 ===== */
  727. .sheet-mask {
  728. position: fixed;
  729. top: 0;
  730. left: 0;
  731. right: 0;
  732. bottom: 0;
  733. background: rgba(0,0,0,0.4);
  734. z-index: 999;
  735. display: flex;
  736. align-items: flex-end;
  737. justify-content: center;
  738. }
  739. .sheet-content {
  740. background: #fff;
  741. border-radius: 30rpx 30rpx 0 0;
  742. padding: 40rpx 32rpx;
  743. padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
  744. width: 100%;
  745. max-width: 750rpx;
  746. box-sizing: border-box;
  747. }
  748. .sheet-title {
  749. font-size: 32rpx;
  750. font-weight: 600;
  751. color: #1E293B;
  752. display: block;
  753. margin-bottom: 12rpx;
  754. }
  755. .sheet-hint {
  756. font-size: 24rpx;
  757. color: #94A3B8;
  758. display: block;
  759. margin-bottom: 24rpx;
  760. }
  761. .sheet-input {
  762. height: 80rpx;
  763. border: 1rpx solid #FED7AA;
  764. border-radius: 16rpx;
  765. padding: 0 24rpx;
  766. font-size: 28rpx;
  767. color: #1E293B;
  768. margin-bottom: 24rpx;
  769. }
  770. .sheet-picker {
  771. height: 80rpx;
  772. border: 1rpx solid #FED7AA;
  773. border-radius: 16rpx;
  774. padding: 0 24rpx;
  775. font-size: 26rpx;
  776. color: #1E293B;
  777. margin-bottom: 24rpx;
  778. display: flex;
  779. align-items: center;
  780. }
  781. .sheet-actions {
  782. display: flex;
  783. gap: 20rpx;
  784. }
  785. .sheet-cancel {
  786. flex: 1;
  787. height: 72rpx;
  788. line-height: 72rpx;
  789. background: #F1F5F9;
  790. color: #64748B;
  791. font-size: 28rpx;
  792. border-radius: 36rpx;
  793. }
  794. .sheet-cancel::after { border: none; }
  795. .sheet-confirm {
  796. flex: 1;
  797. height: 72rpx;
  798. line-height: 72rpx;
  799. background: #F97316;
  800. color: #fff;
  801. font-size: 28rpx;
  802. border-radius: 36rpx;
  803. }
  804. .sheet-confirm::after { border: none; }
  805. .sheet-confirm[disabled] {
  806. opacity: 0.5;
  807. }
  808. /* ===== 统计卡片 ===== */
  809. .stats-cards {
  810. display: flex;
  811. justify-content: space-between;
  812. margin-bottom: 30rpx;
  813. }
  814. .stat-card {
  815. flex: 1;
  816. margin: 0 10rpx;
  817. border-radius: 16rpx;
  818. padding: 24rpx 0;
  819. text-align: center;
  820. color: #fff;
  821. }
  822. .stat-card:first-child { margin-left: 0; }
  823. .stat-card:last-child { margin-right: 0; }
  824. .today-card { background: linear-gradient(135deg, #F97316, #FB923C); }
  825. .month-card { background: linear-gradient(135deg, #0EA5E9, #38BDF8); }
  826. .total-card { background: linear-gradient(135deg, #10B981, #34D399); }
  827. .stat-value {
  828. font-size: 36rpx;
  829. font-weight: bold;
  830. display: block;
  831. }
  832. .stat-label {
  833. font-size: 22rpx;
  834. opacity: 0.9;
  835. margin-top: 8rpx;
  836. display: block;
  837. }
  838. /* ===== 转化漏斗 ===== */
  839. .funnel-section {
  840. background: #fff;
  841. border-radius: 20rpx;
  842. padding: 30rpx;
  843. margin-bottom: 30rpx;
  844. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  845. }
  846. .section-title {
  847. font-size: 28rpx;
  848. font-weight: 600;
  849. color: #1E293B;
  850. margin-bottom: 20rpx;
  851. display: block;
  852. }
  853. .funnel {
  854. display: flex;
  855. flex-direction: column;
  856. align-items: center;
  857. }
  858. .funnel-step {
  859. background: linear-gradient(90deg, #F97316, #FB923C);
  860. border-radius: 12rpx;
  861. padding: 20rpx 0;
  862. margin-bottom: 16rpx;
  863. display: flex;
  864. justify-content: space-between;
  865. align-items: center;
  866. padding-left: 24rpx;
  867. padding-right: 24rpx;
  868. min-width: 60%;
  869. transition: all 0.3s ease;
  870. }
  871. .funnel-label {
  872. font-size: 26rpx;
  873. color: #fff;
  874. font-weight: 500;
  875. }
  876. .funnel-count {
  877. font-size: 28rpx;
  878. color: #fff;
  879. font-weight: bold;
  880. }
  881. /* ===== 收益总览 ===== */
  882. .earnings-card {
  883. background: #fff;
  884. border-radius: 20rpx;
  885. margin-bottom: 30rpx;
  886. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  887. overflow: hidden;
  888. }
  889. .earnings-header {
  890. padding: 24rpx 32rpx 0;
  891. }
  892. .earnings-title {
  893. font-size: 28rpx;
  894. font-weight: 600;
  895. color: #1E293B;
  896. }
  897. .earnings-body {
  898. display: flex;
  899. align-items: center;
  900. padding: 24rpx 32rpx 32rpx;
  901. }
  902. .earning-item {
  903. flex: 1;
  904. text-align: center;
  905. }
  906. .earning-label {
  907. font-size: 22rpx;
  908. color: #94A3B8;
  909. display: block;
  910. margin-bottom: 8rpx;
  911. }
  912. .earning-value {
  913. font-size: 36rpx;
  914. font-weight: bold;
  915. }
  916. .earning-value.orange { color: #F97316; }
  917. .earning-value.blue { color: #0EA5E9; }
  918. .earning-value.green { color: #10B981; }
  919. .earning-divider {
  920. width: 1rpx;
  921. height: 64rpx;
  922. background: #FED7AA;
  923. }
  924. /* ===== 功能入口 ===== */
  925. .menu-grid {
  926. display: flex;
  927. flex-wrap: wrap;
  928. background: #fff;
  929. border-radius: 20rpx;
  930. padding: 24rpx 0;
  931. box-shadow: 0 2rpx 12rpx rgba(249,115,22,0.08);
  932. }
  933. .menu-item {
  934. width: 33.33%;
  935. display: flex;
  936. flex-direction: column;
  937. align-items: center;
  938. padding: 24rpx 0;
  939. box-sizing: border-box;
  940. }
  941. .menu-icon-wrap {
  942. width: 80rpx;
  943. height: 80rpx;
  944. border-radius: 40rpx;
  945. display: flex;
  946. align-items: center;
  947. justify-content: center;
  948. margin-bottom: 12rpx;
  949. }
  950. .icon-commission { background: #FEF3C7; }
  951. .icon-withdraw { background: #DBEAFE; }
  952. .icon-invite { background: #D1FAE5; }
  953. .icon-team { background: #FCE7F3; }
  954. .icon-leaderboard { background: #FFF3CD; }
  955. .icon-records { background: #EDE9FE; }
  956. .menu-icon-text {
  957. font-size: 36rpx;
  958. }
  959. .menu-text {
  960. font-size: 26rpx;
  961. color: #1E293B;
  962. font-weight: 500;
  963. }
  964. </style>