shopmall.js 5.43 KB
import api from "../request/http";
const path = 'scrm.api.shopmall.weapp.'
module.exports = {
  /** 分页查询商城专区的商品信息 */
  getGoodsList(data) {
    return api.post({
      method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage`,
      pageNum: 1,
      pageSize: 999,
      ...data,
    });
  },
  //评论列表
  getCommentList(data) {
    return api.post({
      method: `${path}orderGoodsComment.page`,
      ...data
    },
      true
    )
  },
  /** 添加购物车 */
  addShoppingcart(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.shoppingcart.add`,
      ...data,
    });
  },
  /** 购物车删除商品 */
  delShoppingcart(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.shoppingcart.delete`,
      ...data,
    });
  },
  /** 分页获取购物车 */
  getShoppingcartList(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.shoppingcart.list`,
      ...data,
    });
  },
  /** 购物车商品变更(比如修改数量) */
  updateShoppingcart(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.shoppingcart.update`,
      ...data,
    });
  },
  /** 领取确认订单最大优惠券 */
  getMaxCoupon(orderGoods) {
    return api.fetch("scrm.api.shopmall.weapp.order.coupons.get", {
      orderGoods,
    });
  },

  /**购物车结算 */
  settlementShoppingcart(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.shoppingcart.settlement`,
      ...data,
    });
  },

  /** 创建订单(立即购买) */
  createOrder(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.order.create`,
      ...data,
    });
  },
  /**创建支付订单(去付款) */
  payOrder(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.order.createPay`,
      ...data,
    });
  },
  /**订单详情  */
  getOrderDetail(orderCode) {
    return api.post({
      method: `scrm.api.shopmall.weapp.order.detail`,
      orderCode,
    });
  },
  /**获取订单的售后详情 */
  getOrderRefundDetail(orderCode) {
    return api.post({
      method: `scrm.api.shopmall.weapp.orderRefund.detail`,
      orderCode,
    });
  },

  /**活动详情 */
  getActivityDetail(id) {
    return api.fetch("scrm.api.shopmall.weapp.activity.detail", {
      id,
    });
  },

  /** 根据商品ID获取商品 */
  getGoodsDetail(id) {
    return api.fetch("scrm.api.shopmall.weapp.goods.getById", {
      id,
      viewAmount: true,
    });
  },

  /** 获取商品关联优惠券列表 */
  getGoodscouponList(data) {
    return api.fetch("scrm.api.coupon.seahorse.knife.goods.list", data);
  },

  /** 领取商品详情优惠券 */
  getCoupon(data) {
    return api.fetch("scrm.api.coupon.customer.receive", data);
  },

  /**根据规格值组合获取规格组合库存及零售价 */
  getGoodsSpecificationExtra(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.goods.getGoodsSpecificationExtra`,
      ...data,
    });
  },

  /** 小程序端根据优惠券id查询可使用商品列表(分页) */
  getCouponGoodsPage(data) {
    data.pageSize = 8;
    return api.post({
      method: "scrm.app.shopmall.coupon.goods.page",
      ...data,
    });
  },

  //取消付款
  cancelPay(orderCode) {
    return api.fetch("scrm.api.shopmall.weapp.order.cancelPay", {
      orderCode,
    });
  },
  /** 申请售后 */
  afterSale(data) {
    return api.fetch("scrm.api.shopmall.weapp.orderRefund.apply", data);
  },
  //申请售后待审核的订单取消售后
  cancelOrder(orderCode) {
    return api.fetch("scrm.api.shopmall.weapp.orderRefund.cancel", {
      orderCode,
    });
  },
  /** 为售后添加退货快递信息 */
  addDelivery(data) {
    return api.post({
      method: `scrm.api.shopmall.weapp.orderRefund.addDelivery`,
      ...data,
    });
  },

  requestSubscribeMessage() {
    return api.fetch(
      "scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds"
    );
  },

  /** 确认收货 */
  confirmReceipt(orderCode) {
    return api.post({
      method: `scrm.api.shopmall.weapp.order.confirmReceipt`,
      orderCode,
    });
  },

  /**分类列表
   *
   */
  getMerchantClassify(data) {
    return api.post({
      method: `scrm.api.shopmall.classify.page.curMerchant`,
      pageSize: 9999,
      currentPage: 1,
      ...data,
    });
  },
  /**分类商品  */
  getMerchantClassifyGoods(data) {
    return api.post({
      method: `scrm.api.shopmall.classify.getById`,
      pageSize: 10,
      currentPage: 1,
      ...data,
    });
  },

  /** 获取活动分享链接 */
  getActivitylink(id) {
    return api.post({
      method: "scrm.api.shopmall.activity.get.shared",
      id,
    },true);
  },
  /** 获取商品分享链接 */
  getGoodslink(id) {
    return api.post({
      method: "scrm.api.shopmall.goods.get.shared",
      id,
    },true);
  },
  removeBuuCar(data) {
    return api.post({
      method: "scrm.api.shopmall.weapp.shoppingcart.delete.batch",
      ...data,
    });
  },

  /**埋点接口 */
  trackHttp(data) {
    return api.post({
      method: "entmicro.api.customercollect.reportCustomerList",
      ...data,
    });
  },
    /** 获取商品关联优惠券列表 */
    getEquitycouponList(id) {
      return api.post({
        method: `scrm.api.shopmall.weapp.equitygoods.user.coupons.get`,
        ...id
      },
        true
      )
    },
    // 获取门店列表
    getStoreList(data) {
      return api.post({
        method: `scrm.api.shopmall.weapp.merchant.detail.list`,
        ...data
      })
    },
};