/**
 * 这是用户业务逻辑的服务
 */
export default class UserService {
    constructor(AjaxService) {
        Object.assign(this, {
            AjaxService
        })
        this.name = 'UserService'
    }
    /* 初始化授权登录 */
    UserWechatAuthorLogin(data = {}) {
        return this.AjaxService.get({
            url: '/user/he/authorization',
            data,
            isLoading: false,
            isStatus: false,
            isHost: true
        })
    }
    /* 手机号验证码登录 */
    UserMobileLogin(data = {}) {
        return this.AjaxService.post({
            url: '/user/he/mobile/login',
            data,
            isLoading: false,
            isStatus: false
        })
    }
    /**
     * @地址列表查询
     * @param:userId 用户ID(必传)，
     * @param:pageNum 页码
     * @param:pageSize 每页条数
     */
    QueryAddressList(data = {}) {
        return this.AjaxService.get({
            url: '/other/findAddress',
            data,
            isLoading: false
        })
    }
    /**
     * @添加&&修改地址
     */
    AddOtherSaveAddress(data = {}) {
        return this.AjaxService.post({
            url: '/other/saveAddress',
            data,
            isLoading: true
        })
    }
    /**
     * @删除地址
     * @param:addressId 地址ID，，
     */
    DeleteOtherAddress(data = {}) {
        return this.AjaxService.get({
            url: '/other/deleteAddress',
            data,
            isLoading: true
        })
    }
    /**
     * @设置默认地址
     * @param:userId 用户ID(必传)，
     * @param:addressId 地址ID，
     */
    SetDefaultOtherAddress(data = {}) {
        return this.AjaxService.get({
            url: '/other/defaultAddress',
            data,
            isLoading: false
        })
    }
    /**
     * @设置默认地址
     * @param:userId 用户ID(必传)，
     * @param:addressId 地址ID，
     */
    GetUserOrderTotal(data = {}) {
        return this.AjaxService.get({
            url: '/order/order/total',
            data,
            isLoading: false
        })
    }
}
