Sfoglia il codice sorgente

Merge branch 'master' of http://10.1.1.202:3030/steve07s/lottery

maa3520 2 anni fa
parent
commit
ad523d5e2e
1 ha cambiato i file con 7 aggiunte e 4 eliminazioni
  1. 7 4
      resources/js/src/views/lottery/Slot.vue

+ 7 - 4
resources/js/src/views/lottery/Slot.vue

@@ -249,6 +249,7 @@ export default {
 				this.clearResult()
 				this.drawOption = message;
 				this.drawList = [];
+				this.count();
 			}
 		});
 
@@ -273,7 +274,7 @@ export default {
 		});
 
 		this.bodyListener = (e) => {
-			if (e.keyCode === 13 || e.keyCode === 32 && e.target === document.body) {
+			if ((e.keyCode === 13 || e.keyCode === 32) && e.target === document.body) {
 				console.log("enter");
 				this.draw();
 			}
@@ -322,6 +323,7 @@ export default {
 				this.drawOption.prize_name = params.name;
 				this.drawOption.prize_id = params.id;
 				this.showDraw();
+				this.count();
 			} else {
 				this.showDrawError();
 			}
@@ -349,7 +351,7 @@ export default {
 
 		},
 		recieve(e) {
-			e.target.blur();
+			e.currentTarget.blur();
 			if (this.isDrawn) {
 				var idList = [];
 				this.drawList.forEach(element => {
@@ -364,12 +366,13 @@ export default {
 					} else {
 						console.log("store error");
 					}
+					this.count();
 					this.clearResult();
 				});
 			}
 		},
 		restart(e) {
-			e.target.blur();
+			e.currentTarget.blur();
 			if (this.isDrawn) {
 				var idList = [];
 				this.drawList.forEach(element => {
@@ -445,7 +448,7 @@ export default {
 			this.isDrawn = false;
 		},
 		count() {
-			useJwt.postData('/api/prize/count_by_prize', { prize_id: this.prizeId }).then(res => {
+			useJwt.postData('/api/prize/count_by_prize', { prize_id: this.drawOption.prize_id }).then(res => {
 				this.drawnCount = res.data.drawnCount;
 				this.notDrawnCount = res.data.notDrawnCount;
 			});