import Request from '@/common/request.js';
let request = new Request().http
 
 export function getIntegralGoodsList(data) {
 	 return request('/app/integral/getIntegralGoodsList',data,'GET');
 }
 export function getIntegralGoodsById(data) {
 	 return request('/app/integral/getIntegralGoodsById',data,'GET');
 }
 export function getUserIntegralLogsList(data) {
 	 return request('/app/integral/getUserIntegralLogsList',data,'GET');
 }
 export function getIntegralOrderList(data) {
 	 return request('/app/integral/getIntegralOrderList',data,'GET');
 }
 export function getIntegralOrderById(data) {
 	 return request('/app/integral/getIntegralOrderById',data,'GET');
 }
 
 export function createOrder(data) {
  	return request('/app/integral/createOrder',data,'POST','application/json;charset=UTF-8');
 }
 
 export function getUserSign() {
 	 return request('/app/integral/getUserSign',null,'GET');
 }
 
 export function doSign(data) {
 	 return request('/app/integral/sign',data,'POST','application/json;charset=UTF-8');
 }
export function payment(data) {
  	return request('/app/integral/payment',data,'POST','application/json;charset=UTF-8');
 }
 export function cannelOrder(data) {
  	return request('/app/integral/cannelOrder',data,'POST','application/json;charset=UTF-8');
 }
 
 export function getCartCount() {
  	return request('/app/integral/getCartCount',null,'GET');
 }
 export function addOrUpdateCart(data) {
  	return request('/app/integral/addOrUpdateCart',data,'POST','application/json;charset=UTF-8');
 }
 export function getCarts() {
  	return request('/app/integral/getCarts',null,'GET');
 }
 export function delCart(data) {
  	return request('/app/integral/delCart',data,'POST','application/json;charset=UTF-8');
 }
 export function createCartOrder(data) {
  	return request('/app/integral/createCartOrder',data,'POST','application/json;charset=UTF-8');
 }
 export function getCartByIds(data) {
  	return request('/app/integral/getCartByIds',data,'POST','application/json;charset=UTF-8');
 }
 
 
 // 领取完课积分
 export function completionReceive(data) {
  	return request(`/app/live/completion/receive?recordId=${data}`,data,'POST','application/json;charset=UTF-8');
 }
 // 获取用户未领取的积分列表
 export function completionUnreceived(data) {
  	return request('/app/live/completion/unreceived',data,'GET','application/json;charset=UTF-8');
 }
 // 查询用户积分领取记录
 export function completionRecords(data) {
  	return request('/app/live/completion/records',data,'GET','application/json;charset=UTF-8');
 }
 // 查询用户积分余额和看直播信息统计
 export function completionInfo(data) {
  	return request('/app/live/completion/info',data,'GET','application/json;charset=UTF-8');
 }
 
 
 // 查询当前用户当前直播间领取积分的剩余时长 (传入直播间id)
 export function remainingTime(data) {
  	return request('/app/live/completion/remaining-time',data,'GET','application/json;charset=UTF-8');
 }
 // 更新用户的看课时长 (传入直播间id和看课时长)
 export function updateWatchDuration(liveId,watchDuration) {
  	return request(`/app/live/completion/update-watch-duration?liveId=${liveId}&watchDuration=${watchDuration}`,null,'POST','application/json;charset=UTF-8');
 }
 // 用户领取看课积分(传入直播间id)
 export function receivePoints(data) {
  	return request('/app/live/completion/receive-points?liveId='+data.liveId,null,'POST','application/json;charset=UTF-8');
 }
 // 查询用户自己的积分记录
 export function integrallogs(data) {
  	return request('/app/live/completion/integral-logs',data,'GET','application/json;charset=UTF-8');
 }
//关注公众号
export function getMp(data) {
  	return request('/app/wx/mp',data,'GET','application/json;charset=UTF-8');
 }