Browse Source

物流管理页面新手引导

hangb 8 years ago
parent
commit
06c2664670

BIN
src/main/webapp/resources/img/tour/1.gif


BIN
src/main/webapp/resources/img/tour/2.gif


BIN
src/main/webapp/resources/img/tour/3.gif


BIN
src/main/webapp/resources/img/tour/4.png


+ 102 - 0
src/main/webapp/resources/lib/ui-tour/tour.js

@@ -0,0 +1,102 @@
+/*global angular */
+/**
+ * uiTour directive
+ *
+ * @example:
+ *   <ul ui-tour="currentStep">
+ *     <li target="#someId">
+ *       First Tooltip
+ *       <a ng-click="currentStep=currentStep+1">Next</a>
+ *     </li>
+ *     <li target=".items:eq(2)" name="two">
+ *       Second Tooltip
+ *       <a ng-click="currentStep=currentStep-1">Prev</a>
+ *     </li>
+ *     <li target=".items:eq(2)">
+ *       Third Tooltip
+ *       <a ng-click="currentStep='two'">Go directly to 'two'</a>
+ *       <a ng-click="currentStep=0">Done</a>
+ *     </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 && elm.length) {
+          at = elm.attr('at');
+          $timeout(function(){
+            var target = angular.element(elm.attr('target'))[0];
+
+
+            if (elm.attr('overlay') !== undefined) {
+              $('.tour-overlay').addClass('active').css({
+                marginLeft: target.offsetLeft + target.offsetWidth / 2 - 150,
+                marginTop: target.offsetTop + target.offsetHeight / 2 - 150
+              }).addClass('in');
+            } else {
+              $('.tour-overlay').removeClass('in');
+              setTimeout(function(){
+                $('.tour-overlay').removeClass('active');
+              }, 1000);
+            }
+            offset = {};
+            
+            offset.top = target.offsetTop;
+            offset.left = target.offsetLeft;
+
+            elm.addClass('active');
+              
+            if (at.indexOf('bottom') > -1) {
+              offset.top += target.offsetHeight;
+            } else if (at.indexOf('top') > -1) {
+              offset.top -= elm[0].offsetHeight;
+            } else {
+              offset.top += target.offsetHeight / 2 - elm[0].offsetHeight / 2;
+            }
+            if (at.indexOf('left') > -1) {
+              offset.left -= elm[0].offsetWidth;
+            } else if (at.indexOf('right') > -1) {
+              offset.left += target.offsetWidth;
+            } else {
+              offset.left += target.offsetWidth / 2 - elm[0].offsetWidth / 2;
+            }
+            
+            elm.css(offset);
+          });
+        } else {
+          $('.tour-overlay').removeClass('in');
+          setTimeout(function(){
+            $('.tour-overlay').removeClass('active');
+          }, 1000);
+        }
+      }
+    }
+  };
+}]);

+ 71 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_delivery_rule.html

@@ -250,7 +250,52 @@
 		color: #5782dc;
 		text-decoration: underline ;
 	}
+	/*新手引导*/
+	.popover{
+		display: block!important ;
+		max-height: 0;
+		max-width: 0;
+	}
+	.tour-overlay{
+		display: block;
+	}
+	.fade{
+		opacity: 1;
+	}
+	h1 { width: 50%; margin: 100px auto; text-align: center; background: lightblue; color: white;}
+
+	[ui-tour] > li {
+		display: none;
+	}
+	.active {
+		display: block !important;
+	}
+
+	.tour-overlay {
+		z-index: 10;
+		display: none;
+		height: 500px;
+		width: 500px;
+		top: -4100px;
+		left: -4100px;
+		background: transparent;
+		border-radius: 8000px;
+		border: 4000px solid rgba(0,0,0,.5);
+		position: fixed;
+		-webkit-transition: all 1s ease;
+		-moz-transition: all 1s ease;
+		-ms-transition: all 1s ease;
+		-o-transition: all 1s ease;
+		transition: all 1s ease;
+	}
+	.tour-overlay.in {
+		height: 300px;
+		width: 300px;
+		top: -4000px;
+		left: -4000px;
+	}
 </style>
+<script src="static/lib/ui-tour/tour.js"></script>
 <!--右侧主体部分-->
 <div class="count user_right fr">
 	<div class="count_center">
@@ -631,9 +676,34 @@
 			<h5>2、我有多个实体店可以让顾客自提,要怎么样才能让买家结算时看到这项服务?</h5>
 			<span> 您可以在“物流管理-自提点”设置您支持自提的地址,只要有一个状态为“生效”的自提点,买家就能在结算页选择“上门自提”,并自助选择自提点。</span>
 		</div>
-		<div class="button"><a href="">更多常见问题可点击查看 <i class="fa fa-angle-double-right"></i></a></div>
+		<div class="button"><a href="/help/home">更多常见问题可点击查看 <i class="fa fa-angle-double-right"></i></a></div>
 	</div>
 </div>
+<!--新手引导页面-->
+<div ng-if="tab=='editRule'" ng-init="currentStep=1">
+	<ul  ui-tour="currentStep">
+		<li target="h1:eq(0)" class="popover right in">
+			<img src="static/img/tour/1.gif" alt=""/>
+			<a href="">1111</a>
+		</li>
+		<li target="h1:eq(1)" at="top" class="popover top in">
+			<!--<img src="static/img/tour/2.gif" alt=""/>-->
+		</li>
+		<li target="h1:eq(2) a" at="left" name="chapter3" class="popover left in" overlay>
+			<!--<img src="static/img/tour/3.gif" alt=""/>-->
+		</li>
+		<li target="h1:eq(3)" at="bottom" class="popover bottom in">
+			<!--<img src="static/img/tour/4.png" alt=""/>-->
+		</li>
+	</ul>
+	<!--<pre>{{currentStep|json}}</pre>-->
+	<div class="tour-overlay fade"></div>
+	<style>
+		.tour-overlay{
+			display: block;
+		}
+	</style>
+</div>
 <!--防误删-->
 <div class="com-del-box" ng-if="deleteFrame">
 	<div class="title">