AccountCard copy.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <template>
  2. <view class="account-card" :class="{ 'is-grid-layout': isGridLayout }">
  3. <!-- 折叠/展开按钮 -->
  4. <button class="collapse-btn" @click="toggleExpand">
  5. <cwg-icon name="chevron-right" :size="20" color="#6c8595"
  6. :class="['chevron-icon', { expanded: isExpanded }]" />
  7. </button>
  8. <!-- 标签区域 -->
  9. <view class="labels-container">
  10. <view class="account-number"># {{ account.accountNumber }}</view>
  11. <view class="account-number" @click="copy(account.fwq)">{{ account.fwq }}</view>
  12. <view class="labels">
  13. <template v-for="(label, index) in account.labels" :key="index">
  14. <view v-if="label" class="label-badge">
  15. {{ label }}
  16. </view>
  17. </template>
  18. </view>
  19. </view>
  20. <!-- 主要内容区域(余额和操作按钮) -->
  21. <view class="main-content">
  22. <!-- 余额 -->
  23. <view class="balance">
  24. <text class="balance-number">{{ balanceInteger }}</text>
  25. <text class="balance-decimal">{{ balanceDecimal }} {{ account.currency }}</text>
  26. </view>
  27. <!-- 移动端圆形按钮组(≤1100px显示) -->
  28. <view class="mobile-buttons">
  29. <!-- 交易 -->
  30. <template v-for="(item, index) in circleButtons" :key="index">
  31. <view class="circle-btn" :class="{ 'is-disabled': item.disabled }" @click="handleAction1(item)"
  32. v-if="!item.needDemo">
  33. <view class="circle-icon" :class="{ 'primary': item.primary }">
  34. <cwg-icon :name="item.icon" :size="16" :color="item.color" />
  35. </view>
  36. <text class="circle-label" v-t="item.label" />
  37. </view>
  38. </template>
  39. <!-- 更多(三点) -->
  40. <cwg-dropdown @open="onOpen" @close="onClose" :menu-list="customMenuList"
  41. @menuClick="handleCustomClick">
  42. <view class="circle-btn">
  43. <view class="circle-icon">
  44. <cwg-icon name="crm-ellipsis-vertical" :size="16" color="#2e3a47" />
  45. </view>
  46. <text class="circle-label" v-t="'vu.item7'" />
  47. </view>
  48. </cwg-dropdown>
  49. </view>
  50. <!-- 桌面端按钮组(>1100px显示且非网格布局) -->
  51. <view class="desktop-buttons" v-if="!props.isGridLayout">
  52. <template v-for="(item, index) in actionButtons" :key="index">
  53. <view class="action-btn" :class="{ 'primary': item.primary, 'is-disabled': item.disabled }"
  54. @click="handleAction1(item)" v-if="!item.needDemo">
  55. <text class="btn-icon">
  56. <cwg-icon :name="item.icon" :size="16" :color="item.color" />
  57. </text>
  58. <text v-t="item.label" />
  59. </view>
  60. </template>
  61. <cwg-dropdown @open="onOpen" @close="onClose" :menu-list="customMenuList"
  62. @menuClick="handleCustomClick">
  63. <view class="action-btn icon-only">
  64. <cwg-icon name="crm-ellipsis-vertical" :size="16" color="#2e3a47" />
  65. </view>
  66. </cwg-dropdown>
  67. </view>
  68. </view>
  69. <view ref="infoBottomRef" class="info-bottom" :style="{
  70. height: isExpanded ? infoBottomHeight + 'px' : '0px',
  71. transition: 'height 281ms cubic-bezier(0.4, 0, 0.2, 1)'
  72. }">
  73. <!-- 底部信息区域(折叠时隐藏) -->
  74. <view class="info-section">
  75. <view class="info-column">
  76. <cwg-label-line-value :label="t('Label.Leverage')" :value="account.actualLeverage" />
  77. <cwg-label-line-value :label="t('Label.FloatingPL')" :value="account.floatingPL" />
  78. <cwg-label-line-value :label="t('Label.Balance')" :value="account.balanceWithSymbol" />
  79. </view>
  80. <view class="info-column">
  81. <cwg-label-line-value :label="t('Label.Equity')" :value="account.equityWithSymbol" />
  82. <cwg-label-line-value :label="t('Label.Credit')" :value="account.creditWithSymbol" />
  83. <cwg-label-line-value :label="t('Documentary.console.item3')" :value="account.platform" />
  84. </view>
  85. </view>
  86. <!-- 额外操作行(服务器、登录、更改密码,折叠时隐藏) -->
  87. <view class="extra-actions">
  88. <!-- 登录复制行 -->
  89. <view class="copy-row">
  90. <text class="label">服务器</text>
  91. <view class="value">{{ account.fwq }}</view>
  92. <view class="copy-btn" @click="copy(account.fwq)">
  93. <cwg-icon name="copy" :size="16" color="#2e3a47" />
  94. </view>
  95. </view>
  96. <!-- <view class="divider"></view> -->
  97. <view class="copy-row">
  98. <text class="label" v-t="'signin.title'" />
  99. <text class="value">{{ account.login }}</text>
  100. <view class="copy-btn" @click="copy(account.login)">
  101. <cwg-icon name="copy" :size="16" color="#2e3a47" />
  102. </view>
  103. </view>
  104. <view class="divider"></view>
  105. <!-- 更改交易密码按钮 -->
  106. <view class="change-password-btn" @click="handleAction('changePassword1')" v-if="!isDemo">
  107. <text class="btn-icon">
  108. <cwg-icon name="crm-xg" :size="16" color="#2e3a47" />
  109. </text>
  110. <text v-t="'vu.item3'" />
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 通知区域(预留) -->
  115. <view class="notificators"></view>
  116. <TerminalDialog v-model:visible="terminalDialogVisible" />
  117. <TerminalChangePasswordDialog v-model:visible="terminalChangePasswordDialogVisible" :pwdType="pwdType"
  118. :account="account" :accountLabel="t('Documentary.tradingCenter.item29') + ' # '" />
  119. <TerminalInfoDialog v-model:visible="terminalInfoDialogVisible" :accountNumber="accountInfo.login"
  120. :form="accountInfo" :fieldList="fieldList" :title="t('Documentary.TundManagement.item29')"
  121. :accountLabel="t('Documentary.tradingCenter.item29') + ' # '" />
  122. </view>
  123. </template>
  124. <script setup lang="ts">
  125. import { ref, computed, onMounted, nextTick, onBeforeUnmount } from 'vue';
  126. import useRouter from "@/hooks/useRouter";
  127. const router = useRouter();
  128. import { useI18n } from 'vue-i18n';
  129. const { t } = useI18n();
  130. import TerminalDialog from './TerminalDialog.vue'
  131. import TerminalChangePasswordDialog from './TerminalChangePasswordDialog.vue'
  132. import TerminalInfoDialog from './TerminalInfoDialog.vue'
  133. const props = defineProps<{
  134. account: Account;
  135. isGridLayout?: boolean;
  136. }>();
  137. const accountInfo = ref(props.account)
  138. const isGridLayout = ref(props.isGridLayout || false)
  139. // 定义账户数据类型
  140. export interface Account {
  141. labels: string[]; // 标签数组,如 ['真实', 'MT4', 'Standard']
  142. accountNumber: string; // 账号,如 '85319215'
  143. nickName: string; // 昵称,如 '标准账户'
  144. balance: number; // 余额数字
  145. currency: string; // 货币,如 'USD'
  146. actualLeverage: string; // 实际杠杆,如 '1:2000'
  147. maxLeverage: string; // 调整杠杆,如 '1:2000'
  148. floatingPL: string; // 浮动盈亏,如 '0.00 USD'
  149. creditWithSymbol: string; // 可用保证金,如 '0.00 USD'
  150. equityWithSymbol: string; // 净值,如 '0.00 USD'
  151. platform: string; // 平台,如 'MT4'
  152. server: string; // 服务器,如 'Exness-Real28'
  153. login: string; // 登录名,如 '85319215'
  154. balanceWithSymbol: string; // 余额,如 '85319215'
  155. }
  156. const isDemo = computed(() => accountInfo.value.listType == 'demo')
  157. const closeFunctionOpen = (code) => {
  158. const closeFunctions = accountInfo.value.closeFunctions || ""
  159. if (closeFunctions == null || closeFunctions === "") {
  160. return true;
  161. }
  162. return String(closeFunctions).indexOf(String(code)) === -1;
  163. }
  164. // 圆形按钮数据
  165. const circleButtons = ref([
  166. { key: 'trade', label: 'Shop.Index.Transaction', icon: 'crm-trade', action: 'trade', needDemo: false, primary: true, disabled: false, color: '#fff' },
  167. { key: 'deposit', label: 'Home.page_customer.item2', icon: 'crm-deposit', action: 'deposit', needDemo: isDemo.value, disabled: !closeFunctionOpen('1'), color: '#2e3a47' },
  168. { key: 'withdraw', label: 'Home.page_customer.item3', icon: 'crm-withdraw', action: 'withdraw', needDemo: isDemo.value, disabled: !closeFunctionOpen('2'), color: '#2e3a47' },
  169. { key: 'transfer', label: 'Custom.Index.Transfer', icon: 'crm-transfer', action: 'transfer', needDemo: isDemo.value, disabled: !(closeFunctionOpen('5') && closeFunctionOpen('6') && closeFunctionOpen('3')), color: '#2e3a47' }
  170. ])
  171. // 普通按钮数据
  172. const actionButtons = computed(() => [
  173. { key: 'trade', label: 'Shop.Index.Transaction', icon: 'crm-trade', color: '#fff', primary: true, action: 'trade', needDemo: false, disabled: false },
  174. { key: 'deposit', label: 'Home.page_customer.item2', icon: 'crm-deposit', color: '#2e3a47', primary: false, action: 'deposit', needDemo: isDemo.value, disabled: !closeFunctionOpen('1') },
  175. { key: 'withdraw', label: 'Home.page_customer.item3', icon: 'crm-withdraw', color: '#2e3a47', primary: false, action: 'withdraw', needDemo: isDemo.value, disabled: !closeFunctionOpen('2') },
  176. { key: 'transfer', label: 'Custom.Index.Transfer', icon: 'crm-transfer', color: '#2e3a47', primary: false, action: 'transfer', needDemo: isDemo.value, disabled: !(closeFunctionOpen('5') && closeFunctionOpen('6') && closeFunctionOpen('3')) }
  177. ])
  178. const fieldList = ref([
  179. { label: t('Custom.PaymentHistory.AccountType'), key: 'nickname', copyable: false },
  180. { label: t('Label.Leverage'), key: 'actualLeverage', copyable: false },
  181. { label: t('Label.FloatingPL'), key: 'floatingPL', copyable: false },
  182. { label: t('Label.Balance'), key: 'balanceWithSymbol', copyable: false },
  183. { label: t('Label.Equity'), key: 'equityWithSymbol', copyable: false },
  184. { label: t('Label.Credit'), key: 'creditWithSymbol', copyable: false },
  185. { label: t('Documentary.console.item3'), key: 'platform', copyable: false },
  186. { label: t('Documentary.console.item4'), key: 'login', copyable: true }
  187. ])
  188. const nickName = ref(accountInfo.value.nickName)
  189. const infoBottomRef = ref(null);
  190. const infoBottomHeight = ref(0);
  191. // 测量高度
  192. const updateSubmenuHeight = () => {
  193. const el = infoBottomRef.value.$el;
  194. if (el) {
  195. // 获取内容实际高度(可能需要暂时移除过渡影响)
  196. const height = el.scrollHeight || el.offsetHeight;
  197. if (height > 0) {
  198. infoBottomHeight.value = height;
  199. }
  200. }
  201. };
  202. // 折叠状态
  203. const isExpanded = ref(false);
  204. // 切换折叠
  205. const toggleExpand = () => {
  206. isExpanded.value = !isExpanded.value;
  207. if (isExpanded.value) {
  208. nextTick(() => {
  209. updateSubmenuHeight();
  210. });
  211. }
  212. };
  213. const terminalDialogVisible = ref(false)
  214. const terminalChangePasswordDialogVisible = ref(false)
  215. const terminalInfoDialogVisible = ref(false)
  216. const pwdType = ref(1)
  217. const handleAction1 = (item) => {
  218. if (item.disabled) {
  219. uni.showToast({
  220. title: t('news_add_field.Des.item1'),
  221. icon: 'none'
  222. })
  223. return
  224. }
  225. handleAction(item.action, item)
  226. }
  227. // 处理按钮操作
  228. const handleAction = (type: string) => {
  229. console.log(type == 'info', type, 'info');
  230. switch (type) {
  231. case 'trade':
  232. terminalDialogVisible.value = true
  233. break;
  234. case 'changePassword1':
  235. pwdType.value = 1
  236. terminalChangePasswordDialogVisible.value = true
  237. break;
  238. case 'changePassword2':
  239. pwdType.value = 2
  240. terminalChangePasswordDialogVisible.value = true
  241. break;
  242. case 'info':
  243. console.log(type);
  244. terminalInfoDialogVisible.value = true
  245. break;
  246. case 'deposit':
  247. toDeposit()
  248. break;
  249. case 'withdraw':
  250. toWithdraw()
  251. break;
  252. case 'transfer':
  253. toTransfer()
  254. break;
  255. default:
  256. break;
  257. }
  258. };
  259. const customMenuList = computed(() => !isDemo.value ? [{ label: t('vu.item3'), type: 'changePassword1' }, { label: t('vu.item4'), type: 'changePassword2' }, { label: t('Documentary.TundManagement.item29'), type: 'info' }] : [{ label: t('Documentary.TundManagement.item29'), type: 'info' }])
  260. const handleCustomClick = (item, index) => {
  261. handleAction(item.value.type)
  262. }
  263. // 复制文本
  264. const copy = (text: string) => {
  265. uni.setClipboardData({ data: text });
  266. };
  267. // 按钮对应的操作方法
  268. const toDeposit = () => {
  269. router.push(`/pages/customer/deposit?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  270. }
  271. const toWithdraw = () => {
  272. router.push(`/pages/customer/withdrawal?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  273. }
  274. const toTransfer = () => {
  275. router.push(`/pages/customer/transfer?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  276. }
  277. // 格式化余额,拆分为整数和小数部分
  278. const balanceInteger = computed(() => {
  279. return Math.floor(accountInfo.value.balance).toString();
  280. });
  281. const balanceDecimal = computed(() => {
  282. const parts = accountInfo.value.balance.toFixed(2).split('.');
  283. return parts[1] ? '.' + parts[1] : '.00';
  284. });
  285. // 在组件挂载后初始化高度
  286. onMounted(() => {
  287. nextTick(() => {
  288. updateSubmenuHeight();
  289. });
  290. window.addEventListener('resize', handleResize);
  291. isExpanded.value = accountInfo.value.isExpanded;
  292. });
  293. // 监听窗口 resize
  294. const handleResize = () => {
  295. if (isExpanded.value) {
  296. updateSubmenuHeight();
  297. }
  298. };
  299. onBeforeUnmount(() => {
  300. window.removeEventListener('resize', handleResize);
  301. });
  302. </script>
  303. <style scoped lang="scss">
  304. @import '@/uni.scss';
  305. .account-card {
  306. border-radius: px2rpx(16);
  307. padding: px2rpx(16);
  308. margin-bottom: px2rpx(16);
  309. position: relative;
  310. border: 1px solid rgba(108, 133, 149, 0.12);
  311. color: #2e3a47;
  312. .collapse-btn {
  313. position: absolute;
  314. top: px2rpx(12);
  315. right: px2rpx(12);
  316. background: transparent;
  317. border: none;
  318. padding: 0;
  319. cursor: pointer;
  320. color: #6c8595;
  321. width: px2rpx(32);
  322. height: px2rpx(32);
  323. display: flex;
  324. align-items: center;
  325. justify-content: center;
  326. .chevron-icon {
  327. transform: rotate(90deg);
  328. transition: transform 0.3s;
  329. &.expanded {
  330. transform: rotate(270deg);
  331. }
  332. }
  333. }
  334. .labels-container {
  335. display: flex;
  336. align-items: center;
  337. flex-wrap: wrap;
  338. gap: px2rpx(12);
  339. margin-bottom: px2rpx(16);
  340. padding-right: px2rpx(40); // 为折叠按钮留出空间
  341. .labels {
  342. display: flex;
  343. gap: px2rpx(8);
  344. }
  345. .label-badge {
  346. background-color: rgba(108, 133, 149, 0.08);
  347. border-radius: px2rpx(4);
  348. padding: px2rpx(4) px2rpx(8);
  349. font-size: px2rpx(12);
  350. color: #6c8595;
  351. font-weight: 500;
  352. }
  353. .account-number {
  354. font-size: px2rpx(18);
  355. font-weight: 600;
  356. line-height: 1.3;
  357. }
  358. .account-nickname {
  359. font-size: px2rpx(14);
  360. color: #6c8595;
  361. }
  362. }
  363. .main-content {
  364. .balance {
  365. margin-bottom: px2rpx(16);
  366. .balance-number {
  367. font-size: px2rpx(32);
  368. font-weight: 700;
  369. }
  370. .balance-decimal {
  371. font-size: px2rpx(16);
  372. color: #6c8595;
  373. margin-left: px2rpx(4);
  374. }
  375. }
  376. // 移动端按钮组(默认显示)
  377. .mobile-buttons {
  378. display: flex;
  379. justify-content: center;
  380. gap: px2rpx(0);
  381. margin-bottom: px2rpx(16);
  382. flex-wrap: wrap;
  383. .circle-btn {
  384. display: flex;
  385. flex-direction: column;
  386. align-items: center;
  387. cursor: pointer;
  388. width: px2rpx(64);
  389. .circle-icon {
  390. width: px2rpx(48);
  391. height: px2rpx(48);
  392. border-radius: 50%;
  393. background-color: #f5f7f9;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. color: #2e3a47;
  398. transition: background-color 0.2s;
  399. &.primary {
  400. background-color: var(--color-navy-700);
  401. color: #fff;
  402. }
  403. &:hover {
  404. background-color: #e9ecef;
  405. }
  406. svg {
  407. width: px2rpx(24);
  408. height: px2rpx(24);
  409. }
  410. }
  411. .circle-label {
  412. font-size: px2rpx(12);
  413. margin-top: px2rpx(4);
  414. color: #6c8595;
  415. }
  416. }
  417. }
  418. // 桌面端按钮组(默认隐藏,屏幕>1100px时显示)
  419. .desktop-buttons {
  420. display: none;
  421. .action-btn {
  422. background: transparent;
  423. border: 1px solid rgba(108, 133, 149, 0);
  424. border-radius: px2rpx(8);
  425. padding: px2rpx(8) px2rpx(20);
  426. font-size: px2rpx(14);
  427. color: #2e3a47;
  428. display: inline-flex;
  429. align-items: center;
  430. justify-content: center;
  431. gap: px2rpx(8);
  432. cursor: pointer;
  433. transition: all 0.2s;
  434. height: px2rpx(40);
  435. box-sizing: border-box;
  436. background-color: rgba(108, 133, 149, 0.08);
  437. &.primary {
  438. background-color: var(--color-navy-700);
  439. color: #fff;
  440. &:hover {
  441. background-color: var(--color-navy-600);
  442. }
  443. }
  444. &:hover {
  445. border: 1px solid rgba(108, 133, 149, 0.2);
  446. }
  447. .btn-icon {
  448. display: flex;
  449. align-items: center;
  450. svg {
  451. width: px2rpx(18);
  452. height: px2rpx(18);
  453. }
  454. }
  455. &.icon-only {
  456. padding: px2rpx(8);
  457. }
  458. }
  459. }
  460. .is-disabled {
  461. cursor: not-allowed;
  462. opacity: 0.5;
  463. }
  464. }
  465. .info-section {
  466. display: flex;
  467. gap: px2rpx(24);
  468. padding: px2rpx(16) 0;
  469. border-top: 1px solid rgba(108, 133, 149, 0.12);
  470. border-bottom: 1px solid rgba(108, 133, 149, 0.12);
  471. margin: px2rpx(16) 0;
  472. .info-column {
  473. flex: 1;
  474. display: flex;
  475. flex-direction: column;
  476. gap: px2rpx(12);
  477. }
  478. .info-item {
  479. display: flex;
  480. justify-content: space-between;
  481. align-items: flex-end;
  482. font-size: px2rpx(14);
  483. .label {
  484. color: #6c8595;
  485. }
  486. .line {
  487. flex: 1;
  488. height: 1px;
  489. border-top: 1px dashed rgba(108, 133, 149, 0.5);
  490. margin-bottom: px2rpx(1);
  491. }
  492. .value {
  493. font-weight: 500;
  494. color: #2e3a47;
  495. }
  496. }
  497. }
  498. @media screen and (max-width: 768px) {
  499. .info-section {
  500. flex-direction: column;
  501. gap: px2rpx(12);
  502. }
  503. }
  504. .extra-actions {
  505. display: flex;
  506. align-items: center;
  507. gap: px2rpx(8);
  508. margin-bottom: px2rpx(12);
  509. .copy-row {
  510. display: flex;
  511. align-items: center;
  512. gap: px2rpx(4);
  513. font-size: px2rpx(14);
  514. .label {
  515. color: #6c8595;
  516. min-width: px2rpx(30);
  517. }
  518. .value {
  519. flex: 1;
  520. color: #2e3a47;
  521. font-family: monospace;
  522. }
  523. .copy-btn {
  524. background: transparent;
  525. border: 1px solid rgba(108, 133, 149, 0);
  526. padding: 0;
  527. cursor: pointer;
  528. color: #6c8595;
  529. width: px2rpx(24);
  530. height: px2rpx(24);
  531. display: flex;
  532. align-items: center;
  533. justify-content: center;
  534. box-sizing: border-box;
  535. svg {
  536. width: px2rpx(20);
  537. height: px2rpx(20);
  538. }
  539. &:hover {
  540. background-color: rgba(108, 133, 149, 0.05);
  541. border: 1px solid rgba(108, 133, 149, 0.2);
  542. }
  543. }
  544. }
  545. .divider {
  546. width: 1px;
  547. height: px2rpx(20);
  548. border-left: 1px solid rgba(108, 133, 149, 0.5);
  549. }
  550. .change-password-btn {
  551. background: transparent;
  552. box-sizing: border-box;
  553. border: 1px solid rgba(108, 133, 149, 0);
  554. border-radius: px2rpx(8);
  555. padding: px2rpx(8) px2rpx(16);
  556. font-size: px2rpx(14);
  557. color: #2e3a47;
  558. display: inline-flex;
  559. gap: px2rpx(8);
  560. cursor: pointer;
  561. margin: 0;
  562. // transition: all 0.2s;
  563. .btn-icon svg {
  564. width: px2rpx(16);
  565. height: px2rpx(16);
  566. }
  567. &:hover {
  568. background-color: rgba(108, 133, 149, 0.05);
  569. border: 1px solid rgba(108, 133, 149, 0.2);
  570. }
  571. }
  572. }
  573. .info-bottom {
  574. overflow: hidden;
  575. }
  576. .notificators {
  577. // 预留通知区域
  578. }
  579. }
  580. // 响应式:屏幕宽度 > 1100px 时,隐藏移动端按钮,显示桌面端按钮
  581. @media screen and (min-width: 1100px) {
  582. .account-card {
  583. .main-content {
  584. .mobile-buttons {
  585. display: none;
  586. }
  587. .desktop-buttons {
  588. display: flex;
  589. gap: px2rpx(8);
  590. justify-content: flex-end;
  591. }
  592. }
  593. }
  594. }
  595. // 网格布局时,使用移动端样式
  596. .account-card.is-grid-layout {
  597. .main-content {
  598. .mobile-buttons {
  599. display: flex;
  600. }
  601. .desktop-buttons {
  602. display: none;
  603. }
  604. }
  605. }
  606. </style>