import request from "@/utils/request.js";
/**
 * 获取小程序配置
 *
 */
export function getMiniProgramData() {
  return request.get("mini-program/config/info", {}, { noAuth: true });
}
/**
 * 获取主页数据 无需授权
 *
 */
export function getIndexData() {
  return request.get("index", {}, { noAuth: true });
}
/**
 * 优惠券列表
 * @param object data
 */
export function getCoupons(data) {
  return request.get("coupons", data, { noAuth: true });
}
/**
 * 领取优惠卷
 * @param int couponId
 *
 */
export function setCouponReceive(couponId) {
  return request.post("coupon/receive", { couponId: couponId });
}
/**
 * 获取小程序二维码
 */
export function getQrcode(data) {
  return request.post("qrcode/get", data, { noAuth: true });
}
/**
 * 获取城市信息
 */
export function getCity() {
  return request.get("city/list", {}, { noAuth: true });
}

/**
 * 获取商家的轮播图
 */
export function getMerchantBannerList(data) {
  return request.get("sbmerchant/banner/list", data, { noAuth: true });
}

/**
 * 为用户添加加盟角色
 */
export function addJoinTeamUserRole(data) {
  return request.post("join-team/user-role/add", data);
}