diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index 5241b2d..72966e1 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -20,6 +20,8 @@ import { AtIcon } from "taro-ui"; // export default class Index extends Component { const Index = () => { const [current, setcurrent] = useState(0); + const [openId, setopenId] = useState(null); + const [isOpened, setisOpened] = useState(false); const [joinMeetup, setjoinMeetup] = useState(false); @@ -44,6 +46,7 @@ const Index = () => { // window.alert(hashopenid) let newOpenid = window.localStorage.getItem("openid"); + // window.alert(newOpenid) if ( @@ -55,6 +58,7 @@ const Index = () => { // window.alert(newOpenid); window.localStorage.setItem("openid", hashopenid); + setopenId(hashopenid) } else { // window.alert('不存在') let nowUrl = window.location.href; @@ -210,9 +214,9 @@ const Index = () => { { - Taro.navigateTo({ - url: "/pages/meetup/Detail/index?id=20231206", - }); + // Taro.navigateTo({ + // url: "/pages/meetup/Detail/index?id=20231206", + // }); }} note="" extra="" @@ -232,7 +236,7 @@ const Index = () => { - [已报名] 4/10 + [报名中] 4/10 2023/12/06 星期三 @@ -242,6 +246,8 @@ const Index = () => { className="submitBtn" disabled={joinMeetup} onClick={() => { + // window.alert(window.location.href) + // return false Taro.navigateTo({ url: "/pages/meetup/Detail/index?id=20231206", }); diff --git a/src/pages/meetup/Detail/index.jsx b/src/pages/meetup/Detail/index.jsx index 1f1071e..307e2aa 100644 --- a/src/pages/meetup/Detail/index.jsx +++ b/src/pages/meetup/Detail/index.jsx @@ -31,24 +31,24 @@ const Detail = () => { setjoinMeetup(newjoinMeetup) }, []); - const handleClick = (value) => { - console.log("value", value); - setcurrent(value); - if (value == 2) { - // 跳转到目的页面,在当前页面打开 - Taro.navigateTo({ - url: "/pages/my/index", - }); - } else if (value == 0) { - Taro.navigateTo({ - url: "/pages/index/index", - }); - } else { - Taro.navigateTo({ - url: "/pages/meetup/index", - }); - } - }; + // const handleClick = (value) => { + // console.log("value", value); + // setcurrent(value); + // if (value == 2) { + // // 跳转到目的页面,在当前页面打开 + // Taro.navigateTo({ + // url: "/pages/my/index", + // }); + // } else if (value == 0) { + // Taro.navigateTo({ + // url: "/pages/index/index", + // }); + // } else { + // Taro.navigateTo({ + // url: "/pages/meetup/index", + // }); + // } + // }; const onBridgeReady = () => { WeixinJSBridge.call("hideOptionMenu"); diff --git a/src/pages/meetup/index.jsx b/src/pages/meetup/index.jsx index 23cde58..d2ee270 100644 --- a/src/pages/meetup/index.jsx +++ b/src/pages/meetup/index.jsx @@ -12,17 +12,13 @@ import { AtButton } from "taro-ui"; import { Picker } from "@tarojs/components"; import { AtList, AtListItem } from "taro-ui"; -import { AtNavBar } from 'taro-ui' - +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: "美国", @@ -47,20 +43,20 @@ const Meetup = () => { }); } }; - const goBack=()=>{ + const goBack = () => { // window.history.back(); Taro.navigateBack({ // delta: 2 - }) - } + }); + }; - useEffect(()=>{ - let newjoinMeetup=window.localStorage.getItem('joinMeetup') - setjoinMeetup(newjoinMeetup) + useEffect(() => { + let newjoinMeetup = window.localStorage.getItem("joinMeetup"); + setjoinMeetup(newjoinMeetup); // window.localStorage.removeItem("joinMeetup"); // setjoinMeetup(false) - },[]) + }, []); return ( @@ -100,7 +96,7 @@ const Meetup = () => { */} - { type="primary" size="small" className="submitBtn" - disabled={joinMeetup} - + disabled={joinMeetup} onClick={() => { Taro.navigateTo({ url: "/pages/meetup/Detail/index", }); }} > - {!!joinMeetup?'已报名':'立即报名'} - + {!!joinMeetup ? "已报名" : "立即报名"}