Commit bdcd3198fa694ecf137c773cebc8852b74d51272
1 parent
2e6cbed9
传base64位
Showing
1 changed file
with
6 additions
and
5 deletions
src/pages/test.vue
| ... | ... | @@ -46,17 +46,18 @@ |
| 46 | 46 | |
| 47 | 47 | let event = document.createEvent('MouseEvents'); |
| 48 | 48 | event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); |
| 49 | - save_link.dispatchEvent(event); | |
| 49 | +// save_link.dispatchEvent(event); | |
| 50 | + console.log(data) | |
| 50 | 51 | // 调用原生方法 |
| 51 | 52 | // 调用分享(新方法) |
| 52 | - if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.toShare) { | |
| 53 | + if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.CNDSCheckAllowVisitPhotoAlbumHandler) { | |
| 53 | 54 | |
| 54 | 55 | // 分享 |
| 55 | - window.webkit.messageHandlers.toShare.postMessage({body: {type: type, id: id}}); | |
| 56 | - } else if (window.obj && window.obj.toShare) { | |
| 56 | + window.webkit.messageHandlers.CNDSCheckAllowVisitPhotoAlbumHandler.postMessage({body: {data: data}}); | |
| 57 | + } else if (window.obj && window.obj.CNDSCheckAllowVisitPhotoAlbumHandler) { | |
| 57 | 58 | |
| 58 | 59 | // 分享 |
| 59 | - window.obj.toShare(type, id); | |
| 60 | + window.obj.CNDSCheckAllowVisitPhotoAlbumHandler(data); | |
| 60 | 61 | } |
| 61 | 62 | } |
| 62 | 63 | } | ... | ... |