wx.cloud.callFunction({
name: ‘getjobinfo’,
// 城市地铁
data: {
appid: “wx5adb79…”,
appsecret: “e5f3479e91…”,
offset: 0
}
}).then(res => {
var posts = res.result.metrores.item
var metrolist = [];
for (var i = 0; i < posts.length; i++) {
metrolist.push({
title: posts[i].content.news_item[0].title,
thumb_url: posts[i].content.news_item[0].thumb_url,
url: posts[i].content.news_item[0].url,
});
}
that.setData({
metrolists: metrolist,
});
console.log(that.data.metrolists)
}).catch(console.error)
-----打印出来数据是正常的,开发工具中显示也是正常的,预览在手机上时看不到。请问是什么问题?请指教。