You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

267 lines
6.0 KiB

10 months ago
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {ItemObject, PageQuery, UploadImageData} from '~/types/global'
import {AddressInfo, BindingPhone, LoginCaptcha, LoginFrom, RegisterReset, UseInfoFrom} from "~/types/user";
import {PayPayment} from "~/types/order";
/**
* h5用户登录
* @param params object
*/
export const loginPassword = (params: LoginFrom) => {
return $request.post({ url: 'front/login/mobile/password', params })
}
/**
* h5用户手机号
* @param data object
*/
export const loginMobile = (params: LoginFrom) => {
return $request.post({ url: 'front/login/mobile/captcha', params })
}
/**
* 退
* @param data object
*/
export const loginLogout = () => {
return $request.get({ url: 'front/login/logout' })
}
/**
* key
*/
export const getCodeApi = () => {
return $request.get({ url: 'front/verify_code' })
}
/**
* h5用户发送验证码
* @phone string
*/
export const registerVerify = (params: ItemObject) => {
return $request.post({ url: 'front/login/send/code', params})
}
/**
*
* @param params
*/
export const getCollectProApi = (params: PageQuery) => {
return $request.get({ url: 'front/collect/product/list', params })
}
/**
*
* @param params
*/
export const getCollectCancelProApi = (params) => {
return $request.post({ url: 'front/collect/cancel/product', params })
}
/**
*
* @param params
*/
export const getCityListApi = (params) => {
return $request.get({ url: 'front/city/list', params })
}
/**
*
* @param params
*/
export const addressAddApi = (params) => {
return $request.post({ url: 'front/address/add', params })
}
/**
*
* @param params
*/
export const collectMerchantApi = (params: PageQuery) => {
return $request.get({ url: 'front/collect/merchant/list', params })
}
/**
*
* @id number
*/
export const collectCancelMerchantApi = (id: number) => {
return $request.post({ url: `front/collect/cancel/merchant/${id}` })
}
/**
*
*/
export const browseRecordApi = () => {
return $request.get({ url: `front/user/center/browse/record` })
}
/**
*
*/
export const uploadImageApi = (model: string, pid: string, params: any) => {
return $request.post<UploadImageData>({ url: `front/upload/image?model=${model}&pid=${pid}`, params })
}
/**
*
*/
export const balanceRecordApi = (params: PageQuery) => {
return $request.get({ url: `front/user/center/balance/record`, params })
}
/**
*
*/
export const myAccountApi = () => {
return $request.get({ url: `front/user/center/my/account` })
}
/**
*
*/
export const integralListApi = (params: PageQuery) => {
return $request.get({ url: `front/user/center/integral/list`, params })
}
/**
*
*/
export const myIntegralApi = () => {
return $request.get({ url: `front/user/center/my/integral` })
}
/**
*
*/
export const couponUserListApi = (params: PageQuery) => {
return $request.get({ url: `front/coupon/user/list`, params })
}
/**
*
* @param {Object} params
*/
export const knowUserSmsCaptchaApi = (params: any) => {
return $request.post({ url: `front/safety/check`, params })
}
/**
*
* @param {Object} params
*/
export const knowUserCaptchaApi = (params: any) => {
return $request.post({ url: `front/safety/get`, params })
}
/**
*
*/
export const agreementInfoApi = (info: string) => {
console.log(info)
return $request.get({ url: `front/agreement/${info}` })
}
/**
*
*/
export const addressListApi = () => {
return $request.get({ url: `front/address/list` })
}
/**
*
*/
export const setAddressDefaultApi = (id:number) => {
return $request.post({ url: `front/address/set/default/${id}` })
}
/**
*
*/
export const addressEditApi = (params:AddressInfo) => {
return $request.post({ url: `front/address/edit`,params })
}
/**
*
*/
export const addressDelApi = (id:number) => {
return $request.post({ url: `front/address/delete/${id}` })
}
/**
*
*/
export const addressDetailApi = (id:number) => {
return $request.get({ url: `front/address/detail/${id}` })
}
/**
*
*/
export const userInfoApi = () => {
return $request.get({ url: `front/user/info` })
}
/**
*
*/
export const userEditApi = (params:UseInfoFrom) => {
return $request.post({ url: `front/user/user/edit`, params })
}
/**
*
*/
export const userPhoneCodeApi = () => {
return $request.post({ url: `front/user/phone/code` })
}
/**
*
*/
export const bindingPhoneCodeApi = (params:BindingPhone) => {
return $request.post({ url: `front/user/update/binding/phone/code`, params })
}
/**
*
*/
export const updateBindingApi = (params:BindingPhone) => {
return $request.post({ url: `front/user/update/binding`, params })
}
/**
*
*/
export const registerResetApi = (params:RegisterReset) => {
return $request.post({ url: `front/user/register/reset`, params })
}
/**
*
*
*/
export const orderReplyListApi = (params) => {
return $request.get({ url: `front/order/reply/list`, params })
}
/**
* token是否有效
*
*/
export const tokenIsExistApi = () => {
return $request.post({ url: `front/login/token/is/exist` })
}