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

View File

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