diff --git a/src/api/user/index.ts b/src/api/user/index.ts index 74fa86d..2dfacbf 100644 --- a/src/api/user/index.ts +++ b/src/api/user/index.ts @@ -1,7 +1,7 @@ /** * 用户信息相关接口 */ -import type { LoginParams, LoginResult } from './types'; +import type { LoginParams, LoginResult, RegisterParams } from './types'; import { get, post } from '@/utils/request'; import type { UserState } from '@/store/modules/user/types'; @@ -9,6 +9,7 @@ enum URL { // login = '/member/login', login = '/wc/wechat/LoginByMa', loginByCode = '/wc/wechat/LoginByMaCode', + register = '/wc/wechat/register', logout = '/user/logout', profile = '/user/profile', addressList = '/ext/addr/list', @@ -22,6 +23,9 @@ enum URL { export const getUserProfile = () => get({ url: URL.profile }); export const login = (data: LoginParams) => post({ url: URL.login, data }); export const loginByCode = (code: string, companyId: string) => post({ url: URL.loginByCode + `?code=${code}` }); + +export const register = (data: RegisterParams) => post({ url: URL.register, data }); + export const logout = () => post({ url: URL.logout }); export const getAddressList = () => get({ url: URL.addressList }); @@ -31,3 +35,9 @@ export const addressUpdate = (data: any) => post({ url: URL.addressUpdate, export const addressDelete = (id: string) => post({ url: URL.addressDelete + `?id=${id}` }); export const getDynamicCode = () => post({ url: URL.dynamicCode }); + +export const getCouponList = (params: { + obj: { memberId: string, status: number }, + pageNum: number, + pageSize: number +}) => get({ url: '/couponseUse/pageList' }); diff --git a/src/api/user/types.ts b/src/api/user/types.ts index 5f9b590..2855de9 100644 --- a/src/api/user/types.ts +++ b/src/api/user/types.ts @@ -7,6 +7,19 @@ export interface LoginParams { referrerUserId: string; } +export interface RegisterParams { + unionId: string, + openId: string, + maOpenId: string, + image: string, + nickName: string, + telephone: string, + birthday: string, + companyId: string, + creatorId: string, + gender: number +} + export interface LoginByCodeParams { code: string; } diff --git a/src/pages.json b/src/pages.json index a8e557b..92a1d92 100644 --- a/src/pages.json +++ b/src/pages.json @@ -120,7 +120,7 @@ } }, { - "path": "coupon/coupon-list", + "path": "coupon/index", "style": { "navigationBarTitleText": "优惠券" } @@ -138,7 +138,7 @@ } }, { - "path": "trade/trade-list", + "path": "trade/index", "style": { "navigationBarTitleText": "消费记录" } diff --git a/src/pages/common/login/index.vue b/src/pages/common/login/index.vue index 758b79b..102fb15 100644 --- a/src/pages/common/login/index.vue +++ b/src/pages/common/login/index.vue @@ -1,45 +1,14 @@