获取车辆信息

获取车辆信息

一、getCarInfoDetials;包括车牌号、发动机号、Vin码和车牌颜色。

  • 参数说明:
参数 类型 必填 说明
req Object 请求结构体
req.id String 查询scope,可以一次查询多个,用“,”隔开
success function 成功回调
fail function 失败回调

其中,req.id的查询scope包含以下类型

scope 描述
scope. vin VIN 码
scope. engine 发动机号
scope. plateNumber 车牌号
scope. plateColor 车牌的颜色
  • 返回数据说明:
	{
      "vin":{
           "code":"0",
           "result":"vin"
       },
     "engine":{
          "code":"0",
          "result":"engine"
      },
     "plateNumber":{
          "code":"0",
          "result":"plateNumber"
      },
     "plateColor":{
          "code":"0",
          "result":"plateColor"
      },
  }

其中,code返回0代表授权成功,开发者可以通过result去获取对应的数据如果code返回-1代表授权失败,开发者处理对应自身逻辑。

  • 代码示例
	let reqIds = ' scope.vin, scope.engine';
        swan.iovauto.getCarInfoDetails({
            req:{
                id:reqIds,   
            },
            success: res => {
                if(res.vin.code == "0") {
                    // 处理授权成功逻辑
                    swan.showToast({
                        title: res.vin.result,
                        icon: 'none'
                    });
                } else {
                    // 处理授权失败逻辑
                }
            }
        }
导航获取车型车系