高拍仪
高拍仪插件暴露的API
类别 | 序号 | 名称 | 说明 |
---|---|---|---|
public函数 | 1 | takePicture() | 调起高拍仪操作界面,返回拍摄结果; |
1、takePicture
下面的代码调起高拍仪,返回图片列表
function takePicture1() { console.log("调用takePicture1"); let data = { dataType: 'img' } let callback = (resp) => { if (resp.resultCode === 0) { //调用成功 console.log("调用成功"); console.log(JSON.stringify(resp)); $.each(resp.data, (index, imgData) => { imgElm = document.createElement("img"); imgElm.src = imgData; $(imgElm).addClass('thumbnail'); spanElm = document.createElement("span"); $(spanElm).addClass('pics'); $(spanElm).append(imgElm); aElm = document.createElement("a"); aElm.href = imgData; $(aElm).append(spanElm); $('.image-gallary-1').append(aElm); }); $('.image-gallary-1').magnificPopup({ delegate: 'a', // child items selector, by clicking on it popup will open type: 'image' // other options }); } else { console.log(resp.resultMessage); } } window.zwexplorer.PaperMaterialCamera.takePicture(data, callback); }
下面的代码调起高拍仪,返回图片合并后的pdf
function takePicture2() { console.log("调用takePicture2"); let data = { dataType: 'pdf' } let callback = (resp) => { if (resp.resultCode === 0) { console.log('调用takePicture2成功'); $("#pdfContent").val(resp.data); } else { console.log(resp.resultMessage); } } window.zwexplorer.PaperMaterialCamera.takePicture(data, callback); }