|
|
@@ -28,7 +28,7 @@
|
|
|
@click="hideModal">
|
|
|
Close
|
|
|
</b-button>
|
|
|
- <b-button v-ripple.400="'rgba(255, 255, 255, 0.15)'" class="mt-2" variant="outline-primary" block @click="draw">
|
|
|
+ <b-button v-ripple.400="'rgba(255, 255, 255, 0.15)'" class="mt-2" variant="primary" block @click="draw">
|
|
|
Accept
|
|
|
</b-button>
|
|
|
|
|
|
@@ -36,7 +36,7 @@
|
|
|
|
|
|
<b-modal ref="draw-error" centered title="抽獎" no-stacking hide-footer>
|
|
|
<b-card-text class="my-1 text-center">
|
|
|
- 獎品錯誤
|
|
|
+ 抽獎錯誤
|
|
|
</b-card-text>
|
|
|
<b-button v-ripple.400="'rgba(255, 255, 255, 0.15)'" class="mt-3" variant="outline-secondary" block
|
|
|
@click="hideModal">
|
|
|
@@ -57,7 +57,14 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <b-button v-ripple.400="'rgba(255, 255, 255, 0.15)'" class="mt-2" variant="outline-primary" block
|
|
|
+ <div v-if="onlyOne(drawNumber)">
|
|
|
+ <b-button v-ripple.400="'rgba(255, 255, 255, 0.15)'" class="mt-2" variant="outline-primary" block
|
|
|
+ @click="donate">
|
|
|
+ 捐出
|
|
|
+ </b-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <b-button v-ripple.400="'rgba(255, 255, 255, 0.15)'" class="mt-2" variant="primary" block
|
|
|
@click="store">
|
|
|
Accept
|
|
|
</b-button>
|
|
|
@@ -297,6 +304,20 @@ export default {
|
|
|
this.hideModal();
|
|
|
});
|
|
|
},
|
|
|
+ donate() {
|
|
|
+ var idList = [];
|
|
|
+ this.drawList.forEach(element => {
|
|
|
+ idList.push(element.user_id);
|
|
|
+ });
|
|
|
+ useJwt.postData('/api/draw/donate', { users: idList }).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ console.log("success");
|
|
|
+ } else {
|
|
|
+ console.log("donate error");
|
|
|
+ }
|
|
|
+ this.hideModal();
|
|
|
+ });
|
|
|
+ },
|
|
|
count() {
|
|
|
var departments = this.departments;
|
|
|
var numbers = "0123456789"
|