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

// 统计经销商会员总数和群管总数
export function getCompanyUserAndUserCount(data) {
	return request('/fsUser/getCompanyUserAndUserCount', data,'POST','application/json;charset=UTF-8');
}

// 课程统计
export function getCourseCount(data) {
	return request('/fsCourseWatchLog/getCompanyUserAndUserCount', data,'POST','application/json;charset=UTF-8');
}

// 答题统计
export function getQuesCount(data) {
	return request('/fsAnswerLog/getCompanyUserAndUserCount', data,'POST','application/json;charset=UTF-8');
}

// 红包统计
export function getRecPacketCount(data) {
	return request('/fsCourseRedPacket/getRecPacketCount', data,'POST','application/json;charset=UTF-8');
}

// 获取课程列表
export function getFsCourseList(data) {
	return request('/fsCourse/getFsCourseList', data,'POST','application/json;charset=UTF-8');
}

// 根据训练营查询节目
export function getCourseVdieoList(data) {
	const url = '/fsCourse/getCourseVdieoPageList?courseId='+data.courseId +'&pageNum='+data.pageNum + '&pageSize='+data.pageSize+'&status='+data.status
	return request(url, null,'POST','application/json;charset=UTF-8');
}

// 根据观看记录查询用户
export function getUserLogListByCourseId(data) {
	const url = '/fsCourse/getUserLogListByCourseId'
	return request(url, data,'POST','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 = '/fsUser/getFsUserList'
	return request(url, data, 'POST','application/json;charset=UTF-8')
}

//查询公司标签列表
 export function getcompanyTaglist(data) {
 	 return request('/company/companyTag/list',data,'GET');
 }
  
  //添加黑名单
  export function Addblacklist(data){
  	const url = '/black'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //修改公司会员打标签
  export function changeLable(data){
  	const url = '/company/companyTagUser/edit'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //修改公司会员打标签
  export function getBlackvipNumber(data){
  	const url = '/black/blackCount'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //查询被拉黑的用户列表
  export function getBlackvipList(data){
  	const url = '/fsUser/getBlackUserList'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //查询答题数据（会员详情）
  export function getanswerlist(data){
  	const url = '/fsAnswerLog/getUserAnswerCount'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  }
  
  //移除黑名单（会员详情）
  export function removebalcklist(data){
  	const url = '/black/delete'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  }
  
  
  //生成小节课程 （链接）
  export function sharecourselink(data){
  	const url = '/fsCourseWatchLog/createLinkUrl'
  	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 getuserdetail(data){
  	const url = '/fsUser'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  } 
  
  //查询看课转化率
  export function getcourseRate(data){
  	const url = '/fsCourse/getConversion'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  } 
  
  //标签统计
  export function getlableNum(data){
  	const url = '/company/companyTag/getTagCount'
  	return request(url, data, 'GET','application/json;charset=UTF-8')
  } 
  
//根据经销商或群管查询会员总数
  export function getvipNum(data){
  	const url = '/fsUser/getFsUserListCount'
  	return request(url, data, 'POST','application/json;charset=UTF-8')
  } 
  
//根据经销商 运营:查询课程数,群管数,参与会员
export function getshopCoursenum(data){
	const url = '/fsCourse/getCourseVdieoCount'
	return request(url, data, 'POST','application/json;charset=UTF-8')
} 

//根据经销商 获取群管排名
export function getGroupRanklist(data){
	const url = '/companyUser/getCompanyUserTOP20'
	return request(url, data, 'POST','application/json;charset=UTF-8')
} 

//根据经销商 获取课程排名
export function getCourseRanklist(data){
	const url = '/fsCourse/getCourseTOP20'
	return request(url, data, 'POST','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 = '/companyUser/getCompanyUserList'
	return request(url, data, 'POST','application/json;charset=UTF-8')
} 

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

//根据经销商 删除公司标签
export function deleteCompanyLabel(data){
	const url = '/company/companyTag/delete'
	return request(url, data, 'GET','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 = '/companyUser/CompanyUserListByCompanyId'
	return request(url, data, 'GET','application/json;charset=UTF-8')
}

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

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

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

//根据经销商 批量更换会员归属
export function changevipUser(data){
	const url = '/companyUser/updateCompanyUseruser'
	return request(url, data, 'POST','application/json;charset=UTF-8')
}

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

//根据经销商  查询标签下会员
export function gettagsUser(data){
	const url = '/company/companyTagUser/getUserList'
	return request(url, data, 'POST','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('/fsCourse/generatePostAndQrCode',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('/companyUser/generatePostAndQrCode', data, 'POST', 'application/json;charset=UTF-8');
}

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