<view class="b1" hidden="{{flag}}">
<view class="b2">
<image src='{{qrcodeUrl}}'/>
</view>
var openid=wx.getStorageSync('openid')
if(openid){
wx.request({
url: app.globalData.host+'/getQrcode',
data: {
scene: openid+'&'+that.data.goodsid
},
method:'GET',
header: {
'content-type': 'application/json'
},
success: function(res) {
console.log(res.data)
that.setData({
qrcodeUrl:res.data,
flag:false
})
}
})
手机开启调试模式试一试,或者小程序后台配置一下域名。