我有json data here。我正试图在property_more_images
中获取数据:
getItemImages: function(pid) {
xhr.simpleCall({
query:{
com_option:"item",
item_get_id:pid
},
func:'timeline'
}, function(response) {
if (response.err_code === 0) {
console.log(response.data[0].property_more_images);
var arr = response.data[0].property_more_images;
notice_obj = [];
for (var i = 0, l = arr.length; i < l; ++i) {
notice_obj.push(arr[i]);
}
return notice_obj.join(' ,');
}
});
}
然后像这样使用getItem
函数:
getItem: function(pid) {
var $this = $$('.time-line-content .item-content[data-id="'+ pid +'"]');
var item = {
id: $this.data('id'),
nickname: $this.find('.item-header .detail .nickname').html()
};
item.propslider = this.getItemImages(pid);
var output = TM.renderTplById('itemTemplate', item);
$$('#itemContent').html(output);
}
到目前为止,我的console.log
给了我预期的json数据。当我在getItemImages
函数中调用getItem
函数时,我似乎无法获取任何数据。 getItemImages
函数有问题。我无法弄清楚是什么。