소스 검색

转速与方向

lifanagju_citu 6 달 전
부모
커밋
9dcca7272b
1개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 6 5
      src/views/mall/components/prizeDraw/slotMachine.vue

+ 6 - 5
src/views/mall/components/prizeDraw/slotMachine.vue

@@ -39,17 +39,18 @@ const myLucky = ref()
 const blocks = [
   { padding: '10px', background: '#00897B', borderRadius: 6 },
 ]
+// 转速与方向
 const slots = [
-    { speed: 18 },
-    { speed: 15 },
-    { speed: 12 },
+    { speed: 15, direction: -1 },
+    { speed: 15, direction: 1 },
+    { speed: 15, direction: -1 },
   ]
 const prizes = ref([])
 const defaultConfig = {
   rowSpacing: '10px',
   colSpacing: '10px',
-  accelerationTime: 1000,
-  decelerationTime: 5000,
+  accelerationTime: 1000, // 开始旋转时间
+  decelerationTime: 5000, // 缓慢停止时间
 }
 
 // 根据活动id获取奖品列表