Quellcode durchsuchen

feat: 修改参数

year vor 2 Monaten
Ursprung
Commit
1445663704

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

@@ -232,7 +232,7 @@ const DepositData: FC<Props> = (props) => {
                     footer={
                         <>
                             {!isEmpty && (
-                                <ButtonOwn active>{t("DepositPage.DepositarAgora")}</ButtonOwn>
+                                <ButtonOwn deposit>{t("DepositPage.DepositarAgora")}</ButtonOwn>
                             )}
                         </>
                     }

+ 14 - 4
src/app/[locale]/(doings)/card/layout.tsx

@@ -1,19 +1,29 @@
+"use client";
 import HeaderBack from "@/components/HeaderBack";
-import { getTranslations } from "next-intl/server";
+// import { getTranslations } from "next-intl/server";
+import { useSearchParams } from "next/navigation";
 import { ReactNode } from "react";
 import styles from "./page.module.scss";
 
-export default async function Layout({
+export default function Layout({
     children,
     params: { locale },
 }: {
     children: ReactNode;
     params: { locale: string };
 }) {
-    const t = await getTranslations("Header");
+    // const t = await getTranslations("Header");
+    const searchParams = useSearchParams();
+
     return (
         <div className={styles.page}>
-            <HeaderBack showBack={true} title={"Cartão de semanas"} useBg={false} />
+            <HeaderBack
+                showBack={true}
+                title={
+                    searchParams.get("shop_id") == "4" ? "Cartão de semanas" : "Cartão de semanas"
+                }
+                useBg={false}
+            />
             <main className={"main-header"}>{children}</main>
         </div>
     );

+ 2 - 0
src/components/ButtonOwn/index.tsx

@@ -21,6 +21,7 @@ export interface ButtonOwnProps {
 const ButtonOwn: FC<PropsWithChildren<ButtonOwnProps>> = ({
     children = "",
     active = false,
+    deposit = false,
     callbackFun,
     className,
     style,
@@ -29,6 +30,7 @@ const ButtonOwn: FC<PropsWithChildren<ButtonOwnProps>> = ({
     const divClassName = clsx({
         [styles.button]: true,
         [styles.active]: active,
+        [styles.deposit]: deposit,
         className,
     });
     return (

+ 37 - 22
src/components/ButtonOwn/style.module.scss

@@ -1,27 +1,42 @@
 .button {
-  display: block;
-  width: 100%;
-  height: .44rem;
-  background: -webkit-gradient(linear, left top, left bottom, from(#ff9323), to(#ff6a01));
-  background: -webkit-linear-gradient(top, #ff9323, #ff6a01);
-  background: -o-linear-gradient(top, #ff9323, #ff6a01);
-  background: linear-gradient(180deg, #ff9323, #ff6a01);
-  color: #fff;
-  text-align: center;
-  line-height: .44rem;
-  font-size: .14rem;
-  border-radius: 4px;
-  cursor: not-allowed;
-  opacity: .4;
-  -webkit-box-sizing: border-box;
-  box-sizing: border-box;
-
-  &.active {
+    display: block;
+    width: 100%;
+    height: 0.44rem;
     background: -webkit-gradient(linear, left top, left bottom, from(#ff9323), to(#ff6a01));
     background: -webkit-linear-gradient(top, #ff9323, #ff6a01);
     background: -o-linear-gradient(top, #ff9323, #ff6a01);
     background: linear-gradient(180deg, #ff9323, #ff6a01);
-    cursor: pointer;
-    opacity: 1;
-  }
-}
+    color: #fff;
+    text-align: center;
+    line-height: 0.44rem;
+    font-size: 0.14rem;
+    border-radius: 4px;
+    cursor: not-allowed;
+    opacity: 0.4;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+
+    &.active {
+        background: -webkit-gradient(linear, left top, left bottom, from(#ff9323), to(#ff6a01));
+        background: -webkit-linear-gradient(top, #ff9323, #ff6a01);
+        background: -o-linear-gradient(top, #ff9323, #ff6a01);
+        background: linear-gradient(180deg, #ff9323, #ff6a01);
+        cursor: pointer;
+        opacity: 1;
+    }
+    &.deposit {
+        background-image: -webkit-gradient(
+            linear,
+            left top,
+            left bottom,
+            from(#0fb9d2),
+            to(#0852d3)
+        );
+        background-image: -webkit-linear-gradient(top, #0fb9d2, #0852d3);
+        background-image: -o-linear-gradient(top, #0fb9d2, #0852d3);
+        background-image: linear-gradient(180deg, #0fb9d2, #024bc9) !important;
+        box-shadow: 0 0 0.1rem #0fb9d2 inset;
+        cursor: pointer;
+        opacity: 1;
+    }
+}