85 lines
1.9 KiB
TypeScript
85 lines
1.9 KiB
TypeScript
import { http } from '@/http/alova'
|
|
import type { IUserAddressListResult, IUserAddressDetailsResult, IUserCouponListResult } from '@/api/types/user'
|
|
import type { IOrderListResult } from '@/api/types/teaSpecialist-order'
|
|
import type { IUserResult } from '@/api/types/user'
|
|
|
|
|
|
/**
|
|
* 获取用户个人信息
|
|
*/
|
|
export function getUserInfo() {
|
|
return http.Post<IUserResult>('/storeapi/user/info')
|
|
}
|
|
|
|
/**
|
|
* 修改用户信息
|
|
*/
|
|
export interface IUpdateUserInfoParams {
|
|
nickname?: string
|
|
avatar?: string
|
|
mobile?: number
|
|
band_mobile?: string
|
|
password?: string
|
|
code?: string
|
|
}
|
|
|
|
export function updateUserInfo(data: IUpdateUserInfoParams) {
|
|
return http.Post('/storeapi/user/updateUser', data)
|
|
}
|
|
|
|
/**
|
|
* 获取流水明细
|
|
*/
|
|
export interface IGetUserTransactionDetailsParams {
|
|
page: number
|
|
size: number
|
|
end_time: string
|
|
}
|
|
|
|
export function getUserTransactionDetails(data: IGetUserTransactionDetailsParams) {
|
|
return http.Post<IOrderListResult>('/storeapi/user/balanceLogList', data)
|
|
}
|
|
|
|
/**
|
|
* 获取流水明细详情(账单明细)
|
|
*/
|
|
export function getUserTransactionDetailsInfo(id: number) {
|
|
return http.Post<any>('/storeapi/user/balanceLogDetails', { id })
|
|
}
|
|
|
|
/**
|
|
* 获取验证码
|
|
*/
|
|
export interface IGetStoreVerificationCodeParams {
|
|
mobile: string
|
|
scene: string
|
|
}
|
|
|
|
export function getVerificationCode(data: IGetStoreVerificationCodeParams) {
|
|
return http.Post('/storeapi/sms/sendCode', data, {
|
|
meta: { ignoreAuth: true }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 重置密码
|
|
*/
|
|
export interface IResetPasswordParams {
|
|
mobile: string
|
|
code: string
|
|
password: string
|
|
password_confirm: string
|
|
}
|
|
|
|
export function resetPassword(data: IResetPasswordParams) {
|
|
return http.Post('/storeapi/storeLogin/resetPassword', data, {
|
|
meta: { ignoreAuth: true }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 查询用户余额
|
|
*/
|
|
export function getUserBalance(store_id: number) {
|
|
return http.Post<any>('/storeapi/user/checkMoney', {store_id})
|
|
} |