diff --git a/src/pages.json b/src/pages.json index bcd945d..a28244d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -113,6 +113,15 @@ { "navigationBarTitleText" : "设置" } + }, + { + "path" : "profile/profile", + "style" : + { + "navigationStyle": "custom", + "navigationBarTextStyle": "white", + "navigationBarTitleText" : "个人中心" + } } ] } diff --git a/src/pagesMember/profile/profile.vue b/src/pagesMember/profile/profile.vue new file mode 100644 index 0000000..f1c0a52 --- /dev/null +++ b/src/pagesMember/profile/profile.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/src/services/profile.ts b/src/services/profile.ts new file mode 100644 index 0000000..eb224f0 --- /dev/null +++ b/src/services/profile.ts @@ -0,0 +1,12 @@ +import type { ProfileDetail } from '@/types/member' +import { http } from '@/utils/http' + +/** + * 获取个人信息 + */ +export const getMemberProfileAPI = () => { + return http({ + method: 'GET', + url: '/member/profile', + }) +} diff --git a/src/types/member.d.ts b/src/types/member.d.ts index 05a7384..85dda74 100644 --- a/src/types/member.d.ts +++ b/src/types/member.d.ts @@ -1,5 +1,5 @@ -/** 小程序登录 登录用户信息 */ -export type LoginResult = { +/** 封装通用信息 */ +type BaseProfile = { /** 用户ID */ id: number /** 头像 */ @@ -8,8 +8,26 @@ export type LoginResult = { account: string /** 昵称 */ nickname?: string +} + +/** 小程序登录 登录用户信息 */ +export type LoginResult = BaseProfile & { /** 手机号 */ mobile: string /** 登录凭证 */ token: string } + +/** 个人信息 用户详情信息 */ +export type ProfileDetail = BaseProfile & { + /** 性别 */ + gender?: Gender + /** 生日 */ + birthday?: string + /** 省市区 */ + fullLocation?: string + /** 职业 */ + profession?: string +} +/** 性别 */ +export type Gender = '女' | '男'