const http = uni.$u.http
// 获取运动类型列表
export const getSportList = (data) =>  http.get('/system/sports/list', {params: data, custom: {auth: true} })

/**
 * 查询球馆列表
 * @param {
	 longitude,
	 latitude
 }
 * @returns {
	 businessId, businessName, businessLicenseNo, gymName, contacts, contactsPhone, province, city, county, address, gymNum,
	 serviceCharge, commission, username, businessLicensePicture, gymPicture, longitude, latitude, sportsRange, distance, rank, price, businessTime
	}
 */
export const getArenaList = (data) => http.get('/ground-business/business/list', {params: data, custom: {auth: true} })

/**
 * 根据id查询球馆
 * @param {
	 businessId: 球馆ID
 }
 * @returns {
	 businessId, businessName, businessLicenseNo, gymName, contacts, contactsPhone, province, city, county, address, gymNum,
	 serviceCharge, commission, username, businessLicensePicture, gymPicture, longitude, latitude, sportsRange, distance, rank, price, businessTime
	}
 */
export const getArenaDetail = (businessId) => http.get(`/ground-business/business/${businessId}`, {custom: {auth: true} })

/**
 * 发起约球
 * @param {
	 groundId: 场地id,
	 peopleNum: 参与人数(不包括发起人),
	 orderDate: 订场日期,
	 hourList: {
		 startHour: 开始时间,
		 endHour: 结束时间
	 }
 }
 * @returns {
	 orderId, orderNo, belongGym, groundNum, orderTime, appointmentStartTime, appointmentEndTime,
	 payAmount, peopleNum, serviceCharge, commission, orderType, state, businessId, clientId, groundId
	}
 */
export const sendBall = (data) => http.post('/ground-business/ground/createDateOrder', data, {custom: {auth: true} })