|
|
|
@ -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, cb){
|
|
|
|
|
var addCommonReply = function(id, type, data,args, cb){
|
|
|
|
|
//先判断有没有绑定
|
|
|
|
|
$http.post(
|
|
|
|
|
'/wechat/is_bind',
|
|
|
|
@ -106,8 +106,6 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!data.comment || data.comment.length<=0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -129,6 +127,19 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
}).then(function successCallback(response) {
|
|
|
|
|
//alert("提交成功");
|
|
|
|
|
//数据提交完成,回复按钮启用
|
|
|
|
|
console.log(response);
|
|
|
|
|
if(response.data.status == -1){
|
|
|
|
|
console.log("回复失败!");
|
|
|
|
|
data.comment = "";
|
|
|
|
|
if(response.data.tip == 0){
|
|
|
|
|
args.scope.replytip = "您不是该私有班级成员,不能回复";
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
args.scope.replytip = "您不是该私有项目成员,不能回复";
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data.disabled = false;
|
|
|
|
|
if(typeof cb === 'function'){
|
|
|
|
|
cb();
|
|
|
|
@ -209,6 +220,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var init = function(args){
|
|
|
|
|
args.scope.replytip = "输入回复内容~";
|
|
|
|
|
args.scope.formData = {comment: ''};
|
|
|
|
|
var loadData = function(id,replytype,page){
|
|
|
|
|
loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
|
|
|
|
@ -277,7 +289,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|
|
|
|
loadData(args.id,0,0);
|
|
|
|
|
args.scope.addReply = function(data){
|
|
|
|
|
console.log(data.comment);
|
|
|
|
|
addCommonReply(args.id, args.replyType, data, function(){
|
|
|
|
|
addCommonReply(args.id, args.replyType, data,args, function(){
|
|
|
|
|
args.scope.formData = {comment: ''};
|
|
|
|
|
loadData(args.id,0,0);
|
|
|
|
|
if(typeof args.replyCallback === 'function'){
|
|
|
|
|