year 1 månad sedan
förälder
incheckning
662cbacf88

+ 1 - 0
src/api/depositsApi.ts

@@ -116,6 +116,7 @@ export interface ShopProductItem {
     style: 1 | 2 | 3;
     type: 1 | 2;
     btnType?: BtnTypeEnum;
+    hasReward?: boolean;
 }
 
 export interface ShopInfo {

+ 10 - 6
src/app/[locale]/(TabBar)/deposit/DepositData.tsx

@@ -83,6 +83,9 @@ const DepositData: FC<Props> = (props) => {
                 if (!item.is_buy) {
                     return;
                 }
+                if (item.activity_reward?.length > 0 || item.pay_reward?.length > 0) {
+                    item.hasReward = true;
+                }
                 normalProduct.push(item);
             });
 
@@ -305,14 +308,15 @@ const DepositData: FC<Props> = (props) => {
                         <div className={"flex-1"}>
                             <ul className="ul-box">
                                 {btns?.map((item, index) => {
+                                    console.log(item);
                                     return (
                                         <li
-                                            className={
-                                                amount == item.pay_value &&
-                                                currentProduct?.id === item.id
-                                                    ? "active"
-                                                    : ""
-                                            }
+                                            className={clsx({
+                                                ["active"]:
+                                                    amount == item.pay_value &&
+                                                    currentProduct?.id === item.id,
+                                                ["noReward"]: !item.hasReward,
+                                            })}
                                             key={index}
                                             onClick={() => {
                                                 setCurrentProduct(item);

+ 3 - 2
src/app/[locale]/(TabBar)/deposit/Reward.tsx

@@ -23,7 +23,7 @@ const Reward: React.FC<Props> = ({ data }) => {
         return typeMap[type];
     };
     const renderData = React.useMemo(() => {
-        if (!!(!data?.activity_reward || !data?.activity_reward)) return [];
+        if (!data?.activity_reward && !data?.pay_reward) return [];
         const result: any = {};
 
         if (data?.activity_reward?.length > 0) {
@@ -35,6 +35,7 @@ const Reward: React.FC<Props> = ({ data }) => {
                 };
             });
         }
+        console.log(data?.pay_reward);
         if (data?.pay_reward?.length > 0) {
             data?.pay_reward?.forEach((item) => {
                 if (item?.item_id <= 0 || item?.item_id > 4) return;
@@ -61,7 +62,7 @@ const Reward: React.FC<Props> = ({ data }) => {
         };
     }, [data]);
     // D 1现金2彩金3免费币4重玩币
-    if (Object.keys(renderData).length === 0) return <div className="h-[50px] w-[1px]"></div>;
+    if (Object.keys(renderData).length === 0) return <div className="h-[20px] w-[1px]"></div>;
 
     return (
         <div className={clsx(styles.rewardBox, "text-[.1rem] text-[#ccc]")}>

+ 7 - 4
src/styles/deposit.scss

@@ -88,9 +88,9 @@
         align-items: center;
         // display: grid;
         // grid-template-columns: repeat(2, 1fr);
-        justify-content: center;
-        gap: 20px;
-
+        justify-content: space-between;
+        gap: 10px;
+        display: flex;
         li {
             @extend .commonBorder;
             box-shadow: $-input-shadow;
@@ -99,7 +99,7 @@
             border-radius: 0.06rem;
             color: #fff;
             font-size: 0.18rem;
-            margin-bottom: 0.1rem;
+            // margin-bottom: 0.1rem;
             display: flex;
             align-items: center;
             justify-content: flex-end;
@@ -107,6 +107,9 @@
             cursor: pointer;
             padding: 15px 5px 15px 5px;
             flex-wrap: wrap;
+            &.noReward {
+                width: 47%;
+            }
             &.active {
                 background-color: #d917ff;
                 box-shadow: none;