import request from "@/utils/request";
import {
	Account_BaseUrl,
	Product_BaseUrl,
	Market_BaseUrl,
	System_BaseUrl
} from "@/api/config";

// 获取分店列表
export function getBranchPage() {
	return request({
		url: `${Account_BaseUrl + "/admin/shop/branch/page"}`,
		method: "get",
	});
}

// 店铺分店列表(下拉展示主店和分店使用，默认第一个是主店，其余是分店）
export function getBranchList() {
	return request({
		url: `${Account_BaseUrl + "/admin/shopInfo/branchList"}`,
		method: "get",
	});
}

// 获取商品-列表
export function getProductList() {
	return request({
		url: `${Product_BaseUrl + "/admin/product/list"}`,
		method: "get",
	});
}

// 获取商品分类
export function getCategoryList() {
	return request({
		url: `${Product_BaseUrl + "/admin/prod/category/list"}`,
		method: "get",
	});
}

// 新增优惠券
export function addCoupon(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon"}`,
		method: data.id ? 'put' : 'post',
		data
	});
}

// 优惠券分页
export function couponPage(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon/page"}`,
		method: "GET",
		params
	});
}

// 删除优惠券
export function delCoupon(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon"}`,
		method: 'DELETE',
		params
	});
}

// 新增消费赠券
export function addConsumerCoupon(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/consumerCoupon/addConsumerCoupon"}`,
		method: 'post',
		data
	});
}

// 消费赠券分页
export function getConsumerCouponPage(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/consumerCoupon/getConsumerCouponPage"}`,
		method: "GET",
		params
	});
}

// 更新消费赠券
export function updateConsumerCouponById(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/consumerCoupon/updateConsumerCouponById"}`,
		method: 'put',
		data
	});
}

// 删除消费赠券
export function deleteConsumerCoupon(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/consumerCoupon/deleteConsumerCoupon"}`,
		method: 'DELETE',
		params
	});
}

// 获取该券关联的功能列表
export function relevanceCoupon(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon/gifts"}`,
		method: 'get',
		params
	});
}

// 通过关联Id取消该券的关联
export function delRelevanceCoupon(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon/cancelGift"}`,
		method: 'DELETE',
		params
	});
}

// 优惠券列表/已领取详情
export function couponRecord(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon/record"}`,
		method: 'get',
		params
	});
}

// 消费赠券已领取详情
export function xfCouponRecord(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon/consumerRecord"}`,
		method: 'get',
		params
	});
}

// 删除用户优惠券
export function deleteRecord(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/coupon/deleteRecord"}`,
		method: 'DELETE',
		params
	});
}

// 智慧充值 配置信息修改
export function shopRecharge(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/shopRecharge"}`,
		method: 'post',
		data
	});
}

// 智慧充值 配置信息获取
export function shopRechargeGet() {
	return request({
		url: `${Market_BaseUrl + "/admin/shopRecharge"}`,
		method: 'get'
	});
}

// 获取店铺用户列表
export function getShopUserList(params) {
	return request({
		url: `${Account_BaseUrl + "/admin/shopUser"}`,
		method: 'get',
		params
	});
}

// 消费返现 配置信息获取 
export function consumeCashback() {
	return request({
		url: `${Market_BaseUrl + "/admin/consumeCashback"}`,
		method: 'get'
	});
}

// 消费返现 配置信息修改 
export function consumeCashbackPost(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/consumeCashback"}`,
		method: 'post',
		data
	});
}

// 消费返现 记录获取 
export function consumeCashbackRecord(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/consumeCashback/record"}`,
		method: 'get',
		params
	});
}

// 满减活动 配置信息获取 
export function discountActivityPage(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/discountActivity/page"}`,
		method: 'get',
		params
	});
}

