import Request from '../common/request.js';
let request = new Request().http

// 统计经销商会员总数和群管总数
export function getCompanyUserAndUserCount(data) {
	return request('/companyapp/app/fs/user/firstPage/summaryCount', data,'GET','application/json;charset=UTF-8');
}

// 课程统计
export function getCourseCount(data) {
	return request('/companyapp/app/fs/user/firstPage/statistics', data,'GET','application/json;charset=UTF-8');
}

// 获取课程列表
export function getFsCourseList(data) {
	return request('/companyapp/app/fs/course/courseList', data,'GET','application/json;charset=UTF-8');
}

// 根据训练营查询节目
export function getCourseVdieoList(data) {
	const url = '/companyapp/app/fs/course/pageList?periodId='+data.periodId +'&pageNum='+data.pageNum + '&pageSize='+data.pageSize+'&keyword='+data.keyword
	return request(url, null,'GET','application/json;charset=UTF-8');
}

// 根据观看记录查询用户（课程分析）
export function getUserLogListByCourseId(data) {
	const url = '/companyapp/app/fs/course/participationRecord'
	return request(url, data,'GET','application/json;charset=UTF-8');
}

// 修改用户
export function updateFsUser(data) {
	const url = '/fsUser/updateFsUser'
	return request(url, data,'POST','application/json;charset=UTF-8');
}

//根据经销商或群管查询会员列表
export function getfsuserList(data){
	const url = '/companyapp/app/fs/user/pageList'
	return request(url, data, 'POST','application/json;charset=UTF-8')
}

