Browse Source

打开新手引导

hejq 8 years ago
parent
commit
5e9fd083af

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

@@ -342,29 +342,29 @@
 	</div>
 	<!-- footer End -->
 	<!--新手引导-->
-<!--	<div ng-init="currentStep = 1" class="guide">
+	<div ng-init="currentStep = 1" class="guide">
 		<ul  ui-tour="currentStep" class="container">
 			<li target="h1:eq(0)" class="popover right in" overlay>
 				<img src="static/img/guide/more1.png" alt=""/>
-				&lt;!&ndash;点击下一步&ndash;&gt;
+				<!--点击下一步-->
 				<span class="guide01" ng-click="currentStep = currentStep + 1"></span>
 				<div class="close" ng-click="currentStep = false">&times;</div>
 			</li>
 			<li target="h1:eq(1)" class="popover right in">
 				<img src="static/img/guide/more2.png" alt=""/>
-				&lt;!&ndash;点击下一步&ndash;&gt;
+				<!--点击下一步-->
 				<span class="guide02" ng-click="currentStep = currentStep + 1"></span>
 				<div class="close close02" ng-click="currentStep = false">&times;</div>
 			</li>
 			<li target="h1:eq(2)" class="popover right in">
 				<img src="static/img/guide/more3.png" alt=""/>
-				&lt;!&ndash;点击下一步&ndash;&gt;
+				<!--点击下一步-->
 				<span class="guide03" ng-click="currentStep = false"></span>
 				<div class="close close03" ng-click="currentStep = false">&times;</div>
 			</li>
 		</ul>
 		<div class="tour-overlay fade"></div>
-	</div>-->
+	</div>
 	<!-- 消息提示框  Start-->
 	<toaster-container
 		toaster-options="{'position-class': 'toast-top-center'}"></toaster-container>

+ 47 - 47
src/main/webapp/resources/js/common/directives.js

@@ -78,51 +78,51 @@ define(['angular'], function (angular) {
      *     </li>
      *   </ul>
      */
-    // angular.module('ui.tour', [])
-    //
-    //     .directive('uiTour', ['$timeout', '$parse', function ($timeout, $parse) {
-    //         return {
-    //             link: function ($scope, $element, $attributes) {
-    //                 var model = $parse($attributes.uiTour);
-    //
-    //                 // Watch model and change steps
-    //                 $scope.$watch($attributes.uiTour, function (newVal, oldVal) {
-    //                     if (angular.isNumber(newVal)) {
-    //                         showStep(newVal)
-    //                     } else {
-    //                         if (angular.isString(newVal)) {
-    //                             var stepNumber = 0,
-    //                                 children = $element.children()
-    //                             angular.forEach(children, function (step, index) {
-    //                                 if (angular.element(step).attr('name') === newVal)
-    //                                     stepNumber = index + 1;
-    //                             });
-    //                             model.assign($scope, stepNumber);
-    //                         } else {
-    //                             model.assign($scope, newVal && 1 || 0);
-    //                         }
-    //                     }
-    //                 });
-    //
-    //                 // Show step
-    //                 function showStep(stepNumber) {
-    //                     var elm, at, children = $element.children().removeClass('active');
-    //                     elm = children.eq(stepNumber - 1);
-    //                     if (stepNumber) {
-    //                         at = elm.attr('at');
-    //                         $timeout(function () {
-    //                             var target = angular.element(elm.attr('target'))[0];
-    //                             if (elm.attr('overlay') !== undefined) {
-    //                                 $('.tour-overlay').addClass('active').css({}).addClass('in');
-    //                             }
-    //                             elm.addClass('active');
-    //                         });
-    //                     } else {
-    //                         $('.tour-overlay').removeClass('in');
-    //                         $('.tour-overlay').removeClass('active');
-    //                     }
-    //                 }
-    //             }
-    //         };
-    //     }]);
+    angular.module('ui.tour', [])
+
+        .directive('uiTour', ['$timeout', '$parse', function ($timeout, $parse) {
+            return {
+                link: function ($scope, $element, $attributes) {
+                    var model = $parse($attributes.uiTour);
+
+                    // Watch model and change steps
+                    $scope.$watch($attributes.uiTour, function (newVal, oldVal) {
+                        if (angular.isNumber(newVal)) {
+                            showStep(newVal)
+                        } else {
+                            if (angular.isString(newVal)) {
+                                var stepNumber = 0,
+                                    children = $element.children()
+                                angular.forEach(children, function (step, index) {
+                                    if (angular.element(step).attr('name') === newVal)
+                                        stepNumber = index + 1;
+                                });
+                                model.assign($scope, stepNumber);
+                            } else {
+                                model.assign($scope, newVal && 1 || 0);
+                            }
+                        }
+                    });
+
+                    // Show step
+                    function showStep(stepNumber) {
+                        var elm, at, children = $element.children().removeClass('active');
+                        elm = children.eq(stepNumber - 1);
+                        if (stepNumber) {
+                            at = elm.attr('at');
+                            $timeout(function () {
+                                var target = angular.element(elm.attr('target'))[0];
+                                if (elm.attr('overlay') !== undefined) {
+                                    $('.tour-overlay').addClass('active').css({}).addClass('in');
+                                }
+                                elm.addClass('active');
+                            });
+                        } else {
+                            $('.tour-overlay').removeClass('in');
+                            $('.tour-overlay').removeClass('active');
+                        }
+                    }
+                }
+            };
+        }]);
 });

+ 1 - 1
src/main/webapp/resources/js/index/app.js

@@ -1,6 +1,6 @@
 define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers'], function () {
     'use strict';
-    var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService']);
+    var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour']);
     app.init = function () {
         angular.bootstrap(document, ['myApp']);
     };