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

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

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

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

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

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

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

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

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

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

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

// 发送奖励
export function sendReward(data) {
	return request('/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('/app/wx/mp/getWxConfig', data, 'GET','');
}