import { ActionType, Icon, PageList, Phone, ToolBar } from "@/components"; import Taro, { useShareAppMessage } from "@tarojs/taro"; import { useRef } from "react"; import { business } from "@/services"; import hocAuth from "@/hocs/auth"; import { CommonComponent } from "@/types/typings"; import { Label, Text, View } from "@tarojs/components"; import dayjs from "dayjs"; import { buildUrl } from "@/utils"; import { Button } from "@nutui/nutui-react-taro"; export default hocAuth(function Page(props: CommonComponent) { const { shareOptions } = props; const actionRef = useRef(); const toolbar: ToolBar = { search: { activeKey: "name", defaultActiveKey: "name", items: [ { key: "name", name: "瓜农名称", placeholder: "请输入瓜农名称", }, ], }, actions: [ { Taro.navigateTo({ url: buildUrl("/pages/supplier/create"), }); }} > 登记瓜农 , ], }; useShareAppMessage((res) => { console.log("useShareAppMessage1", res, shareOptions); // 如果是按钮触发的转发,使用默认配置 if (res.from === "button") { return shareOptions; } // 页面转发使用设置的配置 return {}; }); return ( rowId={"supplierId"} itemHeight={182} type={"infinite"} actionRef={actionRef} render={(supplierVO: BusinessAPI.SupplierVO, index) => ( {/* 复制 */} {supplierVO?.name} )} {/* 新建采购 */} {/* 协助开票 */} )} toolbar={toolbar} request={async (params) => { const { data: { data, success, notEmpty }, } = await business.supplier.pageSupplier({ supplierPageQry: { ...params, type: "FARMER", }, }); return { data, success, hasMore: notEmpty, }; }} pagination={{ pageSize: 10, }} /> ); });