Skip to content

Commit 80c3c89

Browse files
committed
🎉 make standard
1 parent 1dcc6b6 commit 80c3c89

File tree

12 files changed

+53
-33
lines changed

12 files changed

+53
-33
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
},
1414
"homepage": "https://github.com/shuosc/shu-scheduling-helper#readme",
1515
"scripts": {
16-
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
17-
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
18-
"lint": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service lint"
16+
"serve": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
17+
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
18+
"lint": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service lint"
1919
},
2020
"dependencies": {
2121
"ant-design-vue": "^1.7.8",
@@ -41,6 +41,7 @@
4141
"acorn": "^7.4.1",
4242
"babel-eslint": "^10.1.0",
4343
"babel-plugin-import": "^1.13.6",
44+
"cross-env": "^7.0.3",
4445
"cz-conventional-changelog": "3.3.0",
4546
"eslint": "^5.16.0",
4647
"eslint-plugin-vue": "^5.2.3",

src/mixins/ScheduleTable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ export const ClassCardMixin = {
115115
},
116116
computed: {
117117
style () {
118-
return [
119-
[
118+
return {
119+
'classic': [
120120
{
121121
color: 'rgba(255, 255, 255, 0.95)',
122122
borderColor: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 1.0)`,
@@ -131,7 +131,7 @@ export const ClassCardMixin = {
131131
color: 'rgba(255, 255, 255, 0.85)',
132132
},
133133
],
134-
[
134+
'candy': [
135135
{
136136
color: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 1.0)`,
137137
background: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 0.3)`,
@@ -144,7 +144,7 @@ export const ClassCardMixin = {
144144
color: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 0.8)`,
145145
},
146146
]
147-
]
147+
}
148148
},
149149
_class() {
150150
return {
File renamed without changes.

src/mixins/UseScheduleTableTheme.js renamed to src/mixins/common/useScheduleTableTheme.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
export const UseScheduleTableThemeMixin = {
22
data () {
33
return {
4-
ScheduleTableTheme: 1,
5-
ScheduleTableThemeText: '糖果'
4+
ScheduleTableTheme: 'candy',
5+
}
6+
},
7+
computed: {
8+
ScheduleTableThemeText () {
9+
const t = this.ScheduleTableTheme
10+
switch (t) {
11+
case 'candy':
12+
return '糖果';
13+
case 'classic':
14+
return '经典';
15+
default:
16+
return '<unknown>'
17+
}
618
}
719
},
820
created () {
@@ -12,17 +24,9 @@ export const UseScheduleTableThemeMixin = {
1224
}
1325
setTimeout(check, 500)
1426
},
15-
watch: {
16-
ScheduleTableTheme: {
17-
handler (newVal) {
18-
this.ScheduleTableThemeText = newVal === 1 ? '糖果' : '经典';
19-
},
20-
immediate: true
21-
}
22-
},
2327
methods: {
2428
handleChangeScheduleTableTheme () {
25-
this.ScheduleTableTheme = (this.ScheduleTableTheme + 1) % 2
29+
this.ScheduleTableTheme = this.ScheduleTableTheme === 'candy' ? 'classic' : 'candy'
2630
this.$store.dispatch('setUseScheduleTableTheme', this.ScheduleTableTheme)
2731
}
2832
}

src/pages/index/components/ReservedClassesList/CourseClassesList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@
142142
143143
.selected-class-list-item h4{
144144
font-weight: bold;
145-
color: black;
145+
color: rgba(0,0,0,0.85);
146146
}
147147
148148
.selected-class-list-item div{
149-
color: rgba(0,0,0,0.8);
149+
color: rgba(0,0,0,0.65);
150150
}
151151
152152
/*noinspection CssUnusedSymbol*/

src/pages/index/components/ReservedClassesList/CourseMeta.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a :href="getLinkHref(id)" :title="getLinkTitle(course, id)"
99
@click.stop="showCourseIntroduction($event, getLinkHref(id))" class="course-link course-intro-link"
1010
rel="external nofollow" target="_blank">简介</a>
11-
<a :title="`复制该课程的课程号 (${id})`"
11+
<a :title="`复制课程号 (${id})`"
1212
v-clipboard:copy="id"
1313
v-clipboard:success="handleCourseIdCopied"
1414
@click.stop
@@ -60,7 +60,7 @@
6060
<script>
6161
import { introductionOpenerMixin } from '../../../../mixins/common/introductionOpener';
6262
import { CourseMetaMixin } from '../../../../mixins/ReservedClassesList';
63-
import { CopyCourseIdMixin } from '../../../../mixins/CopyCourseId'
63+
import { CopyCourseIdMixin } from '../../../../mixins/common/copyCourseId'
6464
import NumberCapacity from './NumberCapacity';
6565
import CourseColor from './CourseColor'
6666

src/pages/index/components/ScheduleTable/ClassCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@
7878
}
7979
8080
.teacher-name-venue {
81-
font-size: 11px;
81+
font-size: 12px;
8282
line-height: 16px;
8383
overflow: hidden;
8484
min-height: 16px;
8585
}
8686
8787
.venue {
88-
font-size: 11px;
88+
font-size: 12px;
8989
line-height: 1.25;
9090
}
9191
@@ -94,7 +94,7 @@
9494
}
9595
9696
.extra {
97-
font-size: 11px;
97+
font-size: 12px;
9898
line-height: 1.25;
9999
}
100100
</style>

src/pages/index/components/ScheduleTable/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
<script>
6767
import { ScheduleTableMixin } from '../../../../mixins/ScheduleTable';
68-
import { UseScheduleTableThemeMixin } from '../../../../mixins/UseScheduleTableTheme'
68+
import { UseScheduleTableThemeMixin } from '../../../../mixins/common/useScheduleTableTheme'
6969
import ClassCard from './ClassCard';
7070
import NoPeriodClassCard from './NoPeriodClassCard';
7171
// import QrCard from './QrCard';

src/pages/m/components/ScheduleTable/ClassCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@
6969
}
7070
7171
.teacher-name-venue {
72-
font-size: 11px;
72+
font-size: 12px;
7373
line-height: 16px;
7474
overflow: hidden;
7575
min-height: 16px;
7676
}
7777
7878
.venue {
79-
font-size: 11px;
79+
font-size: 12px;
8080
line-height: 1.25;
8181
}
8282
@@ -85,7 +85,7 @@
8585
}
8686
8787
.extra {
88-
font-size: 11px;
88+
font-size: 12px;
8989
line-height: 1.25;
9090
}
9191
</style>

