微信扫码登录

其他登录方式

绑定手机号

注册

我同意用户协议

忘记密码

用户协议

绑定手机号

近期有不法分子打着爱盈利的旗号,制作“爱盈利”名称的App,并伪造爱盈利证件,骗取用户信任,以抖音点赞赚钱或其他方式赚钱为名义,过程中以升级会员获得高佣金为名让用户充值。
爱盈利公司郑重声明:我司没有研发或运营过任何名为“爱盈利”的APP,我司做任务赚钱类产品从没有让任何普通用户充值升级会员。我公司产品均在本网站可查询,请将网站拉至底部,点击“关于我们”可查看爱盈利相关产品与服务。
温馨提示:当遇到此类问题请拨打官方电话或添加官方微信,以免财产损失。爱盈利官网地址:www.aiyingli.com。
  • 推广与合作
X

小程序丨【已解决】后台的json数据,无法调用具体数据

来源: 2603

//index.js
onLoad: function () {
    var that = this
    wx.request({
      url: 'http://127.0.0.1:8080/tmall/foreproduct?pid=1', 

      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)   //这里成功打印出了数据
        console.log(res.data.product)   //这里打印显示undefined
      },
      fail: function (res) {
        console.log("fail")
      }
    }) 【已解决】后台的json数据,无法调用具体数据 
  },

网友回复:

前***:

console.log(res.data[0].product)试试看

r***:

res.data 是一个数组。

应该是 console.log(res.data[0].product) 


r***:系统记录
l***:

wx.request请求写的有问题吧


  1. var that = this

  2.       wx.request({

  3.         url: 'https://www.njbrick.com/ocrserver/getweather?city='+this.data.city1,

  4.         headers: {

  5.           'Content-Type': 'application/json'

  6.         },

  7.         success: function (res) {

  8.           that.setData({

  9.             weather: res.data.data,//第一个data为固定用法,第二个data是json中的data


  10.           })

  11.         }

  12.       })


咫尺开发论坛——小乐    


爱盈利(aiyingli.com)移动互联网最具影响力的盈利指导网站。定位于服务移动互联网创业者,移动盈利指导。我们的目标是让盈利目标清晰可见!降低门槛,让缺乏经验、资金有限的个人和团队获得经验和机会,提高热情,激发产品。

评论

相关文章推荐

SELECT dw_posts.ID,dw_posts.post_title,dw_posts.post_content FROM dw_posts INNER JOIN dw_term_relationships ON (dw_posts.ID = dw_term_relationships.object_id) WHERE 1=1 AND(dw_term_relationships.term_taxonomy_id = 5246 ) AND dw_posts.post_type = 'post' AND (dw_posts.post_status = 'publish') GROUP BY dw_posts.ID ORDER BY RAND() LIMIT 0, 6

京ICP备15063977号-2 © 2012-2018 aiyingli.com. All Rights Reserved. 京公网安备 11010102003938号