Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
change:remove unnecessary stepper errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdxcxs committed Apr 18, 2020
1 parent a694a43 commit 7498b5a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 122 deletions.
31 changes: 2 additions & 29 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@
dark>
BiliBili直播弹幕抽奖
</v-app-bar>
<!-- <img src="./assets/bilibili.png" alt="bili-logo" id="bili-logo">-->
<v-content>
<v-stepper v-model="currentStep" vertical>
<room-choosing :enter-room="enterRoom"></room-choosing>
<recording :step-now="this.currentStep"
:recording="this.recording"
:involved-in-total="this.involvedUid.length"
<recording :involved-in-total="this.involvedUid.length"
:stop-rec="this.stopRecording">
</recording>
<lottery :step-now="this.currentStep"
:involved-in-total="this.involvedUid.length"
:uids="this.involvedUid"
:lucky-dogs="this.luckyDogs"
:next-step="()=>{this.currentStep ++}">
</lottery>
<result :step-now="this.currentStep"
:lucky-dogs="this.luckyDogs"
<result :lucky-dogs="this.luckyDogs"
:uids="this.involvedUid"
:unames="this.involvedUname">
</result>
Expand Down Expand Up @@ -79,25 +74,3 @@ export default {
}
}
</script>

<style rel="stylesheet/sass" lang="scss">
#bili-logo {
bottom: 0;
display: block;
margin-right: auto;
margin-left: auto;
}
@media (min-width: 1024px) {
#bili-logo {
width: 350px;
}
}
@media (max-width: 1023px) {
#bili-logo {
width: 80%;
}
}
</style>
24 changes: 2 additions & 22 deletions src/components/Lottery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
</v-card>
</v-dialog>

<v-stepper-step :rules="[accessRule]" step="3">
<v-stepper-step step="3">
抽奖
<small>{{ stepErrorMsg }}</small>
</v-stepper-step>
<v-stepper-content step="3">
<p class="display-1 text-center purple--text">请选择人抽取人数</p>
Expand All @@ -36,25 +35,11 @@
goal: 1
}),
computed: {
stepErrorMsg: function () {
if (this.stepNow === 1) {
return '请先进入房间';
}
else if (this.stepNow===2 && this.involvedInTotal===0) {
return '请等待至少一位用户参与';
}
else {
return '';
}
},
goalLegal: function () {
return this.stepNow===3 && this.goal>=this.uids.length
return this.stepNow===3 && this.goal>=this.uids.length;
}
},
methods: {
accessRule: function () {
return this.stepNow>=2 && this.involvedInTotal!==0;
},
randomNum: function (minNum, maxNum) {
// https://www.cnblogs.com/starof/p/4988516.html
switch (arguments.length) {
Expand Down Expand Up @@ -83,14 +68,9 @@
},
props: {
stepNow: Number,
involvedInTotal: Number,
uids: Array,
luckyDogs: Array,
nextStep: Function
}
}
</script>

<style scoped>
</style>
19 changes: 1 addition & 18 deletions src/components/Recording.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<div>
<v-stepper-step step="2" :rules="[accessRule]">
<v-stepper-step step="2">
记录参与观众
<small>{{ stepErrorMsg }}</small>
</v-stepper-step>
<v-stepper-content step="2">
<p class="display-1 text-center purple--text">当前已有</p>
Expand All @@ -17,25 +16,9 @@
<script>
export default {
name: "Recording",
computed: {
stepErrorMsg: function () {
return this.stepNow === 1?'请先进入房间':'';
}
},
methods: {
accessRule: function () {
return this.stepNow !== 1;
}
},
props: {
stepNow: Number,
recording: Boolean,
involvedInTotal: Number,
stopRec: Function
}
}
</script>

<style scoped>
</style>
16 changes: 1 addition & 15 deletions src/components/Result.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<div>
<v-stepper-step :rules="[accessRule]" step="4">
<v-stepper-step step="4">
开奖
<small>{{ stepErrorMsg }}</small>
</v-stepper-step>
<v-stepper-content step="4">
<p class="display-1 text-center purple--text">中奖名单</p>
Expand All @@ -19,28 +18,15 @@
<script>
export default {
name: "Result",
computed: {
stepErrorMsg: function () {
return this.stepNow===4 ? '' : '请先抽奖';
}
},
methods: {
accessRule: function () {
return this.stepNow === 4;
},
openUserSpace: function (uid) {
window.open('https://space.bilibili.com/' + uid);
}
},
props: {
stepNow: Number,
luckyDogs: Array,
uids: Array,
unames: Object
}
}
</script>

<style scoped>
</style>
8 changes: 0 additions & 8 deletions src/components/RoomChoosing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,3 @@ export default {
})
}
</script>

<style rel="stylesheet" scoped>
#enter-room-btn {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
31 changes: 1 addition & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8198,36 +8198,7 @@ webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-
source-list-map "^2.0.0"
source-map "~0.6.1"

webpack@^4.0.0:
version "4.42.1"
resolved "https://registry.npm.taobao.org/webpack/download/webpack-4.42.1.tgz#ae707baf091f5ca3ef9c38b884287cfe8f1983ef"
integrity sha1-rnB7rwkfXKPvnDi4hCh8/o8Zg+8=
dependencies:
"@webassemblyjs/ast" "1.9.0"
"@webassemblyjs/helper-module-context" "1.9.0"
"@webassemblyjs/wasm-edit" "1.9.0"
"@webassemblyjs/wasm-parser" "1.9.0"
acorn "^6.2.1"
ajv "^6.10.2"
ajv-keywords "^3.4.1"
chrome-trace-event "^1.0.2"
enhanced-resolve "^4.1.0"
eslint-scope "^4.0.3"
json-parse-better-errors "^1.0.2"
loader-runner "^2.4.0"
loader-utils "^1.2.3"
memory-fs "^0.4.1"
micromatch "^3.1.10"
mkdirp "^0.5.3"
neo-async "^2.6.1"
node-libs-browser "^2.2.1"
schema-utils "^1.0.0"
tapable "^1.1.3"
terser-webpack-plugin "^1.4.3"
watchpack "^1.6.0"
webpack-sources "^1.4.1"

webpack@^4.42.1:
webpack@^4.0.0, webpack@^4.42.1:
version "4.42.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.42.1.tgz#ae707baf091f5ca3ef9c38b884287cfe8f1983ef"
integrity sha512-SGfYMigqEfdGchGhFFJ9KyRpQKnipvEvjc1TwrXEPCM6H5Wywu10ka8o3KGrMzSMxMQKt8aCHUFh5DaQ9UmyRg==
Expand Down

0 comments on commit 7498b5a

Please sign in to comment.