提交 b6e0e3d4 编写于 作者: L luojing

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

上级 e82a4471
...@@ -407,7 +407,7 @@ ...@@ -407,7 +407,7 @@
} }
.o2_appmarket_application_comment_content_left{ .o2_appmarket_application_comment_content_left{
width:30%; width:20%;
height:220px; height:220px;
float:left; float:left;
margin-top:10px; margin-top:10px;
...@@ -428,7 +428,6 @@ ...@@ -428,7 +428,6 @@
font-family:MicrosoftYaHei; font-family:MicrosoftYaHei;
color:rgba(51,51,51,1); color:rgba(51,51,51,1);
line-height:21px; line-height:21px;
overflow: hidden;
} }
.comment_dlg_title{ .comment_dlg_title{
...@@ -470,4 +469,4 @@ ...@@ -470,4 +469,4 @@
height:40px; height:40px;
background:rgba(240,240,240,1); background:rgba(240,240,240,1);
border-radius:20px; border-radius:20px;
} }
\ No newline at end of file
...@@ -49,6 +49,8 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({ ...@@ -49,6 +49,8 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
this.page = 1; this.page = 1;
this.pageSize = 100; this.pageSize = 100;
this.querydata = {}; this.querydata = {};
this.bbsUrlPath = "";
this.bbsUrl = "";
this.load(); this.load();
}, },
...@@ -61,37 +63,45 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({ ...@@ -61,37 +63,45 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
data = json.data; //为变量data赋值 data = json.data; //为变量data赋值
this.app.collectUrl = data.collectUrl; this.app.collectUrl = data.collectUrl;
this.app.collectToken = data.collectToken; this.app.collectToken = data.collectToken;
this.loadBbsInfo(this);
this.loadCommentsGrade(this,this.commentsGrade.bind(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)); this.loadCommentsList(this,this.commentsView.bind(this));
} }
}.bind(this),null,false //同步执行 }.bind(this),null,false //同步执行
); );
}else{ }else{
this.loadBbsInfo(this);
this.loadCommentsGrade(this,this.commentsGrade.bind(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)); this.loadCommentsList(this,this.commentsView.bind(this));
} }
}, },
loadCommentsGrade: function(content,callback){ loadBbsInfo: function(content){
var json = null; 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({ var res = new Request.JSON({
url: commenturl, url: commenturl,
headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken}, headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken},
secure: false, secure: false,
method: "get", method: "get",
async: true, async: false,
withCredentials: true, withCredentials: true,
contentType : 'application/json', contentType : 'application/json',
crossDomain : true, crossDomain : true,
onSuccess: function(responseJSON, responseText){ onSuccess: function(responseJSON, responseText){
json = responseJSON; 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); callback(responseJSON);
}else{ }else{
o2.runCallback(callback, "success", [responseJSON, responseText]); o2.runCallback(callback, "success", [responseJSON, responseText]);
} }*/
}.bind(this), }.bind(this),
onFailure: function(xhr){ onFailure: function(xhr){
o2.runCallback(callback, "requestFailure", [xhr]); o2.runCallback(callback, "requestFailure", [xhr]);
...@@ -102,9 +112,9 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({ ...@@ -102,9 +112,9 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
}); });
res.send(); res.send();
}, },
loadCommentPower: function(content,callback){ loadCommentsGrade: function(content,callback){
var json = null; 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({ var res = new Request.JSON({
url: commenturl, url: commenturl,
headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken}, 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({ ...@@ -115,6 +125,7 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
contentType : 'application/json', contentType : 'application/json',
crossDomain : true, crossDomain : true,
onSuccess: function(responseJSON, responseText){ onSuccess: function(responseJSON, responseText){
debugger;
json = responseJSON; json = responseJSON;
if (typeOf(callback).toLowerCase() == 'function'){ if (typeOf(callback).toLowerCase() == 'function'){
callback(responseJSON); callback(responseJSON);
...@@ -131,7 +142,60 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({ ...@@ -131,7 +142,60 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
}); });
res.send(); 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){ 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 json = null;
var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/list/app/'+content.appdata.id+'?time='+(new Date()).getMilliseconds(); var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/list/app/'+content.appdata.id+'?time='+(new Date()).getMilliseconds();
var res = new Request.JSON({ var res = new Request.JSON({
...@@ -310,6 +374,34 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({ ...@@ -310,6 +374,34 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
} }
}, },
commentsView:function(commentdata){ 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; var commentsList = commentdata.data;
commentsList.each(function(percomment){ commentsList.each(function(percomment){
var commentcontentdiv = new Element("div",{"class":"o2_appmarket_application_comment_content"}).inject(this.content.applicationcommentbottom); 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({ ...@@ -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 = { ...@@ -21,6 +21,9 @@ MWF.xApplication.AppMarketV2.Application.LP = {
"bbsname":"藕粉社区", "bbsname":"藕粉社区",
"bbslink":"http://forum.o2oa.net/x_desktop/forum.html?app=ForumSection&id=b1895d5a-7ef2-4d74-b2d1-a7ae10daaa28", "bbslink":"http://forum.o2oa.net/x_desktop/forum.html?app=ForumSection&id=b1895d5a-7ef2-4d74-b2d1-a7ae10daaa28",
"bbstip":"如果您有什么疑问或想法,请来我们的藕粉社区交流吧!", "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}个评分", "commentCountText":"共{n}个评分",
"category" : "分类", "category" : "分类",
...@@ -31,4 +34,4 @@ MWF.xApplication.AppMarketV2.Application.LP = { ...@@ -31,4 +34,4 @@ MWF.xApplication.AppMarketV2.Application.LP = {
"score": "打分:", "score": "打分:",
"comment": "评论:", "comment": "评论:",
"commentNotice" : "请评分,评论后提交" "commentNotice" : "请评分,评论后提交"
}; };
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册