判断图片路径

256 阅读1分钟
getProductImage: function (item) {   
 if (item &&    
item.product.hasOwnProperty('img') &&   
 $CM.isArray(item.img) && 
 item.img.length > 0) 
{    return item.img[0].path;   
 }    
return '';},