同标题
网友回复
风云:
不行啊,发送的是获取小程序码的请求,我无法控制啊
wx.request({ //获取小程序码 url: "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + getApp().globalData.access_token, //仅为示例,并非真实的接口地址 header: { 'content-type' : 'application/json' // 默认值 }, data:{ scene: json.content, page: "pages/news/detial" , width:430 }, method: "POST" , success: function (res) { var json = res.data; //获取的html文本信息 console.log( '小程序码:' ) console.log(res); // that.setData({img: json}) wx.hideNavigationBarLoading(); } }) |
娇华:
你好,还有一个办法就是可以让后端直接返回图片链接给你哈,(#^.^#)
解析:
var that=this;
wx.downloadFile({
url:'**********'
success:function(e){
that.setData({
imgPath:e.tempFilePath
});
}
})
<image src='{{imgPaht}}' />
这样不行吗?