Skip to content

Commit

Permalink
Merge branch 'hot-fix-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
CS-Tao committed Nov 7, 2018
2 parents 21247bf + 33f0414 commit 7808f9b
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

- 下载链接

[whu-library-seat-mobile_v1.4.0.apk](https://github.com/CS-Tao/whu-library-seat-mobile/releases/download/v1.4.0/whu-library-seat-mobile_v1.4.0.apk)
[whu-library-seat-mobile_v1.4.1.apk](https://github.com/CS-Tao/whu-library-seat-mobile/releases/download/v1.4.1/whu-library-seat-mobile_v1.4.1.apk)

- 二维码:

Expand Down
2 changes: 1 addition & 1 deletion cordova/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="cc.cs_tao.whu_library_seat_mobile" version="1.4.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="cc.cs_tao.whu_library_seat_mobile" version="1.4.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>武汉大学图书馆抢座软件</name>
<description>
武汉大学图书馆抢座软件 - 移动端
Expand Down
2 changes: 1 addition & 1 deletion cordova/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cc.cs_tao.whu_library_seat_mobile",
"displayName": "whu-library-seat-mobile",
"version": "1.4.0",
"version": "1.4.1",
"description": "武汉大学图书馆抢座软件 - 移动端",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whu-library-seat-mobile",
"version": "1.4.0",
"version": "1.4.1",
"author": "CS-Tao <whucstao@qq.com>",
"description": "武汉大学图书馆抢座软件",
"license": null,
Expand Down
Binary file added src/assets/last-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/components/Body/Timer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export default {
checkOpenAndBookFunc: {
type: Function,
require: true
},
isToday: {
type: Boolean,
require: true
}
},
components: {
Expand Down Expand Up @@ -142,6 +146,7 @@ export default {
loginFunc: this.loginFunc,
loginAndBookFunc: this.loginAndBookFunc,
checkOpenAndBookFunc: this.checkOpenAndBookFunc,
isToday: this.isToday,
time: this.result
})
this.$message({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Body/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<announce-form v-if="hasToken&&showMode==='announce'"></announce-form>
<user-form v-if="hasToken&&showMode==='userForm'"></user-form>
<history-form v-if="hasToken&&showMode==='historyForm'"></history-form>
<timer-form v-if="hasToken&&checkReserveTime" v-model="reserveTime" :book-func="grabSeat" :check-open-and-book-func="checkLibraryIsOpen" :login-func="login" :loginAndBookFunc="loginAndReserveSeat" @btnClick="oppointmentTimechecked($event)"></timer-form>
<timer-form v-if="hasToken&&checkReserveTime" v-model="reserveTime" :book-func="grabSeat" :check-open-and-book-func="checkLibraryIsOpen" :login-func="login" :loginAndBookFunc="loginAndReserveSeat" :is-today="form.date===freeDates[0]" @btnClick="oppointmentTimechecked($event)"></timer-form>
</div>
</template>

Expand Down
3 changes: 2 additions & 1 deletion src/components/Footer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<script>
import { mapGetters } from 'vuex'
import gitcontentsApi from '@/api/gitcontents.api'
import androidQrCode from '@/assets/last-android.png'
export default {
props: {
Expand Down Expand Up @@ -147,7 +148,7 @@ export default {
dangerouslyUseHTMLString: true,
message: `<el-card shadow="never" style="line-height: 30px;">
<p align="center" style="margin-top:20px;">
<img alt="软件二维码.jpg" src="https://raw.githubusercontent.com/CS-Tao/whu-library-seat/user-validation/last-android-qr.jpg?${new Date()}" width="90%" height="90%">
<img alt="安卓版二维码.jpg" src="${androidQrCode}" width="90%" height="90%">
</p>
</el-card>`,
duration: 0
Expand Down
25 changes: 13 additions & 12 deletions src/store/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ const app = {
beginTime: store.get('whuSeatBeginTime', null),
endTime: store.get('whuSeatEndTime', null),
seatNum: store.get('whuSeatNum', null),
battery: store.get('whuSeatBattery', false),
sun: store.get('whuSeatSun', false)
battery: !!store.get('whuSeatBattery', false),
sun: !!store.get('whuSeatSun', false)
},
settingInfo: {
baseUrl: store.get('baseUrl', defaultSettingInfo.baseUrl),
oppointmentTime: new Date(store.get('oppointmentTime', defaultSettingInfo.oppointmentTime)),
beginTime: new Date(store.get('availableBeginTime', defaultSettingInfo.beginTime)),
endTime: new Date(store.get('availableEndTime', defaultSettingInfo.endTime)),
checkOpenEnable: store.get('checkOpenEnable', defaultSettingInfo.checkOpenEnable),
backgroundEnable: store.get('backgroundEnable', defaultSettingInfo.backgroundEnable),
usageRecordEnable: store.get('usageRecordEnable', defaultSettingInfo.usageRecordEnable)
checkOpenEnable: !!store.get('checkOpenEnable', defaultSettingInfo.checkOpenEnable),
backgroundEnable: !!store.get('backgroundEnable', defaultSettingInfo.backgroundEnable),
usageRecordEnable: !!store.get('usageRecordEnable', defaultSettingInfo.usageRecordEnable)
},
libraryInfo: {
buildings: [],
Expand Down Expand Up @@ -251,36 +251,37 @@ const app = {
// 参数为 {bookFunc: callback, time: millisecond}
// 应当在 bookFunc 所有的异步函数执行完成之后手动执行 Action: cancelTimer()
setTimer ({ commit, state }, param) {
const loginInAdvanceMili = 20000
const checkInAdvanceMili = 10000
if (param) {
const loginInAdvanceMili = 20000
const checkInAdvanceMili = 10000
if (state.timerInfo.state !== statusEnum.unset) {
commit('CANCEL_TIMER', null)
}
let timerInfo = Object()
var timerInfo = Object()
var oppointmentTimeMilli = param.time.getTime()
var isToday = param.isToday
timerInfo.waitedTime = 0
timerInfo.totalTime = oppointmentTimeMilli - (new Date()).getTime()
if (timerInfo.totalTime <= 0) {
// 时间差小于等于 0 立即预约
timerInfo.totalTime = 0
timerInfo.timerId = setTimeout(() => {
if (state.settingInfo.checkOpenEnable) {
if (state.settingInfo.checkOpenEnable && !isToday) {
commit('UPDATE_TIMER_STATE', statusEnum.checking)
}
param.checkOpenAndBookFunc()
}, timerInfo.totalTime)
} else if (timerInfo.totalTime < checkInAdvanceMili) {
// 时间差大于 0,小于提前检查是否开放的时间差,定时直接预约
timerInfo.timerId = setTimeout(() => {
if (state.settingInfo.checkOpenEnable) {
if (state.settingInfo.checkOpenEnable && !isToday) {
commit('UPDATE_TIMER_STATE', statusEnum.checking)
}
param.checkOpenAndBookFunc()
}, timerInfo.totalTime)
} else if (timerInfo.totalTime < loginInAdvanceMili) {
// 时间差小于登录时间差,大于检测开放时间差,定时(提前 checkInAdvanceMili 毫秒)先检测是否开放,再预约
if (state.settingInfo.checkOpenEnable) {
if (state.settingInfo.checkOpenEnable && !isToday) {
// 启用开放检测
timerInfo.timerId = setTimeout(() => {
param.checkOpenAndBookFunc()
Expand All @@ -297,7 +298,7 @@ const app = {
}
} else {
// 时间差大于登录时间差,定时(提前 loginInAdvanceMili 毫秒)登录,再(提前 checkInAdvanceMili 毫秒)检查是否开放,再预约
if (state.settingInfo.checkOpenEnable) {
if (state.settingInfo.checkOpenEnable && !isToday) {
// 启用开放检测
timerInfo.loginTimerId = setTimeout(() => {
param.loginFunc()
Expand Down
10 changes: 5 additions & 5 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ $primary-color: rgb(77, 136, 255);
$second-color: rgb(153, 153, 153);

$primary-button-background-blur: rgba(77, 136, 255, 0.3);
$primary-button-background-hover: rgba(77, 136, 255, 0.38);
$primary-button-background-click: rgba(77, 136, 255, 0.5);
$primary-button-background-hover: rgba(77, 136, 255, 0.42);
$primary-button-background-click: rgba(77, 136, 255, 0.6);

$ok-button-background-blur: rgba(0, 204, 0, 0.3);
$ok-button-background-hover: rgba(0, 204, 0, 0.38);
$ok-button-background-click: rgba(0, 204, 0, 0.5);

$cancel-button-background-blur: rgba(255, 255, 0, 0.18);
$cancel-button-background-hover: rgba(255, 255, 0, 0.24);
$cancel-button-background-click: rgba(255, 255, 0, 0.3);
$cancel-button-background-blur: rgba(255, 255, 0, 0.19);
$cancel-button-background-hover: rgba(255, 255, 0, 0.25);
$cancel-button-background-click: rgba(255, 255, 0, 0.30);
$cancel-button-border: rgba(255, 255, 0, 0.5);

$logout-button-background-blur: rgba(255, 255, 0, 0.7);
Expand Down

0 comments on commit 7808f9b

Please sign in to comment.