restapi.js 3.99 KB
const restapi = require('../../../utils/restapi.js');

module.exports = {

  /** 获取车联网+数据*/
  getSmartPlusModules: function (merchantId, success, fail) {
    restapi.req('/web-dj-weapp/smartplus/getSmartPlusModules', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success, fail);
  },

  /** 获取绑定信息*/
  getBindingInfo: function (merchantId, success, fail) {
    restapi.req('/web-dj-weapp/home/getBindInfoByCondition', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success, fail);
  },
  /**
  * 请求设备列表
  */
  getDeviceList: function (success, fail) {
    restapi.req('/web-dj-weapp/smartcar/listDevice', {}, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
  },

  /**
   * 切换设备
   */
  checkDevice: function (presentDevice, success, failed) {
    restapi.req('/web-dj-weapp/smartcar/checkDevice', presentDevice, {}, 'Get', 'json', 'text', success, failed);
  },


  /**
   * 爱车追踪-获取爱车位置
   */
  getVehiclePosition: function (userId, success, fail) {
    restapi.req('/web-dj-weapp/smartcar/getVehiclePosition', { userId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
  },

  /**
  * 检查设备状态
  */
  checkDeviceStatus: function (userId, success, fail) {
    restapi.req('/web-dj-weapp/smartcar/checkDeviceStatus', { userId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
  },

  /**
   * 获取设备绑定信息
   */
  getDeviceBindInfo: function (sourcefrom, success, fail) {
    restapi.req('/web-dj-weapp/device/getBindInfo', { sourcefrom: sourcefrom }, { 'content-type': 'application/x-www-form-urlencoded' }, 'GET', 'json', 'text', success, fail)
  },

  /**
   * 获取近四个月有轨迹的日期
   */
  getJouneyDays: function (userId, success, fail) {
    restapi.req('/web-dj-weapp/mileage/getJouneyDays', { userId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
  },
  /**
  * 获取车智能助手数据
  */
  getSmartCarindexInfo: function (userId, success, fail) {
    restapi.req('/web-dj-weapp/smartcar/getIndexInfo', { userId: userId }, {}, 'GET', 'json', 'text', success, fail);
  },
  /**
 * 获取车智能助手应用
 */
  getSmartCarApp: function (userId, success, fail) {
    restapi.req('/web-dj-weapp/smartcar/getSmartCarApp', { userId: userId }, {}, 'GET', 'json', 'text', success, fail);
  },


  /**
   * 获取门店信息
   */
  getMerchantById(merchantId, success) {
    restapi.req('/web-dj-weapp/personal/merchant', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success);
  },

  /**
   * 车智能跳转H5
   */
  smartCarJumpToH5(redirectUrl, success, fail) {
    restapi.req('/web-dj-weapp/smartcar/route', { redirectUrl: redirectUrl }, {}, 'GET', 'json', 'text', success, fail);
  },

  /**
   * 获取小程序应用信息
   * merchantId:商户号
   */
  getAppInfo: function (merchantId, success, fail) {
    restapi.req('/web-dj-weapp/appinfo/get', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success, fail);
  },
  /**
   * 获取车联网广告图
   * merchantId:商户号
   */
  getCarBanner: function (success, fail) {
    restapi.req('/web-dj-weapp/smartcar/smartCarBanner', {}, {}, 'GET', 'json', 'text', success, fail);
  },
  /**
 * 获取获取默认嘀嘀号
 */
  getTempleUserID: function (success, fail) {
    restapi.req('/web-dj-weapp/smartcar/getTempleUserID', {}, {}, 'GET', 'json', 'text', success, fail);
  },
  /** 获取车辆信息 */
  getVehicles(success, fail) {
    restapi.req('/web-dj-weapp/home/getVehicles', {}, {}, 'GET', 'json', 'text', success, fail)
  },
  /** 获取地址 */
  getCarPosition(userId,success, fail) {
    restapi.req('/web-dj-weapp/remoteVideo/getCarPosition', {userId: userId}, {}, 'GET', 'json', 'text', success, fail)
  }
}