home_exhibit.js 1.5 KB
var QExhibit = {
		//ajax提交用户评论
		submit_fn : function (photo){
			  //QCheckUserStatus()? alert(1):alert(2);
			  var photo_id = photo;
			  var content = jQuery.trim(jQuery('#content').val());
			  var uid = jQuery.trim(jQuery('#uid').val());
			  var url = document.location.href;
			  if(parseInt(uid)<1){
				    window.location.href='http://www.yohobuy.com/signin.html?refer='+url;
				    return false;
			  }
			  if(content.length<1){
			    alert('评论不能为空');
			    return false;
			  }
			  jQuery.ajax({
			  	  type: "POST",
			      url: "/product/exhibit/addcomment",
			      data: 'id='+photo_id+'&content='+content,
			      dataType:'json',
			      success: function(jsonData)
			      {
			      	if(jsonData.code == 200){
			          jQuery('#content').val('');
			          QExhibit.getPhotoComment('page=1&id='+photo_id);
			      	}else{
			      		alert('评论失败!');
			      		return false;
			      	}
			      }
			  });
			},
		getOtherExhibit : function (page, obj){
				QGlobal.Page.QSend_Url = '/product/exhibit/otherexhibit';
				QGlobal.Page.QItem = 'otherExhibit';
				QGlobal.Page.getList(page, obj);
			},
		getUserExhibit : function (page, obj){
				QGlobal.Page.QSend_Url = '/product/exhibit/otheruser';
				QGlobal.Page.QItem = 'otheruser';
				QGlobal.Page.getList(page, obj);
			},
		getPhotoComment : function (page,obj){
				QGlobal.Page.QSend_Url = '/product/exhibit/ajaxcomment';
				QGlobal.Page.QItem = 'itemList';
				QGlobal.Page.getList(page, obj);
			}
}