import request from '@/utils/request'

// 促销商品
export function groom4(data) {
	return request({
		url: '/api/groom/list/4',
		method: 'get',
		data
	});
}
// 精品推荐
export function groom1(data) {
	return request({
		url: '/api/groom/list/1',
		method: 'get',
		data
	});
}
// 新品首发
export function groom3(data) {
	return request({
		url: '/api/groom/list/3',
		method: 'get',
		data
	});
}

// 获取首页信息
export function loadIndexs(data) {
	return request({
		url: '/api/index',
		method: 'get',
		data
	});
}

/**
 * 获取主页数据 无需授权
 * 
*/
export function getIndexData(data) {
	return request({
		url: '/api/common/home',
		method: 'get',
		data
	})
}

//获取商店列表
export function getStoreList(data) {
	return request({
		url: '/api/store_list',
		method: 'get',
		data
	})
}

//获取自提点列表
export function getPointList(data,id) {
	return request({
		url: '/api/point_list/'+ id,
		method: 'get',
		data
	})
}

//文章详情
export function getArticleDetail(data,id) {
	return request({
		url: '/api/article/details/'+ id,
		method: 'get',
		data
	})
}

//优惠券列表 /api/coupons
export function getCouponsList(data) {
	return request({
		url: '/api/coupons',
		method: 'get',
		data
	})
}

export function getCoupon(data) {
	return request({
		url: '/api/coupon/receive',
		method: 'post',
		data
	})
}
//获取我的优惠券
export function getMyCoupons(data,types) {
	return request({
		url:  '/api/coupons/user/'+ types,
		method: 'get',
		data
	})
}

//获取手机充值套餐
export function getPhoneTc(data) {
	return request({
		url: '/api/mobile_recharge/index',
		method: 'get',
		data
	})
}

export function phonePay(data) {
	return request({
		url: '/api/mobile_recharge/routine',
		method: 'post',
		data
	})
}