|
@@ -8,9 +8,7 @@ import Left from "./Left";
|
|
|
|
|
|
const Deposit = () => {
|
|
|
const searchParams = useSearchParams();
|
|
|
- const [actIdx, setActIdx] = React.useState(
|
|
|
- searchParams.get("target_id") ? Number(searchParams) : 0
|
|
|
- );
|
|
|
+ const [actIdx, setActIdx] = React.useState(0);
|
|
|
const [shopTypeList, setShopTypeList] = React.useState<any[]>([]);
|
|
|
const [currentChannel, setCurrentChannel] = React.useState<any>({});
|
|
|
const [shopInfo, setShopInfo] = React.useState<ShopInfo | null>(null);
|
|
@@ -37,6 +35,15 @@ const Deposit = () => {
|
|
|
const res = await getShopListApi();
|
|
|
if (res?.code === 200 && res?.data) {
|
|
|
setShopTypeList(res?.data || []);
|
|
|
+
|
|
|
+ if (searchParams.get("target_id")) {
|
|
|
+ const act = res.data.findIndex(
|
|
|
+ (item: any) => item.id == searchParams.get("target_id")
|
|
|
+ );
|
|
|
+ setActIdx(act);
|
|
|
+ doChangeChannel(res?.data[act]?.pay_channel[0]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (res?.data[actIdx]?.pay_channel[0]) {
|
|
|
doChangeChannel(res?.data[actIdx]?.pay_channel[0]);
|
|
|
}
|