|
|
@@ -17,10 +17,26 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.project = data;
|
|
|
$scope.styCode = $scope.project.introduction;
|
|
|
$scope.introduction = $sce.trustAsHtml($scope.styCode);
|
|
|
- alert($scope.introduction.length());
|
|
|
$scope.organization = data.organization;
|
|
|
$scope.percentage = data.totalAmount / data.target;
|
|
|
- // document.write('<script type="text/javascript" src="static/js/mobile/detail.js"></script>');
|
|
|
+
|
|
|
+ // 展开全文
|
|
|
+ var $showAll = $('#activityIntroduction');
|
|
|
+ $showAll.html(data.introduction);
|
|
|
+ alert('获取成功');
|
|
|
+ var $height = $showAll.height();
|
|
|
+ alert($showAll.height());
|
|
|
+ if ($height > 700) {
|
|
|
+ $showAll.css({
|
|
|
+ 'height': '6rem',
|
|
|
+ 'overflow': 'hidden'
|
|
|
+ }).next().css('display','block');
|
|
|
+ } else {
|
|
|
+ $showAll.css({
|
|
|
+ 'height': 'auto',
|
|
|
+ 'overflow': 'visible'
|
|
|
+ }).next().css('display','none');
|
|
|
+ }
|
|
|
}, function (error) {
|
|
|
console.log(error);
|
|
|
});
|
|
|
@@ -65,6 +81,34 @@ define([ 'app/app' ], function(app) {
|
|
|
Project.getCarousels({useFor: useFor}, {}, function(data) {
|
|
|
$scope.carousels = data;
|
|
|
});
|
|
|
+
|
|
|
+ // 活动内容获取
|
|
|
+ // $.ajax({
|
|
|
+ // url: '/project/detail/' + id,
|
|
|
+ // type: 'GET',
|
|
|
+ // data: {id : id},
|
|
|
+ // success:function(data){
|
|
|
+ // var $showAll = $('#activityIntroduction');
|
|
|
+ // $showAll.html(data.introduction);
|
|
|
+ // alert('获取成功');
|
|
|
+ // var $height = $showAll.height();
|
|
|
+ // alert($showAll.height());
|
|
|
+ // if ($height > 700) {
|
|
|
+ // $showAll.css({
|
|
|
+ // 'height': '6rem',
|
|
|
+ // 'overflow': 'hidden'
|
|
|
+ // }).next().css('display','block');
|
|
|
+ // } else {
|
|
|
+ // $showAll.css({
|
|
|
+ // 'height': 'auto',
|
|
|
+ // 'overflow': 'visible'
|
|
|
+ // }).next().css('display','none');
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error:function(){
|
|
|
+ // alert('获取内容失败');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
};
|
|
|
init();
|
|
|
|