<template>
|
<InfiniteLoading
|
scrollViewClassName="life-page-infinite-scroll-list"
|
v-bind="infiniteLoadingProps"
|
>
|
<template #renderItem="{ item }">
|
<AccountCard
|
:title="TitleMap[item.lifePayType]"
|
:content="
|
item.lifePayType === LifeRechargeConstants.LifePayOrderTypeEnum.话费订单
|
? item.content
|
: `${item.city}-${item.content}`
|
"
|
:remark="item.remark"
|
:style="{
|
marginBottom: Taro.pxTransform(20),
|
backgroundColor: '#ffffff',
|
}"
|
>
|
<template #action>
|
<div class="account-card-action" @click="handleEditUserAccount">编辑</div>
|
<div class="account-card-action" @click="handleEditUserAccount">删除</div>
|
</template>
|
</AccountCard>
|
</template>
|
</InfiniteLoading>
|
</template>
|
|
<script setup lang="ts">
|
import InfiniteLoading from '../../components/InfiniteLoading/InfiniteLoading.vue';
|
import {
|
BlLifeRecharge,
|
useLifeRechargeContext,
|
QueryUserAccountListInput,
|
LifeRechargeConstants,
|
} from '@life-payment/core-vue';
|
import { useInfiniteLoading } from '../../hooks/infiniteLoading';
|
import { OrderInputType } from '../../constants';
|
import AccountCard from '../../components/Card/AccountCard.vue';
|
import Taro from '@tarojs/taro';
|
|
defineOptions({
|
name: 'UserAccountListView',
|
});
|
|
const { blLifeRecharge } = useLifeRechargeContext();
|
|
const TitleMap = {
|
[LifeRechargeConstants.LifePayOrderTypeEnum.话费订单]: '手机号',
|
[LifeRechargeConstants.LifePayOrderTypeEnum.电费订单]: '电费户号',
|
[LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单]: '燃气户号',
|
};
|
|
const { infiniteLoadingProps } = useInfiniteLoading(
|
({ pageParam }) => {
|
let params: QueryUserAccountListInput = {
|
pageModel: {
|
rows: 20,
|
page: pageParam,
|
orderInput: [{ property: 'id', order: OrderInputType.Desc }],
|
},
|
userId: blLifeRecharge.accountModel.userId,
|
};
|
|
return blLifeRecharge.services.getUserAccountList(params, {
|
showLoading: false,
|
});
|
},
|
{
|
queryKey: ['blLifeRecharge/getUserAccountList', blLifeRecharge.accountModel.userId],
|
}
|
);
|
|
function handleEditUserAccount() {}
|
</script>
|