This commit is contained in:
eric
2023-12-03 20:14:28 +08:00
parent 7c81e29fea
commit 009ded91f2
2 changed files with 27 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ import { AtIcon } from "taro-ui";
const Index = () => {
const [current, setcurrent] = useState(0);
const [isOpened, setisOpened] = useState(false);
const [joinMeetup, setjoinMeetup] = useState(false);
// 获取openid
const getWxid = () => {
@@ -46,6 +46,8 @@ const Index = () => {
useEffect(() => {
getWxid();
let newjoinMeetup = window.localStorage.getItem("joinMeetup");
setjoinMeetup(newjoinMeetup);
}, []);
const handleClick = (value) => {
@@ -186,6 +188,11 @@ const Index = () => {
/>
<AtCard
onClick={() => {
Taro.navigateTo({
url: "/pages/meetup/Detail/index?id=20231206",
});
}}
note=""
extra=""
title="[副业交流] 沙龙茶话会"
@@ -212,13 +219,14 @@ const Index = () => {
type="primary"
size="small"
className="submitBtn"
disabled={joinMeetup}
onClick={() => {
Taro.navigateTo({
url: "/pages/meetup/Detail/index?id=20231206",
});
}}
>
立即报名
{!!joinMeetup ? "已报名" : "立即报名"}
</AtButton>
</View>
</View>

View File

@@ -18,6 +18,11 @@ import { AtNavBar } from 'taro-ui'
// export default class Index extends Component {
const Meetup = () => {
const [current, setcurrent] = useState(1);
const [joinMeetup, setjoinMeetup] = useState(false);
const [pickData, setpickData] = useState({
selector: ["美国", "中国", "巴西", "日本"],
selectorChecked: "美国",
@@ -49,6 +54,14 @@ const Meetup = () => {
})
}
useEffect(()=>{
let newjoinMeetup=window.localStorage.getItem('joinMeetup')
setjoinMeetup(newjoinMeetup)
// window.localStorage.removeItem("joinMeetup");
// setjoinMeetup(false)
},[])
return (
<View className="my">
{/* <AtNavBar
@@ -114,13 +127,16 @@ const Meetup = () => {
type="primary"
size="small"
className="submitBtn"
disabled={joinMeetup}
onClick={() => {
Taro.navigateTo({
url: "/pages/meetup/Detail/index",
});
}}
>
立即报名
{!!joinMeetup?'已报名':'立即报名'}
</AtButton>
</View>
</View>