Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
oawdji committed Apr 3, 2024
2 parents d858c7d + f21fe4f commit 45ac4d2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
6 changes: 2 additions & 4 deletions src/app/dashboard/subscribe/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Page from "../../_components/subscribe/Navscribr";

const Subscribe = () => {
return (
<div>
<div className="min-h-screen relative">
<div className="w-85.75 mt-8 m-auto">
<div className="border-rd-13 h-8.5 bg-[#FFF] flex items-center">
<Image src={"/images/subscribe/search.png"} alt="search" width={18} height={18} className="inline ml-5.25 w-4.5 h-4.5"></Image>
Expand All @@ -28,11 +28,9 @@ const Subscribe = () => {
</div>


<div className="bottom-4 justify-center w-full sticky">
<div className="bottom-4 justify-center w-full fixed">
<Navbar />
</div>
<div className="flex">
</div>
</div >
)
}
Expand Down
48 changes: 31 additions & 17 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
"use client";

import React, { useState } from "react";
import Image from "next/image";
import GeneralModal from "../dialog/dialog"; // 引入GeneralModal组件

const Login = () => {
const [checked, setChecked] = useState(false);
const [modalVisible, setModalVisible] = useState(false); // 用于管理模态框可见性的状态

const handleWechatLogin = () => {
// 处理微信登录按钮点击的函数
setModalVisible(true); // 当点击微信登录按钮时显示模态框
};

const handleCancel = () => {
// 处理模态框取消/关闭的函数
setModalVisible(false); // 当取消时隐藏模态框
};

// 定义关闭模态框的函数
const closeModal = () => {
setModalVisible(false);
};


const handleLogin = () => {
if (checked) {
setModalVisible(true);
} else {
alert("请先勾选同意!");
}
};

// const [scanning, setScanning] = useState(false);
// const handleScanLogin = () => {
// // 在此处可以触发后端请求,以获取微信用户的授权信息
Expand All @@ -34,31 +45,34 @@ const Login = () => {
// }, 3000); // 模拟3秒钟后扫码登录完成
// }


return (
<div>
<div className="flex justify-center mt-73.6">
<div className="flex justify-center items-center mt-46">
<Image src={"/images/logo.png"} alt={"logo"} width={41} height={45}></Image>
<div className="ml-10px">
<div className={"shrink-0 font-size-8.4 "}>
<div className={"shrink-0 font-size-5.25 "}>
有记
</div>
<div className="shrink-0 font-size-3.2">
<div className="shrink-0 font-size-2">
YoNote
</div>
</div>
</div>
<div className="flex flex-col items-center mt-37.6">
<button className="w-115.6 h-18.4 shrink-0 border-rd-10 bg-[#45E1B8] font-size-5.6" onClick={handleWechatLogin}>微信登录</button>
<button className="w-115.6 h-18.4 shrink-0 border-rd-10 border bg-[#fffdfc] mt-6 font-size-5.6">取消</button>
<div className="flex w-108.4 h-9.6 mt-13.7 font-size-4.8 " >
<input type="checkbox" checked={checked} onChange={(e) => setChecked(e.target.checked)} className="w-8 h-8"/>
<div className="ml-2.8">我已阅读并同意《用户协议》和《隐私协议》</div>
<div className="flex flex-col items-center mt-23.5">
<button className="w-72.25 h-11.5 shrink-0 border-rd-10 bg-[#45E1B8] font-size-3.5" onClick={handleLogin}>微信登录</button>
<button className="w-72.25 h-11.5 shrink-0 border-rd-10 border bg-[#fffdfc] mt-3.75 font-size-3.5" onClick={handleCancel}>取消</button>
<div className="flex w-67.75 h-6 mt-8.5575 text-3" >
<input type="checkbox" checked={checked} onChange={(e) => setChecked(e.target.checked) } className="w-5 h-5" />
<div className="ml-1.5">我已阅读并同意《用户协议》和《隐私协议》</div>
</div>
</div>

<div>
<GeneralModal isOpen={modalVisible} onClick={closeModal}>
{/* 这里放入模态框内部的内容 */}
<div>此处放入微信二维码</div>
</GeneralModal>
</div>
</div>
);
}
export default Login;

export default Login;

0 comments on commit 45ac4d2

Please sign in to comment.