|
@@ -34,18 +34,29 @@ const Deposit = () => {
|
|
|
const getData = async () => {
|
|
|
const res = await getShopListApi();
|
|
|
if (res?.code === 200 && res?.data) {
|
|
|
- setShopTypeList(res?.data || []);
|
|
|
+ const toData = res?.data.filter((item) => {
|
|
|
+ if (item.id === 1) {
|
|
|
+ return item.time_last > 0;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ const toUseData = toData || [];
|
|
|
+
|
|
|
+ setShopTypeList(toUseData);
|
|
|
|
|
|
if (searchParams.get("target_id")) {
|
|
|
- const act = res.data.findIndex(
|
|
|
+ let act = toUseData.findIndex(
|
|
|
(item: any) => item.id == searchParams.get("target_id")
|
|
|
);
|
|
|
+ if (act < 0) {
|
|
|
+ act = 0;
|
|
|
+ }
|
|
|
setActIdx(act);
|
|
|
- doChangeChannel(res?.data[act]?.pay_channel[0]);
|
|
|
+ doChangeChannel(toUseData[act]?.pay_channel[0]);
|
|
|
return;
|
|
|
}
|
|
|
- if (res?.data[actIdx]?.pay_channel[0]) {
|
|
|
- doChangeChannel(res?.data[actIdx]?.pay_channel[0]);
|
|
|
+ if (toUseData[actIdx]?.pay_channel[0]) {
|
|
|
+ doChangeChannel(toUseData[actIdx]?.pay_channel[0]);
|
|
|
}
|
|
|
}
|
|
|
};
|