@ -1,6 +1,6 @@
var app = angular . module ( 'wechat' , [ 'ngRoute' , 'ngCookies' ] ) ;
var app = angular . module ( 'wechat' , [ 'ngRoute' , 'ngCookies' ] ) ;
var apiUrl = 'http://wechat.trustie.net/api/v1/' ;
var apiUrl = 'http://wechat.trustie.net/api/v1/' ;
var debug = tru e; //调试标志,如果在本地请置为true
var debug = fals e; //调试标志,如果在本地请置为true
if ( debug === true ) {
if ( debug === true ) {
apiUrl = 'http://localhost:3000/api/v1/' ;
apiUrl = 'http://localhost:3000/api/v1/' ;
@ -77,7 +77,15 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
url : apiUrl + "activities" ,
url : apiUrl + "activities" ,
data : { openid : auth . openid ( ) , page : page }
data : { openid : auth . openid ( ) , page : page }
} ) . then ( function successCallback ( response ) {
} ) . then ( function successCallback ( response ) {
$scope . current _page = 0 ;
console . log ( $scope . current _page ) ;
console . log ( response . data . page ) ;
if ( $scope . current _page < response . data . page ) {
$scope . activities = $scope . activities . concat ( response . data . data ) ;
$scope . activities = $scope . activities . concat ( response . data . data ) ;
} else {
$scope . activities = response . data . data ;
}
$scope . current _page = response . data . page ;
$scope . all _count = response . data . all _count ;
$scope . all _count = response . data . all _count ;
$scope . count = response . data . count ;
$scope . count = response . data . count ;
console . log ( response . data ) ;
console . log ( response . data ) ;
@ -97,12 +105,10 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
$scope . loadActData = loadActData ;
$scope . loadActData = loadActData ;
$scope . addPraise = function ( act ) {
$scope . addPraise = function ( act ) {
console . log ( act ) ;
common . addCommonPraise ( act ) ;
common . addCommonPraise ( act ) ;
} ;
} ;
$scope . decreasePraise = function ( act ) {
$scope . decreasePraise = function ( act ) {
console . log ( act ) ;
common . decreaseCommonPraise ( act ) ;
common . decreaseCommonPraise ( act ) ;
} ;
} ;
@ -110,7 +116,6 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
app . factory ( 'common' , function ( $http , auth , $routeParams ) {
app . factory ( 'common' , function ( $http , auth , $routeParams ) {
var addCommonReply = function ( id , type , data , cb ) {
var addCommonReply = function ( id , type , data , cb ) {
console . log ( data . comment ) ;
if ( ! data . comment || data . comment . length <= 0 ) {
if ( ! data . comment || data . comment . length <= 0 ) {
return ;
return ;
@ -197,12 +202,10 @@ app.controller('IssueController', function($scope, $http, $routeParams, auth, co
} ;
} ;
$scope . addPraise = function ( act ) {
$scope . addPraise = function ( act ) {
console . log ( act ) ;
common . addCommonPraise ( act ) ;
common . addCommonPraise ( act ) ;
} ;
} ;
$scope . decreasePraise = function ( act ) {
$scope . decreasePraise = function ( act ) {
console . log ( act ) ;
common . decreaseCommonPraise ( act ) ;
common . decreaseCommonPraise ( act ) ;
} ;
} ;
} ) ;
} ) ;
@ -229,12 +232,10 @@ app.controller('HomeworkController', function($scope, $http, $routeParams, auth,
} ;
} ;
$scope . addPraise = function ( act ) {
$scope . addPraise = function ( act ) {
console . log ( act ) ;
common . addCommonPraise ( act ) ;
common . addCommonPraise ( act ) ;
} ;
} ;
$scope . decreasePraise = function ( act ) {
$scope . decreasePraise = function ( act ) {
console . log ( act ) ;
common . decreaseCommonPraise ( act ) ;
common . decreaseCommonPraise ( act ) ;
} ;
} ;
} ) ;
} ) ;
@ -261,12 +262,10 @@ app.controller('CourseNoticeController', function($scope, $http, $routeParams, a
} ;
} ;
$scope . addPraise = function ( act ) {
$scope . addPraise = function ( act ) {
console . log ( act ) ;
common . addCommonPraise ( act ) ;
common . addCommonPraise ( act ) ;
} ;
} ;
$scope . decreasePraise = function ( act ) {
$scope . decreasePraise = function ( act ) {
console . log ( act ) ;
common . decreaseCommonPraise ( act ) ;
common . decreaseCommonPraise ( act ) ;
} ;
} ;
} ) ;
} ) ;
@ -293,12 +292,10 @@ app.controller('DiscussionController', function($scope, $http, $routeParams, aut
} ;
} ;
$scope . addPraise = function ( act ) {
$scope . addPraise = function ( act ) {
console . log ( act ) ;
common . addCommonPraise ( act ) ;
common . addCommonPraise ( act ) ;
} ;
} ;
$scope . decreasePraise = function ( act ) {
$scope . decreasePraise = function ( act ) {
console . log ( act ) ;
common . decreaseCommonPraise ( act ) ;
common . decreaseCommonPraise ( act ) ;
} ;
} ;
} ) ;
} ) ;
@ -383,9 +380,6 @@ app.directive('textAutoHeight', function($timeout){
var e = element . parent ( ) . children ( ) . eq ( 4 ) ;
var e = element . parent ( ) . children ( ) . eq ( 4 ) ;
var height = e [ 0 ] . scrollHeight ;
var height = e [ 0 ] . scrollHeight ;
var offsetHeight = e [ 0 ] . offsetHeight ;
var offsetHeight = e [ 0 ] . offsetHeight ;
console . log ( height ) ;
console . log ( offsetHeight ) ;
console . log ( attr ) ;
if ( height > 90 ) {
if ( height > 90 ) {
element . css ( 'display' , 'block' ) ;
element . css ( 'display' , 'block' ) ;
element . on ( 'click' , function ( ) {
element . on ( 'click' , function ( ) {