Commit 9ea65295 by zhangyongfeng

修复多次抽奖不减去奖池人数的bug

parent 75e4d4dd
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
v-for="item in resArr" v-for="item in resArr"
:key="item" :key="item"
class="itemres" class="itemres"
:style="resCardStyle"
@click="showRes = false" @click="showRes = false"
> >
{{ item }} {{ item }}
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
</div> </div>
<LotteryConfig :visible.sync="showConfig" @resetconfig="reloadTagCanvas" /> <LotteryConfig :visible.sync="showConfig" @resetconfig="reloadTagCanvas" />
<Tool @toggle="toggle" :running="running" /> <Tool @toggle="toggle" @resetConfig="reloadTagCanvas" :running="running" />
<Result :visible.sync="showResult"></Result> <Result :visible.sync="showResult"></Result>
<span class="copy-right"> <span class="copy-right">
...@@ -59,6 +60,18 @@ export default { ...@@ -59,6 +60,18 @@ export default {
components: { LotteryConfig, Publicity, Tool, Result }, components: { LotteryConfig, Publicity, Tool, Result },
computed: { computed: {
resCardStyle() {
const style = {};
const { number } = this.config;
if (number < 100) {
style.fontSize = '100px';
} else if (number < 1000) {
style.fontSize = '80px';
} else if (number < 10000) {
style.fontSize = '60px';
}
return style;
},
config: { config: {
get() { get() {
return this.$store.state.config; return this.$store.state.config;
...@@ -192,16 +205,13 @@ export default { ...@@ -192,16 +205,13 @@ export default {
this.resArr = resArr; this.resArr = resArr;
this.category = category; this.category = category;
if (!this.result[category]) {
if (this.result[category]) {
this.$set(this.result, category, []); this.$set(this.result, category, []);
} }
const oldRes = this.result[category] || []; const oldRes = this.result[category] || [];
const data = Object.assign({}, this.result, { const data = Object.assign({}, this.result, {
[category]: oldRes.concat(resArr) [category]: oldRes.concat(resArr)
}); });
this.result = data; this.result = data;
window.TagCanvas.SetSpeed('rootcanvas', [5, 1]); window.TagCanvas.SetSpeed('rootcanvas', [5, 1]);
} }
...@@ -272,7 +282,7 @@ export default { ...@@ -272,7 +282,7 @@ export default {
border-radius: 4px; border-radius: 4px;
border: 1px solid #ccc; border: 1px solid #ccc;
line-height: 160px; line-height: 160px;
font-size: 100px; font-size: 80px;
font-weight: bold; font-weight: bold;
margin-right: 20px; margin-right: 20px;
margin-top: 20px; margin-top: 20px;
......
...@@ -136,6 +136,7 @@ export default { ...@@ -136,6 +136,7 @@ export default {
.then(() => { .then(() => {
clearData(); clearData();
this.$store.commit('setClearStore'); this.$store.commit('setClearStore');
this.$emit('resetConfig');
this.$message({ this.$message({
type: 'success', type: 'success',
message: '重置成功!' message: '重置成功!'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment