欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

用最简单的 js 调用 VUE 中的微信扫一扫功能

最编程 2024-04-29 08:25:57
...
is_weixn() { return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 }, scanCode() { if (!this.is_weixn()) { alert('请用微信打开页面,扫码功能仅支持微信页面') return } sessionStorage.setItem('isInSerach', '1') let hrefStr = location.href let href = hrefStr if (hrefStr.indexOf('?') !== -1) { href = hrefStr.split('?')[0] } location.href = `https://www.996315.com/api/scan?redirect_uri=${encodeURIComponent(href)}` },

推荐阅读