AccountCard.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. <template>
  2. <view class="account-card">
  3. <!-- 折叠/展开按钮 -->
  4. <button class="collapse-btn" @click="toggleExpand">
  5. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
  6. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  7. :class="['chevron-icon', { expanded: isExpanded }]">
  8. <path d="M6 15l6 -6l6 6" />
  9. </svg>
  10. </button>
  11. <!-- 标签区域 -->
  12. <view class="labels-container">
  13. <view class="labels">
  14. <template v-for="(label, index) in account.labels" :key="index">
  15. <view v-if="label" class="label-badge">
  16. {{ label }}
  17. </view>
  18. </template>
  19. </view>
  20. <view class="account-number"># {{ account.accountNumber }}</view>
  21. <view class="account-nickname">{{ nickName }}</view>
  22. </view>
  23. <!-- 主要内容区域(余额和操作按钮) -->
  24. <view class="main-content">
  25. <!-- 余额 -->
  26. <view class="balance">
  27. <text class="balance-number">{{ balanceInteger }}</text>
  28. <text class="balance-decimal">{{ balanceDecimal }} {{ account.currency }}</text>
  29. </view>
  30. <!-- 移动端圆形按钮组(≤1100px显示) -->
  31. <view class="mobile-buttons">
  32. <!-- 交易 -->
  33. <view class="circle-btn" @click="handleAction('trade')">
  34. <view class="circle-icon">
  35. <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
  36. <path
  37. d="M4.66797 2.66602V4.66602M4.66797 8.66602V13.3327M11.3346 2.66602V4.66602M11.3346 11.3327V13.3327M2.66797 5.33268C2.66797 5.15587 2.73821 4.9863 2.86323 4.86128C2.98826 4.73625 3.15782 4.66602 3.33464 4.66602H6.0013C6.17811 4.66602 6.34768 4.73625 6.47271 4.86128C6.59773 4.9863 6.66797 5.15587 6.66797 5.33268V7.99935C6.66797 8.17616 6.59773 8.34573 6.47271 8.47075C6.34768 8.59578 6.17811 8.66602 6.0013 8.66602H3.33464C3.15782 8.66602 2.98826 8.59578 2.86323 8.47075C2.73821 8.34573 2.66797 8.17616 2.66797 7.99935V5.33268ZM9.33464 5.33268C9.33464 5.15587 9.40487 4.9863 9.5299 4.86128C9.65492 4.73625 9.82449 4.66602 10.0013 4.66602H12.668C12.8448 4.66602 13.0143 4.73625 13.1394 4.86128C13.2644 4.9863 13.3346 5.15587 13.3346 5.33268V10.666C13.3346 10.8428 13.2644 11.0124 13.1394 11.1374C13.0143 11.2624 12.8448 11.3327 12.668 11.3327H10.0013C9.82449 11.3327 9.65492 11.2624 9.5299 11.1374C9.40487 11.0124 9.33464 10.8428 9.33464 10.666V5.33268Z"
  38. stroke="currentColor" stroke-width="1.33" stroke-linecap="round"
  39. stroke-linejoin="round" />
  40. </svg>
  41. </view>
  42. <text class="circle-label">交易</text>
  43. </view>
  44. <!-- 入金(带限制包装,此处简化) -->
  45. <view class="circle-btn" @click="toDeposit" v-if="!isDemo">
  46. <view class="circle-icon">
  47. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  48. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  49. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  50. <path d="M8 12l4 4" />
  51. <path d="M12 8v8" />
  52. <path d="M16 12l-4 4" />
  53. </svg>
  54. </view>
  55. <text class="circle-label">入金</text>
  56. </view>
  57. <!-- 出金 -->
  58. <view class="circle-btn" @click="toWithdraw" v-if="!isDemo">
  59. <view class="circle-icon">
  60. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  61. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  62. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  63. <path d="M15 9l-6 6" />
  64. <path d="M15 15v-6h-6" />
  65. </svg>
  66. </view>
  67. <text class="circle-label">出金</text>
  68. </view>
  69. <!-- 转账 -->
  70. <view class="circle-btn" @click="toTransfer" v-if="!isDemo">
  71. <view class="circle-icon">
  72. <svg width="24" height="24" viewBox="0 0 24 24" fill="none">
  73. <path d="M21 17H3M21 17L17.5 20.5M21 17L17.5 13.5M6.5 10.5L3 7M3 7L6.5 3.5M3 7H21"
  74. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  75. </svg>
  76. </view>
  77. <text class="circle-label">转账</text>
  78. </view>
  79. <!-- 更多(三点) -->
  80. <cwg-dropdown @open="onOpen" @close="onClose" :menu-list="customMenuList"
  81. @menuClick="handleCustomClick">
  82. <view class="circle-btn">
  83. <view class="circle-icon">
  84. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
  85. fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
  86. stroke-linejoin="round">
  87. <path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
  88. <path d="M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
  89. <path d="M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
  90. </svg>
  91. </view>
  92. <text class="circle-label">更多</text>
  93. </view>
  94. </cwg-dropdown>
  95. </view>
  96. <!-- 桌面端按钮组(>1100px显示) -->
  97. <view class="desktop-buttons">
  98. <view class="action-btn primary" @click="handleAction('trade')">
  99. <span class="btn-icon">
  100. <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
  101. <path
  102. d="M4.66797 2.66602V4.66602M4.66797 8.66602V13.3327M11.3346 2.66602V4.66602M11.3346 11.3327V13.3327M2.66797 5.33268C2.66797 5.15587 2.73821 4.9863 2.86323 4.86128C2.98826 4.73625 3.15782 4.66602 3.33464 4.66602H6.0013C6.17811 4.66602 6.34768 4.73625 6.47271 4.86128C6.59773 4.9863 6.66797 5.15587 6.66797 5.33268V7.99935C6.66797 8.17616 6.59773 8.34573 6.47271 8.47075C6.34768 8.59578 6.17811 8.66602 6.0013 8.66602H3.33464C3.15782 8.66602 2.98826 8.59578 2.86323 8.47075C2.73821 8.34573 2.66797 8.17616 2.66797 7.99935V5.33268ZM9.33464 5.33268C9.33464 5.15587 9.40487 4.9863 9.5299 4.86128C9.65492 4.73625 9.82449 4.66602 10.0013 4.66602H12.668C12.8448 4.66602 13.0143 4.73625 13.1394 4.86128C13.2644 4.9863 13.3346 5.15587 13.3346 5.33268V10.666C13.3346 10.8428 13.2644 11.0124 13.1394 11.1374C13.0143 11.2624 12.8448 11.3327 12.668 11.3327H10.0013C9.82449 11.3327 9.65492 11.2624 9.5299 11.1374C9.40487 11.0124 9.33464 10.8428 9.33464 10.666V5.33268Z"
  103. stroke="currentColor" stroke-width="1.33" stroke-linecap="round"
  104. stroke-linejoin="round" />
  105. </svg>
  106. </span>
  107. 交易
  108. </view>
  109. <view class="action-btn" @click="toDeposit" v-if="!isDemo">
  110. <span class="btn-icon">
  111. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  112. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  113. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  114. <path d="M8 12l4 4" />
  115. <path d="M12 8v8" />
  116. <path d="M16 12l-4 4" />
  117. </svg>
  118. </span>
  119. 入金
  120. </view>
  121. <view class="action-btn" @click="toWithdraw" v-if="!isDemo">
  122. <span class="btn-icon">
  123. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  124. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  125. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  126. <path d="M15 9l-6 6" />
  127. <path d="M15 15v-6h-6" />
  128. </svg>
  129. </span>
  130. 出金
  131. </view>
  132. <view class="action-btn" @click="toTransfer" v-if="!isDemo">
  133. <span class="btn-icon">
  134. <svg width="24" height="24" viewBox="0 0 24 24" fill="none">
  135. <path d="M21 17H3M21 17L17.5 20.5M21 17L17.5 13.5M6.5 10.5L3 7M3 7L6.5 3.5M3 7H21"
  136. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  137. </svg>
  138. </span>
  139. 转账
  140. </view>
  141. <cwg-dropdown @open="onOpen" @close="onClose" :menu-list="customMenuList"
  142. @menuClick="handleCustomClick">
  143. <view class="action-btn icon-only">
  144. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  145. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  146. <path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
  147. <path d="M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
  148. <path d="M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
  149. </svg>
  150. </view>
  151. </cwg-dropdown>
  152. </view>
  153. </view>
  154. <view ref="infoBottomRef" class="info-bottom" :style="{
  155. height: isExpanded ? infoBottomHeight + 'px' : '0px',
  156. transition: 'height 281ms cubic-bezier(0.4, 0, 0.2, 1)'
  157. }">
  158. <!-- 底部信息区域(折叠时隐藏) -->
  159. <view class="info-section">
  160. <view class="info-column">
  161. <cwg-label-line-value :label="t('Label.Leverage')" :value="account.actualLeverage" />
  162. <cwg-label-line-value label="浮动盈/亏" :value="account.floatingPL" />
  163. <cwg-label-line-value :label="t('Label.Balance')" :value="account.balanceWithSymbol" />
  164. </view>
  165. <view class="info-column">
  166. <cwg-label-line-value :label="t('Label.Equity')" :value="account.equityWithSymbol" />
  167. <cwg-label-line-value :label="t('Label.Credit')" :value="account.creditWithSymbol" />
  168. <cwg-label-line-value label="平台" :value="account.platform" />
  169. </view>
  170. </view>
  171. <!-- 额外操作行(服务器、登录、更改密码,折叠时隐藏) -->
  172. <view class="extra-actions">
  173. <!-- 登录复制行 -->
  174. <view class="copy-row">
  175. <span class="label">{{ account.platform }} 登陆</span>
  176. <span class="value">{{ account.login }}</span>
  177. <view class="copy-btn" @click="copy(account.login)">
  178. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  179. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  180. <path
  181. d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" />
  182. <path
  183. d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
  184. </svg>
  185. </view>
  186. </view>
  187. <!-- 更改交易密码按钮 -->
  188. <view class="change-password-btn" @click="handleAction('changePassword1')" v-if="!isDemo">
  189. <span class="btn-icon">
  190. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
  191. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  192. <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
  193. <path d="M13.5 6.5l4 4" />
  194. </svg>
  195. </span>
  196. 更改交易密码
  197. </view>
  198. </view>
  199. </view>
  200. <!-- 通知区域(预留) -->
  201. <view class="notificators"></view>
  202. <TerminalDialog v-model:visible="terminalDialogVisible" />
  203. <!-- <TerminalNickNameDialog v-model:visible="terminalNickNameDialogVisible" :account="account"
  204. @save="saveNickName" /> -->
  205. <TerminalChangePasswordDialog v-model:visible="terminalChangePasswordDialogVisible" :pwdType="pwdType"
  206. :account="account" />
  207. <TerminalInfoDialog v-model:visible="terminalInfoDialogVisible" :accountNumber="accountInfo.login"
  208. :form="accountInfo" :fieldList="fieldList" />
  209. </view>
  210. </template>
  211. <script setup lang="ts">
  212. import { ref, computed, onMounted, nextTick, onBeforeUnmount, watch } from 'vue';
  213. import useRouter from "@/hooks/useRouter";
  214. const router = useRouter();
  215. import { useI18n } from 'vue-i18n';
  216. const { t, locale } = useI18n();
  217. import TerminalDialog from './TerminalDialog.vue'
  218. import TerminalNickNameDialog from './TerminalNickNameDialog.vue'
  219. import TerminalChangePasswordDialog from './TerminalChangePasswordDialog.vue'
  220. import TerminalInfoDialog from './TerminalInfoDialog.vue'
  221. const props = defineProps<{
  222. account: Account;
  223. }>();
  224. const accountInfo = ref(props.account)
  225. // 定义账户数据类型
  226. export interface Account {
  227. labels: string[]; // 标签数组,如 ['真实', 'MT4', 'Standard']
  228. accountNumber: string; // 账号,如 '85319215'
  229. nickName: string; // 昵称,如 '标准账户'
  230. balance: number; // 余额数字
  231. currency: string; // 货币,如 'USD'
  232. actualLeverage: string; // 实际杠杆,如 '1:2000'
  233. maxLeverage: string; // 调整杠杆,如 '1:2000'
  234. floatingPL: string; // 浮动盈亏,如 '0.00 USD'
  235. creditWithSymbol: string; // 可用保证金,如 '0.00 USD'
  236. equityWithSymbol: string; // 净值,如 '0.00 USD'
  237. platform: string; // 平台,如 'MT4'
  238. server: string; // 服务器,如 'Exness-Real28'
  239. login: string; // 登录名,如 '85319215'
  240. balanceWithSymbol: string; // 余额,如 '85319215'
  241. }
  242. const isDemo = computed(() => accountInfo.value.listType == 'demo')
  243. const fieldList = ref([
  244. { label: '账户类型', key: 'nickname', copyable: false },
  245. { label: t('Label.Leverage'), key: 'actualLeverage', copyable: false },
  246. { label: '浮动盈/亏', key: 'floatingPL', copyable: false },
  247. { label: t('Label.Balance'), key: 'balanceWithSymbol', copyable: false },
  248. { label: t('Label.Equity'), key: 'equityWithSymbol', copyable: false },
  249. { label: t('Label.Credit'), key: 'creditWithSymbol', copyable: false },
  250. { label: '平台', key: 'platform', copyable: false },
  251. { label: '账号', key: 'login', copyable: true }
  252. ])
  253. const nickName = ref(accountInfo.value.nickName)
  254. const saveNickName = (newNickName) => {
  255. nickName.value = newNickName
  256. accountInfo.value.nickName = newNickName
  257. }
  258. const infoBottomRef = ref(null);
  259. const infoBottomHeight = ref(0);
  260. // 测量高度
  261. const updateSubmenuHeight = () => {
  262. const el = infoBottomRef.value.$el;
  263. if (el) {
  264. // 获取内容实际高度(可能需要暂时移除过渡影响)
  265. const height = el.scrollHeight || el.offsetHeight;
  266. if (height > 0) {
  267. infoBottomHeight.value = height;
  268. }
  269. }
  270. };
  271. // 折叠状态
  272. const isExpanded = ref(false);
  273. // 切换折叠
  274. const toggleExpand = () => {
  275. isExpanded.value = !isExpanded.value;
  276. if (isExpanded.value) {
  277. nextTick(() => {
  278. updateSubmenuHeight();
  279. });
  280. }
  281. };
  282. const terminalDialogVisible = ref(false)
  283. const terminalChangePasswordDialogVisible = ref(false)
  284. const terminalInfoDialogVisible = ref(false)
  285. const pwdType = ref(1)
  286. // 处理按钮操作
  287. const handleAction = (type: string) => {
  288. console.log(type == 'info', type, 'info');
  289. switch (type) {
  290. case 'trade':
  291. terminalDialogVisible.value = true
  292. break;
  293. case 'changePassword1':
  294. pwdType.value = 1
  295. terminalChangePasswordDialogVisible.value = true
  296. break;
  297. case 'changePassword2':
  298. pwdType.value = 2
  299. terminalChangePasswordDialogVisible.value = true
  300. break;
  301. case 'info':
  302. console.log(type);
  303. terminalInfoDialogVisible.value = true
  304. break;
  305. default:
  306. break;
  307. }
  308. };
  309. const customMenuList = computed(() => !isDemo.value ? [{ label: '修改交易密码', type: 'changePassword1' }, { label: '修改投资者密码', type: 'changePassword2' }, { label: '账户信息', type: 'info' }] : [{ label: '账户信息', type: 'info' }])
  310. const handleCustomClick = (item, index) => {
  311. handleAction(item.value.type)
  312. }
  313. // 复制文本
  314. const copy = (text: string) => {
  315. uni.setClipboardData({ data: text });
  316. };
  317. // 按钮对应的操作方法
  318. const toDeposit = () => {
  319. router.push(`/pages/customer/deposit?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  320. }
  321. const toWithdraw = () => {
  322. router.push(`/pages/customer/withdraw?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  323. }
  324. const toTransfer = () => {
  325. router.push(`/pages/customer/transfer?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
  326. }
  327. // 更改交易密码
  328. const handleChangePassword = () => {
  329. const close = accountInfo.value.closeFunctions?.indexOf('4') !== -1 ? 1 : 0
  330. router.push(`/pages/customer/settings?login=${accountInfo.value.login}&platform=${accountInfo.value.platform}&type=${accountInfo.value.type}&currency=${accountInfo.value.currency}&leverage=${accountInfo.value.leverage}&close=${close}`)
  331. }
  332. const toStandardRebate = () => {
  333. router.push(`/pages/customer/standard/rebate?login=${accountInfo.value.login}`)
  334. }
  335. // 格式化余额,拆分为整数和小数部分
  336. const balanceInteger = computed(() => {
  337. return Math.floor(accountInfo.value.balance).toString();
  338. });
  339. const balanceDecimal = computed(() => {
  340. const parts = accountInfo.value.balance.toFixed(2).split('.');
  341. return parts[1] ? '.' + parts[1] : '.00';
  342. });
  343. // 在组件挂载后初始化高度
  344. onMounted(() => {
  345. nextTick(() => {
  346. updateSubmenuHeight();
  347. });
  348. window.addEventListener('resize', handleResize);
  349. isExpanded.value = accountInfo.value.isExpanded;
  350. });
  351. // 监听窗口 resize
  352. const handleResize = () => {
  353. if (isExpanded.value) {
  354. updateSubmenuHeight();
  355. }
  356. };
  357. onBeforeUnmount(() => {
  358. window.removeEventListener('resize', handleResize);
  359. });
  360. </script>
  361. <style scoped lang="scss">
  362. @import '@/uni.scss';
  363. .account-card {
  364. border-radius: px2rpx(16);
  365. padding: px2rpx(16);
  366. margin-bottom: px2rpx(16);
  367. position: relative;
  368. border: 1px solid rgba(108, 133, 149, 0.12);
  369. color: #2e3a47;
  370. .collapse-btn {
  371. position: absolute;
  372. top: px2rpx(12);
  373. right: px2rpx(12);
  374. background: transparent;
  375. border: none;
  376. padding: 0;
  377. cursor: pointer;
  378. color: #6c8595;
  379. width: px2rpx(32);
  380. height: px2rpx(32);
  381. display: flex;
  382. align-items: center;
  383. justify-content: center;
  384. .chevron-icon {
  385. transition: transform 0.3s;
  386. &.expanded {
  387. transform: rotate(180deg);
  388. }
  389. }
  390. }
  391. .labels-container {
  392. display: flex;
  393. align-items: center;
  394. flex-wrap: wrap;
  395. gap: px2rpx(8);
  396. margin-bottom: px2rpx(16);
  397. padding-right: px2rpx(40); // 为折叠按钮留出空间
  398. .labels {
  399. display: flex;
  400. gap: px2rpx(8);
  401. }
  402. .label-badge {
  403. background-color: rgba(108, 133, 149, 0.08);
  404. border-radius: px2rpx(4);
  405. padding: px2rpx(4) px2rpx(8);
  406. font-size: px2rpx(12);
  407. color: #6c8595;
  408. font-weight: 500;
  409. }
  410. .account-number {
  411. font-size: px2rpx(18);
  412. font-weight: 600;
  413. line-height: 1.3;
  414. }
  415. .account-nickname {
  416. font-size: px2rpx(14);
  417. color: #6c8595;
  418. }
  419. }
  420. .main-content {
  421. .balance {
  422. margin-bottom: px2rpx(16);
  423. .balance-number {
  424. font-size: px2rpx(32);
  425. font-weight: 700;
  426. }
  427. .balance-decimal {
  428. font-size: px2rpx(16);
  429. color: #6c8595;
  430. margin-left: px2rpx(4);
  431. }
  432. }
  433. // 移动端按钮组(默认显示)
  434. .mobile-buttons {
  435. display: flex;
  436. justify-content: center;
  437. gap: px2rpx(0);
  438. margin-bottom: px2rpx(16);
  439. flex-wrap: wrap;
  440. .circle-btn {
  441. display: flex;
  442. flex-direction: column;
  443. align-items: center;
  444. cursor: pointer;
  445. width: px2rpx(64);
  446. .circle-icon {
  447. width: px2rpx(48);
  448. height: px2rpx(48);
  449. border-radius: 50%;
  450. background-color: #f5f7f9;
  451. display: flex;
  452. align-items: center;
  453. justify-content: center;
  454. color: #2e3a47;
  455. transition: background-color 0.2s;
  456. &:hover {
  457. background-color: #e9ecef;
  458. }
  459. svg {
  460. width: px2rpx(24);
  461. height: px2rpx(24);
  462. }
  463. }
  464. .circle-label {
  465. font-size: px2rpx(12);
  466. margin-top: px2rpx(4);
  467. color: #6c8595;
  468. }
  469. }
  470. }
  471. // 桌面端按钮组(默认隐藏,屏幕>1100px时显示)
  472. .desktop-buttons {
  473. display: none;
  474. .action-btn {
  475. background: transparent;
  476. border: 1px solid rgba(108, 133, 149, 0);
  477. border-radius: px2rpx(8);
  478. padding: px2rpx(8) px2rpx(20);
  479. font-size: px2rpx(14);
  480. color: #2e3a47;
  481. display: inline-flex;
  482. align-items: center;
  483. justify-content: center;
  484. gap: px2rpx(8);
  485. cursor: pointer;
  486. transition: all 0.2s;
  487. height: px2rpx(40);
  488. box-sizing: border-box;
  489. background-color: rgba(108, 133, 149, 0.08);
  490. &.primary {
  491. background-color: var(--color-navy-700);
  492. color: #fff;
  493. svg {
  494. stroke: #fff;
  495. }
  496. &:hover {
  497. background-color: var(--color-navy-600);
  498. }
  499. }
  500. &:hover {
  501. border: 1px solid rgba(108, 133, 149, 0.2);
  502. }
  503. .btn-icon {
  504. display: flex;
  505. align-items: center;
  506. svg {
  507. width: px2rpx(18);
  508. height: px2rpx(18);
  509. }
  510. }
  511. &.icon-only {
  512. padding: px2rpx(8);
  513. }
  514. }
  515. }
  516. }
  517. .info-section {
  518. display: flex;
  519. gap: px2rpx(24);
  520. padding: px2rpx(16) 0;
  521. border-top: 1px solid rgba(108, 133, 149, 0.12);
  522. border-bottom: 1px solid rgba(108, 133, 149, 0.12);
  523. margin: px2rpx(16) 0;
  524. .info-column {
  525. flex: 1;
  526. display: flex;
  527. flex-direction: column;
  528. gap: px2rpx(12);
  529. }
  530. .info-item {
  531. display: flex;
  532. justify-content: space-between;
  533. align-items: flex-end;
  534. font-size: px2rpx(14);
  535. .label {
  536. color: #6c8595;
  537. }
  538. .line {
  539. flex: 1;
  540. height: 1px;
  541. border-top: 1px dashed rgba(108, 133, 149, 0.5);
  542. margin-bottom: px2rpx(1);
  543. }
  544. .value {
  545. font-weight: 500;
  546. color: #2e3a47;
  547. }
  548. }
  549. }
  550. .extra-actions {
  551. display: flex;
  552. align-items: center;
  553. gap: px2rpx(8);
  554. margin-bottom: px2rpx(12);
  555. .copy-row {
  556. display: flex;
  557. align-items: center;
  558. gap: px2rpx(8);
  559. font-size: px2rpx(14);
  560. .label {
  561. color: #6c8595;
  562. min-width: px2rpx(70);
  563. }
  564. .value {
  565. flex: 1;
  566. color: #2e3a47;
  567. font-family: monospace;
  568. }
  569. .copy-btn {
  570. background: transparent;
  571. border: 1px solid rgba(108, 133, 149, 0);
  572. padding: 0;
  573. cursor: pointer;
  574. color: #6c8595;
  575. width: px2rpx(32);
  576. height: px2rpx(32);
  577. display: flex;
  578. align-items: center;
  579. justify-content: center;
  580. box-sizing: border-box;
  581. svg {
  582. width: px2rpx(20);
  583. height: px2rpx(20);
  584. }
  585. &:hover {
  586. background-color: rgba(108, 133, 149, 0.05);
  587. border: 1px solid rgba(108, 133, 149, 0.2);
  588. }
  589. }
  590. }
  591. .change-password-btn {
  592. background: transparent;
  593. box-sizing: border-box;
  594. border: 1px solid rgba(108, 133, 149, 0);
  595. border-radius: px2rpx(8);
  596. padding: px2rpx(8) px2rpx(16);
  597. font-size: px2rpx(14);
  598. color: #2e3a47;
  599. display: inline-flex;
  600. gap: px2rpx(8);
  601. cursor: pointer;
  602. margin: 0;
  603. // transition: all 0.2s;
  604. .btn-icon svg {
  605. width: px2rpx(16);
  606. height: px2rpx(16);
  607. }
  608. &:hover {
  609. background-color: rgba(108, 133, 149, 0.05);
  610. border: 1px solid rgba(108, 133, 149, 0.2);
  611. }
  612. }
  613. }
  614. .info-bottom {
  615. overflow: hidden;
  616. }
  617. .notificators {
  618. // 预留通知区域
  619. }
  620. }
  621. // 响应式:屏幕宽度 > 1100px 时,隐藏移动端按钮,显示桌面端按钮
  622. @media screen and (min-width: 1100px) {
  623. .account-card {
  624. .main-content {
  625. .mobile-buttons {
  626. display: none;
  627. }
  628. .desktop-buttons {
  629. display: flex;
  630. gap: px2rpx(8);
  631. justify-content: flex-end;
  632. }
  633. }
  634. }
  635. }
  636. </style>