200 lines
4.1 KiB
TypeScript
200 lines
4.1 KiB
TypeScript
import { http } from '@/http/alova'
|
|
import type { IOrderListResult } from '@/api/types/teaSpecialist-order'
|
|
|
|
/**
|
|
* 修改用户信息
|
|
*/
|
|
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 function updateUserAvatar(avatar: string) {
|
|
return http.Post('/teamapi/user/editAvatar', { avatar })
|
|
}
|
|
|
|
/**
|
|
* 修改昵称
|
|
*/
|
|
export function updateUserNickname(nickname: string) {
|
|
return http.Post('/teamapi/user/editNickname', { nickname })
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取用户信息
|
|
*/
|
|
export function getUserInfo() {
|
|
return http.Post<any>('/teamapi/user/info')
|
|
}
|
|
|
|
/**
|
|
* 获取流水明细
|
|
*/
|
|
export interface IGetUserTransactionDetailsParams {
|
|
page: number
|
|
size: number
|
|
times: string
|
|
}
|
|
|
|
export function getUserTransactionDetails(data: IGetUserTransactionDetailsParams) {
|
|
return http.Post<IOrderListResult>('/teamapi/user/checkAccountList', data)
|
|
}
|
|
|
|
/**
|
|
* 获取流水明细详情(提现明细)
|
|
*/
|
|
export function getUserTransactionDetailsInfo(id: number) {
|
|
return http.Post<any>('/teamapi/user/reflectDetails', { 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('/teamapi/teamLogin/resetPassword', data, {
|
|
meta: { ignoreAuth: true }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 查询用户余额
|
|
*/
|
|
export function getUserBalance(store_id: number) {
|
|
return http.Post<any>('/storeapi/user/checkMoney', {store_id})
|
|
}
|
|
|
|
/**
|
|
* 修改个人信息
|
|
*/
|
|
// export function setUserAvatar() {
|
|
// return http.Post('/storeapi/user/updateUser', { avatar })
|
|
// }
|
|
|
|
/**
|
|
* 编辑工作时间
|
|
*/
|
|
export interface ISetUserWorkTimeParams {
|
|
work_day: string // 1,2,3,4,5也就是周一、二、三、四、五
|
|
work_start: string // 09:00
|
|
work_end: string // 18:00
|
|
}
|
|
|
|
export function setUserWorkTime(data: ISetUserWorkTimeParams) {
|
|
return http.Post('/teamapi/user/editWork', data)
|
|
}
|
|
|
|
|
|
/**
|
|
* 地址列表
|
|
*/
|
|
export interface IUserAddressListParams {
|
|
id: number
|
|
team_user_id: number
|
|
city_id: number
|
|
longitude: number
|
|
latitude: number
|
|
address: string
|
|
status: number
|
|
}
|
|
|
|
export function getUserAddressList() {
|
|
return http.Post<Array<IUserAddressListParams>>('/teamapi/user/addressList')
|
|
}
|
|
|
|
/**
|
|
* 获取已开通城市列表
|
|
*/
|
|
export function getOpenCityList() {
|
|
return http.Post<any>('/teamapi/user/teaStoreCity')
|
|
}
|
|
|
|
/**
|
|
* 新增地址
|
|
*/
|
|
export interface IAddUserAddressListParams {
|
|
city_id: number
|
|
longitude: number
|
|
latitude: number
|
|
address: string
|
|
}
|
|
export function addUserAddress(data: IAddUserAddressListParams) {
|
|
return http.Post('/teamapi/user/addAddress', data)
|
|
}
|
|
|
|
/**
|
|
* 编辑地址
|
|
*/
|
|
export function editUserAddress(data: IAddUserAddressListParams & { id: number }) {
|
|
return http.Post('/teamapi/user/editAddress', data)
|
|
}
|
|
|
|
/**
|
|
* 删除地址
|
|
*/
|
|
export function deleteUserAddress(id: number) {
|
|
return http.Post('/teamapi/user/delAddress', { id })
|
|
}
|
|
|
|
/**
|
|
* 位置更新
|
|
*/
|
|
export function updateUserAddressLocation(id: number) {
|
|
return http.Post('/teamapi/user/selAddress', { id })
|
|
}
|
|
|
|
/**
|
|
* 地址详情
|
|
*/
|
|
export function getUserAddressInfo(id: number) {
|
|
return http.Post<any>('/teamapi/user/addressDetails', { id })
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取配置项
|
|
*/
|
|
export function getConfigItem() {
|
|
return http.Post<any>('/teamapi/setting/set', null, {
|
|
meta: { ignoreAuth: true }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 更新用户上下班状态
|
|
*/
|
|
export function updateWorkState(state: number) {
|
|
return http.Post<any>('/teamapi/user/updateState', {state})
|
|
} |