import request from "@/helpers/request";

export function mallHomeContent(data) {
  return request({
    baseURL: "/api-mall-portal",
    url: "/home/content",
    method: "get",
    params: data,
  });
}

// 获取商品列表
export const mallProductSearch = (data) => {
  return request({
    baseURL: "/api-mall-portal",
    url: "/product/search",
    method: "post",
    data,
  });
};

// 获取地址列表
export const mallAddressList = (data) => {
  return request({
    baseURL: "/api-mall-portal",
    url: `/member/address/list/${data.userId}`,
    method: "get",
  });
};

// 添加到购物车
export const mallCartAddAll = (data) => {
  return request({
    baseURL: "/api-mall-portal",
    url: "/cart/addAll",
    method: "post",
    data,
  });
};

// 订单支付
export const mallGenerateOrder = (data) => {
  return request({
    baseURL: "/api-mall-portal",
    url: "/order/teacher/generateOrder",
    method: "post",
    data,
  });
};
