feat: 获取openid
This commit is contained in:
@@ -9,12 +9,26 @@ 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);
|
||||
@@ -36,7 +50,13 @@ const My = () => {
|
||||
return (
|
||||
<View className="my">
|
||||
{/* <Text>Hello world!</Text> */}
|
||||
{/* <AtAvatar image='https://cdn.huodongxing.com/logo/202312/8732019012100/promoteMini.png'></AtAvatar> */}
|
||||
|
||||
<View className="myAtAvatar">
|
||||
<AtAvatar className="AtAvatar" image={avatar}></AtAvatar>
|
||||
<AtTag type="primary" circle>
|
||||
新注册用户
|
||||
</AtTag>
|
||||
</View>
|
||||
|
||||
<AtList>
|
||||
<AtListItem
|
||||
@@ -54,7 +74,7 @@ const My = () => {
|
||||
/>
|
||||
</AtList>
|
||||
|
||||
{/* <View className="indexTablebar">
|
||||
<View className="indexTablebar">
|
||||
<AtTabBar
|
||||
tabList={[
|
||||
{ title: "首页", text: "" },
|
||||
@@ -64,7 +84,7 @@ const My = () => {
|
||||
onClick={(value) => handleClick(value)}
|
||||
current={current}
|
||||
/>
|
||||
</View> */}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
.my{
|
||||
|
||||
|
||||
.myAtAvatar{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
// background-color: #f4ffb8;
|
||||
// padding-left: 20px;
|
||||
// padding-right: 20px;
|
||||
.AtAvatar{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.indexTablebar {
|
||||
position: fixed;
|
||||
|
||||
Reference in New Issue
Block a user