欢迎光临,了解微信小程序开发,就上易用通!

小程序中为何无法setData赋值?

发布:2018-05-17 08:44浏览: 来源:网络 作者:cola

代码如下:
[AppleScript] 纯文本查看 复制代码
?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
wx.request({
         url: 'https://route.showapi.com/', // 调用接口
         data: {
           showapi_appid: '//用户名',
           showapi_sign: '//密匙',
           code: res.result
         },
         header: { 'content-type': 'application/x-www-form-urlencoded' },
         method: 'get',
         success: function (res) {
           wx.hideLoading()
           console.log(res.data)
           that.setData({
             barcodeData: res.data.data
           }),
           wx.showToast({
             title: '扫描成功请稍等',
             icon: 'success',
             duration: 500
           });
         }
       })


最后报错
Setting data field "barcodeData" to undefined is invalid.
求大神解答啊,感激不敬





免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。