修复多次抽奖不减去奖池人数的bug
Showing
2 changed files
with
17 additions
and
6 deletions
| ... | @@ -25,6 +25,7 @@ | ... | @@ -25,6 +25,7 @@ |
| 25 | v-for="item in resArr" | 25 | v-for="item in resArr" |
| 26 | :key="item" | 26 | :key="item" |
| 27 | class="itemres" | 27 | class="itemres" |
| 28 | :style="resCardStyle" | ||
| 28 | @click="showRes = false" | 29 | @click="showRes = false" |
| 29 | > | 30 | > |
| 30 | {{ item }} | 31 | {{ item }} |
| ... | @@ -32,7 +33,7 @@ | ... | @@ -32,7 +33,7 @@ |
| 32 | </div> | 33 | </div> |
| 33 | 34 | ||
| 34 | <LotteryConfig :visible.sync="showConfig" @resetconfig="reloadTagCanvas" /> | 35 | <LotteryConfig :visible.sync="showConfig" @resetconfig="reloadTagCanvas" /> |
| 35 | <Tool @toggle="toggle" :running="running" /> | 36 | <Tool @toggle="toggle" @resetConfig="reloadTagCanvas" :running="running" /> |
| 36 | <Result :visible.sync="showResult"></Result> | 37 | <Result :visible.sync="showResult"></Result> |
| 37 | 38 | ||
| 38 | <span class="copy-right"> | 39 | <span class="copy-right"> |
| ... | @@ -59,6 +60,18 @@ export default { | ... | @@ -59,6 +60,18 @@ export default { |
| 59 | components: { LotteryConfig, Publicity, Tool, Result }, | 60 | components: { LotteryConfig, Publicity, Tool, Result }, |
| 60 | 61 | ||
| 61 | computed: { | 62 | computed: { |
| 63 | resCardStyle() { | ||
| 64 | const style = {}; | ||
| 65 | const { number } = this.config; | ||
| 66 | if (number < 100) { | ||
| 67 | style.fontSize = '100px'; | ||
| 68 | } else if (number < 1000) { | ||
| 69 | style.fontSize = '80px'; | ||
| 70 | } else if (number < 10000) { | ||
| 71 | style.fontSize = '60px'; | ||
| 72 | } | ||
| 73 | return style; | ||
| 74 | }, | ||
| 62 | config: { | 75 | config: { |
| 63 | get() { | 76 | get() { |
| 64 | return this.$store.state.config; | 77 | return this.$store.state.config; |
| ... | @@ -192,16 +205,13 @@ export default { | ... | @@ -192,16 +205,13 @@ export default { |
| 192 | this.resArr = resArr; | 205 | this.resArr = resArr; |
| 193 | 206 | ||
| 194 | this.category = category; | 207 | this.category = category; |
| 195 | 208 | if (!this.result[category]) { | |
| 196 | if (this.result[category]) { | ||
| 197 | this.$set(this.result, category, []); | 209 | this.$set(this.result, category, []); |
| 198 | } | 210 | } |
| 199 | |||
| 200 | const oldRes = this.result[category] || []; | 211 | const oldRes = this.result[category] || []; |
| 201 | const data = Object.assign({}, this.result, { | 212 | const data = Object.assign({}, this.result, { |
| 202 | [category]: oldRes.concat(resArr) | 213 | [category]: oldRes.concat(resArr) |
| 203 | }); | 214 | }); |
| 204 | |||
| 205 | this.result = data; | 215 | this.result = data; |
| 206 | window.TagCanvas.SetSpeed('rootcanvas', [5, 1]); | 216 | window.TagCanvas.SetSpeed('rootcanvas', [5, 1]); |
| 207 | } | 217 | } |
| ... | @@ -272,7 +282,7 @@ export default { | ... | @@ -272,7 +282,7 @@ export default { |
| 272 | border-radius: 4px; | 282 | border-radius: 4px; |
| 273 | border: 1px solid #ccc; | 283 | border: 1px solid #ccc; |
| 274 | line-height: 160px; | 284 | line-height: 160px; |
| 275 | font-size: 100px; | 285 | font-size: 80px; |
| 276 | font-weight: bold; | 286 | font-weight: bold; |
| 277 | margin-right: 20px; | 287 | margin-right: 20px; |
| 278 | margin-top: 20px; | 288 | margin-top: 20px; | ... | ... |
| ... | @@ -136,6 +136,7 @@ export default { | ... | @@ -136,6 +136,7 @@ export default { |
| 136 | .then(() => { | 136 | .then(() => { |
| 137 | clearData(); | 137 | clearData(); |
| 138 | this.$store.commit('setClearStore'); | 138 | this.$store.commit('setClearStore'); |
| 139 | this.$emit('resetConfig'); | ||
| 139 | this.$message({ | 140 | this.$message({ |
| 140 | type: 'success', | 141 | type: 'success', |
| 141 | message: '重置成功!' | 142 | message: '重置成功!' | ... | ... |
-
Please register or sign in to post a comment