Browse Source

物流管理新增配送规则新手引导解决gif图片第二次播放时不能动态播放的问题

hangb 8 years ago
parent
commit
0786686a20

+ 18 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -153,9 +153,25 @@ define([ 'app/app' ], function(app) {
                 $scope.fareArray.push(secondFare);
             }
         };
-        $scope.getIndex = function (index) {
-            index = index + 1;
+        $scope.prevIndex = function () {
+            $scope.currentStep =  $scope.currentStep - 1;
+            angular.forEach ($scope.imagesObject, function (object, index) {
+                object.img = '';
+                if ($scope.currentStep == index + 1) {
+                    object.img = $scope.imgIndex[index];
+                }
+            })
             
+        };
+        $scope.nextIndex = function () {
+            $scope.currentStep =  $scope.currentStep + 1;
+            angular.forEach ($scope.imagesObject, function (object, index) {
+                object.img = '';
+                if ($scope.currentStep == index + 1) {
+                    object.img = $scope.imgIndex[index];
+                }
+            })
+
         };
         $scope.cancelOperateTip = function (noTip) {
             if (noTip){

+ 18 - 12
src/main/webapp/resources/view/vendor/forstore/vendor_delivery_rule.html

@@ -342,19 +342,25 @@
 		width: 250px;
 	}
 	.guide ul.guide-content li div.click4{
+		position: absolute;
+		top: 678px;
+		left: 561px;
+		width: 330px;
+	}
+	.guide ul.guide-content li div.click5{
 		position: absolute;
 		top: 714px;
 		left: 1245px;
 		width: 330px;
 	}
-	.guide ul.guide-content li div.click4 .next{
+	.guide ul.guide-content li div.click5 .next{
 		display: inline-block;
 		width: 120px;
 		height: 44px;
 		background: transparent;
 		cursor: pointer;
 	}
-	.guide ul.guide-content li div.click4 input{
+	.guide ul.guide-content li div.click5 input{
 		margin-left: 32px;
 		margin-top: -12px;
 		width: 20px;
@@ -761,29 +767,29 @@
 <div ng-if="tab=='editRule' && showOperate" class="guide">
 	<ul  ui-tour="currentStep" class="guide-content" id="one">
 		<li target="h1:eq(0)" class="popover right in guide01" overlay>
-			<img src="static/img/tour/1.gif" alt=""/>
+			<img ng-src="{{imagesObject[currentStep-1].img}}" alt=""/>
 			<!--点击下一步-->
-			<span class="next-btn" ng-click="currentStep=currentStep+1"></span>
+			<span class="next-btn" ng-click="nextIndex()"></span>
 		</li>
 		<li target="h1:eq(1)" at="top" class="popover top in guide02">
-			<img src="static/img/tour/2.gif" alt=""/>
+			<img ng-src="{{imagesObject[currentStep-1].img}}" alt=""/>
 			<!--点击上一步 下一步-->
-			<div class="click2"><span class="pre"  ng-click="currentStep=currentStep-1"></span><span class="next" ng-click="currentStep=currentStep+1"></span></div>
+			<div class="click2"><span class="pre"  ng-click="prevIndex()"></span><span class="next" ng-click="nextIndex()"></span></div>
 		</li>
 		<li target="h1:eq(2) a" at="left" name="chapter3" class="popover left in guide03">
-			<img src="static/img/tour/3.gif" alt=""/>
+			<img ng-src="{{imagesObject[currentStep-1].img}}" alt=""/>
 			<!--点击上一步 下一步-->
-			<div class="click3"><span class="pre" ng-click="currentStep=currentStep-1"></span><span class="next"  ng-click="currentStep=currentStep+1"></span></div>
+			<div class="click3"><span class="pre" ng-click="prevIndex()"></span><span class="next"  ng-click="nextIndex()"></span></div>
 		</li>
 		<li target="h1:eq(3)" at="bottom" class="popover bottom in guide04">
-			<img src="static/img/tour/4.gif" alt=""/>
+			<img ng-src="{{imagesObject[currentStep-1].img}}" alt=""/>
 			<!--点击上一步 下一步-->
-			<div class="click4"><span class="pre"  ng-click="currentStep=currentStep-1"></span><span class="next" ng-click="cancelOperateTip(noTip)"></span></div>
+			<div class="click4"><span class="pre"  ng-click="prevIndex()"></span><span class="next" ng-click="nextIndex()"></span></div>
 		</li>
 		<li target="h1:eq(4)" at="bottom" class="popover bottom in guide05">
-			<img src="static/img/tour/5.png" alt=""/>
+			<img ng-src="{{imagesObject[currentStep-1].img}}" alt=""/>
 			<!--点击上一步 下一步-->
-			<div class="click4"><span class="pre"  ng-click="currentStep=currentStep-1"></span><span class="next" ng-click="cancelOperateTip(noTip)"></span> <input type="checkbox" ng-model="noTip"></div>
+			<div class="click5"><span class="pre"  ng-click="prevIndex()"></span><span class="next" ng-click="cancelOperateTip(noTip)"></span> <input type="checkbox" ng-model="noTip"></div>
 		</li>
 	</ul>
 	<div class="tour-overlay fade"></div>