order.js 2.79 KB
import request from '@/sheep/request';

const PayOrderApi = {

  // 课券包订单确认-详情
  getCoursePackageOrderConfirm: (id) => { 
    return request({
      url: '/app/order/packageOrderConfirm',
      method: 'POST',
      data: { id },
    });
  },


  // 礼品卡订单确认详情
  getGiftCardOrderConfirm: (data) => {
    return request({
      url: '/app/order/giftCardOrderConfirm',
      method: 'POST',
      data
    });
  },

  // 包月团课卡订单确认-详情
  getMonthlyLeagueCardOrderConfirm: (id) => {
    return request({
      url: '/app/order/monthlyLeagueCardOrderConfirm',
      method: 'POST',
      data: { id },
    });
  },
  // 月卡订单确认-详情
  getMonthlyCardOrderConfirm: (id) => {
    return request({
      url: '/app/order/monthlyCardOrderConfirm',
      method: 'POST',
      data: { id },
    });
  },
  // 包月私教卡订单确认-详情
  getPtcardOrderConfirm: (id) => {
    return request({
      url: '/app/order/ptcardOrderConfirm',
      method: 'POST',
      data: { id },
    });
  },

  // 私教订单确认-详情
  getPrivateOrder: (data) => {
    return request({
      url: '/app/order/ptOrderConfirm',
      method: 'POST',
      data,
      custom: {
        loading: true,
        loadingText: '加载中...',
      },
    });
  },

  //  团课订单确认-详情
  getGroupOrder: (data) => {
    return request({
      url: '/app/order/leagueOrderConfirm',
      method: 'POST',
      data,
      custom: {
        loading: true,
        loadingText: '加载中...',
      },
    });
  },
  // 创建订单
  createOrder: (data) => {
    return request({
      url: '/app/order/createOrder',
      method: 'POST',
      data,
      custom: {
        loading: true,
        loadingText: '加载中...',
      },
    });
  },
  //  提交支付订单
  payOrderSubmit: (data) => {
    return request({
      url: '/pay/order/submit',
      method: 'POST',
      data: {
        id: data.id,
        channelCode: data.channelCode,
        channelExtras: data.channelExtras,
      },
    });
  },
  // 订单分页
  orderPage: (data) => {
    return request({
      url: '/app/order/page',
      method: 'get',
      data,
      custom: {
        loading: true,
        loadingText: '加载中...',
      },
    });
  },
  // 订单详情
  orderDetail: (id) => {
    return request({
      url: `/app/order/detail/${id}`,
      method: 'get',
      custom: {
        loading: true,
        loadingText: '加载中...',
      },
    });
  },
  // 获取订单类型
  getOrderTypes: () => {
    return request({
      url: '/app/order/getType',
      method: 'get',
    });
  },
  // 取消订单
  cancelOrder: (id) => {
    return request({
      url: `/app/order/cancelOrder`,
      method: 'post',
      data: {
        id,
      },
    });
  },
};

export default PayOrderApi;