小程序模板網(wǎng)

小程序中為何無(wú)法setData賦值?

發(fā)布時(shí)間:2018-05-17 08:44 所屬欄目:小程序開(kāi)發(fā)教程
代碼如下:
[AppleScript] 純文本查看 復(fù)制代碼
?
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/', // 調(diào)用接口
         data: {
           showapi_appid: '//用戶(hù)名',
           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: '掃描成功請(qǐng)稍等',
             icon: 'success',
             duration: 500
           });
         }
       })


最后報(bào)錯(cuò)
Setting data field "barcodeData" to undefined is invalid.
求大神解答啊,感激不敬


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開(kāi)源 碼云倉(cāng)庫(kù):starfork
本文地址:http://22321a.com/wxmini/doc/course/24445.html 復(fù)制鏈接 如需定制請(qǐng)聯(lián)系易優(yōu)客服咨詢(xún):800182392 點(diǎn)擊咨詢(xún)
QQ在線(xiàn)咨詢(xún)