一样的问题,就是参数二维码用微信直接扫描测试效果必须在发布审核后才可以看到,因为只有正式板才能生效,这完全不符合开发逻辑。
微信带参数二维码生成,扫描进入必须正式发布,无法调试1.页面代码 <view class='bd-qrcode'> <image src="{{qrcodeUrl}}" class='bd-qrcode-image'></image> </view> <view class="weui-cells__title bd-textinfo">推荐人({{userInfo.UserDetails.UserName}})</view> <view class="weui-panel"> <view class="weui-panel__hd bd-textinfo">微信扫码,即可参与蜂蚂分享经济</view> <view class="weui-panel__bd"> <view class="weui-media-box weui-media-box_text"> <view class="weui-media-box__title weui-media-box__title_in-text">规则</view> <view class="weui-media-box__desc">目前只支持扫码识别推荐好友</view> <view class="weui-media-box__info"> <view class="weui-media-box__info__meta">共享资源</view> <view class="weui-media-box__info__meta weui-media-box__info__meta_extra">合作共赢</view> <view class="weui-media-box__info__meta weui-media-box__info__meta_extra">合作简单</view> <view class="weui-media-box__info__meta weui-media-box__info__meta_extra">自动赚钱</view> </view> <view class="weui-media-box__info"> <view class="weui-media-box__info__meta ">可分享蜂蚂平台去中心化利润的0-50%奖励</view> </view> </view> </view> </view> 2.生成带参数小程序二维码: var parameters = { scene: "pageurl=qrcode&userid=" +that.data.userInfo.AutoId, page: "pages/index/index", width: 430 } wx.request({ url: getApp().globalData.api + '/api/WeChat/GetQrCodeImage', data: JSON.stringify(parameters), method: 'PUT', responseType: 'arraybuffer', success: function(res) { console.log(res); let data = wx.arrayBufferToBase64(res.data); that.setData({ qrcodeUrl: 'data:image/jpeg;base64,' + data }) } }) } }); 3.获取二维码代码 var scene = decodeURIComponent (options.scene); console.log("The from qrcode and share info is " + scene); //var scene = "pageurl=qrcode&userid=4" var url = scene.split("&")[0].split("=")[1] var id = scene.split('&')[1].split("=")[1]; if (url == "qrcode") { that.setData({ pageUrl: "store", isLoad: true, userId: id }); }
2018-12-26