小程序怎么读取阿里云发送的json对应的值?

小程序 文章 2022-01-27 14:20 312 0 全屏看文

AI助手支持GPT4.0

小程序怎么读取阿里云发送的json对应的值?How does the applet read the value corresponding to the json sent by Alibaba Cloud?

小程序怎么读取阿里云发送的json对应的值?

想把Humidity的值在小程序上显示,希望大佬能帮忙解惑

I want to display the value of humidity on the applet. I hope the boss can help solve my doubts

回答:

困难:

你把payload里的JSON用JSON.parse解析就可以了

有赞:

按照json取值方式取你想要的字段即可

Mr.Zhao:

打印不就是读取

zero:打印出来是json格式,但是我想要的是单独的一个数字
Mr.Zhao:json.属性就可以了啊

-EOF-

AI助手支持GPT4.0