feat(dealer): 添加微信客服功能并优化订单和客户页面

- 在 app.config.ts 中添加微信客服页面路由
- 修改订单页面标题为"电费收益"
- 新增微信客服页面组件和样式
- 优化客户交易页面,添加搜索功能
- 更新二维码页面文案- 新增微信二维码图片说明文档
This commit is contained in:
2025-09-03 14:43:41 +08:00
parent e4d993548f
commit 1368155736
11 changed files with 287 additions and 9 deletions

View File

@@ -1,12 +1,11 @@
import {useState, useEffect, useCallback} from 'react'
import {View, Text} from '@tarojs/components'
import {Loading, Space} from '@nutui/nutui-react-taro'
import {Loading, Space, SearchBar} from '@nutui/nutui-react-taro'
import type {ShopDealerApply as UserType} from "@/api/shop/shopDealerApply/model";
import {
CustomerStatus,
mapApplyStatusToCustomerStatus,
} from '@/utils/customerStatus';
import navTo from "@/utils/common";
import {pageShopDealerApply} from "@/api/shop/shopDealerApply";
// 扩展User类型添加客户状态
@@ -17,7 +16,7 @@ interface CustomerUser extends UserType {
const CustomerTrading = () => {
const [list, setList] = useState<CustomerUser[]>([])
const [loading, setLoading] = useState<boolean>(false)
const [searchValue, _] = useState<string>('')
const [searchValue, setSearchValue] = useState<string>('')
// 获取客户数据
const fetchCustomerData = useCallback(async () => {
@@ -75,8 +74,7 @@ const CustomerTrading = () => {
// 渲染客户项
const renderCustomerItem = (customer: CustomerUser) => (
<View key={customer.userId} className="bg-white rounded-lg p-4 mb-3 shadow-sm">
<View className="flex items-center"
onClick={() => navTo(`/dealer/customer/add?id=${customer.applyId}`, true)}>
<View className="flex items-center">
<View className="flex-1">
<View className="flex items-center justify-between mb-1">
<Text className="font-semibold text-gray-800 mr-2">
@@ -125,6 +123,16 @@ const CustomerTrading = () => {
return (
<View className="min-h-screen bg-gray-50">
{/* 搜索栏 */}
<View className="bg-white shadow-sm">
<SearchBar
placeholder="请输入搜索关键词"
value={searchValue}
onChange={(value) => setSearchValue(value)}
onSearch={(value) => setSearchValue(value)}
onClear={() => setSearchValue('')}
/>
</View>
{/* 客户列表 */}
{renderCustomerList()}