| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- // import wx from './aa';
- function alertMessage(text) {
- alert(text)
- // wx.config({
- // })
- // wx.ready(function () {
- // })
- // alert(text+'sss')
- }
- function isWechatBrowser(){
- var ua = window.navigator.userAgent.toLocaleLowerCase();
- return ua.indexOf('micromessenger')!=-1;
- }
- async function getClipboardContents() {
- try {
- const text = await navigator.clipboard.readText();
- alert('Pasted content: ' + text);
- } catch (err) {
- alert('Failed to read clipboard contents: ' + err);
- }
- }
- function share(parmas) {
- jWeixin.config({
- appId: parmas.appid, // 必填,公众号的唯一标识
- timestamp: parmas.timestamp, // 必填,生成签名的时间戳
- nonceStr: parmas.noncestr, // 必填,生成签名的随机串
- signature: parmas.signature, // 必填,签名
- jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'getNetworkType', 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', 'closeWindow', 'scanQRCode', 'chooseWXPay']
- })
- jWeixin.ready(function () {
- })
- }
- async function shareSys(base64url,shareUrl){
- const blob = await (await fetch(base64url)).blob();
- const file = new File([blob],'share.png',{type:blob.type});
- if (navigator.share){
- window.navigator.share({text:'LinkBaeBae 链接吧,宝贝!',title:'LinkBaeBae 链接吧,宝贝!',url:shareUrl,files:[file]})
- }
- else {
- alert('bb')
- }
- }
- // function capture(x, y, width, height) {
- // // Get The canvas
- // html2canvas(document.body, {
- // x: x,
- // y: y,
- // width: width - x,
- // height: height - y
-
- // //Callback after image captured
- // }).then(function (canvas) {
-
- // //Create a dummy element to download the file
- // var a = document.createElement("a")
- // a.style = "display: none;"
- // a.href = canvas.toDataURL("image/png");
- // a.download = "Example.png";
- // document.querySelector("body").append(a);
- // a.click();
- // a.remove();
- // });
- // }
|