import {request} from '@/utils/request.js'

// 获取栏目
export function getMenu(data) {
	return request({
		url: '/zswl-cloud-shop/column/searchByUser',
		data
	})
}

// 获取二级栏目页
export function getPage(data) {
	return request({
		url: '/zswl-cloud-shop/column/page',
		data
	})
}

// 获取tab列表
export function getTab(data) {
	return request({
		url: '/zswl-cloud-shop/community/get',
		data
	})
}

// 获取tab内容列表
export function getItem(data) {
	return request({
		url: '/zswl-cloud-shop/communityItem/getItem',
		data
	})
}

// 获取帖子详情
export function detail(data) {
	return request({
		url: '/zswl-cloud-shop/communityItem/detail',
		data
	})
}

// 获取三级栏目列表
export function studyGoodsList(data) {
	return request({
		url: '/zswl-cloud-shop/goodsCoupon/studyGoods',
		data
	})
}

// 研学商品推荐
export function studyGoodsByUser(data) {
	return request({
		url: '/zswl-cloud-shop/goodsInfo/studyGoodsByUser',
		data
	})
}

// // 研学商品详情
// export function studyGoodsDetail(data) {
// 	return request({
// 		url: '/zswl-cloud-shop/goodsCoupon/studyGoodsDetail',
// 		data
// 	})
// }

// 研学测试题库
export function getPaper(data) {
	return request({
		url: '/zswl-cloud-shop/paper/search',
		data
	})
}

// 研学测试题
export function getTestList(data) {
	return request({
		url: '/zswl-cloud-shop/paperQuestions/search',
		data
	})
}

// 研学测试
export function studyTest(data) {
	return request({
		url: '/zswl-cloud-bdb/user/studyTest',
		data
	})
}

// 研学测试结果
export function getResult(data) {
	return request({
		url: '/zswl-cloud-shop/paperResult/get',
		data
	})
}


// 课程视频列表
export function videoList(data) {
	return request({
		url: '/zswl-cloud-shop/course/video',
		data
	})
}
// 课程栏目推荐
export function videoLists(data) {
	return request({
		url: '/zswl-cloud-shop/courseChapter/video',
		data
	})
}


// 课程详情
export function videoDetail(data) {
	return request({
		url: '/zswl-cloud-shop/course/detail',
		data
	})
}

// 研学预约
export function subscribe(data) {
	return request({
		url: '/zswl-cloud-shop/reservationLog/addOrUpdate',
		method:'post',
		data
	})
}

// 查询点赞
export function getLikes(data) {
	return request({
		url: '/zswl-cloud-shop/communityLikeLog/get',
		data
	})
}

// 点赞/取消点赞
export function likes(data) {
	return request({
		url: '/zswl-cloud-shop/communityLikeLog/likes',
		method:'post',
		data
	})
}

// 研学商品列表
export function studyGoods(data) {
	return request({
		url: '/zswl-cloud-shop/goodsInfo/studyGoods',
		data
	})
}

// 获取栏目下的互动社区tab
// community/getCommunitys
export function getCommunitys(data) {
	return request({
		url: '/zswl-cloud-shop/community/getCommunitys',
		method:'get',
		data
	})
}

// 获取出游人
// /traveler/getAllTravelers
export function getAllTravelers(data) {
	return request({
		url: '/zswl-cloud-shop/traveler/getAllTravelers',
		method:'get',
		data
	})
}
// 保存出游人
// /traveler/saveTraveler
export function saveTraveler(data) {
	return request({
		url: '/zswl-cloud-shop/traveler/saveTraveler',
		method:'post',
		data
	})
}

// 研学课程详情
// goodsReserve/getCourseDetail 
export function getCourseDetail({ orderNo,id}) {
	return request({
		url: `/zswl-cloud-shop/goodsReserve/getCourseDetail?id=${id}&orderNo=${orderNo}`,
	})
}
// 视频进度上报
// /dataViewPer/updatePer
export function updatePer(data) {
	return request({
		url: '/zswl-cloud-shop/dataViewPer/updatePer',
		method:'post',
		data
	})
}

// 研学心得发表
// /communityItem/goodsSaveCommunityItem
export function goodsSaveCommunityItem(data) {
	return request({
		url: '/zswl-cloud-shop/communityItem/goodsSaveCommunityItem',
		method:'post',
		data
	})
}

// 研学心得详情
// /communityItem/detail
export function goodsCommunityItemDetail(data) {
	return request({
		url: '/zswl-cloud-shop/communityItem/detail?tabId='+data ,
	})
}

// 研学心得列表
// communityItem/pageItem
export function goodsSharePage(data) {
	return request({
		url: '/zswl-cloud-shop/communityItem/pageItem',
		method:'post',
		data
	})
}

// 科普视频播放量
// coursePlayLog/add
export function coursePlayLog(data) {
	return request({
		url: '/zswl-cloud-shop/coursePlayLog/add',
		method:'post',
		data
	})
}

// 创建研学订单
// springbatchservice/studyOrder/creat
export function studyOrderCreat(data) {
	return request({
		url: '/springbatchservice/studyOrder/creat',
		method:'post',
		data
	})
}