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

 //微信小程序登录
 export function loginByMiniApp(data) {
 	 return request('/course_uniapp/app/wx/miniapp/loginByMa',data,'POST','application/json;charset=UTF-8');
 }
// 播放错误上报
export function getErrMsg(data) {
	return request('/course_uniapp/app/course/wx/h5/getErrMsg', data, 'POST', 'application/x-www-form-urlencoded','https://h5api.his.cdwjyyh.com');
}
// h5课程简介
export function getH5CourseByVideoId(data) {
	return request('/course_uniapp/app/course/wx/h5/getH5CourseByVideoId', data, 'GET','','https://h5api.his.cdwjyyh.com');
}
// h5课程详情加问答
export function getH5CourseVideoDetails(data) {
	return request('/course_uniapp/app/course/wx/h5/videoDetails', data, 'GET','','https://h5api.his.cdwjyyh.com');
}
// 答题发红包
export function courseAnswer(data) {
	return request('/course_uniapp/app/course/wx/h5/courseAnswer', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
}
// 记录看课时间（新）
export function getFinishCourseVideo(data) {
	return request('/course_uniapp/app/course/wx/h5/updateWatchDuration', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
}
// 关注客服 是否添加客服
export function getIsAddKf(data) {
	return request('/course_uniapp/app/course/wx/h5/isAddKf', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
}
// 流量(缓冲百分比)
export function getInternetTraffic(data) {
	return request('/course_uniapp/app/course/wx/h5/getInternetTraffic', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
}
// 每十分钟获得积分
export function getIntegralByH5Video(data) {
	return request('/app/course/getIntegralByH5Video', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
}

// 发送奖励
export function sendReward(data) {
	return request('/course_uniapp/app/course/wx/h5/sendReward', data, 'POST', 'application/json;charset=UTF-8','https://h5api.his.cdwjyyh.com');
}
// 获取真实链接
export function getRealLink(data) {
	return request('/app/course/getRealLink', data, 'GET','','https://h5api.his.cdwjyyh.com');
}
 //检查是否有头像以及昵称
 export function checkUserInfo(data) {
 	 return request('/course_uniapp/app/user/checkUserInfo',data,'GET','application/json;charset=UTF-8');
 }
 //更改用户头像以及昵称
 export function editUser(data) {
 	 return request('/course_uniapp/app/user/editUser',data,'POST','application/json;charset=UTF-8');
 }
 // 成为会员
 export function registerCourses(data) {
 	 return request('/course_uniapp/companyapp/app/fs/user/beMember',data,'POST','application/json;charset=UTF-8');
 }
 //获取头像以及昵称信息
 export function getusername(data) {
 	 return request('/companyapp/app/wx/h5/mp/userInfo',data,'POST','application/json;charset=UTF-8');
 }
 //h5授权登录
 export function handleFsUserWx(data) {
 	 return request('/course_uniapp/app/wx/h5/mp/handleFsUserWx',data,'POST','application/json;charset=UTF-8');
 }
 //h5授权登录
 export function H5logoinApp(data,type) {
	 if(type&&type==1) {
		return request('/app/wx/h5/mp/courseLoginByMp',data,'POST','application/json;charset=UTF-8'); 
	 } else {
		return request('/app/wx/h5/mp/loginByMp',data,'POST','application/json;charset=UTF-8'); 
	 }
 }