更新记录

1.0.1(2023-03-31)

1.封装了部网络货运信息交互系统位置信息原生SDK(百度地图版),提供授权企业信息、开始定位、发送定位、停止定位、暂停定位、重新定位。


平台兼容性

Android Android CPU类型 iOS
适用版本区间:4.4 - 12.0 armeabi-v7a:支持,arm64-v8a:支持,x86:未测试 适用版本区间:9 - 16

原生插件通用使用流程:

  1. 购买插件,选择该插件绑定的项目。
  2. 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
  3. 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
  4. 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
  5. 开发完毕后正式云打包

付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios

注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择




概述

部网络货运信息交互系统位置信息简介

集成在网络货运企业司机端 APP中,在运单起运到收货的运输过程中,抓取驾驶员位置信息数据,上传至部交互系统。

netLocationBMap 模块概述

本模块封装了部网络货运信息交互系统位置信息原生SDK(百度地图版),提供授权企业信息、开始定位、发送定位、停止定位、暂停定位、重新定位。

模块使用攻略

可以通过部交互系统网站(http://wlhy.mot.gov.cn)或 QQ 运维群 (530051420、129197455)等渠道获取。

模块依赖

-注意:

1.本模块依赖【百度地图】模块

2.联系QQ:770104707

模块接口

setAgreePrivacyForMap

百度隐私合规接口

setAgreePrivacyForMap({params},callback(ret, err))

params

isAgree

  • 类型:布尔
  • 描述:(必填)是否同意隐私政策

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.setAgreePrivacyForMap({
        isAgree:true
    });

auth

授权企业信息

auth({params},callback(ret, err))

params

appId

  • 类型:字符串
  • 描述:(选填)APPID

appSecurity

  • 类型:字符串
  • 描述:(选填)APP安全码

enterpriseSenderCode

  • 类型:字符串
  • 描述:(选填)企业码

environment

  • 类型:字符串
  • 描述:(选填)环境 debug 、release

vehicleNumber

  • 类型:字符串
  • 描述:(必填)车牌号

driverName

  • 类型:字符串
  • 描述:(必填)司机姓名

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.auth({
        appId:"",//APPID
        appSecurity:"",//APP安全码
        enterpriseSenderCode:"",//企业码
        environment:"release",//环境 debug 、release
        vehicleNumber:"辽A123456",//车牌号
        driverName:"测试",//司机姓名
    }, function(ret, err){
        if(ret.status){

        }
    });

start

开始定位

start({params},callback(ret, err))

params

remark

  • 类型:字符串
  • 描述:(选填)备注

shippingNoteInfos

  • 类型:数组
  • 描述:(必填)运单信息列表
    [
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        },
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        }
    ]

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.start({
        remark:"",//备注
        shippingNoteInfos:[
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            },
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            }
        ]
    },function (ret,err){

        if(ret.status){

        }else{
            //错误信息
        }
    });

send

发送定位

send({params},callback(ret, err))

params

remark

  • 类型:字符串
  • 描述:(选填)备注

shippingNoteInfos

  • 类型:数组
  • 描述:(选填)运单信息列表 (为空,运行start填写的信息)
    [
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        },
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        }
    ]

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.send({
        remark:"",//备注
        shippingNoteInfos:[
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            },
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            }
        ]
    },function (ret,err){

        if(ret.status){

        }else{
            //错误信息
        }
    });

pause

暂停定位

pause({params},callback(ret, err))

params

remark

  • 类型:字符串
  • 描述:(选填)备注

shippingNoteInfos

  • 类型:数组
  • 描述:(选填)运单信息列表 (为空,运行start填写的信息)
    [
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        },
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        }
    ]

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.pause({
        remark:"",//备注
        shippingNoteInfos:[
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            },
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            }
        ]
    },function (ret,err){

        if(ret.status){

        }else{
            //错误信息
        }
    });

stop

停止定位

stop({params},callback(ret, err))

params

remark

  • 类型:字符串
  • 描述:(选填)备注

shippingNoteInfos

  • 类型:数组
  • 描述:(选填)运单信息列表 (为空,运行start填写的信息)
    [
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        },
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        }
    ]

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.stop({
        remark:"",//备注
        shippingNoteInfos:[
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            },
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            }
        ]
    },function (ret,err){

        if(ret.status){

        }else{
            //错误信息
        }
    });

restart

重置定位

restart({params},callback(ret, err))

params

remark

  • 类型:字符串
  • 描述:(选填)备注

shippingNoteInfos

  • 类型:数组
  • 描述:(选填)运单信息列表 (为空,运行start填写的信息)
    [
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        },
        {
            shippingNoteNumber:'ZM2021042420001515151',//运单号
            serialNumber:'ZM202104242000151515101',//分单号
            startCountrySubdivisionCode:'210106',//起点行政区划代码
            startLatitude:'',//起点位置纬度
            startLongitude:'',//起点位置经度
            startLocationText:'',//起点地址文字描述
            endCountrySubdivisionCode:'110105',//终点行政区划代码
            endLatitude:'',//到达位置经度
            endLongitude:'',//到达位置纬度
            endLocationText:''//到达地址文字描述
        }
    ]

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = uni.requireNativePlugin('saner-netLocationBMap');
    netLocationBMap.restart({
        remark:"",//备注
        shippingNoteInfos:[
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            },
            {
                shippingNoteNumber:'ZM2021042420001515151',//运单号
                serialNumber:'ZM202104242000151515101',//分单号
                startCountrySubdivisionCode:'210106',//起点行政区划代码
                startLatitude:'',//起点位置纬度
                startLongitude:'',//起点位置经度
                startLocationText:'',//起点地址文字描述
                endCountrySubdivisionCode:'110105',//终点行政区划代码
                endLatitude:'',//到达位置经度
                endLongitude:'',//到达位置纬度
                endLocationText:''//到达地址文字描述
            }
        ]
    },function (ret,err){

        if(ret.status){

        }else{
            //错误信息
        }
    });

隐私、权限声明

1. 本插件需要申请的系统权限列表:

定位 网络服务

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件自身不采集任何数据,插件使用的百度地图定位 SDK采集数据请参考其官方说明:https://lbsyun.baidu.com

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问