- 企业微信工作台ios左上角返回按钮进到其他页面监听不到
$.ajax({ url: Sys_Server.server + '/sso/wechatParam', data:{ url:location.href.split('#')[0] }, async:false, success:function(res) { console.log('res',res) wx.config({ beta: true,// 必须这么写,否则wx.invoke调用形式的jsapi会有问题 // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: res.data.appId, // 必填,企业微信的corpID timestamp: res.data.timestamp, // 必填,生成签名的时间戳 nonceStr: res.data.noncestr, // 必填,生成签名的随机串 signature: res.data.signature,// 必填,签名,见附录1 jsApiList: ["onMenuShareAppMessage","onMenuShareWechat","onMenuShareTimeline","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","previewFile","getNetworkType","onNetworkStatusChange","openLocation","getLocation","startAutoLBS","stopAutoLBS","onLocationChange","onHistoryBack","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","openDefaultBrowser","scanQRCode","selectEnterpriseContact","openEnterpriseChat","chooseInvoice","selectExternalContact","getCurExternalContact","openUserProfile","shareAppMessage","shareWechatMessage","startWifi","stopWifi","connectWifi","getWifiList","onGetWifiList","onWifiConnected","getConnectedWifi","setClipboardData","getClipboardData"] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }) } }) wx.ready(function(){ console.log('ready成功') wx.onHistoryBack(function(){ alert('监听到了') if(location.href.indexOf('wxWork/index.html') !== -1){ alert(location.href) wx.closeWindow(); }else { return true } }); })
2021-09-09 - 不打包可正常运行,打包就报错 是啥情况?
TypeError: Cannot read property 'prototype' of undefined [图片]
2020-10-27