Ver Fonte

Merge branch 'feature-year0512' into v1.4cache

year há 1 mês atrás
pai
commit
1443bdbb18

+ 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 {

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

@@ -85,6 +85,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);
             });
 
@@ -323,12 +326,12 @@ const DepositData: FC<Props> = (props) => {
                                 {btns?.map((item, index) => {
                                     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);

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

@@ -23,9 +23,8 @@ const Reward: React.FC<Props> = ({ data }) => {
         return typeMap[type];
     };
     const renderData = React.useMemo(() => {
-        if (!!(!data?.activity_reward || !data?.activity_reward)) return [];
         const result: any = {};
-
+        if (!data?.activity_reward && !data?.pay_reward) return result;
         if (data?.activity_reward?.length > 0) {
             data?.activity_reward?.forEach((item) => {
                 if (item?.item_id <= 0 || item?.item_id > 4) return;

+ 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;