AbilityDiagram.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. <template>
  2. <!-- 能力图 - 径向布局 Canvas 组件 -->
  3. <view class="ability-graph-wrapper" v-if="abilities && abilities.length > 0" :style="{ '--font-scale': fontScale, height: canvasHeight + 'px' }">
  4. <canvas
  5. class="ability-graph-canvas"
  6. canvas-id="abilityGraphCanvas"
  7. id="abilityGraphCanvas"
  8. type="2d"
  9. :style="{ width: canvasWidth + 'px', height: canvasHeight + 'px' }"
  10. @tap="onCanvasTap" />
  11. <!-- 点击节点时显示详情弹窗 -->
  12. <view class="ability-detail-popup" v-if="selectedNode" :style="popupPosition">
  13. <view class="popup-content">
  14. <view class="popup-header">
  15. <image class="popup-avatar" :src="selectedNode.avatar || defaultAvatar" mode="aspectFill" />
  16. <view class="popup-info">
  17. <text class="popup-name">{{ selectedNode.name }}</text>
  18. <text class="popup-relation" v-if="selectedNode.relationshipType">{{ selectedNode.relationshipType }}</text>
  19. </view>
  20. </view>
  21. <view class="popup-skills-section">
  22. <text class="popup-skills-title">技能 x{{ selectedNode.skillCount || 0 }}</text>
  23. <view class="popup-skills-list">
  24. <text class="popup-skill-item" v-for="(sk, idx) in displaySkills" :key="idx">{{ sk }}</text>
  25. <text class="popup-skill-more" v-if="selectedNode.skills && selectedNode.skills.length > 8">+{{ selectedNode.skills.length - 8 }} 项</text>
  26. </view>
  27. </view>
  28. <view class="popup-time" v-if="selectedNode.lastHelpedAt">
  29. <text class="popup-time-label">最近帮助:</text>
  30. <text class="popup-time-value">{{ formatDate(selectedNode.lastHelpedAt) }}</text>
  31. </view>
  32. <view class="popup-arrow" :style="arrowPosition"></view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 空状态 -->
  37. <view class="ability-graph-empty" v-else-if="abilities && abilities.length === 0">
  38. <text class="empty-icon">🛠️</text>
  39. <text class="empty-text">暂无能力图数据</text>
  40. <text class="empty-hint">记录技能类帮助后,这里会画出大家的能力</text>
  41. </view>
  42. <!-- 加载状态 -->
  43. <view class="ability-loading" v-else>
  44. <text class="loading-text">加载能力图...</text>
  45. </view>
  46. </template>
  47. <script>
  48. import { BrandColors } from '../../../utils/brand-colors.js'
  49. /**
  50. * AbilityDiagram - 能力图 Canvas 组件
  51. *
  52. * 径向布局,展示"谁有哪项能力、曾帮助过谁":
  53. * - 中心节点 = 当前用户"我"(受助人,静态)
  54. * - 外围节点 = 提供过 SKILL 类帮助的人
  55. * - 节点大小 = 技能数量(skillCount)
  56. * - 边标注 = 技能名称
  57. * - 点击节点 → 显示详情弹窗(技能列表、最近帮助时间)
  58. *
  59. * 数据源:父组件通过 abilities prop 传入
  60. */
  61. import fontScaleMixin from '@/mixins/font-scale.js'
  62. export default {
  63. mixins: [fontScaleMixin],
  64. name: 'AbilityDiagram',
  65. props: {
  66. /** 当前用户ID */
  67. selfId: {
  68. type: [Number, String],
  69. default: null
  70. },
  71. /** 能力数据数组或 null(null=加载中) */
  72. abilities: {
  73. type: Array,
  74. default: null
  75. },
  76. /** 画布宽度 px */
  77. canvasWidth: {
  78. type: Number,
  79. default: 340
  80. },
  81. /** 画布高度 px */
  82. canvasHeight: {
  83. type: Number,
  84. default: 280
  85. },
  86. /** 是否允许交互(点击节点查看明细) */
  87. interactive: {
  88. type: Boolean,
  89. default: true
  90. }
  91. },
  92. data: function() {
  93. return {
  94. dpr: 1,
  95. ctx: null,
  96. canvasReady: false,
  97. nodeData: [],
  98. edges: [],
  99. selectedNode: null,
  100. selectedNodePos: null,
  101. defaultAvatar: '/static/default-avatar.png',
  102. _destroyed: false,
  103. _canvasRect: null,
  104. // 节点颜色:技能统一金色
  105. skillColor: BrandColors.wealth,
  106. // 边颜色
  107. edgeColor: BrandColors.slate300
  108. }
  109. },
  110. computed: {
  111. popupPosition: function() {
  112. if (!this.selectedNodePos) return { display: 'none' }
  113. return {
  114. left: this.selectedNodePos.x + 'px',
  115. top: this.selectedNodePos.y + 'px'
  116. }
  117. },
  118. arrowPosition: function() {
  119. return {}
  120. },
  121. displaySkills: function() {
  122. if (!this.selectedNode || !this.selectedNode.skills) return []
  123. return this.selectedNode.skills.slice(0, 8)
  124. }
  125. },
  126. watch: {
  127. abilities: {
  128. handler: function() {
  129. this.buildNodesAndEdges()
  130. this.draw()
  131. },
  132. deep: true
  133. },
  134. canvasWidth: function() {
  135. this.buildNodesAndEdges()
  136. this.draw()
  137. },
  138. canvasHeight: function() {
  139. this.buildNodesAndEdges()
  140. this.draw()
  141. }
  142. },
  143. mounted: function() {
  144. this._destroyed = false
  145. var self = this
  146. try {
  147. this.dpr = uni.getWindowInfo().pixelRatio || 1
  148. } catch (e) {
  149. this.dpr = 1
  150. }
  151. // 延迟初始化 canvas(等待 DOM 布局完成)
  152. var retryCount = 0
  153. var maxRetry = 5
  154. function tryInit() {
  155. if (self._destroyed) return
  156. self.initCanvas(function(success) {
  157. if (self._destroyed) return
  158. if (!success && retryCount < maxRetry) {
  159. retryCount++
  160. setTimeout(tryInit, 60)
  161. } else if (!success) {
  162. console.log('[AbilityDiagram] canvas 初始化失败,重试 ' + maxRetry + ' 次后放弃')
  163. }
  164. })
  165. }
  166. this.$nextTick(function() {
  167. if (self._destroyed) return
  168. self.$nextTick(function() {
  169. if (!self._destroyed) {
  170. tryInit()
  171. }
  172. })
  173. })
  174. },
  175. beforeDestroy: function() {
  176. this._destroyed = true
  177. },
  178. methods: {
  179. /* ===========================
  180. * 数据构建
  181. * =========================== */
  182. buildNodesAndEdges: function() {
  183. if (!this.abilities || this.abilities.length === 0) {
  184. this.nodeData = []
  185. this.edges = []
  186. return
  187. }
  188. var centerX = this.canvasWidth / 2
  189. var centerY = this.canvasHeight / 2
  190. var n = this.abilities.length
  191. var self = this
  192. // 径向分布半径(确保不超出画布,留边距)
  193. var maxRadius = Math.min(this.canvasWidth, this.canvasHeight) * 0.38
  194. // 如果节点多,缩小半径避免重叠(最小 0.2)
  195. var layoutRadius = maxRadius
  196. if (n > 6) {
  197. layoutRadius = maxRadius * Math.max(0.22, 1 - (n - 6) * 0.06)
  198. }
  199. // 1. 中心节点(自己)
  200. var centerNode = {
  201. id: 'center',
  202. isCenter: true,
  203. displayName: '我',
  204. radius: 30,
  205. x: centerX,
  206. y: centerY
  207. }
  208. // 2. 能力节点(提供技能帮助的人)
  209. var abilityNodes = this.abilities.map(function(a, idx) {
  210. var angle = (2 * Math.PI * idx) / n
  211. var nodeRadius = 24 + Math.min(12, (a.skillCount - 1) * 2)
  212. return {
  213. id: 'ability_' + a.contactId,
  214. contactId: a.contactId,
  215. name: a.name,
  216. displayName: a.name ? a.name.charAt(0) : '?',
  217. avatar: a.avatar,
  218. relationshipType: a.relationshipType,
  219. skillCount: a.skillCount || 0,
  220. skills: a.skills || [],
  221. lastHelpedAt: a.lastHelpedAt,
  222. radius: nodeRadius,
  223. color: self.skillColor,
  224. x: centerX + layoutRadius * Math.cos(angle),
  225. y: centerY + layoutRadius * Math.sin(angle)
  226. }
  227. })
  228. this.nodeData = [centerNode].concat(abilityNodes)
  229. // 3. 边:中心连接到每个能力节点
  230. this.edges = abilityNodes.map(function(n) {
  231. return {
  232. source: centerNode,
  233. target: n,
  234. skills: n.skills
  235. }
  236. })
  237. },
  238. /* ===========================
  239. * 渲染
  240. * =========================== */
  241. draw: function() {
  242. if (!this.ctx) return
  243. var ctx = this.ctx
  244. var w = this.canvasWidth
  245. var h = this.canvasHeight
  246. ctx.clearRect(0, 0, w, h)
  247. // 1. 绘制边(连接线 + 箭头 + 技能标注)
  248. this._drawEdges(ctx)
  249. // 2. 绘制节点
  250. for (var i = 0; i < this.nodeData.length; i++) {
  251. this._drawNode(ctx, this.nodeData[i])
  252. }
  253. },
  254. _drawEdges: function(ctx) {
  255. var self = this
  256. var centerR = 30 // 中心节点半径
  257. this.edges.forEach(function(e) {
  258. var source = e.source
  259. var target = e.target
  260. // 计算方向
  261. var dx = target.x - source.x
  262. var dy = target.y - source.y
  263. var dist = Math.sqrt(dx * dx + dy * dy) || 1
  264. var nx = dx / dist
  265. var ny = dy / dist
  266. // 线段起点(从中心节点边缘)
  267. var sx = source.x + nx * centerR
  268. var sy = source.y + ny * centerR
  269. // 线段终点(到能力节点边缘)
  270. var tx = target.x - nx * target.radius
  271. var ty = target.y - ny * target.radius
  272. // 绘制线段
  273. ctx.beginPath()
  274. ctx.moveTo(sx, sy)
  275. ctx.lineTo(tx, ty)
  276. ctx.strokeStyle = self.edgeColor
  277. ctx.lineWidth = 1.5
  278. ctx.stroke()
  279. // 箭头(靠近中心侧)
  280. var arrowLen = 8
  281. var arrowWidth = 4
  282. // 箭头位置:在终点偏回一点
  283. var ax = tx
  284. var ay = ty
  285. ctx.beginPath()
  286. ctx.moveTo(ax, ay)
  287. ctx.lineTo(ax - nx * arrowLen + ny * arrowWidth, ay - ny * arrowLen - nx * arrowWidth)
  288. ctx.lineTo(ax - nx * arrowLen - ny * arrowWidth, ay - ny * arrowLen + nx * arrowWidth)
  289. ctx.closePath()
  290. ctx.fillStyle = self.edgeColor
  291. ctx.fill()
  292. // 技能标注(在能力节点附近)
  293. var skills = e.skills || []
  294. if (skills.length > 0) {
  295. var label = self._buildSkillLabel(skills)
  296. var labelX = target.x - nx * (target.radius + 10)
  297. var labelY = target.y - ny * (target.radius + 10)
  298. // 微调偏移让文字不压在连线上
  299. var perpX = -ny
  300. var perpY = nx
  301. labelX += perpX * 12
  302. labelY += perpY * 12
  303. ctx.font = '11px PingFang SC, sans-serif'
  304. ctx.fillStyle = BrandColors.slate600
  305. ctx.textAlign = 'center'
  306. ctx.textBaseline = 'middle'
  307. ctx.fillText(label, labelX, labelY)
  308. }
  309. })
  310. },
  311. _buildSkillLabel: function(skills) {
  312. if (!skills || skills.length === 0) return ''
  313. if (skills.length === 1) return skills[0]
  314. // 最多显示 2 个技能名
  315. var first = skills[0]
  316. var second = skills[1]
  317. var combined = first + '、' + second
  318. if (combined.length <= 12) {
  319. if (skills.length > 2) {
  320. return combined + ' +' + (skills.length - 2)
  321. }
  322. return combined
  323. }
  324. // 名字太长,只显示第一个 + 数量
  325. return first + ' +' + (skills.length - 1)
  326. },
  327. _drawNode: function(ctx, node) {
  328. var r = node.radius
  329. var x = node.x
  330. var y = node.y
  331. // 裁剪到画布范围
  332. if (x - r > this.canvasWidth || x + r < 0 || y - r > this.canvasHeight || y + r < 0) {
  333. return
  334. }
  335. if (node.isCenter) {
  336. // 中心节点:实心圆 + "我" 字
  337. ctx.beginPath()
  338. ctx.arc(x, y, r, 0, Math.PI * 2)
  339. ctx.fillStyle = BrandColors.success
  340. ctx.fill()
  341. ctx.strokeStyle = BrandColors.white
  342. ctx.lineWidth = 2
  343. ctx.stroke()
  344. ctx.font = 'bold 18px PingFang SC, sans-serif'
  345. ctx.fillStyle = BrandColors.white
  346. ctx.textAlign = 'center'
  347. ctx.textBaseline = 'middle'
  348. ctx.fillText('我', x, y + 1)
  349. } else {
  350. // 能力节点:实心圆 + 头像(异步加载,兜底首字)
  351. ctx.beginPath()
  352. ctx.arc(x, y, r, 0, Math.PI * 2)
  353. ctx.fillStyle = node.color
  354. ctx.fill()
  355. // 白边
  356. ctx.strokeStyle = BrandColors.white
  357. ctx.lineWidth = 2
  358. ctx.stroke()
  359. // 首字(先画兜底,头像加载成功后覆盖)
  360. ctx.font = 'bold ' + Math.max(14, r * 0.7) + 'px PingFang SC, sans-serif'
  361. ctx.fillStyle = BrandColors.white
  362. ctx.textAlign = 'center'
  363. ctx.textBaseline = 'middle'
  364. ctx.fillText(node.displayName, x, y + 1)
  365. // 头像:圆形裁剪绘制
  366. if (node.avatar && this._canvasNode && this._canvasNode.createImage) {
  367. var img = this._canvasNode.createImage()
  368. var self = this
  369. img.onload = function() {
  370. if (self._destroyed || !self.ctx) return
  371. var ctx2 = self.ctx
  372. ctx2.save()
  373. ctx2.beginPath()
  374. ctx2.arc(x, y, r, 0, Math.PI * 2)
  375. ctx2.clip()
  376. ctx2.drawImage(img, x - r, y - r, r * 2, r * 2)
  377. ctx2.restore()
  378. // 重绘白边(覆盖裁剪边缘)
  379. ctx2.beginPath()
  380. ctx2.arc(x, y, r, 0, Math.PI * 2)
  381. ctx2.strokeStyle = BrandColors.white
  382. ctx2.lineWidth = 2
  383. ctx2.stroke()
  384. }
  385. img.onerror = function() {
  386. // 头像加载失败,保留首字兜底
  387. }
  388. img.src = node.avatar
  389. }
  390. }
  391. },
  392. /* ===========================
  393. * 交互
  394. * =========================== */
  395. onCanvasTap: function(e) {
  396. if (!this.interactive) return
  397. var touches = e.touches || e.changedTouches
  398. if (!touches || touches.length === 0) return
  399. var touch = touches[0]
  400. var canvasRect = this._getCanvasRect()
  401. if (!canvasRect) return
  402. var x = touch.clientX - canvasRect.left
  403. var y = touch.clientY - canvasRect.top
  404. var hitNode = this._hitTest(x, y)
  405. if (hitNode && !hitNode.isCenter) {
  406. this.selectedNode = hitNode
  407. this.selectedNodePos = { x: hitNode.x, y: hitNode.y }
  408. } else {
  409. this.selectedNode = null
  410. this.selectedNodePos = null
  411. }
  412. },
  413. _hitTest: function(x, y) {
  414. for (var i = this.nodeData.length - 1; i >= 0; i--) {
  415. var node = this.nodeData[i]
  416. var dx = x - node.x
  417. var dy = y - node.y
  418. if (dx * dx + dy * dy <= node.radius * node.radius) {
  419. return node
  420. }
  421. }
  422. return null
  423. },
  424. /* ===========================
  425. * 工具方法
  426. * =========================== */
  427. _getCanvasRect: function() {
  428. if (this._canvasRect) {
  429. return {
  430. left: this._canvasRect.left,
  431. top: this._canvasRect.top,
  432. width: this.canvasWidth,
  433. height: this.canvasHeight
  434. }
  435. }
  436. return {
  437. left: 0,
  438. top: 0,
  439. width: this.canvasWidth,
  440. height: this.canvasHeight
  441. }
  442. },
  443. formatDate: function(dateStr) {
  444. if (!dateStr) return ''
  445. // 直接截取前 10 位 yyyy-MM-dd,无需 Date 解析
  446. return String(dateStr).substring(0, 10)
  447. },
  448. /* ===========================
  449. * Canvas 初始化
  450. * =========================== */
  451. initCanvas: function(cb) {
  452. var self = this
  453. uni.createSelectorQuery().in(this)
  454. .select('#' + 'abilityGraphCanvas')
  455. .fields({ node: true, size: true, rect: true })
  456. .exec(function(res) {
  457. try {
  458. if (self._destroyed) return
  459. if (!res || !res[0]) {
  460. if (cb) cb(false)
  461. return
  462. }
  463. var info = res[0]
  464. if (!info.node) {
  465. if (cb) cb(false)
  466. return
  467. }
  468. var canvas = info.node
  469. var width = info.width
  470. var height = info.height
  471. if (!width || !height) {
  472. var winWidth = 375
  473. try {
  474. var winInfo = uni.getWindowInfo()
  475. winWidth = winInfo.windowWidth || 375
  476. } catch (e2) {}
  477. width = Math.round((self.canvasWidth || 340) * winWidth / 750)
  478. height = Math.round((self.canvasHeight || 280) * winWidth / 750)
  479. }
  480. var pixelRatio = 2
  481. try {
  482. var system = uni.getWindowInfo()
  483. pixelRatio = system.pixelRatio || 2
  484. } catch (e) {}
  485. canvas.width = width * pixelRatio
  486. canvas.height = height * pixelRatio
  487. var ctx = canvas.getContext('2d')
  488. if (!ctx) {
  489. if (cb) cb(false)
  490. return
  491. }
  492. ctx.scale(pixelRatio, pixelRatio)
  493. self.ctx = ctx
  494. self._canvasNode = canvas
  495. self.canvasWidth = width
  496. self.canvasHeight = height
  497. self.dpr = pixelRatio
  498. self.canvasReady = true
  499. // 存储 canvas 在页面中的真实位置(触摸坐标转换用)
  500. if (info.rect) {
  501. self._canvasRect = { left: info.rect.left || 0, top: info.rect.top || 0 }
  502. }
  503. self.buildNodesAndEdges()
  504. self.draw()
  505. if (cb) cb(true)
  506. } catch (e) {
  507. if (cb) cb(false)
  508. }
  509. })
  510. }
  511. }
  512. }
  513. </script>
  514. <style scoped lang="scss">
  515. .ability-graph-wrapper {
  516. position: relative;
  517. width: 100%;
  518. min-height: 200px;
  519. height: auto;
  520. margin: 10rpx 0;
  521. background: $app-surface;
  522. border-radius: 24rpx;
  523. overflow: hidden;
  524. }
  525. .ability-graph-canvas {
  526. position: absolute;
  527. top: 0;
  528. left: 0;
  529. z-index: 1;
  530. }
  531. /* 详情弹窗 */
  532. .ability-detail-popup {
  533. position: absolute;
  534. z-index: 10;
  535. pointer-events: none;
  536. transform: translate(-50%, -100%);
  537. margin-top: -16rpx;
  538. }
  539. .popup-content {
  540. background: $app-surface;
  541. border-radius: 16rpx;
  542. padding: 20rpx;
  543. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
  544. min-width: 200rpx;
  545. max-width: 320rpx;
  546. pointer-events: auto;
  547. }
  548. .popup-header {
  549. display: flex;
  550. align-items: center;
  551. margin-bottom: 16rpx;
  552. }
  553. .popup-avatar {
  554. width: 56rpx;
  555. height: 56rpx;
  556. border-radius: 50%;
  557. margin-right: 12rpx;
  558. }
  559. .popup-info {
  560. display: flex;
  561. flex-direction: column;
  562. }
  563. .popup-name {
  564. font-size: calc(28rpx * var(--font-scale, 1));
  565. font-weight: 600;
  566. color: $uni-text-color;
  567. }
  568. .popup-relation {
  569. font-size: calc(22rpx * var(--font-scale, 1));
  570. color: $uni-text-color-secondary;
  571. margin-top: 2rpx;
  572. }
  573. .popup-skills-section {
  574. padding: 12rpx 0;
  575. border-top: 1rpx solid $facade-fill-slate;
  576. border-bottom: 1rpx solid $facade-fill-slate;
  577. margin-bottom: 12rpx;
  578. }
  579. .popup-skills-title {
  580. font-size: calc(24rpx * var(--font-scale, 1));
  581. font-weight: 700;
  582. color: $status-warning-2;
  583. display: block;
  584. margin-bottom: 8rpx;
  585. }
  586. .popup-skills-list {
  587. display: flex;
  588. flex-wrap: wrap;
  589. gap: 8rpx;
  590. }
  591. .popup-skill-item {
  592. font-size: calc(22rpx * var(--font-scale, 1));
  593. color: $facade-text-slate-deep;
  594. background: $status-warning-soft;
  595. border-radius: 8rpx;
  596. padding: 4rpx 10rpx;
  597. }
  598. .popup-skill-more {
  599. font-size: calc(22rpx * var(--font-scale, 1));
  600. color: $app-text-subtle;
  601. padding: 4rpx 6rpx;
  602. }
  603. .popup-time {
  604. display: flex;
  605. align-items: center;
  606. margin-top: 4rpx;
  607. }
  608. .popup-time-label {
  609. font-size: calc(22rpx * var(--font-scale, 1));
  610. color: $app-text-subtle;
  611. }
  612. .popup-time-value {
  613. font-size: calc(22rpx * var(--font-scale, 1));
  614. color: $facade-text-slate-deep;
  615. }
  616. .popup-arrow {
  617. position: absolute;
  618. bottom: -8rpx;
  619. left: 50%;
  620. margin-left: -8rpx;
  621. width: 0;
  622. height: 0;
  623. border-left: 8rpx solid transparent;
  624. border-right: 8rpx solid transparent;
  625. border-top: 8rpx solid $app-surface;
  626. }
  627. /* 空状态 */
  628. .ability-graph-empty,
  629. .ability-loading {
  630. display: flex;
  631. flex-direction: column;
  632. align-items: center;
  633. justify-content: center;
  634. padding: 60rpx 20rpx;
  635. background: $app-surface;
  636. border-radius: 24rpx;
  637. margin: 10rpx 0;
  638. }
  639. .empty-icon {
  640. font-size: calc($uni-font-size-5xl * var(--font-scale, 1));
  641. margin-bottom: 16rpx;
  642. }
  643. .empty-text {
  644. font-size: calc(28rpx * var(--font-scale, 1));
  645. font-weight: 600;
  646. color: $uni-text-color;
  647. margin-bottom: 8rpx;
  648. }
  649. .empty-hint {
  650. font-size: calc(24rpx * var(--font-scale, 1));
  651. color: $app-text-subtle;
  652. margin-bottom: 24rpx;
  653. }
  654. .loading-text {
  655. font-size: calc(28rpx * var(--font-scale, 1));
  656. color: $uni-text-color-secondary;
  657. }
  658. </style>