Sfoglia il codice sorgente

增加广告提示!

Administrator 7 anni fa
parent
commit
05d0e79add

+ 15 - 39
src/main/webapp/WEB-INF/views/normal/index.html

@@ -207,17 +207,21 @@
 	<!-- body End -->
 
 	<!-- 金控广告 -->
-	<div class="jinkong_bottom"></div>
-	<div class="jinkong">
-		<div class="container">
-			<div class="img">
-				<span class="qcrode_close close">×</span>
-                <span class="close time">5s</span>
-				<img src="static/img/jinkong/xiaoren.png" id="img_xiaoren">
-				<img src="static/img/jinkong/qrcode.png">
-			</div>
-		</div>
-	</div>
+	<div ng-controller="AdController">
+        <div ng-if="adStart">
+            <div class="jinkong_bottom" ng-if="banner" ng-class="{'jinkong_animation': jingKongAnmiation}"></div>
+            <div class="jinkong" ng-if="imgShow" ng-class="{'jinkong_animation': jingKongAnmiation}">
+                <div class="container">
+                    <div class="img" ng-class="{'img_stater': imgAnmiation}">
+                        <span class="qcrode_close close" ng-click="closeClick()">×</span>
+                        <span class="close time" ng-if="!imgAnmiation">{{count || 0}}s</span>
+                        <img src="static/img/jinkong/xiaoren.png" ng-class="{'animation_xr': imgAnmiation}">
+                        <img src="static/img/jinkong/qrcode.png">
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
  	<!-- -金控广告 -->
 
 	<!-- footer Start -->
@@ -292,34 +296,6 @@
 	<script src="static/lib/jquery/jquery.min.js"></script>
 	<script src="static/lib/bootstrap/js/bootstrap.js"></script>
 <script type="text/javascript">
