/*手机端通用获取商品评论列表*/
var querydata = new Object;
var page = 1;
$(document).ready(function(){
    get_comment_list(page);
	$('.load_mores').click(function(){
		page++;
        get_comment_list(page,0);
	});
});
function get_comment_list(page,type){
	page=parseInt(page);if(!page)page=1;
	querydata['page']=page;
    querydata['type']=type;
	$.ajax({
		url: queryurl,
		type: "post",
		data: querydata,
		dataType: "json",
		success: function (ret) {
			if (ret.status) {
				if(page==1){
					$('#guessList').html(ret.html);
				}else{
					$('#guessList').append(ret.html);
				}
				if(page >= ret.sum_page){
					$('.load_mores').attr('style','display:none;');
				}else{
					$('.load_mores').attr('style','display:block;');
				}
				if(ret.nowPage==ret.totalPages){
					$("#article_load").css('display','none');
				}
			}else{
				if(page==1){
					$('#guessList').html('<div class="buy-none"><i class="hc-iconfont">&#xe70a;</i><h3>暂无数据</h3></div>');
				}else {
                    $.showSuccess('没有更多的数据了', 1, 'hc');
                }
                $('.load_mores').attr('style','display:none;');
			}
		}
	});
}
//删除收藏商品
function delete_collect(id,type){
	$.get(APP+"Mobile/Collection/delete_collect", {id:id,type:type}, function(data){
		if(data.status==0) {
			showtoast(data.msg);body_position();return false;
		}else if(data.status == 1){
			$('#f_id_'+id).remove();showtoast(data.msg);body_position();return false;
		}
	}); 
}
