/**
 * 这是用户业务逻辑的服务
 */
export default class UserService {
    constructor(AjaxService) {
        Object.assign(this, { AjaxService })
        this.name = 'UserService'
    }
    /* 初始化授权登录 */
    UserLoginAuthApplets (data = {}) {
        return this.AjaxService.post({
            url: '/user/login/auth/applets',
            data,
            isLoading: false,
            isHost:true
        })
    }
    /* 邀请码授权登录 */
    InvitationCodeLogin (data = {}) {
        return this.AjaxService.post({
            url: '/user/login/auth/invitation',
            data,
            isLoading: true,
            isStatus: false,
            isHost:true
        })
    }
    /* 个人机构注册 */
    UserRegisterClub (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/register/club', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 供应商注册 */ 
    SupplierAppletsRegistered (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/register/shop', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 * 账号登录
	 * @param mobileOrEmail 邮箱或手机
	 * @param password	密码
	 * @param source 来源 PC与小程序传:'www'crm就传'crm'
	 */
    AorganizationLogin (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/login/password', 
            data, 
            isLoading: true ,
            isStatus: true,
            isHost:true
        })
    }
    /* 查询机构资料*/
    OrganizationUpdateModifyInfo (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/club/info',
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 协销拉机构上线(查询暂时数据)*/
    UseRregisterTemporaryInfo (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/register/temporary/data',
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 机构升级资质机构 */
    OrganizationRegister (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/register/club/upgrade', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 机构提交资料修改 */
    OrganizationUpdate (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/club/info/update', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 供应商资料信息-数据回显 */
    SupplierShopInfo (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/shop/info', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 供应商修改申请信息保存 */
    SupplierUpdateCompanyInfo (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/register/shop/apply', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /* 供应商资料信息-提交修改 */
    SupplierModifiedData (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/shop/info/update', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 *运营人员绑定微信
	 */
    BindingWechat (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/login/auth/bind', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /*个人机构取消提示*/
    CancelPrompt (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/register/guide', 
            data, 
            isLoading: false ,
            isHost:true
        })
    }
    /**
	 * 找回密码&修改密码
	 * @param: mobileOrEmail	手机号或邮箱	
	 * @param: password			密码
	 * @param: passwordConfirm	用户确认密码
	 * @param: smsCode			短信验证码
	 * @param: status			1:手机号找回,2:邮箱找回
	*/
    ModifyMobilePassword (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/update/password', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 * 更换手机号
	 * @param: mobile			原手机号	
	 * @param: newMobile		新手机号
	 * @param: smsCode			原手机号验证码
	 * @param: newSmsCode		新手机号验证码
	 * @param: userId			用户userId
	*/
    UserUpdateMobile (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/update/mobile', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 * @机构-地址列表
	 * @param:userId 用户ID(必传)，
	 * @param:pageNum 页码
	 * @param:pageSize 每页条数
	 */
    QueryAddressList (data = {}) {
        return this.AjaxService.get({ 
            url:'/order/address/list', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 * @机构-添加&&修改地址
	 * @param:userId 用户ID(必传)，
	 * @param:地址信息，
	 */
    AddressSave (data = {}) {
        return this.AjaxService.post({ 
            url:'/order/address/save', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 * @机构-删除地址
	 * @param:userId 用户ID(必传)，
	 * @param:地址信息，
	 */
    DeleteAddress (data = {}) {
        return this.AjaxService.post({ 
            url:'/order/address/delete', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 * @机构-个人中心
	 * @param:userId 用户ID(必传)，
	 */
    PersonalInfo (data = {}) {
        return this.AjaxService.get({ 
            url:'/personalCenter/myCentre', 
            data, 
            isLoading: false ,
        })
    }
    /**
	 * @机构-获取账户余额明细
	 * @param:userId 用户ID(必传)，
	 */
    GetAccountInfo (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/center/balance', 
            data, 
            isLoading: true ,
        })
    }
    /* 运营人员管理-列表 */
    QueryOperatorList (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/operation/list', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /* 运营人员管理-添加 */
    PostAddOperator (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/operation/save', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /* 运营人员管理-删除 */
    PostDeleteOperator (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/operation/delete', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /* 运营人员管理-更新邀请码 */
    PostUpdateOperatorCode (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/operation/code/update', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 *@协销帮机构注册 待注册列表
	 *@param userId	协销用户userId
	 *@param searchName 关键词
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    SellerUserTemporaryClub (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/seller/temporary/club', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 *@协销待注册列表 删除操作
	 *@param ID
	 */
    SellerDeleteUserTemporaryClub (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/seller/delete/temporary/club', 
            data, 
            isLoading: true ,
            isHost:true
        })
    }
    /**
	 *@获取采美豆状态 
	 *@userId userId
	 */
    GetHomeObtainBeans (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/club/obtain/beans', 
            data, 
            isLoading: false,
            isHost:true
        })
    }
    /**
	 *@获取机构个人中心
	 *@userId userId
	 */
    GetClubObtainCenter (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/club/home', 
            data, 
            isLoading: false,
            isHost:true
        })
    }
    /**
	 *@机构采美豆收支明细 
	 *@param userId	机构用户userId
	 *@param year 年份
	 *@param month 月份
	 *@param type 收支类型：全部0  1收入  2支出
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    GetUserClubBeansList (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/club/beans/history', 
            data, 
            isLoading: false,
            isHost:true
        })
    }
    /**
	 *@机构资料备注列表 
	 *@param clubId	机构用户clubId
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    getUserClubRemarksList (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/club/remarks/list', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 *@机构资料备注保存
	 *@param clubId	机构用户clubId
	 */
    getUserClubRemarksSave (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/club/remarks/save', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 *@机构资料备注详情
	 *@param remarksId	备注Id
	 */
    getUserClubRemarksDetail (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/club/remarks/detail', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 *@机构资料备注删除
	 *@param remarksId	备注Id
	 */
    getUserClubRemarksDelete (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/club/remarks/delete', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 *@会员中心
	 *@param userId	用户Id
	 */
    getUserSuperCenter (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/super/center', 
            data, 
            isLoading: false,
            isHost:true
        })
    }
    /**
	 *@会员购买记录
	 *@param userId	用户Id
	 *@param pageNum	页码
	 *@param pageSize	条数
	 */
    getUserSuperHistory (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/super/history', 
            data, 
            isLoading: true,
            isHost:true
        })
    }
    /**
	 *@超级会员套餐
	 */
    getUserSuperPackage (data = {}) {
        return this.AjaxService.get({ 
            url:'/user/super/package', 
            data, 
            isLoading: true,
            isHost:true
        })
    }		
}