254 lines
5.6 KiB
TypeScript
254 lines
5.6 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>('/api/user/info')
|
|
}
|
|
|
|
/**
|
|
* 获取优惠券列表
|
|
*/
|
|
export function getUserCoupons() {
|
|
return http.Post('/api/UserCoupon/UserCoupinList')
|
|
}
|
|
|
|
/**
|
|
* 获取用户地址
|
|
*/
|
|
export function getUserAddress() {
|
|
return http.Post('/api/user/addressList')
|
|
}
|
|
|
|
/**
|
|
* 用户添加地址
|
|
*/
|
|
export interface IAddUserAddressParams {
|
|
id: number
|
|
contact: string
|
|
telephone: string
|
|
// city_id: number
|
|
longitude: number,
|
|
latitude: number,
|
|
address: string
|
|
// is_default: number
|
|
}
|
|
|
|
export function addUserAddress(data: IAddUserAddressParams) {
|
|
return http.Post<IUserAddressListResult>('/api/user/addAddress', data)
|
|
}
|
|
|
|
/**
|
|
* 编辑用户地址
|
|
*/
|
|
export interface IEditUserAddressParams extends IAddUserAddressParams {
|
|
id: number
|
|
}
|
|
|
|
export function editUserAddress(data: IAddUserAddressParams) {
|
|
return http.Post('/api/user/editAddress', data)
|
|
}
|
|
|
|
/**
|
|
* 删除用户地址
|
|
*/
|
|
export interface IDeleteUserAddressParams {
|
|
id: number
|
|
}
|
|
|
|
export function deleteUserAddress(data: IDeleteUserAddressParams) {
|
|
return http.Post('/api/user/delAddress', data)
|
|
}
|
|
|
|
/**
|
|
* 获取地址详情
|
|
*/
|
|
|
|
export interface IUserAddressDetailsParams extends IDeleteUserAddressParams {}
|
|
export function userAddressDetails(data: IUserAddressDetailsParams) {
|
|
return http.Post<IUserAddressDetailsResult>('/api/user/addressDetails', data)
|
|
}
|
|
|
|
/**
|
|
* 优惠券列表(从订单页获取)
|
|
*/
|
|
export interface IGetCouponsParams {
|
|
type_id: number
|
|
price: number
|
|
}
|
|
|
|
export function getCoupons(data: IGetCouponsParams) {
|
|
return http.Post<any>('/api/UserCoupon/UserCoupinList', data)
|
|
}
|
|
|
|
/**
|
|
* 个人中心优惠券
|
|
*/
|
|
export function getMyCoupon() {
|
|
return http.Post<IUserCouponListResult>('/api/UserCoupon/coupinList')
|
|
}
|
|
|
|
/**
|
|
* 领取个人中心优惠券
|
|
*/
|
|
export interface IClaimMyCouponParams {
|
|
id: number
|
|
}
|
|
|
|
export function claimMyCoupon(data: IClaimMyCouponParams) {
|
|
return http.Post('/api/UserCoupon/receiveCoupon', data)
|
|
}
|
|
|
|
|
|
/**
|
|
* 金额使用记录
|
|
*/
|
|
export interface IGetUserMoneyLogParams {
|
|
page: number
|
|
size: number
|
|
month: string
|
|
}
|
|
|
|
export function getUserMoneyLog(data: IGetUserMoneyLogParams) {
|
|
return http.Post<any>('/api/user/moneyLogList', data)
|
|
}
|
|
|
|
/**
|
|
* 修改用户信息
|
|
*/
|
|
export interface IUpdateUserInfoParams {
|
|
field: string,
|
|
value: string | number
|
|
}
|
|
|
|
export function updateUserInfo(data: IUpdateUserInfoParams) {
|
|
return http.Post('/api/user/setInfo', data)
|
|
}
|
|
|
|
/**
|
|
* 抖音验券
|
|
*/
|
|
export interface ICheckDouyinCouponParams {
|
|
store_id: number,
|
|
code: string,
|
|
type: number // 1是手动输入 2是扫码
|
|
}
|
|
|
|
export function checkDouyinCoupon(data: ICheckDouyinCouponParams) {
|
|
return http.Post('/api/DouyinAfterVerifi/setDouy', data)
|
|
}
|
|
|
|
/**
|
|
* 会员记录
|
|
*/
|
|
export function getUserMember() {
|
|
return http.Post<any>('/api/user/UserMember')
|
|
}
|
|
|
|
/**
|
|
* 流水账单详情
|
|
*/
|
|
export function getUserBillDetails(id: number) {
|
|
return http.Post<any>('/api/user/accountDetails', {id})
|
|
}
|
|
|
|
/**
|
|
* 转让订单
|
|
*/
|
|
export function transferOrder(order_id: number) {
|
|
return http.Post('/api/order/transferOrder', {order_id})
|
|
}
|
|
|
|
/**
|
|
* 用户一件授权手机号
|
|
*/
|
|
export function getMobileByMnp(code: string) {
|
|
return http.Post('/api/user/getMobileByMnp', {code})
|
|
}
|
|
|
|
/**
|
|
* 用户开门
|
|
*/
|
|
export function openLock(order_id: number, type: number) {
|
|
return http.Post('/api/Common/ce_ttlock', {order_id, type})
|
|
}
|
|
|
|
/**
|
|
* 门店余额记录
|
|
*/
|
|
export function getStoreBalanceLog() {
|
|
return http.Post<any>('/api/user/userStoreMoneyList', {})
|
|
}
|
|
|
|
/**
|
|
* 获取验证码
|
|
*/
|
|
export interface IGetStoreVerificationCodeParams {
|
|
mobile: string
|
|
scene: string
|
|
}
|
|
|
|
export function getVerificationCode(data: IGetStoreVerificationCodeParams) {
|
|
return http.Post('/storeapi/sms/sendCode', data, {
|
|
meta: { ignoreAuth: true }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 添加申请茶艺师
|
|
*/
|
|
export interface IAddTeaSpecialistParams {
|
|
license_img: string // 营业执照
|
|
username: string // 茶艺师名字
|
|
gender: number // 茶艺师性别(1男 2女)
|
|
both: number | string // 出生年月
|
|
height: string // 身高
|
|
weight: string // 体重
|
|
hobby_introduce: string // 兴趣爱好介绍
|
|
city_id: number // 城市ID
|
|
avatar: string // 头像
|
|
certificate: string // 健康证、资格证书信息
|
|
mobile: string // 联系电话
|
|
code: string // 验证码
|
|
}
|
|
|
|
export function addTeaSpecialist(data: IAddTeaSpecialistParams) {
|
|
return http.Post('/api/submitForm/addTeamaster', data)
|
|
}
|
|
|
|
/**
|
|
* 查看申请茶艺师表单状态
|
|
*/
|
|
export function getTeaSpecialistStatus() {
|
|
return http.Post<any>('/api/submitForm/teamasterRealStatus')
|
|
}
|
|
|
|
/**
|
|
* 添加加盟合作
|
|
*/
|
|
export interface IAddJoinCooperationParams {
|
|
operation_type: number // 加盟类型
|
|
license_img: string // 营业执照
|
|
username: string // 联系人姓名
|
|
mobile: string // 联系电话
|
|
code: string // 验证码
|
|
city_id: number // 城市ID
|
|
address: string // 详细地址
|
|
suggest: string // 意见建议
|
|
}
|
|
|
|
export function addJoinCooperation(data: IAddJoinCooperationParams) {
|
|
return http.Post('/api/submitForm/addStore', data)
|
|
}
|
|
|
|
/**
|
|
* 查看加盟合作表单状态
|
|
*/
|
|
export function getJoinCooperationStatus() {
|
|
return http.Post<any>('/api/submitForm/StoreRealStatus')
|
|
} |