// 引入 request 文件
import request from '@/common/api/request.js'
const urlAccount = '/account'
const urlProduct = '/product'
const urlOrder = '/order'
const urlMarket = '/market'

//桌码换取详细店铺信息
export const APIproductqueryShop = (data) => {
	return request({
		url: urlAccount + '/user/shopInfo',
		method: 'get',
		data: data
	})
}

// 获取登录用户店铺会员信息 
export const APIshopUserInfo = (data) => {
	return request({
		url: urlAccount + '/user/shopUser',
		method: 'get',
		data: data,
		toast: false
	})
}

// 加入会员 
export const APIshopUser = (data) => {
	return request({
		url: urlAccount + '/user/shopUser',
		method: 'post',
		data: data
	})
}

// 获取动态会员码 3分钟内可用 
export const APIusershopUsercode = (data) => {
	return request({
		url: urlAccount + '/user/shopUser/code',
		method: 'get',
		data: data
	})
}

// 获取当前用户所有店铺会员信息 列表
export const APIusershopUservipCard = (data) => {
	return request({
		url: urlAccount + '/user/shopUser/vipCard',
		method: 'get',
		data: data
	})
}


// 获取店铺详细信息
export const APIusershopInfodetail = (data) => {
	return request({
		url: urlAccount + '/user/shopInfo/detail',
		method: 'get',
		data: data
	})
}

//通过用户Id 查找优惠券
export const APIcouponfindByUserId = (data) => {
	return request({
		url: urlMarket + '/user/coupon/findByUserId',
		method: 'get',
		data: data
	})
}
//生成订单后使用
export const APIfindCoupon = (data) => {
	return request({
		url: urlAccount + '/user/coupon/findCoupon',
		method: 'get',
		data: data
	})
}

//桌码换取详细店铺信息
export const APIuseractivate = (data) => {
	return request({
		url: urlAccount + '/user/activate',
		method: 'get',
		data: data
	})
}

//获取余额余额明细
export const APIshopUsermoneyRecord = (data) => {
	return request({
		url: urlAccount + '/user/shopUser/moneyRecord',
		method: 'get',
		data: data
	})
}

//获取积分明细
export const APIshopUserpointsRecord = (data) => {
	return request({
		url: urlMarket + '/user/point/userRecord',
		method: 'get',
		data: data
	})
}

//获取动态会员码
export const APIshopUsercode = (data) => {
	return request({
		url: urlAccount + '/user/shopUser/code',
		method: 'get',
		data: data
	})
}

// 获取当前店铺会员信息
export const getCouponShops = (data) => {
	return request({
		url: urlMarket + '/user/coupon/shops',
		method: 'get',
		data: data
	})
}

// 优惠券弹窗
export const getCouponPopup = (data) => {
	return request({
		url: urlMarket + '/user/coupon/popUp',
		method: 'get',
		data: data
	})
}

// 优惠券弹窗领取
export const receivePopUp = (data) => {
	return request({
		url: urlMarket + '/user/coupon/receivePopUp',
		method: 'get',
		data: data
	})
}