敬告:此 demo 演示为开放测试页面,仅用于开发者快速测试体验应用功能,请严格遵守开发者协议,九游会j9备用网址-j9九游会登录入口首页新版。
♦ js-sdk 引用方式:
♦ 普通网页 script 方式加载:下载最新版 jsbridge-v20250416.zip,请在页面上调用 jsbridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge
♦ 模型(model) 结构与 sdk model 定义一致,参数含义及约束规则请参考官方文档。
//返回百度经纬度坐标 bd09ll jsbridge.freight.location(function(succ, res) { if (res.success) { //定位成功,在本页面底部显示 res //请根据 res.loctype 使用位置数据 //当 61 卫星定位结果,66 离线定位结果,161 网络定位结果 时才成功 showresult(res); } else { alert(res.message); } });
enterprisecode:
appidentity:
appkey:
driveridentity:
jsbridge.freight.register({ //企业代码 enterprisecode: "{{register.enterprisecode}}", //企业app的身份码 appidentity: "{{register.appidentity}}", //企业app验证码 appkey: "{{register.appkey}}", //司机身份证号 driveridentity: "{{register.driveridentity}}" }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
jsbridge.freight.pickup({ //运单号 shipmentcode: "{{shipmentcode}}", //位置信息 location: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}} } }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
jsbridge.freight.unload({ //运单号 shipmentcode: "{{shipmentcode}}", //位置信息 location: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}} } }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
jsbridge.freight.sign({ //运单号 shipmentcode: "{{shipmentcode}}", //位置信息 location: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}} }, //货物清单(数组) goodslist: [ { //货品编号 itemno: 11223344, //货品名称 goodsname: "某某某", //货品应收数量 quantity: 100, //货品实收数量 receivedquantity: 100, //货品破损数量 damagequantity: 0, //货品丢失数量 lostquantity: 0, //货品单位 unit: "箱" } //,{ } ] }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
jsbridge.freight.pod({ //运单号 shipmentcode: "{{shipmentcode}}", //位置信息 location: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}} } }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
image.filename:
image.filedata:
image.fileext:
image.imagetakendate:
jsbridge.freight.uploadpickupimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图⽚信息 image: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}}, //⽂件名 filename: "{{image.filename}}", //建议压缩图片,不要太大 //⽂件数据(base64格式),数据格式:data:image/{file ext};base64,{file data base64} filedata: "{{image.filedata}}", //照⽚格式 fileext: "{{image.fileext}}", //拍照时间 imagetakendate: "{{image.imagetakendate}}" } }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
image.filename:
image.filedata:
image.fileext:
image.imagetakendate:
jsbridge.freight.uploadunloadimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图⽚信息 image: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}}, //⽂件名 filename: "{{image.filename}}", //建议压缩图片,不要太大 //⽂件数据(base64格式),数据格式:data:image/{file ext};base64,{file data base64} filedata: "{{image.filedata}}", //照⽚格式 fileext: "{{image.fileext}}", //拍照时间 imagetakendate: "{{image.imagetakendate}}" } }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
location.baidulongitude:
location.baidulatitude:
location.location:
location.time:
location.altitude:
location.speed:
location.direction:
image.filename:
image.filedata:
image.fileext:
image.imagetakendate:
jsbridge.freight.uploadpodimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图⽚信息 image: { //baidu定位经度 baidulongitude: {{location.baidulongitude}}, //baidu定位纬度 baidulatitude: {{location.baidulatitude}}, //经纬度转化来的具体位置 location: "{{location.location}}", //操作时间,格式:yyyy-mm-ddthh:mm:ss time: "{{location.time}}", //海拔,选填 altitude: {{location.altitude}}, //速度,选填 speed: {{location.speed}}, //⽅向,选填 direction: {{location.direction}}, //⽂件名 filename: "{{image.filename}}", //建议压缩图片,不要太大 //⽂件数据(base64格式),数据格式:data:image/{file ext};base64,{file data base64} filedata: "{{image.filedata}}", //照⽚格式 fileext: "{{image.fileext}}", //拍照时间 imagetakendate: "{{image.imagetakendate}}" } }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
jsbridge.freight.getpickupimagenames({ //运单号 shipmentcode: "{{shipmentcode}}" }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
shipmentcode:
jsbridge.freight.getunloadimagenames({ //运单号 shipmentcode: "{{shipmentcode}}" }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
shipmentcode:
jsbridge.freight.getpodimagenames({ //运单号 shipmentcode: "{{shipmentcode}}" }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
shipmentcode:
imagename:
imageext:
jsbridge.freight.deletepickupimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图片名称 imagename: "{{imagename}}", //图片类型 imageext: "{{imageext}}" }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
imagename:
imageext:
jsbridge.freight.deleteunloadimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图片名称 imagename: "{{imagename}}", //图片类型 imageext: "{{imageext}}" }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
imagename:
imageext:
jsbridge.freight.deletepodimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图片名称 imagename: "{{imagename}}", //图片类型 imageext: "{{imageext}}" }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
imagename:
imageext:
jsbridge.freight.downloadpickupimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图片名称 imagename: "{{imagename}}", //图片类型 imageext: "{{imageext}}" }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
shipmentcode:
imagename:
imageext:
jsbridge.freight.downloadunloadimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图片名称 imagename: "{{imagename}}", //图片类型 imageext: "{{imageext}}" }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
shipmentcode:
imagename:
imageext:
jsbridge.freight.downloadpodimage({ //运单号 shipmentcode: "{{shipmentcode}}", //图片名称 imagename: "{{imagename}}", //图片类型 imageext: "{{imageext}}" }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
pagesize:
currentpage:
jsbridge.freight.getinvoices({ //分页大小 pagesize: {{pagesize}}, //当前页次 currentpage: {{currentpage}} }, function(succ, res) { if (succ) { //在本页面底部显示 res showresult(res); } else { alert('失败\n' json.stringify(res)); } });
driverinvoicecode:
jsbridge.freight.confirminvoice({ //司机发票编号 driverinvoicecode: "{{driverinvoicecode}}" }, function(succ, res) { alert(succ ? '成功' : '失败\n' json.stringify(res)); });
shipmentcode:
jsbridge.freight.getshipmentstatus({ //运单号 shipmentcode: "{{shipmentcode}}" }, function(succ, res) { if (succ) { alert(res.status) } else { alert('失败\n' json.stringify(res)); } });
监听回调数据: