
/**
 * 手太欠
 * 愿这世界都如故事里一样 美好而动人~
 */
import request from '../request'

const index = (data) => {
	return request({
		url: 'schools'
	})
}

//卡券二维码
const qrcode = (coupon_id) => {
	return request({
		url: 'coupons/qrcode',
        data: {
            coupon_id
        }
	})
}

//门店列表
const barcode = (coupon_id) => {
	return request({
		url: "coupons/" + coupon_id + '/barcode'
	})
}

//卡券二维码
const couponinfo = (data) => {
	return request({
		url: "coupons/show",
		data: data
	})
}

// 获取商家券信息
const merchantCard = (coupon_id) => {
	return request({
		url: "coupons/merchant_card",
		method: "GET",
		data: {
		    coupon_id
		}
	})
}

// 校园活动确认订单
const buy = (data) => {
	return request({
		url : "schools/buy",
		data: data
	})
}

// 校园活动提交订单
const buySubmit = (data) => {
	return request({
		url     : "schools/buy",
		method  : "POST",
		data    : data
	})
}

// 卡券分组
const coupon = (data) => {
	return request({
		url     : "coupons",
		data    : data
	})
}

// 卡券分组
const breakCode = (coupon_id) => {
	return request({
		url     : "coupons/qrcode",
		data: {
		    coupon_id
		}
	})
}

export {
	index,
    qrcode,
    barcode,
    couponinfo,
    merchantCard,
    buy,
    buySubmit,
    coupon,
    breakCode
}
