VirtualCard.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180
  1. <template>
  2. <view v-if="cardList.length" class="page">
  3. <view class="card-swiper">
  4. <swiper class="swiper-container" :current="currentIndex" @change="handleSwiperChange">
  5. <swiper-item v-for="(card, index) in cardList" :key="card.id">
  6. <view class="card-wrapper">
  7. <view class="card-info" :class="{ flipping: isFlipping[card.id] }"
  8. @click.stop="(e: MouseEvent) => toggleCardNo(card, e)">
  9. <view v-if="card.type == 'Virtual'" class="card-name">
  10. {{ card.type || "Virtual" }}
  11. </view>
  12. <view v-if="card.type == 'Physical'" class="card-name">
  13. {{ card.type || "Physical" }}
  14. </view>
  15. <image class="card-type" src="/static/images/c-type.png" alt="" srcset="" />
  16. <image class="logo" src="/static/images/logo1.png" alt="" srcset="" />
  17. <template v-if="showCardNo[card.id]">
  18. <view class="number">
  19. {{ card?.cardNumber }}
  20. <view class="copy" @click.stop="cardCopy(card.cardNumber, 'cardNumber')"><cwg-icon name="copy"
  21. :size="13" color="" /></view>
  22. </view>
  23. <view class="card-b">
  24. <view class="valid">
  25. <view class="lable">{{ t("cards.p13") }}</view>
  26. <view>{{ card.firstName }} {{ card.lastName }}</view>
  27. </view>
  28. <view class="valid">
  29. <view class="lable">{{ t("cards.p14") }}</view>
  30. <view>{{ card.expireDate || "--" }}</view>
  31. </view>
  32. <view class="valid" @click.stop="setCvv">
  33. <view class="lable" v-if="!card.expireDate">CVV</view>
  34. <view v-if="!card.expireDate" class="cvv">
  35. ***
  36. <view class="copy"><cwg-icon name="icon_visiable" :size="13" color="" /></view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <template v-else>
  42. <view v-if="currentCard.status == 'success' && currentCard?.activateStatus" class="zw">{{
  43. card.cardNumber }}</view>
  44. <view v-else class="zw">{{ "**** **** **** ****" }}</view>
  45. </template>
  46. </view>
  47. </view>
  48. </swiper-item>
  49. </swiper>
  50. <view v-if="cardList.length > 1" class="swiper-indicators">
  51. <view v-for="(card, index) in cardList" :key="card.id" class="indicator-dot"
  52. :class="{ active: index === currentIndex }" @click="currentIndex = index"></view>
  53. </view>
  54. </view>
  55. <template v-if="currentCard.status == 'success' && currentCard?.activateStatus">
  56. <view class="actions">
  57. <template v-if="
  58. currentCard.freezeType == 1 && currentCard.freezeStatus == 'success'
  59. ">
  60. <view class="action-btn" @click="ucardOperation(currentCard, 2)">
  61. <cwg-icon name="icon_recharge" :size="28" color="#EA002A" />
  62. <view>{{ t("card.Btn.b3") }}</view>
  63. </view>
  64. <view class="action-btn" @click="ucardOperation(currentCard, 3)">
  65. <cwg-icon name="icon_card password reset" :size="28" color="#EA002A" />
  66. <view>{{ t("card.Btn.b4") }}</view>
  67. </view>
  68. </template>
  69. <template v-else>
  70. <view class="action-btn action-btn1">
  71. <cwg-icon name="icon_recharge" :size="28" color="#999" />
  72. <view>{{ t("card.Btn.b3") }}</view>
  73. </view>
  74. <view class="action-btn action-btn1">
  75. <cwg-icon name="icon_card password reset" :size="28" color="#999" />
  76. <view>{{ t("card.Btn.b4") }}</view>
  77. </view>
  78. </template>
  79. <view v-if="currentCard.freezeType == '1'" class="action-btn" @click="ucardOperation(currentCard, 4)">
  80. <cwg-icon name="icon_unfreeze" :size="28" color="#EA002A" />
  81. <view v-if="currentCard.freezeStatus == 'success'">{{
  82. t("card.Btn.b5")
  83. }}</view>
  84. <view v-else>{{ t("card.Btn.b14") }}</view>
  85. </view>
  86. <view v-if="currentCard.freezeType == '2'" class="action-btn" @click="ucardOperation(currentCard, 5)">
  87. <cwg-icon name="icon_freeze" :size="28" color="#EA002A" />
  88. <view v-if="currentCard.freezeStatus == 'success'">{{
  89. t("card.Btn.b6")
  90. }}</view>
  91. <view v-else>{{ t("card.Btn.b15") }}</view>
  92. </view>
  93. </view>
  94. <view class="balance-wrap">
  95. <!-- <view class="balance-content">{{ t('cards.currency') }}</view> -->
  96. <view class="balance-content">{{ t("card.Btn.b10") }}</view>
  97. </view>
  98. <view class="balance-wrap balance-wrap1">
  99. <view class="global-con-l">
  100. <!-- <view class="global-con-l" @click="setModelValue"> -->
  101. <image class="l-img" :src="imageSrc(currency)" alt="" srcset="" />
  102. <view class="r">
  103. <view>{{ currency }}</view>
  104. </view>
  105. <!-- <cwg-icon name="icon_dropdown" :size="24" /> -->
  106. </view>
  107. <view class="balance">
  108. <view class="balance-amount">{{
  109. isOpen ? amount + " " + "USD" : "*****"
  110. }}</view>
  111. <cwg-icon :name="isOpen ? 'icon_visiable' : 'icon_unvisiable'" :size="24" @click.stop="debouncedGetBalance" />
  112. </view>
  113. </view>
  114. <view class="trans-header">
  115. <view class="trans-title">{{ t("cards.transactions") }}</view>
  116. <view class="all" @click="goRechargeRecord">{{
  117. t("card.Status.t22")
  118. }}</view>
  119. <!-- <i class="i-mdi-calendar-month-outline" @click="showDatePicker = true" /> -->
  120. </view>
  121. <cwg-tabs :list="tabList" @click="handleTabClick" />
  122. <view class="transaction-list">
  123. <!-- Recharge Records -->
  124. <view v-if="jiluIndex === 0" :a="currentCard.cardNumber">
  125. <RechargeList :pageSize="4" ref="rechargeListRef" :cardNumber="currentCard.cardNumber" />
  126. </view>
  127. <!-- Transfer Records -->
  128. <view v-if="jiluIndex === 1" :a="currentCard.cardNumber">
  129. <TransactionList :pageSize="4" ref="rechargeListRef" :cardNumber="currentCard.cardNumber" />
  130. </view>
  131. </view>
  132. </template>
  133. <template v-else>
  134. <view class="actions1">
  135. <view class="card-btn">
  136. <view class="yue st">
  137. <view class="a">{{ t("card.Info.t15") }}</view>
  138. <view v-if="
  139. !currentCard.activateStatus &&
  140. (currentCard.applyStatus == null ||
  141. currentCard.applyStatus == 'wait_process' ||
  142. currentCard.applyStatus == 'processing')
  143. " v-t="'card.Info.t16'" class="v"></view>
  144. <view v-if="currentCard.applyStatus == 'fail'" v-t="'card.Info.t17'" class="v"></view>
  145. <view v-if="currentCard.activateStatus == 'unactivate'" v-t="'card.Info.t18'" class="v"></view>
  146. <view v-if="
  147. currentCard.activateStatus &&
  148. (currentCard.status == 'processing' ||
  149. currentCard.status == 'wait_process')
  150. " v-t="'card.Info.t19'" class="v"></view>
  151. <view v-if="currentCard.activateStatus == 'fail'" v-t="'card.Info.t20'" class="v"></view>
  152. </view>
  153. <!-- 查询进度 -->
  154. <view v-if="!currentCard.activateStatus" class="btn1 btn2" @click="viewApply(currentCard)">
  155. <view v-t="'card.Btn.b11'"></view>
  156. </view>
  157. <!-- 激活 -->
  158. <view v-if="currentCard.activateStatus" class="btn1 btn2" :class="currentCard.activateStatus == 'unactivate' ||
  159. currentCard.activateStatus == 'fail'
  160. ? ''
  161. : 'btn3'
  162. " @click="ucardOperation(currentCard, 1)">
  163. <view v-t="'card.Btn.b1'"></view>
  164. </view>
  165. <!-- 重新开卡 -->
  166. <view v-if="
  167. (currentCard.tradeStatus == '3' ||
  168. (currentCard.tradeStatus == '2' &&
  169. currentCard.tradeType == '2')) &&
  170. currentCard.applyStatus == 'fail'
  171. " class="btn1 btn2" @click="updateCardTypes(card, 1)">
  172. <view v-t="'card.Btn.b12'"></view>
  173. </view>
  174. </view>
  175. </view>
  176. </template>
  177. <CardHandle v-if="dialogInfoTradingAdd" :dialog-info-trading-add="dialogInfoTradingAdd" :form-list="formList"
  178. @close-add="dialogInfoTradingAdd = false" />
  179. </view>
  180. </template>
  181. <script setup lang="ts">
  182. import { ref, onMounted, watch, computed, onUnmounted } from "vue";
  183. import type { CardInfo } from "@/api/ucard";
  184. import { showToast } from "@/utils/toast";
  185. import { useI18n } from "vue-i18n";
  186. import useRouter from "@/hooks/useRouter";
  187. import { ucardApi } from "@/api/ucard";
  188. import _ from 'lodash';
  189. import useCardStore from "@/stores/use-card-store";
  190. import CardHandle from "./CardHandle.vue";
  191. import RechargeList from "@/pages/recharge-record/components/RechargeList.vue";
  192. import TransactionList from "@/pages/recharge-record/components/TransactionList.vue";
  193. const debouncedGetBalance = _.debounce(getBalance, 300, { leading: true, trailing: false });
  194. const router = useRouter();
  195. const cardStore = useCardStore();
  196. const cardList = computed(() => {
  197. return cardStore.userCard;
  198. });
  199. const { t } = useI18n();
  200. const currentCard = computed<CardInfo | null>(() => {
  201. if (!cardList.value.length) return null;
  202. return cardList.value[currentIndex.value] || null;
  203. });
  204. const formList = ref({});
  205. const balance = ref<{ amount: number; currency: string; value: string }[]>([
  206. {
  207. amount: 0,
  208. currency: "USD",
  209. value: "USD",
  210. },
  211. ]);
  212. const showCardNo = ref<{ [key: string]: boolean }>({});
  213. const isFlipping = ref<{ [key: string]: boolean }>({});
  214. const isOpen = ref(false);
  215. const currentIndex = ref(0);
  216. const dialogInfoTradingAdd = ref(false);
  217. const images = import.meta.glob("/static/images/currency/*.png", {
  218. eager: true,
  219. });
  220. const tabList = ref([
  221. { name: t("cards.rechargeB1") },
  222. { name: t("Shop.Index.Transaction") }
  223. ]);
  224. const handleTabClick = (item, index) => {
  225. jiluIndex.value = index;
  226. };
  227. function imageSrc(currency: string) {
  228. return images[`/static/images/currency/${currency}.png`]?.default;
  229. }
  230. function setCvv() {
  231. dialogInfoTradingAdd.value = true;
  232. formList.value = currentCard.value;
  233. }
  234. const jiluIndex = ref(0);
  235. function cardCopy(data) {
  236. let title = t("common.copy1");
  237. console.log(title);
  238. uni.setClipboardData({
  239. data,
  240. success: () => {
  241. uni.showToast({ title });
  242. },
  243. });
  244. }
  245. const currency = ref("USD");
  246. const amount = ref(0);
  247. const dateRange = ref<[string, string] | undefined>(undefined);
  248. dateRange.value = ["", ""];
  249. function goRechargeRecord() {
  250. router.push(`/pages/recharge-record/list?cardNumber=${currentCard.value?.cardNumber}`);
  251. }
  252. async function getBalance() {
  253. if (isOpen.value) {
  254. isOpen.value = false;
  255. return;
  256. }
  257. try {
  258. balance.value = [
  259. {
  260. amount: 0,
  261. currency: "USD",
  262. value: "USD",
  263. },
  264. ];
  265. if (!currentCard.value?.cardNo) return;
  266. const res = await ucardApi.ucardBalance({
  267. cardNo: currentCard.value?.cardNo,
  268. uniqueId: currentCard.value?.uniqueId,
  269. });
  270. if (res.code == 200) {
  271. currency.value = "USD";
  272. amount.value = res.data.amount;
  273. isOpen.value = true;
  274. } else {
  275. balance.value = [
  276. {
  277. amount: 0,
  278. currency: "USD",
  279. value: "USD",
  280. },
  281. ];
  282. currency.value = "USD";
  283. amount.value = 0;
  284. isOpen.value = false;
  285. }
  286. } catch (error: any) {
  287. showToast(error?.message || String(error));
  288. balance.value = [
  289. {
  290. amount: 0,
  291. currency: "USD",
  292. value: "USD",
  293. },
  294. ];
  295. isOpen.value = false;
  296. }
  297. }
  298. function toggleCardNo(card: any, event: MouseEvent) {
  299. if (!card.id) return;
  300. if (!(card.status == "success" && card?.activateStatus)) return;
  301. event.stopPropagation();
  302. isFlipping.value[card.id] = !isFlipping.value[card.id];
  303. showCardNo.value[card.id] = !showCardNo.value[card.id];
  304. }
  305. function handleSwiperChange(e: any) {
  306. const newIndex = e?.detail?.current ?? 0;
  307. currentIndex.value = newIndex;
  308. // 切换卡片时重置卡号显示状态
  309. cardList.value.forEach((card) => {
  310. if (!card.id) return;
  311. showCardNo.value[card.id] = false;
  312. isFlipping.value[card.id] = false;
  313. });
  314. }
  315. async function ucardOperation(card, type) {
  316. if (card.freezeType == "2" && type != "5") {
  317. showToast(t("card.Msg.m10"));
  318. return;
  319. }
  320. if (card.blocked) {
  321. showToast(t("card.New2.p6"));
  322. return;
  323. }
  324. if (card.freezeStatus != "success") {
  325. if (card.freezeType == "1") {
  326. showToast(t("card.Btn.b14"));
  327. } else {
  328. showToast(t("card.Btn.b15"));
  329. }
  330. return;
  331. }
  332. router.push({
  333. path: "/pages/card/operations",
  334. query: { id: card.id, type },
  335. });
  336. }
  337. function viewApply(item: any) {
  338. router.push({
  339. path: "/pages/apply-record/detail",
  340. query: {
  341. id: item.id,
  342. type: "card",
  343. },
  344. });
  345. }
  346. watch(
  347. currentIndex,
  348. (newIndex) => {
  349. if (cardList.value[newIndex]) {
  350. if (
  351. cardList.value[newIndex].cardNo &&
  352. cardList.value[newIndex].activateStatus == "success"
  353. ) {
  354. isOpen.value = false;
  355. }
  356. }
  357. },
  358. { immediate: true }
  359. );
  360. onMounted(async () => {
  361. cardList.value.forEach((card) => {
  362. showCardNo.value[card.id] = false;
  363. isFlipping.value[card.id] = false;
  364. });
  365. });
  366. onUnmounted(() => {
  367. debouncedGetBalance.cancel();
  368. });
  369. </script>
  370. <style scoped lang="scss">
  371. @import "@/uni.scss";
  372. .page {
  373. padding: 0 px2rpx(24) px2rpx(130) px2rpx(24);
  374. }
  375. .card-wrapper {
  376. position: absolute;
  377. width: 100%;
  378. height: 100%;
  379. transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  380. will-change: transform;
  381. }
  382. .card-info {
  383. background: url(/static/images/card/physical.png) no-repeat center center;
  384. background-size: cover;
  385. border-radius: px2rpx(16);
  386. padding: px2rpx(16);
  387. color: var(--main-yellow);
  388. width: 100%;
  389. height: 100%;
  390. display: flex;
  391. justify-content: flex-start;
  392. align-items: baseline;
  393. flex-wrap: wrap;
  394. /* transform-style: preserve-3d;
  395. transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); */
  396. /* flex-direction: column; */
  397. .logo {
  398. width: px2rpx(120);
  399. height: auto;
  400. margin-bottom: px2rpx(16);
  401. }
  402. .card-type {
  403. width: px2rpx(74);
  404. height: px2rpx(39);
  405. position: absolute;
  406. bottom: px2rpx(16);
  407. right: px2rpx(16);
  408. z-index: 1;
  409. }
  410. .card-name {
  411. position: absolute;
  412. top: px2rpx(16);
  413. right: px2rpx(16);
  414. font-size: var(--font-size-14);
  415. font-weight: 500;
  416. color: #fff;
  417. font-family: Rubik;
  418. }
  419. &.flipping {
  420. transform: rotateX(360deg);
  421. }
  422. .zw {
  423. position: absolute;
  424. left: px2rpx(16);
  425. bottom: px2rpx(16);
  426. color: #fff;
  427. font-family: Rubik;
  428. font-size: px2rpx(12);
  429. font-style: normal;
  430. font-weight: 700;
  431. display: flex;
  432. align-items: center;
  433. }
  434. .card-b {
  435. display: flex;
  436. flex-wrap: wrap;
  437. justify-content: center;
  438. align-items: center;
  439. gap: px2rpx(16);
  440. span {
  441. display: block;
  442. }
  443. .valid {
  444. font-size: var(--font-size-14);
  445. font-weight: 500;
  446. color: var(--black);
  447. gap: px2rpx(8);
  448. line-height: px2rpx(20);
  449. }
  450. .lable {
  451. font-size: var(--font-size-10);
  452. font-weight: 400;
  453. }
  454. .cvv {
  455. display: flex;
  456. align-items: center;
  457. gap: px2rpx(8);
  458. font-size: var(--font-size-14);
  459. font-weight: 500;
  460. color: var(--black);
  461. .copy,
  462. .icon {
  463. display: flex;
  464. }
  465. }
  466. }
  467. .copy {
  468. width: px2rpx(18);
  469. height: px2rpx(18);
  470. border-radius: 50%;
  471. background: rgba(255, 255, 255, 0.6);
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. cursor: pointer;
  476. color: #000;
  477. }
  478. }
  479. .card-front,
  480. .card-back {
  481. position: absolute;
  482. top: 0;
  483. left: 0;
  484. width: 100%;
  485. height: 100%;
  486. padding: px2rpx(24) px2rpx(20) px2rpx(16) px2rpx(20);
  487. backface-visibility: hidden;
  488. -webkit-backface-visibility: hidden;
  489. }
  490. .card-back {
  491. transform: rotateY(180deg);
  492. }
  493. .owner {
  494. font-size: var(--font-size-14);
  495. line-height: 2;
  496. margin-bottom: px2rpx(8);
  497. display: flex;
  498. align-items: center;
  499. gap: px2rpx(8);
  500. i {
  501. font-size: var(--font-size-18);
  502. color: var(--main-yellow);
  503. }
  504. }
  505. .number {
  506. color: var(--black);
  507. font-size: var(--font-size-18);
  508. font-weight: 500;
  509. line-height: 3;
  510. margin: px2rpx(20) 0;
  511. display: flex;
  512. align-items: center;
  513. gap: px2rpx(8);
  514. }
  515. .actions {
  516. display: flex;
  517. justify-content: space-between;
  518. margin: px2rpx(20) 0 px2rpx(16) 0;
  519. gap: px2rpx(8);
  520. background-color: #fff;
  521. width: 100%;
  522. }
  523. .action-btn {
  524. color: var(--white);
  525. border: none;
  526. border-radius: px2rpx(12);
  527. padding: 0 px2rpx(12);
  528. font-size: var(--font-size-14);
  529. cursor: pointer;
  530. display: flex;
  531. flex-direction: column;
  532. align-items: center;
  533. gap: px2rpx(8);
  534. transition: all 0.3s ease;
  535. text-align: center;
  536. color: #1a1a1a;
  537. flex: 1;
  538. height: px2rpx(100);
  539. flex-shrink: 0;
  540. border-radius: px2rpx(15);
  541. box-shadow: 0px 5px 30px 0px rgba(5, 0, 1, 0.05);
  542. .icon {
  543. margin: px2rpx(16) 0 px2rpx(4) 0;
  544. }
  545. span {
  546. line-height: px2rpx(20);
  547. }
  548. }
  549. .action-btn1 {
  550. background: rgba(153, 153, 153, 0.03) !important;
  551. color: #999 !important;
  552. pointer-events: none !important;
  553. }
  554. .balance-wrap {
  555. display: flex;
  556. align-items: center;
  557. justify-content: space-between;
  558. margin: px2rpx(24) 0;
  559. font-size: var(--font-size-14);
  560. }
  561. .balance-wrap1 {
  562. background-color: #f9fafb;
  563. border-radius: px2rpx(12);
  564. padding: px2rpx(16) px2rpx(12);
  565. display: flex;
  566. align-items: center;
  567. justify-content: space-between;
  568. margin-bottom: px2rpx(12);
  569. .global-con-l {
  570. display: flex;
  571. width: px2rpx(164);
  572. align-items: center;
  573. gap: px2rpx(12);
  574. border-radius: px2rpx(12);
  575. // box-shadow: 0px 5px 30px 0px rgba(5, 0, 1, 0.05);
  576. color: var(--white);
  577. p {
  578. color: #000;
  579. font-family: Roboto;
  580. font-size: px2rpx(16);
  581. font-style: normal;
  582. font-weight: 600;
  583. line-height: px2rpx(24);
  584. }
  585. .l-img {
  586. width: px2rpx(36);
  587. height: px2rpx(36);
  588. border: 1px solid #f4f4f4;
  589. border-radius: 50%;
  590. }
  591. }
  592. }
  593. .balance-content {
  594. font-size: var(--font-size-20);
  595. color: var(--white);
  596. font-weight: bold;
  597. }
  598. .balance-title {
  599. font-size: var(--font-size-12);
  600. color: var(--white);
  601. }
  602. .currency {
  603. display: flex;
  604. align-items: center;
  605. font-size: var(--font-size-14);
  606. margin-right: px2rpx(12);
  607. color: var(--white);
  608. }
  609. .flag {
  610. width: px2rpx(24);
  611. height: px2rpx(24);
  612. border-radius: 50%;
  613. margin-right: px2rpx(6);
  614. }
  615. .balance {
  616. display: flex;
  617. align-items: center;
  618. font-size: var(--font-size-14);
  619. font-weight: bold;
  620. color: var(--white);
  621. .balance-amount {
  622. display: inline-flex;
  623. padding-right: px2rpx(8);
  624. }
  625. }
  626. .transactions {
  627. border-radius: px2rpx(16);
  628. margin-bottom: px2rpx(16);
  629. padding-bottom: px2rpx(16);
  630. }
  631. .trans-icon {
  632. width: px2rpx(48);
  633. height: px2rpx(48);
  634. display: flex;
  635. background: var(--main-bg);
  636. box-shadow: 0 4px 12px rgba(214, 255, 0, 0.1);
  637. border-radius: px2rpx(8);
  638. margin-right: px2rpx(12);
  639. align-items: center;
  640. justify-content: center;
  641. .trans-icon-inner {
  642. width: px2rpx(48);
  643. height: px2rpx(48);
  644. background: rgba(212, 206, 206, 0.24);
  645. border-radius: 50%;
  646. display: flex;
  647. align-items: center;
  648. justify-content: center;
  649. }
  650. i {
  651. color: #000;
  652. width: px2rpx(24);
  653. height: px2rpx(24);
  654. border-radius: 50%;
  655. }
  656. }
  657. .trans-header {
  658. display: flex;
  659. justify-content: space-between;
  660. align-items: center;
  661. margin: px2rpx(32) 0;
  662. color: var(--white);
  663. i {
  664. font-size: var(--font-size-20);
  665. cursor: pointer;
  666. }
  667. }
  668. ::v-deep .van-calendar {
  669. background: var(--action-bg);
  670. }
  671. ::v-deep .van-calendar__month-mark {
  672. display: none;
  673. }
  674. ::v-deep .van-calendar__header-subtitle {
  675. color: var(--white);
  676. }
  677. ::v-deep .van-calendar__header-title {
  678. color: var(--white);
  679. }
  680. ::v-deep .van-calendar__month-title {
  681. color: var(--main-yellow);
  682. }
  683. .trans-title {
  684. font-size: var(--font-size-20);
  685. color: var(--white);
  686. font-weight: bold;
  687. }
  688. .date-field {
  689. width: px2rpx(200);
  690. :deep(.van-field__control) {
  691. color: var(--white);
  692. }
  693. :deep(.van-field__placeholder) {
  694. color: var(--gray);
  695. }
  696. }
  697. :deep(.van-popup) {
  698. background: var(--action-bg);
  699. }
  700. :deep(.van-picker__toolbar) {
  701. background: var(--action-bg);
  702. border-bottom: 1px solid var(--border);
  703. }
  704. :deep(.van-picker__title) {
  705. color: var(--white);
  706. }
  707. :deep(.van-picker__confirm) {
  708. color: var(--main-yellow);
  709. }
  710. :deep(.van-picker__cancel) {
  711. color: var(--gray);
  712. }
  713. :deep(.van-picker-column) {
  714. color: var(--white);
  715. }
  716. :deep(.van-picker-column__item) {
  717. color: var(--white);
  718. }
  719. :deep(.van-picker-column__item--selected) {
  720. color: var(--main-yellow);
  721. }
  722. .transaction {
  723. display: flex;
  724. align-items: center;
  725. justify-content: space-between;
  726. padding: px2rpx(10) 0;
  727. /* border-bottom: 1px solid var(--border); */
  728. font-size: var(--font-size-16);
  729. }
  730. .transaction:last-child {
  731. border-bottom: none;
  732. }
  733. .trans-left {
  734. width: px2rpx(200);
  735. }
  736. .trans-right {
  737. width: px2rpx(100);
  738. div {
  739. text-align: right;
  740. }
  741. }
  742. .trans-type {
  743. color: var(--white);
  744. font-size: var(--font-size-16);
  745. font-weight: 600;
  746. line-height: 2;
  747. }
  748. .trans-desc {
  749. font-size: var(--font-size-12);
  750. color: var(--gray);
  751. }
  752. .trans-amount {
  753. font-size: var(--font-size-16);
  754. font-weight: 600;
  755. color: var(--white);
  756. line-height: 2;
  757. }
  758. .trans-date {
  759. color: var(--gray);
  760. font-size: var(--font-size-12);
  761. }
  762. .card-swiper {
  763. width: 100%;
  764. margin: px2rpx(20) 0 0 0;
  765. position: relative;
  766. overflow: hidden;
  767. display: flex;
  768. justify-content: center;
  769. flex-direction: column;
  770. align-items: center;
  771. padding-bottom: px2rpx(5);
  772. }
  773. .swiper-container {
  774. position: relative;
  775. width: 100%;
  776. height: px2rpx(219);
  777. touch-action: pan-y pinch-zoom;
  778. user-select: none;
  779. }
  780. .card-info {
  781. position: absolute;
  782. width: 100%;
  783. height: 100%;
  784. transition: transform 0.3s ease;
  785. will-change: transform;
  786. box-sizing: border-box;
  787. }
  788. .swiper-controls {
  789. display: flex;
  790. align-items: center;
  791. justify-content: center;
  792. margin-top: px2rpx(12);
  793. gap: px2rpx(16);
  794. }
  795. .swiper-btn {
  796. background: var(--action-bg);
  797. border: none;
  798. border-radius: 50%;
  799. width: px2rpx(32);
  800. height: px2rpx(32);
  801. display: flex;
  802. align-items: center;
  803. justify-content: center;
  804. cursor: pointer;
  805. color: var(--main-yellow);
  806. &:disabled {
  807. opacity: 0.5;
  808. cursor: not-allowed;
  809. }
  810. i {
  811. font-size: var(--font-size-20);
  812. }
  813. }
  814. .swiper-dots {
  815. display: flex;
  816. gap: px2rpx(8);
  817. }
  818. .dot {
  819. width: px2rpx(8);
  820. height: px2rpx(8);
  821. border-radius: 50%;
  822. background: var(--action-bg);
  823. cursor: pointer;
  824. transition: all 0.3s ease;
  825. &.active {
  826. background: var(--main-yellow);
  827. transform: scale(1.2);
  828. }
  829. }
  830. .swiper-indicators {
  831. display: flex;
  832. justify-content: center;
  833. margin-top: px2rpx(16);
  834. gap: px2rpx(8);
  835. }
  836. .indicator-dot {
  837. width: px2rpx(8);
  838. height: px2rpx(8);
  839. border-radius: 50%;
  840. background: var(--gray);
  841. cursor: pointer;
  842. transition: all 0.3s ease;
  843. &.active {
  844. background: var(--main-yellow);
  845. transform: scale(1.2);
  846. }
  847. }
  848. .flags {
  849. width: px2rpx(20);
  850. height: px2rpx(20);
  851. cursor: pointer;
  852. position: absolute;
  853. top: px2rpx(10);
  854. right: px2rpx(10);
  855. }
  856. .balance-content1 {
  857. margin-bottom: px2rpx(20);
  858. font-size: var(--font-size-20);
  859. color: var(--white);
  860. font-weight: bold;
  861. }
  862. .cwg-btn {
  863. margin-top: px2rpx(36);
  864. }
  865. .custom-toast {
  866. background: rgba(0, 0, 0, 0) !important;
  867. color: #fff;
  868. font-size: px2rpx(14);
  869. padding: px2rpx(10);
  870. border-radius: px2rpx(8);
  871. display: flex;
  872. align-items: center;
  873. gap: px2rpx(8);
  874. .van-icon {
  875. width: px2rpx(24);
  876. height: px2rpx(24);
  877. }
  878. .van-icon--copy {
  879. color: #fff;
  880. }
  881. }
  882. .actions1 {
  883. width: 100%;
  884. padding: px2rpx(20);
  885. margin-top: px2rpx(20);
  886. border: 1px solid rgba(214, 255, 0, 0.2);
  887. box-shadow: 0 0.053333rem 0.213333rem rgba(0, 0, 0, 0.08);
  888. }
  889. .card-btn {
  890. width: 100%;
  891. .yue {
  892. display: flex;
  893. align-items: center;
  894. box-sizing: border-box;
  895. line-height: px2rpx(50);
  896. width: 100%;
  897. height: px2rpx(50);
  898. background: rgba(208, 37, 55, 0.03);
  899. border-radius: px2rpx(8);
  900. text-align: left;
  901. padding-left: px2rpx(20);
  902. margin-bottom: px2rpx(20);
  903. }
  904. .a {
  905. font-size: px2rpx(14);
  906. color: #333333;
  907. font-weight: bold;
  908. padding: 0;
  909. }
  910. .v {
  911. font-size: px2rpx(14);
  912. color: #eb3f57;
  913. padding: 0;
  914. }
  915. .btn {
  916. width: px2rpx(193);
  917. height: px2rpx(40);
  918. border: 1px solid #eb3f57;
  919. border-radius: px2rpx(4);
  920. text-align: center;
  921. color: #eb3f57;
  922. font-size: px2rpx(16);
  923. font-family: Roboto;
  924. font-weight: 600;
  925. line-height: px2rpx(40);
  926. cursor: pointer;
  927. user-select: none;
  928. }
  929. .btn1 {
  930. width: px2rpx(100);
  931. height: px2rpx(94);
  932. background: rgba(208, 37, 55, 0.03);
  933. border: 1px solid rgba(208, 37, 55, 0.03);
  934. border-radius: px2rpx(15);
  935. text-align: center;
  936. color: #eb3f57;
  937. font-size: px2rpx(16);
  938. font-family: Roboto;
  939. font-weight: 600;
  940. line-height: px2rpx(20);
  941. padding: 0 px2rpx(8);
  942. cursor: pointer;
  943. user-select: none;
  944. display: flex;
  945. align-items: center;
  946. justify-content: center;
  947. flex-direction: column;
  948. gap: px2rpx(8);
  949. &:hover {
  950. border: 1px solid #eb3f57;
  951. }
  952. img {
  953. width: px2rpx(28);
  954. height: px2rpx(28);
  955. vertical-align: middle;
  956. margin-right: px2rpx(5);
  957. }
  958. }
  959. .btn2 {
  960. width: px2rpx(162);
  961. }
  962. .btn3 {
  963. background: rgba(153, 153, 153, 0.03) !important;
  964. color: #999 !important;
  965. pointer-events: none !important;
  966. }
  967. }
  968. .status {
  969. position: absolute;
  970. top: px2rpx(15);
  971. right: -px2rpx(30);
  972. padding: px2rpx(4) px2rpx(40);
  973. background: rgba(235, 63, 87, 0.1);
  974. color: #eb3f57;
  975. font-size: px2rpx(14);
  976. font-weight: 500;
  977. text-align: center;
  978. transform: rotate(45deg);
  979. transform-origin: center center;
  980. }
  981. .status1 {
  982. position: absolute;
  983. top: px2rpx(15);
  984. right: -px2rpx(30);
  985. padding: px2rpx(4) px2rpx(40);
  986. background: rgba(67, 68, 68, 0.1);
  987. color: #434444;
  988. font-size: px2rpx(14);
  989. font-weight: 500;
  990. text-align: center;
  991. transform: rotate(45deg);
  992. transform-origin: center center;
  993. }
  994. .transaction-list {
  995. display: flex;
  996. flex-direction: column;
  997. .transaction-item {
  998. display: flex;
  999. justify-content: space-between;
  1000. align-items: center;
  1001. padding: px2rpx(16) 0;
  1002. border-bottom: 1px solid #f3f4f6;
  1003. }
  1004. .transaction-item:last-child {
  1005. border-bottom: none;
  1006. }
  1007. .transaction-left {
  1008. display: flex;
  1009. align-items: center;
  1010. gap: px2rpx(12);
  1011. }
  1012. .transaction-icon {
  1013. width: px2rpx(40);
  1014. height: px2rpx(40);
  1015. background-color: #f9fafb;
  1016. border-radius: 50%;
  1017. display: flex;
  1018. align-items: center;
  1019. justify-content: center;
  1020. }
  1021. .icon-text {
  1022. font-size: px2rpx(20);
  1023. color: #6b7280;
  1024. }
  1025. .transaction-info {
  1026. display: flex;
  1027. flex-direction: column;
  1028. gap: px2rpx(4);
  1029. }
  1030. .transaction-status {
  1031. font-size: px2rpx(14);
  1032. color: #111827;
  1033. }
  1034. .transaction-time {
  1035. font-size: px2rpx(12);
  1036. color: #9ca3af;
  1037. }
  1038. .transaction-right {
  1039. display: flex;
  1040. flex-direction: column;
  1041. align-items: flex-end;
  1042. }
  1043. .transaction-amount {
  1044. font-size: px2rpx(16);
  1045. font-weight: 600;
  1046. color: #111827;
  1047. }
  1048. .transaction-amount.negative {
  1049. color: #ef4444;
  1050. }
  1051. }
  1052. </style>