|
|
|
@ -3,19 +3,19 @@ var apiUrl = 'http://wechat.trustie.net/api/v1/';
|
|
|
|
|
var debug = true; //调试标志,如果在本地请置为true
|
|
|
|
|
|
|
|
|
|
if(debug===true){
|
|
|
|
|
apiUrl = 'http://localhost:3000/api/v1/';
|
|
|
|
|
//apiUrl = 'http://localhost:3000/api/v1/';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.factory('auth', function($http,$routeParams, $cookies, $q){
|
|
|
|
|
var _openid = '';
|
|
|
|
|
|
|
|
|
|
if(debug===true){
|
|
|
|
|
_openid = "2";
|
|
|
|
|
_openid = "oCnvgvz8R7QheXE-R9Kkr39j8Ndg";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var getOpenId = function() {
|
|
|
|
|
var deferred = $q.defer();
|
|
|
|
|
if (typeof _openid !== 'undefined' && _openid.length > 0) {
|
|
|
|
|
if (typeof _openid !== 'undefined' && _openid.length > 0){
|
|
|
|
|
deferred.resolve(_openid);
|
|
|
|
|
} else {
|
|
|
|
|
var code = $routeParams.code;
|
|
|
|
@ -289,6 +289,38 @@ app.filter('safeHtml', function ($sce) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.directive('textAutoHeight', function($timeout){
|
|
|
|
|
return {
|
|
|
|
|
restrict: 'A',
|
|
|
|
|
scope: {},
|
|
|
|
|
link: function(scope, element, attr){
|
|
|
|
|
scope.text = '点击展开';
|
|
|
|
|
$timeout(function(){
|
|
|
|
|
var e = element.parent().children().eq(4);
|
|
|
|
|
var height = e[0].scrollHeight;
|
|
|
|
|
var offsetHeight = e[0].offsetHeight;
|
|
|
|
|
console.log(height);
|
|
|
|
|
console.log(offsetHeight);
|
|
|
|
|
console.log(attr);
|
|
|
|
|
if(height>90){
|
|
|
|
|
element.css('display', 'block');
|
|
|
|
|
element.on('click', function(){
|
|
|
|
|
if(element.text() == "点击展开"){
|
|
|
|
|
e.css("height", height+'px');
|
|
|
|
|
element.text("点击隐藏");
|
|
|
|
|
} else {
|
|
|
|
|
e.css("height", '90px');
|
|
|
|
|
element.text("点击展开");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.config(['$routeProvider',function ($routeProvider) {
|
|
|
|
|
$routeProvider
|
|
|
|
|
.when('/activities', {
|
|
|
|
|