小程序
小游戏
企业微信
微信支付
扫描小程序码分享
目前可以扫普通二维码跳转小程序,可否通过直接打开二维码的地址打开小程序,而不通过扫码的形式
6 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
let postData = { appKey: 'QTSHE_MINI_APP', path: 'pages/partdetails/partdetails', query: 'partJobId=123456' || 'a=1' } this.$axios.post('/qtsWeChat/wechat/qrCode/scheme/info', postData).then((res) => { if (res.success) { const url = res.data.openlink // 将scheme转为我们平台的短链接,否则在安卓手机上无法打开微信小程序,会默认打开浏览器搜索。 this.$axios.get(`/misc/shortLink/conversion`, {url}).then((res) => { if (res.success) { this.shortLink = res.data } }) } else { this.$Message.error('获取失败,请稍后重试') } }).catch((err) => { console.log(err) })
wx-open-launch-app
wx-open-launch-weapp
window.wx.config({ debug: false, appId: window.g_info.wx_appid, timestamp: data.data.timestamp, nonceStr: data.data.nonceStr, signature: data.data.signature, jsApiList: [], openTagList: [ 'wx-open-launch-app', 'wx-open-launch-weapp' ] })
<script type="text/wxtag-template"></script>
position: fixed; top -100;
frame-src https://*.qq.com webcompt:
<wx-open-launch-weapp id="launch-btn" username="gh_7c2bc00a6bf8" path="pages/partdetails/partdetails.html?partJobId=1013456"> <script type="text/wxtag-template"> <style> img { width: 100%; display: block; animation: free_download 0.9s linear alternate infinite; will-change: transform; } @keyframes free_download { 0% { transform: scale(0.9); } 100% { transform: scale(1); } } </style> <img src="https://qiniu-image.qtshe.com/202103179.png" alt="" /> </script> </wx-open-launch-weapp>
// 各个端口跳转兼职详情页 jumpToPartJobDetail(partJobId) { util.isAliMiniApp().then((res) => { if (res) { // 如果是在支付宝小程序环境则打开小程序详情页 my.navigateTo({ url: `/pages/partdetails/partdetails?partJobId=${partJobId}` }) } else { // 如果是在客户端app环境,则打开原生岗位详情页 if (util.isAndroidApp() || util.isIosApp()) { jsBridge.evokeNormalPartJobDetailPage(partJobId) } else if (util.isMiniApp()) { // 微信小程序里则打开微信小程序岗位详情 wx.miniProgram.navigateTo({ url: `/pages/partdetails/partdetails?partJobId=${partJobId}` }) } else if (util.isMobile()) { // 如果是在手机自带浏览器或者除微信外的app浏览器,统一打开支付宝小程序 let url = `alipays://platformapi/startapp?appId=2018082861168647&page=pages/partdetails/partdetails&query=partJobId%3D${partJobId}` window.location.href = `https://ds.alipay.com/?scheme=${encodeURIComponent(url)}` } else { // pc端打开h5的兼职详情页 window.location.href = `/app/partdetails?partJobId=${partJobId}` } } }) }
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
微信内部环境 可通过urlLink方式打开非个人小程序,相关文档:
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/url-link.html
外部h5任意外链跳转微信打开小程序,参考案例 http://m.jumpwx.com/wx/?i=170
:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#21
微信外浏览器用urlscheme.generate:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html
你说的是 url scheme?
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html
自己试一下很难吗
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
微信外部浏览器唤起微信小程序
目的:通过发送短信召回流失用户。
官方文档地址
步骤一
步骤二
步骤三
步骤四
步骤五
let postData = { appKey: 'QTSHE_MINI_APP', path: 'pages/partdetails/partdetails', query: 'partJobId=123456' || 'a=1' } this.$axios.post('/qtsWeChat/wechat/qrCode/scheme/info', postData).then((res) => { if (res.success) { const url = res.data.openlink // 将scheme转为我们平台的短链接,否则在安卓手机上无法打开微信小程序,会默认打开浏览器搜索。 this.$axios.get(`/misc/shortLink/conversion`, {url}).then((res) => { if (res.success) { this.shortLink = res.data } }) } else { this.$Message.error('获取失败,请稍后重试') } }).catch((err) => { console.log(err) })
注意点
微信内部浏览器唤起小程序
官方文档地址
步骤一
步骤二
步骤三
wx-open-launch-app
微信h5唤起本地已经安装的app,以及wx-open-launch-weapp
微信h5唤起小程序,操作如下:window.wx.config({ debug: false, appId: window.g_info.wx_appid, timestamp: data.data.timestamp, nonceStr: data.data.nonceStr, signature: data.data.signature, jsApiList: [], openTagList: [ 'wx-open-launch-app', 'wx-open-launch-weapp' ] })
注意点
<script type="text/wxtag-template"></script>
进行代替,来包裹插槽模版和样式。position: fixed; top -100;
等,尽量不要写在插槽模版的节点中,请声明在标签或其父节点上;frame-src https://*.qq.com webcompt:
,才能在页面中正常使用开放标签。<wx-open-launch-weapp id="launch-btn" username="gh_7c2bc00a6bf8" path="pages/partdetails/partdetails.html?partJobId=1013456"> <script type="text/wxtag-template"> <style> img { width: 100%; display: block; animation: free_download 0.9s linear alternate infinite; will-change: transform; } @keyframes free_download { 0% { transform: scale(0.9); } 100% { transform: scale(1); } } </style> <img src="https://qiniu-image.qtshe.com/202103179.png" alt="" /> </script> </wx-open-launch-weapp>
示例效果
扩展
// 各个端口跳转兼职详情页 jumpToPartJobDetail(partJobId) { util.isAliMiniApp().then((res) => { if (res) { // 如果是在支付宝小程序环境则打开小程序详情页 my.navigateTo({ url: `/pages/partdetails/partdetails?partJobId=${partJobId}` }) } else { // 如果是在客户端app环境,则打开原生岗位详情页 if (util.isAndroidApp() || util.isIosApp()) { jsBridge.evokeNormalPartJobDetailPage(partJobId) } else if (util.isMiniApp()) { // 微信小程序里则打开微信小程序岗位详情 wx.miniProgram.navigateTo({ url: `/pages/partdetails/partdetails?partJobId=${partJobId}` }) } else if (util.isMobile()) { // 如果是在手机自带浏览器或者除微信外的app浏览器,统一打开支付宝小程序 let url = `alipays://platformapi/startapp?appId=2018082861168647&page=pages/partdetails/partdetails&query=partJobId%3D${partJobId}` window.location.href = `https://ds.alipay.com/?scheme=${encodeURIComponent(url)}` } else { // pc端打开h5的兼职详情页 window.location.href = `/app/partdetails?partJobId=${partJobId}` } } }) }
具体示例
微信内部环境 可通过urlLink方式打开非个人小程序,相关文档:
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/url-link.html
外部h5任意外链跳转微信打开小程序,参考案例 http://m.jumpwx.com/wx/?i=170
微信内用开放标签wx-open-launch-weapp
:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#21
微信外浏览器用urlscheme.generate:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html
你说的是 url scheme?
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html
自己试一下很难吗