找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 小程序开发 查看内容

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

作者:模板之家 2018-5-17 08:43 1822人关注

代码如下: 纯文本查看复制代码 ? 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 ...

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


路过

雷人

握手

鲜花

鸡蛋
原作者: 模板之家 来自: 网络收集

全部回复(0)