|
|
@@ -80,14 +80,14 @@
|
|
|
<cwg-icon name="icon_unfreeze" :size="28" color="#EA002A" />
|
|
|
<view v-if="currentCard.freezeStatus == 'success'">{{
|
|
|
t("card.Btn.b5")
|
|
|
- }}</view>
|
|
|
+ }}</view>
|
|
|
<view v-else>{{ t("card.Btn.b14") }}</view>
|
|
|
</view>
|
|
|
<view v-if="currentCard.freezeType == '2'" class="action-btn" @click="ucardOperation(currentCard, 5)">
|
|
|
<cwg-icon name="icon_freeze" :size="28" color="#EA002A" />
|
|
|
<view v-if="currentCard.freezeStatus == 'success'">{{
|
|
|
t("card.Btn.b6")
|
|
|
- }}</view>
|
|
|
+ }}</view>
|
|
|
<view v-else>{{ t("card.Btn.b15") }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -107,7 +107,7 @@
|
|
|
<view class="balance">
|
|
|
<view class="balance-amount">{{
|
|
|
isOpen ? amount + " " + "USD" : "*****"
|
|
|
- }}</view>
|
|
|
+ }}</view>
|
|
|
<cwg-icon :name="isOpen ? 'icon_visiable' : 'icon_unvisiable'" :size="24" @click.stop="debouncedGetBalance" />
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -115,18 +115,18 @@
|
|
|
<view class="trans-title">{{ t("cards.transactions") }}</view>
|
|
|
<view class="all" @click="goRechargeRecord">{{
|
|
|
t("card.Status.t22")
|
|
|
- }}</view>
|
|
|
+ }}</view>
|
|
|
<!-- <i class="i-mdi-calendar-month-outline" @click="showDatePicker = true" /> -->
|
|
|
</view>
|
|
|
<cwg-tabs :list="tabList" @click="handleTabClick" />
|
|
|
<view class="transaction-list">
|
|
|
<!-- Recharge Records -->
|
|
|
<view v-if="jiluIndex === 0">
|
|
|
- <RechargeList :pageSize="4" ref="rechargeListRef" :cardNo="currentCard.cardNo" />
|
|
|
+ <RechargeList :pageSize="4" ref="rechargeListRef" :cardNumber="currentCard.cardNumber" />
|
|
|
</view>
|
|
|
<!-- Transfer Records -->
|
|
|
- <view v-if="jiluIndex === 1">
|
|
|
- <TransactionList :pageSize="4" ref="rechargeListRef" :cardNo="currentCard.cardNo" />
|
|
|
+ <view v-if="jiluIndex === 1" :a="currentCard.cardNumber">
|
|
|
+ <TransactionList :pageSize="4" ref="rechargeListRef" :cardNumber="currentCard.cardNumber" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -181,15 +181,12 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted, watch, computed, onUnmounted } from "vue";
|
|
|
-import type { CardInfo, TransactionInfo } from "@/api/ucard";
|
|
|
-import dayjs from "dayjs";
|
|
|
+import type { CardInfo } from "@/api/ucard";
|
|
|
import { showToast } from "@/utils/toast";
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
import useRouter from "@/hooks/useRouter";
|
|
|
import { ucardApi } from "@/api/ucard";
|
|
|
import _ from 'lodash';
|
|
|
-import useTransferStore from "@/stores/use-transfer-store";
|
|
|
-import useUserStore from "@/stores/use-user-store";
|
|
|
import useCardStore from "@/stores/use-card-store";
|
|
|
import CardHandle from "./CardHandle.vue";
|
|
|
import RechargeList from "@/pages/recharge-record/components/RechargeList.vue";
|
|
|
@@ -197,12 +194,14 @@ import TransactionList from "@/pages/recharge-record/components/TransactionList.
|
|
|
const debouncedGetBalance = _.debounce(getBalance, 300, { leading: true, trailing: false });
|
|
|
const router = useRouter();
|
|
|
const cardStore = useCardStore();
|
|
|
-const userStore = useUserStore();
|
|
|
-const transferStore = useTransferStore();
|
|
|
-const cardList = computed(() => cardStore.userCard);
|
|
|
-const userInfo = computed(() => userStore.userInfo);
|
|
|
+const cardList = computed(() => {
|
|
|
+ return cardStore.userCard;
|
|
|
+});
|
|
|
const { t } = useI18n();
|
|
|
-const currentCard = ref<CardInfo | null>({});
|
|
|
+const currentCard = computed<CardInfo | null>(() => {
|
|
|
+ if (!cardList.value.length) return null;
|
|
|
+ return cardList.value[currentIndex.value] || null;
|
|
|
+});
|
|
|
const formList = ref({});
|
|
|
const balance = ref<{ amount: number; currency: string; value: string }[]>([
|
|
|
{
|
|
|
@@ -211,7 +210,6 @@ const balance = ref<{ amount: number; currency: string; value: string }[]>([
|
|
|
value: "USD",
|
|
|
},
|
|
|
]);
|
|
|
-const transactions = ref<TransactionInfo[]>([]);
|
|
|
const showCardNo = ref<{ [key: string]: boolean }>({});
|
|
|
const isFlipping = ref<{ [key: string]: boolean }>({});
|
|
|
const isOpen = ref(false);
|
|
|
@@ -226,7 +224,6 @@ const tabList = ref([
|
|
|
]);
|
|
|
|
|
|
const handleTabClick = (item, index) => {
|
|
|
- console.log('点击了标签:', item, '索引:', index);
|
|
|
jiluIndex.value = index;
|
|
|
};
|
|
|
|
|
|
@@ -238,15 +235,6 @@ function setCvv() {
|
|
|
formList.value = currentCard.value;
|
|
|
}
|
|
|
const jiluIndex = ref(0);
|
|
|
-const transStatusMap = {
|
|
|
- succeed: t("card.Status.t1"),
|
|
|
- success: t("card.Status.t1"),
|
|
|
- failed: t("card.Status.t1"),
|
|
|
- fail: t("card.Status.t1"),
|
|
|
- processing: t("card.Status.t3"),
|
|
|
- auth: t("card.Status.t4"),
|
|
|
- wait_process: t("card.Status.t5"),
|
|
|
-};
|
|
|
function cardCopy(data) {
|
|
|
let title = t("common.copy1");
|
|
|
console.log(title);
|
|
|
@@ -257,50 +245,17 @@ function cardCopy(data) {
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
-function setDate(date) {
|
|
|
- return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
|
|
|
-}
|
|
|
const currency = ref("USD");
|
|
|
const amount = ref(0);
|
|
|
-const modelValue = ref(false);
|
|
|
-function setModelValue() {
|
|
|
- modelValue.value = true;
|
|
|
-}
|
|
|
-function changeSelect(e) {
|
|
|
- amount.value = e.amount;
|
|
|
- currency.value = e.currency;
|
|
|
-}
|
|
|
-const showDatePicker = ref(false);
|
|
|
const dateRange = ref<[string, string] | undefined>(undefined);
|
|
|
dateRange.value = ["", ""];
|
|
|
-const minDate = new Date(new Date().getFullYear() - 10, 0, 1);
|
|
|
-const maxDate = new Date(new Date().getFullYear() + 10, 0, 1);
|
|
|
-function onConfirmStart(value: [string, string]) {
|
|
|
- dateRange.value = ["", ""];
|
|
|
- if (value && value.length === 2) {
|
|
|
- dateRange.value = value;
|
|
|
- }
|
|
|
- showDatePicker.value = false;
|
|
|
- handleDateRangeChange();
|
|
|
-}
|
|
|
|
|
|
-function formatter(day: any) {
|
|
|
- if (day.type === "start") {
|
|
|
- day.bottomInfo = t("cards.start");
|
|
|
- } else if (day.type === "end") {
|
|
|
- day.bottomInfo = t("cards.end");
|
|
|
- } else {
|
|
|
- day.bottomInfo = "";
|
|
|
- }
|
|
|
- return day;
|
|
|
-}
|
|
|
function goRechargeRecord() {
|
|
|
- router.push(`/pages/recharge-record/list?cardNo=${currentCard.value?.cardNo}`);
|
|
|
+ router.push(`/pages/recharge-record/list?cardNumber=${currentCard.value?.cardNumber}`);
|
|
|
}
|
|
|
|
|
|
|
|
|
async function getBalance() {
|
|
|
- console.log(isOpen.value, 'isOpen.valueisOpen.value');
|
|
|
if (isOpen.value) {
|
|
|
isOpen.value = false;
|
|
|
return;
|
|
|
@@ -400,40 +355,10 @@ function viewApply(item: any) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-function goToTransactionDetail(record: TransactionInfo) {
|
|
|
- const amount = Number(record.amount || 0);
|
|
|
- const fee = Number(record.fee || 0);
|
|
|
- const normalizedStatus = normalizeStatus(record.status);
|
|
|
-
|
|
|
- const detailPayload = {
|
|
|
- category: 'recharge' as const,
|
|
|
- orderNo: record.merchantOrderNo || record.orderNo || '',
|
|
|
- type: '充值',
|
|
|
- amount,
|
|
|
- fee,
|
|
|
- actualAmount: amount - fee,
|
|
|
- currency: record.currency || 'USD',
|
|
|
- orderStatus: normalizedStatus,
|
|
|
- statusMessage: getStatusText(record.status),
|
|
|
- createTime: formatDateTime(record.addTime || record.time),
|
|
|
- completeTime: '',
|
|
|
- merchant: '',
|
|
|
- bankCard: record.cardNumber || '',
|
|
|
- remark: record.remark || '',
|
|
|
- approvalSteps: [] as any[]
|
|
|
- };
|
|
|
-
|
|
|
- cardStore.saveOrderDetail(detailPayload);
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/recharge-record/detail'
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
watch(
|
|
|
currentIndex,
|
|
|
(newIndex) => {
|
|
|
if (cardList.value[newIndex]) {
|
|
|
- currentCard.value = cardList.value[newIndex];
|
|
|
if (
|
|
|
cardList.value[newIndex].cardNo &&
|
|
|
cardList.value[newIndex].activateStatus == "success"
|