This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kdxcxs/element
update to latest bilibili live rules
- Loading branch information
Showing
14 changed files
with
8,718 additions
and
8,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,76 @@ | ||
<template> | ||
<div> | ||
<v-dialog v-model="goalLegal" persistent max-width="290"> | ||
<v-card> | ||
<v-card-title class="headline">抽取人数过多</v-card-title> | ||
<v-card-text>所选抽取人数应小于参加观众人数</v-card-text> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn color="green darken-1" text @click="goal = 1">确定</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
|
||
<v-stepper-step step="3"> | ||
抽奖 | ||
</v-stepper-step> | ||
<v-stepper-content step="3"> | ||
<p class="display-1 text-center purple--text">请选择人抽取人数</p> | ||
<v-text-field | ||
v-model="goal" | ||
type="number" | ||
label="抽取人数" | ||
class="px-2" | ||
outlined | ||
></v-text-field> | ||
<v-btn color="primary" @click="this.doLottery">随机抽奖</v-btn> | ||
</v-stepper-content> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Lottery", | ||
data: () => ({ | ||
goal: 1 | ||
}), | ||
computed: { | ||
goalLegal: function () { | ||
return this.stepNow===3 && this.goal>=this.uids.length; | ||
} | ||
}, | ||
methods: { | ||
randomNum: function (minNum, maxNum) { | ||
// https://www.cnblogs.com/starof/p/4988516.html | ||
switch (arguments.length) { | ||
case 1: | ||
return parseInt(Math.random() * minNum + 1, 10); | ||
case 2: | ||
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10); | ||
default: | ||
return 0; | ||
} | ||
}, | ||
doLottery: function () { | ||
if (!this.goalLegal) { | ||
this.nextStep(); | ||
let count = 0; | ||
let randomIndex = 0; | ||
while (count < this.goal){ | ||
randomIndex = this.randomNum(0, this.uids.length-1); | ||
if (!this.luckyDogs.includes(randomIndex)) { | ||
this.luckyDogs.push(randomIndex); | ||
count ++; | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
props: { | ||
stepNow: Number, | ||
uids: Array, | ||
luckyDogs: Array, | ||
nextStep: Function | ||
} | ||
} | ||
</script> | ||
<template> | ||
<div> | ||
<v-dialog v-model="goalLegal" persistent max-width="290"> | ||
<v-card> | ||
<v-card-title class="headline">抽取人数过多</v-card-title> | ||
<v-card-text>所选抽取人数应小于参加观众人数</v-card-text> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn color="green darken-1" text @click="goal = 1">确定</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
|
||
<v-stepper-step step="3"> | ||
抽奖 | ||
</v-stepper-step> | ||
<v-stepper-content step="3"> | ||
<p class="display-1 text-center purple--text">请选择人抽取人数</p> | ||
<v-text-field | ||
v-model="goal" | ||
type="number" | ||
label="抽取人数" | ||
class="px-2" | ||
outlined | ||
></v-text-field> | ||
<v-btn color="primary" @click="this.doLottery">随机抽奖</v-btn> | ||
</v-stepper-content> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Lottery", | ||
data: () => ({ | ||
goal: 1 | ||
}), | ||
computed: { | ||
goalLegal: function () { | ||
return this.stepNow===3 && this.goal>=this.uids.length; | ||
} | ||
}, | ||
methods: { | ||
randomNum: function (minNum, maxNum) { | ||
// https://www.cnblogs.com/starof/p/4988516.html | ||
switch (arguments.length) { | ||
case 1: | ||
return parseInt(Math.random() * minNum + 1, 10); | ||
case 2: | ||
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10); | ||
default: | ||
return 0; | ||
} | ||
}, | ||
doLottery: function () { | ||
if (!this.goalLegal) { | ||
this.nextStep(); | ||
let count = 0; | ||
let randomIndex = 0; | ||
while (count < this.goal){ | ||
randomIndex = this.randomNum(0, this.uids.length-1); | ||
if (!this.luckyDogs.includes(randomIndex)) { | ||
this.luckyDogs.push(randomIndex); | ||
count ++; | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
props: { | ||
stepNow: Number, | ||
uids: Array, | ||
luckyDogs: Array, | ||
nextStep: Function | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<template> | ||
<div> | ||
<v-stepper-step step="2"> | ||
记录参与观众 | ||
</v-stepper-step> | ||
<v-stepper-content step="2"> | ||
<p class="display-1 text-center purple--text">当前已有</p> | ||
<p class="display-2 text-center orange--text">{{ involvedInTotal }}</p> | ||
<p class="display-1 text-center purple--text">名观众参与</p> | ||
<v-btn color="primary" @click="stopRec">停止记录</v-btn> | ||
<v-btn text>返回</v-btn> | ||
</v-stepper-content> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Recording", | ||
props: { | ||
involvedInTotal: Number, | ||
stopRec: Function | ||
} | ||
} | ||
</script> | ||
<template> | ||
<div> | ||
<v-stepper-step step="2"> | ||
记录参与观众 | ||
</v-stepper-step> | ||
<v-stepper-content step="2"> | ||
<p class="display-1 text-center purple--text">当前已有</p> | ||
<p class="display-2 text-center orange--text">{{ involvedInTotal }}</p> | ||
<p class="display-1 text-center purple--text">名观众参与</p> | ||
<v-btn color="primary" @click="stopRec">停止记录</v-btn> | ||
<v-btn text>返回</v-btn> | ||
</v-stepper-content> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Recording", | ||
props: { | ||
involvedInTotal: Number, | ||
stopRec: Function | ||
} | ||
} | ||
</script> |
Oops, something went wrong.