提交 b6e0e3d4 编写于 作者: L luojing

更新应用市场-从论坛获取应用评论及评分

上级 e82a4471
......@@ -407,7 +407,7 @@
}
.o2_appmarket_application_comment_content_left{
width:30%;
width:20%;
height:220px;
float:left;
margin-top:10px;
......@@ -428,7 +428,6 @@
font-family:MicrosoftYaHei;
color:rgba(51,51,51,1);
line-height:21px;
overflow: hidden;
}
.comment_dlg_title{
......@@ -470,4 +469,4 @@
height:40px;
background:rgba(240,240,240,1);
border-radius:20px;
}
}
\ No newline at end of file
......@@ -49,6 +49,8 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
this.page = 1;
this.pageSize = 100;
this.querydata = {};
this.bbsUrlPath = "";
this.bbsUrl = "";
this.load();
},
......@@ -61,37 +63,45 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
data = json.data; //为变量data赋值
this.app.collectUrl = data.collectUrl;
this.app.collectToken = data.collectToken;
this.loadBbsInfo(this);
this.loadCommentsGrade(this,this.commentsGrade.bind(this));
this.loadCommentPower(this,this.commentsPower.bind(this));
//this.loadCommentPower(this,this.commentsPower.bind(this));
this.loadCommentPower(this);
this.loadCommentsList(this,this.commentsView.bind(this));
}
}.bind(this),null,false //同步执行
);
}else{
this.loadBbsInfo(this);
this.loadCommentsGrade(this,this.commentsGrade.bind(this));
this.loadCommentPower(this,this.commentsPower.bind(this));
//this.loadCommentPower(this,this.commentsPower.bind(this));
this.loadCommentPower(this);
this.loadCommentsList(this,this.commentsView.bind(this));
}
},
loadCommentsGrade: function(content,callback){
loadBbsInfo: function(content){
var json = null;
var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/stat/grade/app/'+content.appdata.id+'?time='+(new Date()).getMilliseconds();
var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/collect/config/key/(0)?time='+(new Date()).getMilliseconds();
debugger;
var res = new Request.JSON({
url: commenturl,
headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken},
secure: false,
method: "get",
async: true,
async: false,
withCredentials: true,
contentType : 'application/json',
crossDomain : true,
onSuccess: function(responseJSON, responseText){
json = responseJSON;
if (typeOf(callback).toLowerCase() == 'function'){
debugger;
this.bbsUrlPath = json.data.bbsUrlPath;
this.bbsUrl = json.data.bbsUrl;
/*if (typeOf(callback).toLowerCase() == 'function'){
callback(responseJSON);
}else{
o2.runCallback(callback, "success", [responseJSON, responseText]);
}
}*/
}.bind(this),
onFailure: function(xhr){
o2.runCallback(callback, "requestFailure", [xhr]);
......@@ -102,9 +112,9 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
});
res.send();
},
loadCommentPower: function(content,callback){
loadCommentsGrade: function(content,callback){
var json = null;
var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/app/'+content.appdata.id+'/available?time='+(new Date()).getMilliseconds();
var commenturl = content.app.lp.commentpath +'/x_bbs_assemble_control/jaxrs/subject/statgrade/sectionName/'+content.app.lp.title+'/subjectType/'+content.appdata.name+'?time='+(new Date()).getMilliseconds();
var res = new Request.JSON({
url: commenturl,
headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken},
......@@ -115,6 +125,7 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
contentType : 'application/json',
crossDomain : true,
onSuccess: function(responseJSON, responseText){
debugger;
json = responseJSON;
if (typeOf(callback).toLowerCase() == 'function'){
callback(responseJSON);
......@@ -131,7 +142,60 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
});
res.send();
},
loadCommentPower: function(content,callback){
//var bbsurl = content.app.lp.bbsurl;
debugger;
var commentbuttondiv = new Element("div",{"class":"o2_appmarket_application_comment_middle_tip"}).inject(this.content.applicationcommentmiddle);
new Element("span",{
"class":"o2_appmarket_application_introduce_tab_current",
"text":content.app.lp.bbsNotice
}).inject(commentbuttondiv);
commentbuttondiv.addEvents({
"click": function(e){
window.open(this.bbsUrl);
}
})
},
loadCommentsList:function(content,callback){
var commentdata = {};
commentdata["sectionName"] = content.app.lp.title;
commentdata["subjectType"] = content.appdata.name;
//var commenturl = content.app.lp.commentpath+'/x_bbs_assemble_control/jaxrs/subject/filter/listsubjectinfo/page/1/count/10';
var commenturl = this.bbsUrlPath+'/x_bbs_assemble_control/jaxrs/subject/filter/listsubjectinfo/page/1/count/10';
debugger;
var res = new Request.JSON({
"url": commenturl,
"headers" : {"Content-Type": "application/json; charset=utf-8","x-debugger" : true},
secure: false,
"method": "POST",
async: true,
emulation: false,
noCache: true,
withCredentials: true,
crossDomain : true,
"data": JSON.stringify(commentdata),
onSuccess: function(responseJSON, responseText){
debugger;
json = responseJSON;
if (typeOf(callback).toLowerCase() == 'function'){
callback(responseJSON);
}else{
o2.runCallback(callback, "success", [responseJSON, responseText]);
}
}.bind(this),
onFailure: function(xhr){
debugger;
o2.runCallback(callback, "requestFailure", [xhr]);
}.bind(this),
onError: function(text, error){
debugger;
o2.runCallback(callback, "error", [text, error]);
}.bind(this)
});
debugger;
res.send();
},
loadCommentsList_bak:function(content,callback){
var json = null;
var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/list/app/'+content.appdata.id+'?time='+(new Date()).getMilliseconds();
var res = new Request.JSON({
......@@ -310,6 +374,34 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
}
},
commentsView:function(commentdata){
var commentsList = commentdata.data;
debugger
commentsList.each(function(percomment){
var commentcontentdiv = new Element("div",{"class":"o2_appmarket_application_comment_content"}).inject(this.content.applicationcommentbottom);
var commentcontentleft = new Element("div",{"class":"o2_appmarket_application_comment_content_left"}).inject(commentcontentdiv);
var iconpersondiv = new Element("div",{"class":"o2_appmarket_application_comment_content_left_icon"}).inject(commentcontentleft);
new Element("img",{"src":this.content.iconPath+"icon_men.png"}).inject(iconpersondiv);
debugger;
new Element("div",{"class":"o2_appmarket_application_comment_content_left_name","text":percomment.creatorName}).inject(commentcontentleft);
var commentcontentright = new Element("div",{"class":"o2_appmarket_application_comment_content_right"}).inject(commentcontentdiv);
var commentangulardiv = new Element("div").inject(commentcontentright);
for (var tmpi=0;tmpi<parseInt(percomment.grade);tmpi++){
new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(commentangulardiv)
}
for (var tmpi=0;tmpi<5-parseInt(percomment.grade);tmpi++){
new Element("img",{"src":this.content.iconPath+"whitefiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(commentangulardiv)
}
var content = percomment.content;
var percommentConent = content.replace("<p>","").replace("</p>","");
new Element("div",{"class":"o2_appmarket_application_comment_content_title","text":percomment.title}).inject(commentcontentright);
var conentDiv = new Element("div",{"class":"o2_appmarket_application_comment_content_text"}).inject(commentcontentright);
var conentHtml = percomment.content;
conentDiv.set("html",conentHtml);
}.bind(this))
},
commentsView_bak:function(commentdata){
var commentsList = commentdata.data;
commentsList.each(function(percomment){
var commentcontentdiv = new Element("div",{"class":"o2_appmarket_application_comment_content"}).inject(this.content.applicationcommentbottom);
......@@ -459,4 +551,4 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
}
}
})
})
\ No newline at end of file
......@@ -21,6 +21,9 @@ MWF.xApplication.AppMarketV2.Application.LP = {
"bbsname":"藕粉社区",
"bbslink":"http://forum.o2oa.net/x_desktop/forum.html?app=ForumSection&id=b1895d5a-7ef2-4d74-b2d1-a7ae10daaa28",
"bbstip":"如果您有什么疑问或想法,请来我们的藕粉社区交流吧!",
"commentpath":"https://forum.o2oa.net:40020",
"bbsurl":"http://forum.o2oa.net/x_desktop/forum.html?app=ForumSection&id=b1895d5a-7ef2-4d74-b2d1-a7ae10daaa28",
"bbsNotice":"评论请点此链接至o2论坛",
"commentCountText":"共{n}个评分",
"category" : "分类",
......@@ -31,4 +34,4 @@ MWF.xApplication.AppMarketV2.Application.LP = {
"score": "打分:",
"comment": "评论:",
"commentNotice" : "请评分,评论后提交"
};
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册