扫描小程序码分享
这是后台配置的参数相关,大佬帮吗看下,不知道怎么回事,options.q这玩意儿根本就获取不到啊
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
onLoad: function (options) { console.log('q', options); if (options.q) { var qrUrl = decodeURIComponent(options.q);// 获取到二维码原始链接内容 var id = qrUrl.split('?')[1].split('&')[0].split('=')[1]; var flag = qrUrl.split('?')[1].split('&')[1].split('=')[1]; this.setData({ orderid: id, flag: 0 }) } else { this.setData({ orderid: options.id, flag: options.flag }) } this.queryorderDetail(options.id) //详情页的路由信息 const pages = getCurrentPages(); const currentPage = pages[pages.length - 1] //路由 const url = currentPage.route; //路由参数 const opt = currentPage.options; var urlWithArgs = `/${url}?` urlWithArgs += `id=${opt.id}&flag=0` wx.setStorageSync('urlWithArgs', urlWithArgs); }, 这是代码
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
https://developers.weixin.qq.com/community/develop/doc/00024afde985f01dd8ac5730451400?jumpto=comment
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
onLoad: function (options) { console.log('q', options); if (options.q) { var qrUrl = decodeURIComponent(options.q);// 获取到二维码原始链接内容 var id = qrUrl.split('?')[1].split('&')[0].split('=')[1]; var flag = qrUrl.split('?')[1].split('&')[1].split('=')[1]; this.setData({ orderid: id, flag: 0 }) } else { this.setData({ orderid: options.id, flag: options.flag }) } this.queryorderDetail(options.id) //详情页的路由信息 const pages = getCurrentPages(); const currentPage = pages[pages.length - 1] //路由 const url = currentPage.route; //路由参数 const opt = currentPage.options; var urlWithArgs = `/${url}?` urlWithArgs += `id=${opt.id}&flag=0` wx.setStorageSync('urlWithArgs', urlWithArgs); }, 这是代码
https://developers.weixin.qq.com/community/develop/doc/00024afde985f01dd8ac5730451400?jumpto=comment