// 满减活动 新增 
export function discountActivity(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl + "/admin/discountActivity"}`,
		method: method,
		data
	});
}

// 满减活动 删除
export function discountActivityDelete(id) {
	return request({
		url: `${Market_BaseUrl + "/admin/discountActivity"}?id=${id}`,
		method: 'DELETE'
	});
}

// 店铺详情
export function shopInfoGet() {
	return request({
		url: `${Account_BaseUrl + "/admin/shopInfo/detail"}`,
		method: 'get'
	});
}

// 店铺编辑
export function shopInfoPut(data) {
	return request({
		url: `${Account_BaseUrl + "/admin/shopInfo"}`,
		method: 'put',
		data
	});
}

// 私域引流 配置信息获取 
export function drainageConfigGet() {
	return request({
		url: `${Market_BaseUrl + "/admin/drainageConfig"}`,
		method: 'get'
	});
}

// 私域引流 配置信息修改 
export function drainageConfigPost(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/drainageConfig"}`,
		method: 'post',
		data
	});
}

// 短信模板 新增 
export function smsTemplate(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsTemplate"}`,
		method: 'post',
		data
	});
}

// 短信模板 重新提交
export function smsTemplateResubmit(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsTemplate/resubmit"}`,
		method: 'post',
		data
	});
}

// 短信模板 列表 
export function smsTemplateGet() {
	return request({
		url: `${Market_BaseUrl + "/admin/smsTemplate"}`,
		method: 'get',
	});
}

// 短信模板 列表 管理员专用
export function smsTemplatePage(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsTemplate/query"}`,
		method: 'post',
		data
	});
}

// 获取短信发送用户 
export function getPushEventUser(data) {
	return request({
		url: `${Account_BaseUrl + "/admin/shopUser/getPushEventUser"}`,
		method: 'post',
		data
	});
}

// 短信推送任务 新增
export function pushEventPost(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl + "/admin/pushEvent"}`,
		method: method,
		data
	});
}

// 短信推送任务 列表 
export function pushEventGet(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/pushEvent"}`,
		method: 'get',
		params
	});
}

// 短信推送任务 删除任务 
export function pushEventDel(id) {
	return request({
		url: `${Market_BaseUrl}/admin/pushEvent/${id}`,
		method: 'DELETE'
	});
}

// 获取店铺短信余额明细 
export function smsMoneyDetail(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsMoneyDetail"}`,
		method: 'get',
		params
	});
}

// 霸王餐 配置信息获取 
export function freeDingGet(params) {
	return request({
		url: `${Account_BaseUrl + "/admin/freeDing"}`,
		method: 'get',
		params
	});
}

// 霸王餐 修改霸王餐配置信息 
export function freeDingPut(data) {
	return request({
		url: `${Account_BaseUrl + "/admin/freeDing"}`,
		method: 'put',
		data
	});
}

// 平台 模板状态/删除 
export function shopUseDelStatus(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsTemplate/shopUse"}`,
		method: 'post',
		data
	});
}

// 配置信息获取 
export function adminSmsMoneyPage(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsMoney/page"}`,
		method: 'get',
		params
	});
}

// 变更店铺短信余额
export function smsMoneyChange(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsMoney/change"}`,
		method: 'post',
		data
	});
}

// 平台 获取店铺短信余额明细
export function smsMoneyDetailQuery(data) {
	return request({
		url: `${Market_BaseUrl + "/admin/smsMoneyDetail/query"}`,
		method: 'post',
		data
	});
}

// 获取店铺短信余额 
export function smsMoneyGet() {
	return request({
		url: `${Market_BaseUrl + "/admin/smsMoney"}`,
		method: 'get'
	});
}

// 获取发送短信单价 
export function smsMoneyGetFee() {
	return request({
		url: `${System_BaseUrl + "/admin/sysParams/code/sms_fee"}`,
		method: 'get'
	});
}

// 微信公众号 商家每日可创建次数 
export function acDayCount() {
	return request({
		url: `${System_BaseUrl + "/admin/sysParams/code/ac_day_count"}`,
		method: 'get'
	});
}

// 公众号推送：列表
export function acPushEventGet(params) {
	return request({
		url: `${Market_BaseUrl + "/admin/acPushEvent"}`,
		method: 'get',
		params
	});
}

