|
@@ -8,6 +8,7 @@ import {
|
|
|
ShopInfo,
|
|
|
ShopProductItem,
|
|
|
} from "@/api/depositsApi";
|
|
|
+import { useRouter } from "@/i18n/routing";
|
|
|
import { formatAmount } from "@/utils/index";
|
|
|
import { Toast } from "antd-mobile";
|
|
|
import clsx from "clsx";
|
|
@@ -20,6 +21,7 @@ import { Swiper, SwiperClass, SwiperSlide } from "swiper/react";
|
|
|
import styles from "./page.module.scss";
|
|
|
|
|
|
const CardPage = () => {
|
|
|
+ const router = useRouter();
|
|
|
const searchParams = useSearchParams();
|
|
|
const swiperRef = React.useRef<SwiperClass | null>(null);
|
|
|
const [act, setAct] = React.useState(0);
|
|
@@ -44,7 +46,7 @@ const CardPage = () => {
|
|
|
try {
|
|
|
setLoading(true);
|
|
|
const res = await getShopInfoApi({ shop_id });
|
|
|
- if (res?.code === 200 && res?.data) {
|
|
|
+ if (res?.code === 200 && res?.data?.products) {
|
|
|
res.data.products.sort((a: any, b: any) => {
|
|
|
return a.pay - b.pay;
|
|
|
}); //TODO: sort sho
|
|
@@ -134,7 +136,7 @@ const CardPage = () => {
|
|
|
|
|
|
return (
|
|
|
<div className={styles.CardPage}>
|
|
|
- <div className={styles.top}>
|
|
|
+ <div className={styles.top} style={{ minHeight: "300px" }}>
|
|
|
<Swiper
|
|
|
spaceBetween={10}
|
|
|
slidesPerView={1.25}
|
|
@@ -159,8 +161,8 @@ const CardPage = () => {
|
|
|
<SwiperSlide
|
|
|
key={item.id}
|
|
|
className={clsx(styles.swiperSlide, {
|
|
|
- [styles.swiperSlideBlue]: item.id === 1,
|
|
|
- [styles.swiperSlideGold]: item.id === 2,
|
|
|
+ [styles.swiperSlideBlue]: item.style === 1,
|
|
|
+ [styles.swiperSlideGold]: item.style === 3,
|
|
|
})}
|
|
|
>
|
|
|
<div className={styles.swiperItem}>
|
|
@@ -324,7 +326,10 @@ const CardPage = () => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className={styles.main}>
|
|
|
- <div className="my-[.15rem] cursor-pointer text-right text-[#00deff]">
|
|
|
+ <div
|
|
|
+ className="my-[.15rem] cursor-pointer text-right text-[#00deff]"
|
|
|
+ onClick={() => router.push("/cardRecord")}
|
|
|
+ >
|
|
|
Receba sens registros>
|
|
|
</div>
|
|
|
<div className={styles.config}>
|