/**
 * 这是用户业务逻辑的服务
 */
export default class UserService {
    constructor(AjaxService) {
        Object.assign(this, {
            AjaxService
        })
        this.name = 'UserService'
    }
    /* 初始化授权登录 */
    UserLoginAuthApplets(data = {}) {
        return this.AjaxService.post({
            url: '/user/login/auth/appletsOrganize',
            data,
            isLoading: false,

        })
    }
    /* 注册第一步校验 */
    checkRegisterClub(data = {}) {
        return this.AjaxService.get({
            url: '/user/register/accountInfo',
            data,
            isLoading: false,
        })
    }
    /* 机构注册提交审核 */
    userAccountRegister(data = {}) {
	    return this.AjaxService.post({
	        url: '/user/register/accountRegister',
	        data,
	        isLoading: true,
	    })
    }
    /* 供应商注册 */
    SupplierAppletsRegistered(data = {}) {
        return this.AjaxService.post({
            url: '/user/register/shop',
            data,
            isLoading: 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,

        })
    }
	
    /**
	 * 短信验证登录
	 * @param mobileOrEmail 邮箱或手机
	 * @param password	密码
	 * @param unionId	微信unionId
	 */
    userCodeLogin(data = {}) {
        return this.AjaxService.post({
            url: '/user/login/codeLogin',
            data,
            isLoading: true,
            isStatus: true,

        })
    }
    /**
	 * 获取登录验证码
	 * @param mobile 手机号
	 */
    userLoginCode(data = {}) {
        return this.AjaxService.get({
            url: '/user/sms/code',
            data,
            isLoading: true
        })
    }
	
