restapi.js 3.58 KB
const restapi = require('../utils/restapi.js')
import api from './request.js'
module.exports = {
  /** 获取订单数据*/
  GETORDERINFO: function (oParams, success, fail) {
    restapi.req('/web-dj-weapp/smartcarlife/goodsOrder/createWxPayOrderWithNotLogin', oParams, {}, 'GET', 'json', 'text', success, fail)
    // restapi.req('/web-dj-weapp/smartcarlife/goodsOrder/createWxPayOrder', oParams, {}, 'GET', 'json', 'text', success, fail)
  },
  /** 精品交付单订单详情列表 */
  // getBoutiqueOrderDetail(data, success, fail) {
  //   api.get('boutiquedelivery/order/getDetail', data, success, fail)
  // },
  // req(`/web-dj-weapp/${link}`, data, header, method, 'json', 'text',
  /** 精品交付单订单详情列表 */
  // getBoutiqueOrderDetail: function (params, success, fail) {
  //   restapi.req(
  //     '/web-dj-weapp/boutiquedelivery/order/getDetail',
  //     // JSON.stringify(code),
  //     params, {},'GET', 'json', 'text', success,fail
  //   )
  // },
  getDetailByOrderCode(params, success, fail) {
    // api.get('smartcarlife/goodsOrder/getDetailByOrderCode', data, success)
    restapi.req(
      '/web-dj-weapp/smartcarlife/goodsOrder/getDetailByOrderCode',
      // JSON.stringify(code),
      params,
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 根据场景id获取场景值
   */
  qrCodeScene: function (qrcodeScene, success, fail) {
    restapi.req('/web-dj-weapp/home/qrCodeScene/getSceneById', qrcodeScene, {}, 'GET', 'json', 'text', success, fail)
  },
  /** 查询支付结果 */
  queryPayOrderStatus: function (params, success, fail) {
    restapi.req(
      '/web-dj-weapp/smartcarlife/goodsOrder/queryPayOrderStatus',
      params,
      // {
      //   'content-type': 'application/x-www-form-urlencoded'
      // },
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /** 发起微信支付 */
  createWxPayOrderH5: function (params, success, fail) {
    restapi.req(
      '/web-dj-weapp/smartcarlife/goodsOrder/createWxPayOrderH5',
      params,
      // {
      //   'content-type': 'application/x-www-form-urlencoded'
      // },
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 授权登录
   * wechatAuthSetting:微信授权信息
   */
  authOpenId: function (params, success, fail) {
    restapi.req(
      '/web-dj-weapp/jscode/getOpenId',
      // JSON.stringify(code),
      params,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },

  /** 获取园区店加微二维码 */
  yqMerchantDetail: function (params, success, fail) {
    restapi.req(
      '/web-dj-weapp/smartcarlife/yqMerchant/getYqMerchantConfig',
      // JSON.stringify(code),
      params,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      //   'POST',
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },
  /** 获取用户协议配置 */
  getTitleByModule(data) {
    return api.post('dj.api.smartcarlife.privacyAgreement.getTitleByModule', data)
  },
  /** 订单截图 */
  orderScreenShot(data) {
    return api.post('dj.api.smartcarlife.common.screenShot', data)
  },
  /** 新订单详情 */
  getOrderDetail(data) {
    return api.post('dj.api.smartcarlife.order.detail', data)
  }
}