${D}
${time.t}
`; + return `${D}
${time.d}
`; } }, methods: { @@ -67,25 +64,41 @@ export default { diff --git a/src/page/wallet/components/WalletWithdrawDetailItem.vue b/src/page/wallet/components/WalletWithdrawDetailItem.vue index 3b33e69e..cf7e6f4c 100644 --- a/src/page/wallet/components/WalletWithdrawDetailItem.vue +++ b/src/page/wallet/components/WalletWithdrawDetailItem.vue @@ -28,7 +28,7 @@ function splitYMD(date) { const w = week[date.getDay()]; const h = (date.getHours() + "").padStart(2, 0); const m = (date.getMinutes() + "").padStart(2, 0); - const d = (M + "").padStart(2, 0) + "/" + (D + "").padStart(2, 0); + const d = (M + "").padStart(2, 0) + "." + (D + "").padStart(2, 0); const t = h + ":" + m; return { Y, M, D, w, d, t }; } @@ -58,7 +58,7 @@ export default { } else if (now.D - time.D === 0) { D = "今天"; } - return `${D}
${time.t}
`; + return `${D}
${time.d}
`; }, typeText() { return typeMap[this.detail.type] || ""; diff --git a/src/stores/module/wallet.js b/src/stores/module/wallet.js index 4aa6e4e0..f32350ba 100644 --- a/src/stores/module/wallet.js +++ b/src/stores/module/wallet.js @@ -1,4 +1,5 @@ import * as api from "@/api/wallet"; +import _ from "lodash"; const state = { list: [], // 充值纪录 @@ -39,8 +40,8 @@ const actions = { */ async getWalletOrders({ commit, state }, params) { let { data } = await api.getWalletOrders(params); - if (params && params.after) data = [...state.list, ...data]; - commit(TYPES.UPDATE_WALLET, { list: data }); + const unionList = _.unionBy([...state.list, ...data], "id"); + commit(TYPES.UPDATE_WALLET, { list: unionList }); return data || []; },