|
|
|
@ -94,7 +94,7 @@ app.factory('rms', function(){
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){
|
|
|
|
|
var addCommonReply = function(id, type, data,args, cb){
|
|
|
|
|
var addCommonReply = function(id, type, data,args,reply_type, cb){
|
|
|
|
|
//先判断有没有绑定
|
|
|
|
|
// $http.post(
|
|
|
|
|
// '/wechat/is_bind',
|
|
|
|
@ -116,7 +116,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
var userInfo = {
|
|
|
|
|
type: type,
|
|
|
|
|
content: temp,
|
|
|
|
|
token: auth.token()
|
|
|
|
|
token: auth.token(),
|
|
|
|
|
reply_type:reply_type
|
|
|
|
|
};
|
|
|
|
|
//回复按钮禁用
|
|
|
|
|
data.disabled = true;
|
|
|
|
@ -146,24 +147,26 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
cb(response.data.subscribe);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var act_id = response.data.act_id;
|
|
|
|
|
|
|
|
|
|
//保证内外回复数一致
|
|
|
|
|
activities = rms.get("activities") || [];
|
|
|
|
|
course_activities = rms.get("course_activities") || [];
|
|
|
|
|
project_activities = rms.get("project_activities") || [];
|
|
|
|
|
for(var i in activities){
|
|
|
|
|
if(activities[i].act_id == id){
|
|
|
|
|
if(activities[i].act_id == act_id){
|
|
|
|
|
activities[i].reply_count += 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(var i in course_activities){
|
|
|
|
|
if(course_activities[i].act_id == id){
|
|
|
|
|
if(course_activities[i].act_id == act_id){
|
|
|
|
|
course_activities[i].reply_count += 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(var i in project_activities){
|
|
|
|
|
if(project_activities[i].act_id == id){
|
|
|
|
|
if(project_activities[i].act_id == act_id){
|
|
|
|
|
project_activities[i].reply_count += 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -222,7 +225,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
|
|
|
|
|
var init = function(args){
|
|
|
|
|
args.scope.replytip = "输入回复内容~";
|
|
|
|
|
args.scope.formData = {comment: ''};
|
|
|
|
|
// args.scope.formData = {comment: ''};
|
|
|
|
|
var loadData = function(id,replytype,page){
|
|
|
|
|
loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
|
|
|
|
|
console.log(response.data);
|
|
|
|
@ -304,10 +307,10 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
loadData(args.id,0,0);
|
|
|
|
|
args.scope.addReply = function(data){
|
|
|
|
|
args.scope.addReply = function(data,reply_type){
|
|
|
|
|
console.log(data.comment);
|
|
|
|
|
addCommonReply(args.id, args.replyType, data,args, function(subscribe){
|
|
|
|
|
args.scope.formData = {comment: ''};
|
|
|
|
|
addCommonReply(data.act_id, args.replyType, data,args,reply_type, function(subscribe){
|
|
|
|
|
// args.scope.formData = {comment: ''};
|
|
|
|
|
if(subscribe == 0){
|
|
|
|
|
$location.path("/login_tip");
|
|
|
|
|
return;
|
|
|
|
@ -322,6 +325,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 动态详情界面点赞与动态界面的数据要同步 保证进入详情点赞后出来显示一致
|
|
|
|
|
args.scope.addPraise = function(act){
|
|
|
|
|
activities = rms.get("activities") || [];
|
|
|
|
|