小程序模板网

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

代码如下:
[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: 'http://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.
求大神解答啊,感激不敬


易优小程序(企业版)+灵活api+前后代码开源 码云仓库:starfork
本文地址:https://www.eyoucms.com/wxmini/doc/course/24445.html 复制链接 如需定制请联系易优客服咨询:800182392 点击咨询
QQ在线咨询