-	// 金控广告动画设置
-	$(function() {
-        var closeClick = function () {
-            var display = $('.jinkong_bottom').css('display')
-            if (display === 'none') {
-                $('.jinkong').fadeOut(500)
-            } else {
-                $('.jinkong_bottom').fadeOut(500)
-                $('.jinkong .img').addClass('img_stater')
-                $('#img_xiaoren').addClass('animation_xr')
-            }
-        }
-        var count  = 6
-        var getLoc = function () {
-            count--;
-            $('.time').html(count + 's');
-            if (count <= 0) {
-                $('.time').hide()
-                clearInterval(timeOut)
-                closeClick()
-            }
-        }
-	    $('.qcrode_close').click(function() {
-            closeClick()
-		})
-        var timeOut = setInterval(getLoc,1000);
-	})
-
 	$(function(){
 		// 新手引导
 		$('#mask,#searchTip,#searchTip div:eq(0)').show();

+ 10 - 12
src/main/webapp/resources/css/index.css

@@ -4737,12 +4737,14 @@ a.order-detail {
 	position:fixed;
 	bottom:0;
 	z-index:10000;
-	margin-bottom:-241px;
 	background: url(../img/jinkong/tangchuan.png)no-repeat center center;
-    animation: shift_up 1s linear 1s forwards;
-    -o-animation: shift_up 1s linear 1s forwards;
-    -webkit-animation: shift_up 1s linear 1s forwards;
-    -moz-animation: shift_up 1s linear 1s forwards;
+}
+.jinkong_animation{
+	margin-bottom:-241px;
+	animation: shift_up 1s linear 1s forwards;
+	-o-animation: shift_up 1s linear 1s forwards;
+	-webkit-animation: shift_up 1s linear 1s forwards;
+	-moz-animation: shift_up 1s linear 1s forwards;
 }
 @keyframes shift_up {
 	form{margin-bottom: -241px;opacity:0;}
@@ -4777,11 +4779,6 @@ a.order-detail {
 	bottom:0;
 	z-index:10000;
 	width:100%;
-	margin-bottom:-241px;
-	animation: shift_up 1s linear 1s forwards;
-	-o-animation: shift_up 1s linear 1s forwards;
-	-webkit-animation: shift_up 1s linear 1s forwards;
-	-moz-animation: shift_up 1s linear 1s forwards;
 }
 
 .jinkong .img{
@@ -4849,14 +4846,15 @@ a.order-detail {
 }
 .jinkong .img .qcrode_close{
 	position:absolute;
-	right:-25px;
+	right:-40px;
 	top:0;
 }
 .jinkong .img .time{
     position:absolute;
-    right:-50px;
+    right:-70px;
     top:0;
     color:#333;
+	background:none;
 }
 .jinkong .img .qcrode_close:hover{
     background: #666;

+ 53 - 19
src/main/webapp/resources/js/index/app.js

@@ -929,6 +929,57 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $rootScope.active = active;
             window.location.href = "#/purc/purchaseinquiry";
         }
+
+    }]);
+
+    app.controller('AdController', ['$scope', '$modal', '$interval', function($scope, $modal, $interval) {
+        $scope.adStart = false;
+        $modal.open({
+            templateUrl: 'static/tpl/index/home/modal/notice.html',
+            controller: 'NotifyCtrl'
+        }).result.then(function (s) {
+            $scope.adStart = true;
+            // 广告操作
+            $scope.count = 5;
+            $scope.banner = true;
+            $scope.imgAnmiation = false;
+            $scope.jingKongAnmiation = true;
+            $scope.imgShow = true;
+            $scope.Times = $interval(function () {
+                $scope.count--;
+                if ($scope.count <= 0) {
+                    $scope.count = 5;
+                    $interval.cancel($scope.Times);
+                    $scope.closeClick();
+                }
+            }, 1000);
+            // 金控广告动画设置
+            $scope.closeClick = function () {
+                $scope.jingKongAnmiation = false;
+                if ($scope.banner === false) {
+                    $scope.imgAnmiation = false;
+                    $scope.imgShow = false;
+                } else {
+                    $scope.banner = false;
+                    $scope.imgAnmiation = true;
+                }
+            }
+        });
+    }]);
+
+    app.controller('NotifyCtrl', ['$scope', '$modalInstance', '$interval', function($scope, $modalInstance, $interval) {
+        $scope.count = 5;
+        $scope.intervalTime = $interval(function () {
+            $scope.count--;
+            if ($scope.count === 0) {
+                $scope.lockstatus = false;
+                $interval.cancel($scope.intervalTime)
+                $scope.close()
+            }
+        }, 1000);
+        $scope.close = function() {
+            $modalInstance.close();
+        }
     }]);
 
     /**
@@ -1577,27 +1628,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $rootScope.tenderActive = active;
             window.location.hash = '#/purc/tender';
         }
-            $modal.open({
-                templateUrl: 'static/tpl/index/home/modal/notice.html',
-                controller: 'NotifyCtrl'
-            }).result.then(function (s) {
-            });
-    }]);
 
-    app.controller('NotifyCtrl', ['$scope', '$modalInstance', '$interval', function($scope, $modalInstance, $interval) {
-        $scope.count = 5;
-        $scope.intervalTime = $interval(function () {
-                $scope.count--;
-                if ($scope.count === 0) {
-                    $scope.lockstatus = false;
-                    $interval.cancel($scope.intervalTime)
-                    $scope.close()
-                }
-            }, 1000);
-        $scope.close = function() {
-            $modalInstance.close();
-        }
     }]);
+
+
     // header
     app.controller('HeaderCtrl', ['$scope', 'SnapshotService', function ($scope, SnapshotService) {
         SnapshotService.getMessage(function (data) {

+ 2 - 3
src/main/webapp/resources/js/serve/app.js

@@ -137,6 +137,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
 	}]);
 	app.controller('AuthCtrl', ['$scope', '$window', 'AuthenticationService', function($scope, $window, AuthenticationService) {
 		$scope.isAuthed = AuthenticationService.isAuthed();
+        $scope.adStart = false;
 		$scope.userInfo = {};
 		AuthenticationService.getAuthentication().success(function(data) {
 			$scope.userInfo = data;
@@ -149,9 +150,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
 			});
 		};
 	}]);
-	app.controller('IndexCtrl', ['$scope', function($scope){
-		
-	}]);
+
 	app.controller('ContactCtrl', ['$scope', 'toaster', 'AuthenticationService', 'FeedBackService', function($scope, toaster, AuthenticationService, FeedBackService){
 		$scope.connect = function(type) {
 			toaster.pop('warning', '连接失败', '高峰期建议选择自助服务或问题反馈');