import { Component } from "react"; import { View, Text, Image } from "@tarojs/components"; import "./index.scss"; import { AtTabBar } from "taro-ui"; import React, { useCallback, useEffect, useState } from "react"; import { AtGrid } from "taro-ui"; import { Swiper, SwiperItem } from "@tarojs/components"; import { AtCard } from "taro-ui"; import { AtImagePicker } from "taro-ui"; import Taro from "@tarojs/taro"; import { AtAvatar } from "taro-ui"; import { AtTag } from "taro-ui"; import { AtList, AtListItem } from "taro-ui"; import avatar from "../../images/avatar.jpg"; // export default class Index extends Component { const My = () => { const [current, setcurrent] = useState(2); const [wxid, setwxid] = useState(null); useEffect(()=>{ getWxid() },[]) const getWxid = () => { let newWxid = window.localStorage.getItem("wxid"); if (!!newWxid) { setwxid(newWxid); } }; 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", }); } }; return ( {/* Hello world! */} 新注册用户 handleClick(value)} current={current} /> ); }; export default My;