feat(pages): 添加新页面组件

- 创建了 add.config.ts 配置文件
- 实现了 add.tsx 页面组件
- 添加了 index.config.ts 配置文件
- 创建了 index.tsx 页面组件
This commit is contained in:
2026-03-16 21:53:20 +08:00
parent 338edaac13
commit 694efb77ec
4 changed files with 170 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
import {useState} from "react";
import Taro, {useDidShow} from '@tarojs/taro'
import {Button, Cell, CellGroup, Space, Empty, ConfigProvider, Divider} from '@nutui/nutui-react-taro'
import {Dongdong, ArrowRight, CheckNormal, Checked} from '@nutui/icons-react-taro'
import {View} from '@tarojs/components'
import {CreditMpCustomer} from "@/api/credit/creditMpCustomer/model";
import {listCreditMpCustomer, removeCreditMpCustomer, updateCreditMpCustomer} from "@/api/credit/creditMpCustomer";
const CreditMpCustomerList = () => {
const [list, setList] = useState<CreditMpCustomer[]>([])
const reload = () => {
listCreditMpCustomer({
// 添加查询条件
})
.then(data => {
setList(data || [])
})
.catch(() => {
Taro.showToast({
title: '获取数据失败',
icon: 'error'
});
})
}
const onDel = async (id?: number) => {
await removeCreditMpCustomer(id)
Taro.showToast({
title: '删除成功',
icon: 'success'
});
reload();
}
useDidShow(() => {
reload()
});
if (list.length == 0) {
return (
<ConfigProvider>
<div className={'h-full flex flex-col justify-center items-center'} style={{
height: 'calc(100vh - 300px)',
}}>
<Empty
style={{
backgroundColor: 'transparent'
}}
description="暂无数据"
/>
<Space>
<Button onClick={() => Taro.navigateTo({url: '/credit/creditMpCustomer/add'})}></Button>
</Space>
</div>
</ConfigProvider>
)
}
return (
<>
{list.map((item, _) => (
<Cell.Group key={item.