//查询会员标签列表
 export function getcompanyTaglist(data) {
 	 return request('/companyapp/app/fs/user/tagList',data,'GET');
 }
  
  //添加黑名单
  export function Addblacklist(data){
  	const url = '/companyapp/app/fs/user/disabled'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //修改公司会员打标签
  export function changeLable(data){
  	const url = '/companyapp/app/fs/user/changeUserTags'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //查询答题数据（会员详情）
  export function getanswerlist(data){
  	const url = '/companyapp/app/fs/user/details'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  }
  
  //移除黑名单（会员详情）
  export function removebalcklist(data){
  	const url = '/companyapp/app/fs/user/enabled'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  

  //生成小节课程 （链接）
  export function sharecourselink(data){
  	const url = '/companyapp/app/fs/course/courseSortLink'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //修改用户名称
  export function changeUserName(data){
  	const url = '/fsUser/updateFsUser'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //查询看课转化率(漏斗图)
  export function getcourseRate(data){
  	const url = '/companyapp/app/fs/user/firstPage/graphic'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  } 
  //查询详情看课转化率(漏斗图)
  export function getcourseRates(data){
  	const url = '/companyapp/app/fs/user/graphic/details'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  } 
  
//根据经销商或群管查询会员总数
  export function getvipNum(data){
  	const url = '/companyapp/app/fs/user/totalNumber'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  } 
  
//根据经销商 运营:查询课程数,群管数,参与会员
export function getshopCoursenum(data){
	const url = '/companyapp/app/fs/user/statistics/details'
	return request(url, data, 'GET','application/json;charset=UTF-8')
} 

//根据经销商 获取群管排名
export function getGroupRanklist(data){
	const url = '/companyapp/app/fs/user/firstPage/userRanking'
	return request(url, data, 'GET','application/json;charset=UTF-8')
} 

//根据经销商 获取课程排名
export function getCourseRanklist(data){
	const url = '/companyapp/app/fs/user/firstPage/courseRanking'
	return request(url, data, 'GET','application/json;charset=UTF-8')
} 

//根据经销商 获取红包领取记录
export function getCourseRedPacklist(data){
	const url = '/fsCourseRedPacket/getRedPacketLogList'
	return request(url, data, 'POST','application/json;charset=UTF-8')
} 

//根据经销商 获取账户可用余额
export function getuserbalance(data){
	const url = '/companyUser/getCompanyBalance'
	return request(url, data, 'POST','application/json;charset=UTF-8')
} 

//根据经销商 查询所属群管
export function getusergroup(data){
	const url = '/companyapp/app/companyUser/getCompanyUserList'
	return request(url, data, 'GET','application/json;charset=UTF-8')
} 

//根据经销商 新增公司标签
export function addCompanyLabel(data){
	const url = '/companyapp/app/companyTag/add'
	return request(url, data, 'POST','application/json;charset=UTF-8')
} 

//根据经销商 删除公司标签
export function deleteCompanyLabel(data){
	const url = '/companyapp/app/companyTag/delete?tagIds='+data
	return request(url, data, 'POST','application/json;charset=UTF-8')
}

//根据经销商 获取红包价格表
export function getredPrice(data){
	const url = '/fsCourseRedPacket/getRedPacketList'
	return request(url, data, 'GET','application/json;charset=UTF-8')
}

//根据经销商 查询所属群管列表
export function getgroupList(data){
	const url = '/companyapp/app/companyUser/companyUserListByCompanyId'
	return request(url, data, 'GET','application/json;charset=UTF-8')
}

//根据经销商 查询群管的课程
export function getcourseList(data){
	const url = '/companyapp/app/fs/user/courseAnalysis'
	return request(url, data, 'GET','application/json;charset=UTF-8')
}

//根据经销商 修改群管信息
export function updategroupinfo(data){
	const url = '/companyapp/app/companyUser/updateUserInfo'
	return request(url, data, 'POST','application/json;charset=UTF-8')
}

//根据经销商 获取群管详情
export function getGroupDetail(data){
	const url = '/companyapp/app/companyUser/getCompanyUserInfo?companyUserId'
	return request(url, data, 'GET','application/json;charset=UTF-8')
}

//根据经销商  修改全部会员群管
export function changevipUserAll(data){
	const url = '/companyapp/app/companyUser/changeUserParentApply'
	return request(url, data, 'POST','application/json;charset=UTF-8')
}

//根据经销商  查询标签下会员
export function gettagsUser(data){
	const url = '/companyapp/app/companyTag/tagSubUsers'
	return request(url, data, 'GET','application/json;charset=UTF-8')
}

// h5课程简介
export function getH5CourseByVideoId(data) {
	return request('/fsCourse/getH5CourseByVideoId', data, 'GET');
}

// h5课程详情加问答
export function getH5CourseVideoDetails(data) {
	return request('/fsCourse/getH5CourseVideoDetails', data, 'GET');
}

// 答题发红包
export function courseAnswer(data) {
	return request('/fsCourse/courseAnswer', data, 'POST', 'application/json;charset=UTF-8');
}

// 发送奖励
export function sendReward(data) {
	return request('/fsCourse/sendReward', data, 'POST', 'application/json;charset=UTF-8');
}

// 课程完成
export function getFinishCourseVideo(data) {
	return request('/fsCourse/getFinishCourseVideo', data, 'POST', 'application/json;charset=UTF-8');
}

// 课程完成
export function getaddcourseLog(data) {
	return request('/fsCourseWatchLog/addCourseLog', data, 'POST', 'application/json;charset=UTF-8');
}

// 生成海报和看图二维码
export function buildCode(data) {
	return request('/companyapp/app/fs/course/courseImage',data, 'POST',  'application/json;charset=UTF-8');
}

//是否可以看课
export function idlookCourse(data) {
	return request('/fsCourse/isWatch', data, 'POST', 'application/json;charset=UTF-8');
}

//点击链接后添加课程记录
export function clickCourse(data) {
	return request('/fsCourseWatchLog/addCourseLog', data, 'POST', 'application/json;charset=UTF-8');
}

//用户成为会员
export function becomeVip(data) {
	return request('/fsUser/addFsUserByCompanyUserAndCompany', data, 'POST', 'application/json;charset=UTF-8');
}

//生成分享链接,新建会员
export function becomeVipuser(data) {
	return request('/companyUser/generateLink', data, 'POST', 'application/json;charset=UTF-8');
}

//生成分享海报,新建会员
export function becomeVipuserImg(data) {
	return request('/companyapp/app/fs/user/userImage', data, 'POST', 'application/json;charset=UTF-8');
}

//获取jssdk
export function getSDK(data){
	return request('/companyapp/app/wx/mp/getWeiXinConfig', data, 'GET', 'application/json;charset=UTF-8');
}

//获取公司所有销售
export function getusersales(data){
	return request('/companyapp/app/fs/user/allCompanyUser', data, 'GET', 'application/json;charset=UTF-8');
}

//获取催课面板
export function geturgeCourse(data){
	return request('/companyapp/app/qwWorkTask/list', data, 'GET', 'application/json;charset=UTF-8');
}

//获取企微账号
export function geturgeqiwei(data){
	return request('/companyapp/app/qwWorkTask/getQwUserList', data, 'GET', 'application/json;charset=UTF-8');
}

//获取课程视频详情
export function getcourseDetail(data){
	return request('/companyapp/app/fs/course/videoDetails', data, 'GET', 'application/json;charset=UTF-8');
}

//通过销售审核
export function subsalesaudit(data){
	return request('/companyapp/app/user/audit?userIds='+data, data, 'POST', 'application/json;charset=UTF-8');
}

//解除销售黑名单
export function changesalesState(data){
	return request('/companyapp/app/user/changeUserState?userIds='+data,data,  'POST', 'application/json;charset=UTF-8');
}

//注册销售账户
export function loginsales(data){
	return request('/companyapp/app/companyUser/resisterCompanyUser',data,  'POST', 'application/json;charset=UTF-8');
}

//获取课程小节下拉列表
export function getvideolist(data){
	return request('/companyapp/app/fs/course/videoList',data,  'GET', 'application/json;charset=UTF-8');
}

//获取公司所有标签
export function getallTags(data){
	return request('/companyapp/app/companyTag/list',data,  'GET', 'application/json;charset=UTF-8');
}

//获取更换会员归属审核列表
export function getchangeslist(data){
	return request('/companyapp/app/companyUser/applyList',data,  'GET', 'application/json;charset=UTF-8');
}

//更改用户姓名，备注
export function getchangesUserInfo(data){
	return request('/companyapp/app/fs/user/changeUserInfo',data,  'POST', 'application/json;charset=UTF-8');
}

//管理 获取会员人数等
export function getmanagepopnum(data){
	return request('/companyapp/app/fs/user/companyUser/summaryCount',data,  'GET', 'application/json;charset=UTF-8');
}


//管理 获取管理课程统计
export function getmanagecourse(data){
	return request('/companyapp/app/fs/user/companyUser/details',data,  'GET', 'application/json;charset=UTF-8');
}

//催课 获取会员注册
export function getWorkTask(data){
	return request('/companyapp/app/qwWorkTask/getUserList',data,  'GET', 'application/json;charset=UTF-8');
}

//获取企业理念
export function getenterprise(data){
	return request('/app/index/getConcept',data,  'GET', 'application/json;charset=UTF-8');
}

//获取今日课程
export function getTodayCourse(data){
	return request('/companyapp/app/fs/course/todayCourseList',data, 'GET', 'application/json;charset=UTF-8');
}

//更改课程时间
export function updataTime(data){
	return request('/companyapp/app/fs/course/setWatchTime',data, 'POST', 'application/json;charset=UTF-8');
}

//查看用户轨迹
export function getuserTrajectory(data){
	return request('/companyapp/app/operationLog/page',data, 'POST', 'application/json;charset=UTF-8');
}

//生成小程序链接
export function copyuniLink(data){
	return request('/companyapp/app/fs/course/getGotoWxAppLink',data, 'GET', 'application/json;charset=UTF-8');
}