    /* 查询机构资料*/
    OrganizationUpdateModifyInfo(data = {}) {
        return this.AjaxService.get({
            url: '/user/club/info',
            data,
            isLoading: true,

        })
    }
    /* 机构升级资质机构 */
    OrganizationRegister(data = {}) {
        return this.AjaxService.post({
            url: '/user/register/club/upgrade',
            data,
            isLoading: true,

        })
    }
    /* 机构提交资料修改 */
    updateOrganize(data = {}) {
        return this.AjaxService.post({
            url: '/user/club/info/updateOrganize',
            data,
            isLoading: true,

        })
    }
    /* 机构提交资料修改 */
    againUpdateOrganize(data = {}) {
        return this.AjaxService.post({
            url: '/user/club/info/organizeClubinfo',
            data,
            isLoading: true,
        })
    }
    /* 供应商资料信息-数据回显 */
    SupplierShopInfo(data = {}) {
        return this.AjaxService.get({
            url: '/user/shop/info',
            data,
            isLoading: true,

        })
    }
    /* 供应商修改申请信息保存 */
    SupplierUpdateCompanyInfo(data = {}) {
        return this.AjaxService.post({
            url: '/user/register/shop/apply',
            data,
            isLoading: true,

        })
    }
    /* 供应商资料信息-提交修改 */
    SupplierModifiedData(data = {}) {
        return this.AjaxService.post({
            url: '/user/shop/info/update',
            data,
            isLoading: true,

        })
    }
    /**
	 *运营人员绑定微信
	 */
    BindingWechat(data = {}) {
        return this.AjaxService.post({
            url: '/user/login/auth/bind',
            data,
            isLoading: true,

        })
    }
    /*个人机构取消提示*/
    CancelPrompt(data = {}) {
        return this.AjaxService.get({
            url: '/user/register/guide',
            data,
            isLoading: false,

        })
    }
    /**
	 * 找回密码&修改密码
	 * @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,

        })
    }
    /**
	 * 更换手机号
	 * @param: mobile			原手机号	
	 * @param: newMobile		新手机号
	 * @param: smsCode			原手机号验证码
	 * @param: newSmsCode		新手机号验证码
	 * @param: userId			用户userId
	 */
    UserUpdateMobile(data = {}) {
        return this.AjaxService.post({
            url: '/user/update/mobile',
            data,
            isLoading: true,

        })
    }
    /**
	 * @机构-地址列表
	 * @param:userId 用户ID(必传)，
	 * @param:pageNum 页码
	 * @param:pageSize 每页条数
	 */
    QueryAddressList(data = {}) {
        return this.AjaxService.get({
            url: '/order/address/list',
            data,
            isLoading: false,
        })
    }
    /**
	 * @机构-添加&&修改地址
	 * @param:userId 用户ID(必传)，
	 * @param:地址信息，
	 */
    AddressSave(data = {}) {
        return this.AjaxService.post({
            url: '/order/address/save',
            data,
            isLoading: true,

        })
    }
    /**
	 * @机构-删除地址
	 * @param:userId 用户ID(必传)，
	 * @param:地址信息，
	 */
    DeleteAddress(data = {}) {
        return this.AjaxService.post({
            url: '/order/address/delete',
            data,
            isLoading: 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,

        })
    }
    /* 运营人员管理-添加 */
    PostAddOperator(data = {}) {
        return this.AjaxService.post({
            url: '/user/operation/save',
            data,
            isLoading: true,

        })
    }
    /* 运营人员管理-删除 */
    PostDeleteOperator(data = {}) {
        return this.AjaxService.post({
            url: '/user/operation/delete',
            data,
            isLoading: true,

        })
    }
    /* 运营人员管理-更新邀请码 */
    PostUpdateOperatorCode(data = {}) {
        return this.AjaxService.post({
            url: '/user/operation/code/update',
            data,
            isLoading: true,

        })
    }
    /**
	 *@协销帮机构注册 待注册列表
	 *@param userId	协销用户userId
	 *@param searchName 关键词
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    SellerUserTemporaryClub(data = {}) {
        return this.AjaxService.get({
            url: '/user/seller/temporary/club',
            data,
            isLoading: true,

        })
    }
    /**
	 *@协销待注册列表 删除操作
	 *@param ID
	 */
    SellerDeleteUserTemporaryClub(data = {}) {
        return this.AjaxService.post({
            url: '/user/seller/delete/temporary/club',
            data,
            isLoading: true,

        })
    }
    /**
	 *@获取采美豆状态 
	 *@userId userId
	 */
    GetHomeObtainBeans(data = {}) {
        return this.AjaxService.get({
            url: '/user/club/obtain/beans',
            data,
            isLoading: false,

        })
    }
    /**
	 *@获取机构个人中心
	 *@userId userId
	 */
    GetClubObtainCenter(data = {}) {
        return this.AjaxService.get({
            url: '/user/club/home',
            data,
            isLoading: false,

        })
    }
    /**
	 *@机构采美豆收支明细 
	 *@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,

        })
    }
    /**
	 *@机构资料备注列表 
	 *@param clubId	机构用户clubId
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    getUserClubRemarksList(data = {}) {
        return this.AjaxService.get({
            url: '/user/club/remarks/list',
            data,
            isLoading: true,

        })
    }
    /**
	 *@机构资料备注保存
	 *@param clubId	机构用户clubId
	 */
    getUserClubRemarksSave(data = {}) {
        return this.AjaxService.post({
            url: '/user/club/remarks/save',
            data,
            isLoading: true,

        })
    }
    /**
	 *@备注关键词库联想查询
	 *@param remarks 联想词
	 */
    getCmremarkslist(data = {}) {
        return this.AjaxService.get({
            url: '/user/club/remarks/cmremarkslist',
            data,
            isLoading: false,
        })
    }
    /**
	 *@注册机构咨询记录详情
	 *@param remarksId	记录Id
	 */
    getUserClubRemarksDetail(data = {}) {
        return this.AjaxService.get({
            url: '/user/club/remarks/detail',
            data,
            isLoading: false,

        })
    }
    /**
	 *@机构资料备注删除
	 *@param remarksId	备注Id
	 */
    getUserClubRemarksDelete (data = {}) {
        return this.AjaxService.post({ 
            url:'/user/club/remarks/delete', 
            data, 
            isLoading: true,
        })
    }
    /**
	 *@添加潜在客户咨询人
	 *@param name	机构用户clubId
	 *@param serviceProviderId	协销Id
	 */
    getUserClubVisitorSave (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/remarks/visitor/save',
	        data,
	        isLoading: false,
        })
    }
    /**
	 *@修改潜在客户咨询人名称
	 *@param questionMan	姓名
	 *@param questionManId	咨询人Id
	 *@param serviceProviderId	协销Id
	 */
    getUserClubVisitorUpdate (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/remarks/visitor/update',
	        data,
	        isLoading: false,
        })
    }
    /**
	 *@潜在客户列表
	 *@param serviceProviderId	机构用户clubId
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    getUserClubVisitorList (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/remarks/visitor/list',
	        data,
	        isLoading: true,
        })
    }
    /**
	 *@潜在客户列表
	 *@param questionManId	咨詢人ID
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    getUserClubVisitorRecordlist (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/remarks/visitor/recordlist',
	        data,
	        isLoading: true,
        })
    }
    /**
	 *@潜在客户信息保存
	 *@param remarksId	記錄ID
	 *@param questionManId	咨詢人ID
	 *@param serviceProviderId	协销ID
	 *@param remarks	文字
	 *@param fileList	文件
	 *@param imageList	图片
	 *@param pageNum 页码
	 *@param pageSize 条数
	 */
    getUserClubVisitorSaveAdd(data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/remarks/save/visit',
	        data,
	        isLoading: true,
        })
    }
    /**
	 *@咨询人记录删除
	 *@param remarksId	备注Id
	 */
    getUserRemarksVisitDelete (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/remarks/delete/visit',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@咨询人记录详情
	 *@param remarksId	备注Id
	 */
    getUserRemarksVisitDetail (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/remarks/detail/visit',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@同步咨询人至机构
	 *@param questionManId	备注Id
	 */
    getUserRemarksConcactVisit (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/remarks/concact/visit',
	        data,
	        isLoading: true,
            loadText:'同步中...'
	    })
    }
    /**
	 *@获取查询记录类别
	 *@param consults	咨询类别Id
	 */
    getUserClubConsults (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/consults',
	        data,
	        isLoading: false
	    })
    }
    /**
	 *@获取协销组长列表
	 */
    getUserClubTeams (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/teams',
	        data,
	        isLoading: false
	    })
    }

    /**
	 *@根据协销组长id获取组员列表
	 *@param  leaderId	组长Id
	 */
    getUserClubTeamsRroups (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/teams/groups',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@已注册机构新增报备
	 *@param  productId:商品Id
	 *@param  clubId:	机构Id
	 *@param  serviceProviderId	协销Id
	 *@param  reportText:报备事由
	 */
    userClubReportSave (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/report/save',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@咨询报备关联商品
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userReportProductList (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/productList',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@对应机构报备列表
	 *@param  serviceProviderId：: 协销Id
	 *@param  clubId: 机构Id
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userClubReportList (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/List',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@所有注册机构报备记录列表
	 *@param  manager：: 是否是管理员 1是管理员 （从登录协销信息内取）
	 *@param  serviceProviderId：: 协销Id
	 *@param  keyWord：关键词
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userClubReportReportRemarks (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/reportRemarks',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@注册机构关联咨询记录列表
	 *@param  reportId：: 报备Id
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userClubReportAssociatedList (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/associatedList',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@删除机构报备记录
	 *@param  reportId：: 报备Id
	 */
    userClubReportDelete (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/report/delete',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@注册机构报备详情
	 *@param  reportId: 报备Id
	 */
    userReportDetails (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/details',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@未注册咨询人报备详情
	 *@param  reportId: 报备Id
	 */
    userReportVisitorDetails (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/visitor/details',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@未注册客户咨询人新建报备
	 *@param  questionManId：: 协销咨询人Id
	 *@param  productId: 商品Id
	 *@param  reportText: 报备事由
	 */
    userReportVisitorSave (data = {}) {
	    return this.AjaxService.post({
	        url:'/user/club/report/visitor/save',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@单个咨询人报备列表
	 *@param  questionManId：: 咨询人Id
	 *@param  keyWord: 关键词
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userReportVisitorList (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/visitor/List',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@所有未注册机构报备记录列表
	 *@param  manager：: 是否是管理员 1是管理员 （从登录协销信息内取）
	 *@param  serviceProviderId：: 协销Id
	 *@param  keyWord：关键词
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userReportVisitorRemarks (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/visitor/reportRemarks',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@未注册咨询人关联咨询记录列表
	 *@param  reportId：报备Id
	 *@param  keyWord：关键词
	 *@param  pageNum: 页码
	 *@param  pageSize:	条数
	 */
    userReportVisitorAssociatedList (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/visitor/associatedList',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@已注册机构取消报备关联咨询记录
	 *@param  remarksId：报备Id
	 */
    userClubReportDisassociation (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/disassociation',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@未注册咨询人取消报备关联咨询记录
	 *@param  remarksId：报备Id
	 */
    userReportVisitorDisassociation (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/report/visitor/disassociation',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@会员中心
	 *@param userId	用户Id
	 */
    getUserSuperCenter(data = {}) {
        return this.AjaxService.get({
            url: '/user/super/center',
            data,
            isLoading: false,

        })
    }
    /**
	 *@会员购买记录
	 *@param userId	用户Id
	 *@param pageNum	页码
	 *@param pageSize	条数
	 */
    getUserSuperHistory(data = {}) {
        return this.AjaxService.get({
            url: '/user/super/history',
            data,
            isLoading: true,

        })
    }
    /**
	 *@超级会员套餐
	 */
    getUserSuperPackage(data = {}) {
        return this.AjaxService.get({
            url: '/user/super/package',
            data,
            isLoading: true,

        })
    }
    /**
	 *@机构消息通知中心未读消息数量
	 */
    getUserAuthClubMessageCount(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/login/auth/ClubMessageCount',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@机构消息通知列表
	 *@param commonId：机构clubId
	 *@param messageType：消息类型1.交易物流2.账户通知3.服务通知4.优惠促销
	 *@param pageNum	页码
	 *@param pageSize	条数
	 */
    getUserAuthClubMessageList(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/login/auth/ClubMessageList',
	        data,
	        isLoading: false,
	
	    })
    }
    /**
	 *@删除通知消息
	 *@param id：消息Id
	 */
    authDeleteMessage(data = {}) {
	    return this.AjaxService.post({
	        url: '/user/login/auth/deleteMessage',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@机构标记通知消息已读
	 *@param messageType：''
	 */
    authUpdateMessageAsRead(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/login/auth/updateMessageAsRead',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@供应商通标记知消息已读
	 *@param messageType：''
	 */
    authUpdateShopMessageAsRead(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/login/auth/updateShopMessageAsRead',
	        data,
	        isLoading: true,
	    })
    }
    /**
	 *@查询机构未读消息数量
	 *@param commonId：机构clubId
	 */
    getAuthClubCount(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/login/auth/ClubCount',
	        data,
	        isLoading: false,
	    })
    }
    /**
	 *@上送用户浏览行为
	 *@param userId：  登录用户userId 默认 ：0
	 *@param pagePath：页面路径
	 *@param pageType：页面类型
	 *@param pageLabel：页面标签
	 *@param productId：商品Id
	 *@param accessDuration：浏览时长
	 */
    userRecordStatistics(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/record/Statistics',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@查看用户是否有过弹框游客当天是否有过弹框
	 */
    userInformationIsClick(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/information/isClick',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@插入填写咨询人基本信息
	 *@param consultName：页面类型
	 *@param consultMobile：页面标签
	 *@param isClick：1
	 
	 */
    userInformationInsertRoos(data = {}) {
	    return this.AjaxService.post({
	        url: '/user/information/insertRoos',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@查看访问者是否浏览过roos相关页面
	 */
    userInformationVisitRoos(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/information/visitRoos',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@机构访问记录列表
	 */
    userClubRecordList(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/club/record/list',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@机构访问记录详情
	 */
    userClubRecordDetail(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/club/record/detail',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@机构画像
	 */
    userClubPortrait(data = {}) {
	    return this.AjaxService.post({
	        url: '/user/club/clubPortrait',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@机构画像查所有
	 */
    userClubInitial(data = {}) {
	    return this.AjaxService.get({
	        url: '/user/club/clubInitial',
	        data,
	        isLoading: false,
	    }) 
    }
    /**
	 *@param 我的银行卡
	 userId 用户
	 */
    userClubBanks (data = {}) {
	    return this.AjaxService.get({
	        url:'/user/club/banks', 
	        data, 
	        isLoading: false ,
	    }) 
    } 
	 
}