// 公众号推送：删除任务
export function acPushEventDel(id) {
	return request({
		url: `${Market_BaseUrl}/admin/acPushEvent/${id}`,
		method: 'DELETE'
	});
}

// 公众号推送：新增/更新
export function acPushEventPost(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl}/admin/acPushEvent`,
		method: method,
		data
	});
}

// 公众号任务获取用户
export function getAcPushEventUser(data) {
	return request({
		url: `${Account_BaseUrl + "/admin/shopUser/getAcPushEventUser"}`,
		method: 'post',
		data
	});
}

// 充值兑换 配置开关
export function rechargeRedemptionPut(data) {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption/enable`,
		method: 'put',
		data
	});
}

// 充值兑换 开关状态
export function rechargeRedemptionEnableStatus() {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption/enable/status`,
		method: 'get',
	});
}

// 充值兑换 配置信息获取 列表
export function rechargeRedemptionList(params) {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption/list`,
		method: 'get',
		params
	});
}

// 充值兑换 配置信息添加/编辑
export function rechargeRedemption(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption`,
		method: method,
		data
	});
}

// 充值兑换 充值兑换码列表
export function rechargeRedemptionCodeList(params) {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption/code/list`,
		method: 'get',
		params
	});
}

// 充值兑换 配置信息详情
export function rechargeRedemptionDetail(params) {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption`,
		method: 'get',
		params
	});
}

// 充值兑换 配置信息详情
export function rechargeRedemptionExport(params) {
	return request({
		url: `${Market_BaseUrl}/admin/rechargeRedemption/code/export`,
		method: 'get',
		params,
		responseType: "blob",
	});
}

// 券兑换码 开关。可用门店修改
export function couponRedemptionEnable(data) {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption/enable`,
		method: 'put',
		data
	});
}

// 券兑换码 开关状态，可用门店详情
export function couponRedemptionEnableStatus() {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption/enable/status`,
		method: 'get',
	});
}

// 券兑换码 配置信息获取 列表
export function couponRedemptionList(params) {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption/list`,
		method: 'get',
		params
	});
}

// 券兑换码 配置信息添加/编辑
export function couponRedemption(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption`,
		method: method,
		data
	});
}

// 券兑换码 券兑换码码列表
export function couponRedemptionCodeList(params) {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption/code/list`,
		method: 'get',
		params
	});
}

// 券兑换码 配置信息详情
export function couponRedemptionDetail(params) {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption`,
		method: 'get',
		params
	});
}

// 券兑换码 配置信息详情
export function couponRedemptionCodeExport(params) {
	return request({
		url: `${Market_BaseUrl}/admin/couponRedemption/code/export`,
		method: 'get',
		params,
		responseType: "blob",
	});
}

// 限时折扣-分页
export function limitTimeDiscountPage(params) {
	return request({
		url: `${Market_BaseUrl}/admin/limitTimeDiscount/page`,
		method: 'get',
		params
	});
}

// 限时折扣-新增
export function limitTimeDiscount(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl}/admin/limitTimeDiscount`,
		method: method,
		data
	});
}

// 限时折扣-删除
export function limitTimeDiscountDel(params) {
	return request({
		url: `${Market_BaseUrl}/admin/limitTimeDiscount`,
		method: 'DELETE',
		params
	});
}

// 点单智能推荐-分页
export function suggestPage(params) {
	return request({
		url: `${Market_BaseUrl}/admin/suggest/page`,
		method: 'get',
		params
	});
}

// 点单智能推荐-添加/修改
export function suggestPostPut(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl}/admin/suggest`,
		method: method,
		data
	});
}

// 点单智能推荐-删除
export function suggestDel(params) {
	return request({
		url: `${Market_BaseUrl}/admin/suggest`,
		method: 'DELETE',
		params
	});
}

// 分销-配置信息详情
export function distributionGet(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution`,
		method: 'get',
		params
	});
}

