|
|
@@ -1,10 +1,12 @@
|
|
|
import Buttons from "@/components/Buttons";
|
|
|
import { clear, logout } from "@/services/user";
|
|
|
-import { View, Text } from "@tarojs/components";
|
|
|
-import { useDispatch } from "react-redux";
|
|
|
+import { View, Text,Image } from "@tarojs/components";
|
|
|
+import { useDispatch, useSelector } from "react-redux";
|
|
|
+import './Profile.scss'
|
|
|
|
|
|
export default function Page() {
|
|
|
const dispatch = useDispatch();
|
|
|
+ const user = useSelector((state: any) => state.user);
|
|
|
function logoutF() {
|
|
|
dispatch(logout() as any);
|
|
|
}
|
|
|
@@ -12,11 +14,23 @@ export default function Page() {
|
|
|
function clearF() {
|
|
|
dispatch(clear() as any);
|
|
|
}
|
|
|
-
|
|
|
- return <View>
|
|
|
- <Buttons title='退出登录' onClick={logoutF} style={{ width: 289, marginBottom: 30 }} />
|
|
|
|
|
|
- <Buttons title='注销账号' onClick={clearF} style={{ width: 289, marginBottom: 30 }} />
|
|
|
+ return <View className="container">
|
|
|
+ <View className="row">
|
|
|
+ <Text>头像</Text>
|
|
|
+ <Image src={user.avatar} className="avatar" />
|
|
|
+ </View>
|
|
|
+ <View className="row">
|
|
|
+ <Text>昵称</Text>
|
|
|
+ <Text>{user.nickname}</Text>
|
|
|
+ </View>
|
|
|
+ <View className="row">
|
|
|
+ <Text>用户名</Text>
|
|
|
+ <Text>{user.username}</Text>
|
|
|
+ </View>
|
|
|
+ {/* <Buttons title='退出登录' onClick={logoutF} style={{ width: 289, marginBottom: 30 }} />
|
|
|
+
|
|
|
+ <Buttons title='注销账号' onClick={clearF} style={{ width: 289, marginBottom: 30 }} /> */}
|
|
|
|
|
|
|
|
|
</View>
|