src/pages/m/components/ScheduleTable/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<script>
3030
import ClassCard from './ClassCard';
3131
import { ScheduleTableMixin } from '../../../../mixins/ScheduleTable';
32-
import { UseScheduleTableThemeMixin } from '../../../../mixins/UseScheduleTableTheme';
32+
import { UseScheduleTableThemeMixin } from '../../../../mixins/common/useScheduleTableTheme';
3333
3434
export default {
3535
name: 'ScheduleTable',

src/store.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default new Vuex.Store({
3131
historyPos: 0,
3232
historyHold: false,
3333
showIntroductionNotification: true,
34-
useScheduleTableTheme: 1,
34+
useScheduleTableTheme: 'candy',
3535
},
3636
getters: {
3737
scheduleTableRows(state) {
@@ -313,6 +313,8 @@ export default new Vuex.Store({
313313
state.showIntroductionNotification = false;
314314
},
315315
SET_SCHEDULETABLE_THEME (state, value) {
316+
if (value !== 'candy' && value !== 'classic')
317+
value = 'candy' // 匹配不到主题需要恢复默认主题
316318
state.useScheduleTableTheme = value;
317319
}
318320
},
@@ -330,7 +332,7 @@ export default new Vuex.Store({
330332
Storage.get('trimester', null),
331333
Storage.get('backend', null),
332334
Storage.get('colorSeed', 2),
333-
Storage.get('useScheduleTableTheme', 1)
335+
Storage.get('useScheduleTableTheme', 'candy')
334336
]).then((values) => {
335337
context.commit('ALL_CLASSES', values[0]);
336338
context.commit('ALL_CLASSES_HASH', values[1]);

yarn.lock

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4537,6 +4537,18 @@ __metadata:
45374537
languageName: node
45384538
linkType: hard
45394539

4540+
"cross-env@npm:^7.0.3":
4541+
version: 7.0.3
4542+
resolution: "cross-env@npm:7.0.3"
4543+
dependencies:
4544+
cross-spawn: ^7.0.1
4545+
bin:
4546+
cross-env: src/bin/cross-env.js
4547+
cross-env-shell: src/bin/cross-env-shell.js
4548+
checksum: 26f2f3ea2ab32617f57effb70d329c2070d2f5630adc800985d8b30b56e8bf7f5f439dd3a0358b79cee6f930afc23cf8e23515f17ccfb30092c6b62c6b630a79
4549+
languageName: node
4550+
linkType: hard
4551+
45404552
"cross-spawn@npm:^5.0.1":
45414553
version: 5.1.0
45424554
resolution: "cross-spawn@npm:5.1.0"
@@ -4561,7 +4573,7 @@ __metadata:
45614573
languageName: node
45624574
linkType: hard
45634575

4564-
"cross-spawn@npm:^7.0.0":
4576+
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1":
45654577
version: 7.0.3
45664578
resolution: "cross-spawn@npm:7.0.3"
45674579
dependencies:
@@ -11574,6 +11586,7 @@ __metadata:
1157411586
babel-eslint: ^10.1.0
1157511587
babel-plugin-import: ^1.13.6
1157611588
core-js: ^3.27.2
11589+
cross-env: ^7.0.3
1157711590
crypto-js: ^3.3.0
1157811591
cz-conventional-changelog: 3.3.0
1157911592
eslint: ^5.16.0

0 commit comments

Comments
 (0)