// 分销-配置信息修改
export function distributionPut(data) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution`,
		method: 'put',
		data
	});
}

// 分销-金额记录
export function distributionFlow(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/flow`,
		method: 'get',
		params
	});
}

// 分销-现金充值
export function distributionCashPay(data) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/cashPay`,
		method: 'post',
		data
	});
}

// 分销-分销员:添加分销员
export function distributionUser(data, method = 'post') {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/user`,
		method: method,
		data
	});
}

// 分销员:分销员列表  下级用户列表
export function distributionUserPage(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/user`,
		method: 'get',
		params
	});
}

// 分销员:开通记录
export function distributionOpenFlow(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/openFlow`,
		method: 'get',
		params
	});
}

// 分销员:分销明细
export function distributionFlowGet(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/distributionFlow`,
		method: 'get',
		params
	});
}

// 分销员:用户提现列表
export function distributionWithdrawFlow(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/withdrawFlow`,
		method: 'get',
		params
	});
}

// 分销员:充值二维码获取
export function distributionRechargeQrCode(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/rechargeQrCode`,
		method: 'get',
		params
	});
}

// 店铺列表, 只允许管理员调用
export function shopInfoList(params) {
	return request({
		url: `${Account_BaseUrl}/admin/shopInfo`,
		method: 'get',
		params
	});
}

// 分销, 金额记录
export function distributionShopFlow(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/flow`,
		method: 'get',
		params
	});
}

// 分销员:获取邀请人分页列表
export function distributionUserInviteUser(params) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/user/inviteUser`,
		method: 'get',
		params
	});
}

// 分销员:重置分销员等级
export function distributionUserResetLevel(data) {
	return request({
		url: `${Market_BaseUrl}/admin/distribution/user/resetLevel`,
		method: 'post',
		data
	});
}

// 会员购买订单记录 分页
export function memberOrder(params) {
	return request({
		url: `${Market_BaseUrl}/admin/member/order`,
		method: 'get',
		params
	});
}

// 考勤打卡数据 配置获取
export function attendanceConfig(params) {
	return request({
		url: `${Market_BaseUrl}/admin/attendance/config`,
		method: 'get',
		params
	});
}

// 考勤打卡数据 修改配置
export function attendanceConfigPut(data) {
	return request({
		url: `${Market_BaseUrl}/admin/attendance/config`,
		method: 'put',
		data
	});
}

// 考勤打卡数据 列表
export function attendanceList(params) {
	return request({
		url: `${Market_BaseUrl}/admin/attendance`,
		method: 'get',
		params
	});
}

// 考勤打卡数据 用户打卡详情
export function attendanceDetail(params) {
	return request({
		url: `${Market_BaseUrl}/admin/attendance/detail`,
		method: 'get',
		params
	});
}

// 分享奖励基础:新增/修改
export function shareBasePost(data) {
	return request({
		url: `${Market_BaseUrl}/admin/shareBase`,
		method: 'POST',
		data
	});
}

// 分享奖励基础 查询
export function shareBaseGet(params) {
	return request({
		url: `${Market_BaseUrl}/admin/shareBase`,
		method: 'GET',
		params
	});
}

// 轮播图配置:新增/修改
export function shareCarouselPost(data) {
	return request({
		url: `${Market_BaseUrl}/admin/carousel`,
		method: 'POST',
		data
	});
}

// 分享轮播图配置
export function shareCarouselGet(params) {
	return request({
		url: `${Market_BaseUrl}/admin/carousel`,
		method: 'GET',
		params
	});
}

// 分享 轮播图配置 删除
export function shareCarouselDel(id) {
	return request({
		url: `${Market_BaseUrl}/admin/carousel/${id}`,
		method: 'DELETE'
	});
}

// 全民股东群聊 配置信息获取
export function disGroupGet(params) {
	return request({
		url: `${Market_BaseUrl}/admin/disGroup`,
		method: 'get',
		params
	});
}

// 全民股东群聊:新增/修改
export function disGroupPost(data) {
	return request({
		url: `${Market_BaseUrl}/admin/disGroup`,
		method: 'POST',
		data
	});
}































