Parcourir la source

奖品移动修改

hwb0 il y a 3 ans
Parent
commit
c8c8e76ef7
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      packagePrize/rolling/index.vue

+ 4 - 2
packagePrize/rolling/index.vue

@@ -54,6 +54,7 @@
 				num: 8, // 动画倒计时
 				num2: 0, // 动画持续时间
 				time: null, // 定时器
+				stopTime: null, //自动停止
 				list: [
 					[
 						{ url: 'https://cdn.uviewui.com/uview/album/1.jpg', title: '微软显示(Miceosoft)日版Xbox Seies S', price: 2999 },
@@ -179,7 +180,7 @@
 					}
 				}, 1000)
 				// 不手动停止动画,自动停止
-				setTimeout(() => {
+				this.stopTime = setTimeout(() => {
 					this.stop()
 				}, 8000);
 				// #endif
@@ -208,7 +209,7 @@
 				}).exec();
 				
 				// 不手动停止动画,自动停止
-				setTimeout(() => {
+				this.stopTime = setTimeout(() => {
 					this.num = 0
 					this.stop()
 				}, 8000);
@@ -238,6 +239,7 @@
 				 * */
 				
 				clearInterval(this.time)
+				clearTimeout(this.stopTime)
 				this.animationData = {}
 				if (this.num2 == 0) {
 					this.list[3][1].url = 'https://cdn.uviewui.com/uview/album/4.jpg'