AccountCard copy.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  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({
  266. data: text,
  267. success: function () {
  268. uni.showToast({
  269. title: t('Btn.item8'),
  270. icon: 'none',
  271. duration: 2000
  272. });
  273. }
  274. });
  275. };
  276. // 按钮对应的操作方法
  277. const toDeposit = () => {
  278. router.push(`/pages/customer/deposit-select?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  279. }
  280. const toWithdraw = () => {
  281. router.push(`/pages/customer/withdrawal-select?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  282. }
  283. const toTransfer = () => {
  284. router.push(`/pages/customer/transfer?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  285. }
  286. // 格式化余额,拆分为整数和小数部分
  287. const balanceInteger = computed(() => {
  288. return Math.floor(accountInfo.value.balance).toString();
  289. });
  290. const balanceDecimal = computed(() => {
  291. const parts = accountInfo.value.balance.toFixed(2).split('.');
  292. return parts[1] ? '.' + parts[1] : '.00';
  293. });
  294. // 在组件挂载后初始化高度
  295. onMounted(() => {
  296. nextTick(() => {
  297. updateSubmenuHeight();
  298. });
  299. window.addEventListener('resize', handleResize);
  300. isExpanded.value = accountInfo.value.isExpanded;
  301. });
  302. // 监听窗口 resize
  303. const handleResize = () => {
  304. if (isExpanded.value) {
  305. updateSubmenuHeight();
  306. }
  307. };
  308. onBeforeUnmount(() => {
  309. window.removeEventListener('resize', handleResize);
  310. });
  311. </script>
  312. <style scoped lang="scss">
  313. @import '@/uni.scss';
  314. .account-card {
  315. border-radius: px2rpx(16);
  316. padding: px2rpx(16);
  317. margin-bottom: px2rpx(16);
  318. position: relative;
  319. border: 1px solid rgba(108, 133, 149, 0.12);
  320. color: #2e3a47;
  321. .collapse-btn {
  322. position: absolute;
  323. top: px2rpx(12);
  324. right: px2rpx(12);
  325. background: transparent;
  326. border: none;
  327. padding: 0;
  328. cursor: pointer;
  329. color: #6c8595;
  330. width: px2rpx(32);
  331. height: px2rpx(32);
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. .chevron-icon {
  336. transform: rotate(90deg);
  337. transition: transform 0.3s;
  338. &.expanded {
  339. transform: rotate(270deg);
  340. }
  341. }
  342. }
  343. .labels-container {
  344. display: flex;
  345. align-items: center;
  346. flex-wrap: wrap;
  347. gap: px2rpx(12);
  348. margin-bottom: px2rpx(16);
  349. padding-right: px2rpx(40); // 为折叠按钮留出空间
  350. .labels {
  351. display: flex;
  352. gap: px2rpx(8);
  353. }
  354. .label-badge {
  355. background-color: rgba(108, 133, 149, 0.08);
  356. border-radius: px2rpx(4);
  357. padding: px2rpx(4) px2rpx(8);
  358. font-size: px2rpx(12);
  359. color: #6c8595;
  360. font-weight: 500;
  361. }
  362. .account-number {
  363. font-size: px2rpx(18);
  364. font-weight: 600;
  365. line-height: 1.3;
  366. }
  367. .account-nickname {
  368. font-size: px2rpx(14);
  369. color: #6c8595;
  370. }
  371. }
  372. .main-content {
  373. .balance {
  374. margin-bottom: px2rpx(16);
  375. .balance-number {
  376. font-size: px2rpx(32);
  377. font-weight: 700;
  378. }
  379. .balance-decimal {
  380. font-size: px2rpx(16);
  381. color: #6c8595;
  382. margin-left: px2rpx(4);
  383. }
  384. }
  385. // 移动端按钮组(默认显示)
  386. .mobile-buttons {
  387. display: flex;
  388. justify-content: center;
  389. gap: px2rpx(0);
  390. margin-bottom: px2rpx(16);
  391. flex-wrap: wrap;
  392. .circle-btn {
  393. display: flex;
  394. flex-direction: column;
  395. align-items: center;
  396. cursor: pointer;
  397. width: px2rpx(64);
  398. .circle-icon {
  399. width: px2rpx(48);
  400. height: px2rpx(48);
  401. border-radius: 50%;
  402. background-color: #f5f7f9;
  403. display: flex;
  404. align-items: center;
  405. justify-content: center;
  406. color: #2e3a47;
  407. transition: background-color 0.2s;
  408. &.primary {
  409. background-color: #cf1322;
  410. ;
  411. color: #fff;
  412. }
  413. &:hover {
  414. background-color: #e9ecef;
  415. }
  416. svg {
  417. width: px2rpx(24);
  418. height: px2rpx(24);
  419. }
  420. }
  421. .circle-label {
  422. font-size: px2rpx(12);
  423. margin-top: px2rpx(4);
  424. color: #6c8595;
  425. }
  426. }
  427. }
  428. // 桌面端按钮组(默认隐藏,屏幕>1100px时显示)
  429. .desktop-buttons {
  430. display: none;
  431. .action-btn {
  432. background: transparent;
  433. border: 1px solid rgba(108, 133, 149, 0);
  434. border-radius: px2rpx(8);
  435. padding: px2rpx(8) px2rpx(20);
  436. font-size: px2rpx(14);
  437. color: #2e3a47;
  438. display: inline-flex;
  439. align-items: center;
  440. justify-content: center;
  441. gap: px2rpx(8);
  442. cursor: pointer;
  443. transition: all 0.2s;
  444. height: px2rpx(40);
  445. box-sizing: border-box;
  446. background-color: rgba(108, 133, 149, 0.08);
  447. &.primary {
  448. background-color: #cf1322;
  449. ;
  450. color: #fff;
  451. &:hover {
  452. background-color: var(--color-navy-600);
  453. }
  454. }
  455. &:hover {
  456. border: 1px solid rgba(108, 133, 149, 0.2);
  457. }
  458. .btn-icon {
  459. display: flex;
  460. align-items: center;
  461. svg {
  462. width: px2rpx(18);
  463. height: px2rpx(18);
  464. }
  465. }
  466. &.icon-only {
  467. padding: px2rpx(8);
  468. }
  469. }
  470. }
  471. .is-disabled {
  472. cursor: not-allowed;
  473. opacity: 0.5;
  474. }
  475. }
  476. .info-section {
  477. display: flex;
  478. gap: px2rpx(24);
  479. padding: px2rpx(16) 0;
  480. border-top: 1px solid rgba(108, 133, 149, 0.12);
  481. border-bottom: 1px solid rgba(108, 133, 149, 0.12);
  482. margin: px2rpx(16) 0;
  483. .info-column {
  484. flex: 1;
  485. display: flex;
  486. flex-direction: column;
  487. gap: px2rpx(12);
  488. }
  489. .info-item {
  490. display: flex;
  491. justify-content: space-between;
  492. align-items: flex-end;
  493. font-size: px2rpx(14);
  494. .label {
  495. color: #6c8595;
  496. }
  497. .line {
  498. flex: 1;
  499. height: 1px;
  500. border-top: 1px dashed rgba(108, 133, 149, 0.5);
  501. margin-bottom: px2rpx(1);
  502. }
  503. .value {
  504. font-weight: 500;
  505. color: #2e3a47;
  506. }
  507. }
  508. }
  509. @media screen and (max-width: 768px) {
  510. .info-section {
  511. flex-direction: column;
  512. gap: px2rpx(12);
  513. }
  514. }
  515. .extra-actions {
  516. display: flex;
  517. align-items: center;
  518. gap: px2rpx(8);
  519. margin-bottom: px2rpx(12);
  520. .copy-row {
  521. display: flex;
  522. align-items: center;
  523. gap: px2rpx(4);
  524. font-size: px2rpx(14);
  525. .label {
  526. color: #6c8595;
  527. min-width: px2rpx(30);
  528. }
  529. .value {
  530. flex: 1;
  531. color: #2e3a47;
  532. font-family: monospace;
  533. }
  534. .copy-btn {
  535. background: transparent;
  536. border: 1px solid rgba(108, 133, 149, 0);
  537. padding: 0;
  538. cursor: pointer;
  539. color: #6c8595;
  540. width: px2rpx(24);
  541. height: px2rpx(24);
  542. display: flex;
  543. align-items: center;
  544. justify-content: center;
  545. box-sizing: border-box;
  546. svg {
  547. width: px2rpx(20);
  548. height: px2rpx(20);
  549. }
  550. &:hover {
  551. background-color: rgba(108, 133, 149, 0.05);
  552. border: 1px solid rgba(108, 133, 149, 0.2);
  553. }
  554. }
  555. }
  556. .divider {
  557. width: 1px;
  558. height: px2rpx(20);
  559. border-left: 1px solid rgba(108, 133, 149, 0.5);
  560. }
  561. .change-password-btn {
  562. background: transparent;
  563. box-sizing: border-box;
  564. border: 1px solid rgba(108, 133, 149, 0);
  565. border-radius: px2rpx(8);
  566. padding: px2rpx(8) px2rpx(16);
  567. font-size: px2rpx(14);
  568. color: #2e3a47;
  569. display: inline-flex;
  570. gap: px2rpx(8);
  571. cursor: pointer;
  572. margin: 0;
  573. // transition: all 0.2s;
  574. .btn-icon svg {
  575. width: px2rpx(16);
  576. height: px2rpx(16);
  577. }
  578. &:hover {
  579. background-color: rgba(108, 133, 149, 0.05);
  580. border: 1px solid rgba(108, 133, 149, 0.2);
  581. }
  582. }
  583. }
  584. .info-bottom {
  585. overflow: hidden;
  586. }
  587. .notificators {
  588. // 预留通知区域
  589. }
  590. }
  591. // 响应式:屏幕宽度 > 1100px 时,隐藏移动端按钮,显示桌面端按钮
  592. @media screen and (min-width: 1100px) {
  593. .account-card {
  594. .main-content {
  595. .mobile-buttons {
  596. display: none;
  597. }
  598. .desktop-buttons {
  599. display: flex;
  600. gap: px2rpx(8);
  601. justify-content: flex-end;
  602. }
  603. }
  604. }
  605. }
  606. // 网格布局时,使用移动端样式
  607. .account-card.is-grid-layout {
  608. .main-content {
  609. .mobile-buttons {
  610. display: flex;
  611. }
  612. .desktop-buttons {
  613. display: none;
  614. }
  615. }
  616. }
  617. </style>