diff --git a/Cunkebao/src/pages/mobile/mine/traffic-pool/list/BatchAddModal.tsx b/Cunkebao/src/pages/mobile/mine/traffic-pool/list/BatchAddModal.tsx index 86dda202..19ffcae4 100644 --- a/Cunkebao/src/pages/mobile/mine/traffic-pool/list/BatchAddModal.tsx +++ b/Cunkebao/src/pages/mobile/mine/traffic-pool/list/BatchAddModal.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Popup, Selector } from "antd-mobile"; +import { Popup, Selector, Button } from "antd-mobile"; import type { PackageOption } from "./data"; interface BatchAddModalProps { @@ -9,7 +9,7 @@ interface BatchAddModalProps { batchTarget: string; setBatchTarget: (v: string) => void; selectedCount: number; - onConfirm: () => void; + onConfirm: (options) => void; } const BatchAddModal: React.FC = ({ @@ -20,38 +20,40 @@ const BatchAddModal: React.FC = ({ setBatchTarget, selectedCount, onConfirm, -}) => ( - // - //
- //
选择目标分组
- // ({ label: p.name, value: p.id }))} - // value={[batchTarget]} - // onChange={v => setBatchTarget(v[0])} - // /> - //
- //
- // 将选中的{selectedCount}个用户加入所选分组 - //
- //
- onClose()} - position="bottom" - bodyStyle={{ height: "80vh" }} - > -
-
选择目标分组
- ({ label: p.name, value: p.id }))} - value={[batchTarget]} - onChange={v => setBatchTarget(v[0])} - /> -
-
- 将选中的{selectedCount}个用户加入所选分组 -
-
-); +}) => { + const handSubmit = () => { + onConfirm(packageOptions); + }; + return ( + onClose()} + position="bottom" + bodyStyle={{ height: "80vh" }} + > +
+
选择目标分组
+ ({ label: p.name, value: p.id }))} + value={[batchTarget]} + onChange={v => setBatchTarget(v[0])} + /> +
+ 将选中的{selectedCount}个用户加入所选分组 +
+ +
+
+ ); +}; export default BatchAddModal; diff --git a/Cunkebao/src/pages/mobile/mine/traffic-pool/list/dataAnyx.tsx b/Cunkebao/src/pages/mobile/mine/traffic-pool/list/dataAnyx.tsx index 8a5f7edc..ad4fc037 100644 --- a/Cunkebao/src/pages/mobile/mine/traffic-pool/list/dataAnyx.tsx +++ b/Cunkebao/src/pages/mobile/mine/traffic-pool/list/dataAnyx.tsx @@ -5,7 +5,6 @@ import { fetchScenarioOptions, } from "./api"; import type { TrafficPoolUser, PackageOption, ScenarioOption } from "./data"; -import { Toast } from "antd-mobile"; export function useTrafficPoolListLogic() { const [loading, setLoading] = useState(false); @@ -116,19 +115,21 @@ export function useTrafficPoolListLogic() { }; // 批量加入分组/流量池 - const handleBatchAdd = () => { - if (!batchTarget) { - Toast.show({ content: "请选择目标分组", position: "top" }); - return; - } - // TODO: 调用后端批量接口,这里仅模拟 - Toast.show({ - content: `已将${selectedIds.length}个用户加入${packageOptions.find(p => p.id === batchTarget)?.name || ""}`, - position: "top", - }); - setBatchModal(false); - setSelectedIds([]); - setBatchTarget(""); + const handleBatchAdd = options => { + console.log("批量加入分组", options); + + // if (!batchTarget) { + // Toast.show({ content: "请选择目标分组", position: "top" }); + // return; + // } + // // TODO: 调用后端批量接口,这里仅模拟 + // Toast.show({ + // content: `已将${selectedIds.length}个用户加入${packageOptions.find(p => p.id === batchTarget)?.name || ""}`, + // position: "top", + // }); + // setBatchModal(false); + // setSelectedIds([]); + // setBatchTarget(""); // 可刷新列表 };