You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.7 KiB
79 lines
2.7 KiB
function dataURLToBlob(cropperData) { |
|
let arr = cropperData.split(","); |
|
console.log('arr',arr) |
|
let mime = arr[0].match(/:(.*?);/)[1]; |
|
let blobStr = atob(arr[1]); |
|
let n = blobStr.length; |
|
let u8arr = new Uint8Array(n); |
|
while (n--) { |
|
u8arr[n] = blobStr.charCodeAt(n); |
|
} |
|
return URL.createObjectURL(new Blob([u8arr], { type: mime })) |
|
} |
|
|
|
export default { |
|
build() { |
|
// uni.chooseImage = (params) => { |
|
// try { |
|
// if('compile' in params)params.compile(); |
|
// eshimin.getLocalPicture({ |
|
// onResponse:function (res) { |
|
// if('success' in params)params.success([dataURLToBlob(res.img)]); |
|
// } |
|
// }); |
|
// }catch (e){ |
|
// console.log(e) |
|
// if('fail' in params)params.fail(e); |
|
// } |
|
// } |
|
// uni.getLocation = (params) => { |
|
// try { |
|
// console.log('getLocation', params) |
|
// if('compile' in params)params.compile(); |
|
// eshimin.getLocation({ |
|
// onResponse:function (res) { |
|
// if('success' in params)params.success(res); |
|
// } |
|
// }); |
|
// }catch (e){ |
|
// console.log(e) |
|
// if('fail' in params)params.fail(e); |
|
// } |
|
// } |
|
// uni.makePhoneCall = (params) => { |
|
// try { |
|
// console.log('makePhoneCall', params) |
|
// if('compile' in params)params.compile(); |
|
// eshimin.getLocation({ |
|
// phoneNum:params.phoneNumber, |
|
// onResponse:function (res) { |
|
// alert(res) |
|
// if('success' in params)params.success(res); |
|
// } |
|
// }); |
|
// }catch (e){ |
|
// console.log(e) |
|
// if('fail' in params)params.fail(e); |
|
// } |
|
// } |
|
// uni.setNavigationBarTitle = (params) => { |
|
// try { |
|
// console.log('setTitle', params) |
|
// if('compile' in params)params.compile(); |
|
// eshimin.setTitle({ |
|
// title:params.title, |
|
// onResponse:function (res) { |
|
// alert(res) |
|
// if('success' in params)params.success(res); |
|
// } |
|
// }); |
|
// alert(12) |
|
// }catch (e){ |
|
// console.log(e) |
|
// alert(e); |
|
// if('fail' in params)params.fail(e); |
|
// } |
|
// }; |
|
}, |
|
}; |
|
|
|
|