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); }, 这是代码
扫描二维码为啥那个options.q总是获取不到,一直是undefined,是哪里出了问题?这是后台配置的参数相关,大佬帮吗看下,不知道怎么回事,options.q这玩意儿根本就获取不到啊 [图片]
2022-03-04