import http from '@/http/http.js'

//获取短剧视频详情
export function getVideoDetail(data) {
	return http.request({
		url: 'course/courseSets',
		data: data
	})
}







//追剧
export function zhuiju(data) {
	return http.request({
		url: 'courseCollect/insertCourseCollect',
		method: 'POST',
		data: {
			classify: 1,
			...data
		}
	})
}

//点赞
export function dianzan(data) {
	return http.request({
		url: 'courseCollect/insertCourseCollect',
		method: 'POST',
		data: {
			classify: 2,
			...data
		}
	})
}

//插入播放历史记录

export function insertHistory(data) {
	return http.request({
		url: 'courseCollect/insertCourseCollect',
		method: 'POST',
		data: {
			classify: 3,
			type: 1,
			...data
		}
	})
}

//获取金币比例
export function getJinbiBili(data) {
	return http.request({
		url: 'common/type/914',
		data
	})
}

//获取推荐视频
export function tuijianVideo(data) {
	const randomNum = 10 + Math.ceil(Math.random() * 20)
	return http.request({
		url: 'course/selectCourseDetailsList',
		method: 'GET',
		data: {
			page: 1,
			limit: 10,
			randomNum: randomNum
		}
	})
}
//解锁10集视频
export function buyTenVideo(data) {
	return http.request({
		url: 'order/insertCourseOrders/limit10',
		method: 'GET',
		data: data
	})
}
//解锁单集或者全部视频
export function buyVideo(data) {
	return http.request({
		url: 'order/insertCourseOrders',
		method: 'GET',
		data: data
	})
}
//订单支付
export function payOrder(data) {
	let payType = 'h5'
	// #ifdef APP
	payType = 'app'
	// #endif
	return http.request({
		url: 'wuyou/payOrder/' + data.orderId + '?payType=' + payType,
		method: 'GET'
	})
}
//获取订单支付状态
export function getOrderInfo(data) {
	return http.request({
		url: 'wuyou/queryOrder/' + data.orderId,
		method: 'GET'
	})
}
//金币解锁
export function goldPay(data) {
	return http.request({
		url: 'order/payOrders',
		method: 'POST',
		data: {
			...data,
			header: {
				'content-type': 'application/x-www-form-urlencoded'
			}
		}
	})
}

//获取转盘抽奖次数
export function getDrawCount(data) {
	return http.request({
		url: 'discSpinning/drawCount',
		method: 'GET',
		data
	})
}

//播放开始或者结束
export function playStatus(data) {
	return http.request({
		url: 'course/viewCourse',
		method: 'GET',
		data
	})
}

// 获取支付次数提示
export function getPayTips(data){
	return http.request({
		url: 'course/getRedEnvelopeTips',
		method: 'GET',
		data
	})
	
}
