home_exhibit.js
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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);
}
}