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

export function loginByMp(data) {
 	 return request('/course_auto/app/wx/courseLogin',data,'POST','application/json;charset=UTF-8');
 }

// 获取真实链接
export function getRealLink(data) {
	return request('/course_auto/app/course/getRealLink', data, 'GET','');
}

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

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

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

// // 记录看课时间（旧）
// export function getFinishCourseVideo(data) {
// 	return request('/course_auto/app/course/getFinishCourseVideo', data, 'POST', 'application/json;charset=UTF-8');
// }

// 记录看课时间（新）
export function getFinishCourseVideo(data) {
	return request('/course_auto/app/course/updateWatchDuration', data, 'POST', 'application/json;charset=UTF-8');
}

// 关注客服
export function getIsAddKf(data) {
	return request('/course_auto/app/course/isAddKf', data, 'POST', 'application/json;charset=UTF-8');
}

// 流量(缓冲百分比)
export function getInternetTraffic(data) {
	return request('/course_auto/app/course/getInternetTraffic', data, 'POST', 'application/json;charset=UTF-8');
}

// 每十分钟获得积分
export function getIntegralByH5Video(data) {
	return request('/course_auto/app/course/getIntegralByH5Video', data, 'POST', 'application/json;charset=UTF-8');
}

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

// 播放错误上报
export function getErrMsg(data) {
	return request('/app/course/getErrMsg', data, 'POST', 'application/x-www-form-urlencoded');
}


// 获取getWxConfig
export function getWxConfig(data) {
	return request('/course_auto/app/wx/mp/getWxConfig', data, 'GET','');
}

// 保存评论数据
export function saveMsg(data) {
	return request('/course_auto/app/course/saveMsg', data, 'POST', 'application/json;charset=UTF-8');
}

// 撤销评论
export function revokeMsg(data) {
	return request('/course_auto/app/course/revokeMsg', data, 'PUT', 'application/json;charset=UTF-8');
}

// 获取历史评论数据
export function getComments(data) {
	return request('/course_auto/app/course/getComments', data, 'GET');
}

// 企业理念
export function getConcept() {
	return request('/course_auto/app/index/getConcept', null, 'GET');
}

 export function getTypeTree(data) {
 	return request('/course_auto/app/user/complaint/getTypeTree', null, 'GET');
 }
 export function complaintRecord(data) {
 	return request('/course_auto/app/user/complaint/record', data, 'POST','application/json;charset=UTF-8');
 }