From 174f774704bbab83061288522ec4fbdfba1f6716 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 25 三月 2025 13:17:10 +0800 Subject: [PATCH] fix: 三期bug --- packages/components/src/views/userAccount/UserAccountListView.vue | 33 ++++++++++++++++++++++++++++----- 1 files changed, 28 insertions(+), 5 deletions(-) diff --git a/packages/components/src/views/userAccount/UserAccountListView.vue b/packages/components/src/views/userAccount/UserAccountListView.vue index 68ee021..ed2b857 100644 --- a/packages/components/src/views/userAccount/UserAccountListView.vue +++ b/packages/components/src/views/userAccount/UserAccountListView.vue @@ -18,8 +18,8 @@ }" > <template #action> - <div class="account-card-action" @click="handleEditUserAccount">缂栬緫</div> - <div class="account-card-action" @click="handleEditUserAccount">鍒犻櫎</div> + <div class="account-card-action" @click="handleEditUserAccount(item)">缂栬緫</div> + <div class="account-card-action" @click="handleDeleteUserAccount(item)">鍒犻櫎</div> </template> </AccountCard> </template> @@ -33,6 +33,7 @@ useLifeRechargeContext, QueryUserAccountListInput, LifeRechargeConstants, + UserAccountListOutput, } from '@life-payment/core-vue'; import { useInfiniteLoading } from '../../hooks/infiniteLoading'; import { OrderInputType } from '../../constants'; @@ -43,6 +44,10 @@ name: 'UserAccountListView', }); +const emit = defineEmits<{ + (e: 'goEdit', row: UserAccountListOutput): void; +}>(); + const { blLifeRecharge } = useLifeRechargeContext(); const TitleMap = { @@ -51,13 +56,13 @@ [LifeRechargeConstants.LifePayOrderTypeEnum.鐕冩皵璁㈠崟]: '鐕冩皵鎴峰彿', }; -const { infiniteLoadingProps } = useInfiniteLoading( +const { infiniteLoadingProps, invalidateQueries } = useInfiniteLoading( ({ pageParam }) => { let params: QueryUserAccountListInput = { pageModel: { rows: 20, page: pageParam, - orderInput: [{ property: 'id', order: OrderInputType.Desc }], + orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }], }, userId: blLifeRecharge.accountModel.userId, }; @@ -71,5 +76,23 @@ } ); -function handleEditUserAccount() {} +function handleEditUserAccount(row: UserAccountListOutput) { + emit('goEdit', row); +} + +async function handleDeleteUserAccount(row: UserAccountListOutput) { + try { + const res = await Taro.showModal({ + title: '鎻愮ず', + content: '纭畾瑕佸垹闄よ鏁版嵁鍚�?', + confirmColor: '#3a71ff', + }); + if (res.confirm) { + await blLifeRecharge.services.deleteUserAccount({ + id: row.id, + }); + invalidateQueries(); + } + } catch (error) {} +} </script> -- Gitblit v1.9.1