|
|
|
@ -1,217 +1,193 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="content m-content" :style="{ height: `${windowHeight}px` }"> |
|
|
|
|
<profile></profile> |
|
|
|
|
<view class="m-top-bg"> |
|
|
|
|
<image src="/static/images/index/head-bg.png" alt="" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-head"> |
|
|
|
|
<view class="m-tips">今日数据</view> |
|
|
|
|
<view class="m-head-content"> |
|
|
|
|
<view class="m-nums people">{{ checkedNum }}</view> |
|
|
|
|
<view class="m-text"> |
|
|
|
|
<image src="/static/images/index/icon_people-number.png" alt="" /> |
|
|
|
|
今日总检票人数 |
|
|
|
|
</view> |
|
|
|
|
<view class="content m-content" :style="{ height: `${windowHeight}px` }"> |
|
|
|
|
<profile></profile> |
|
|
|
|
<view class="m-top-bg"> |
|
|
|
|
<image src="/static/images/index/head-bg.png" alt="" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-head"> |
|
|
|
|
<view class="m-tips">今日数据</view> |
|
|
|
|
<view class="m-head-content"> |
|
|
|
|
<view class="m-nums people">{{ checkedNum }}</view> |
|
|
|
|
<view class="m-text"> |
|
|
|
|
<image src="/static/images/index/icon_people-number.png" alt="" /> |
|
|
|
|
今日总检票人数 |
|
|
|
|
</view> |
|
|
|
|
<view class="m-drived-colum"></view> |
|
|
|
|
<view class="m-head-content"> |
|
|
|
|
<view class="m-nums seal">{{ ticketNum }}</view> |
|
|
|
|
<view class="m-text"> |
|
|
|
|
<image src="/static/images/index/icon_sheet-number.png" alt="" /> |
|
|
|
|
今日总预约人数 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-drived-colum"></view> |
|
|
|
|
<view class="m-head-content"> |
|
|
|
|
<view class="m-nums seal">{{ ticketNum }}</view> |
|
|
|
|
<view class="m-text"> |
|
|
|
|
<image src="/static/images/index/icon_sheet-number.png" alt="" /> |
|
|
|
|
今日总预约人数 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="uni-form-item uni-columns" style="opacity: 0.9"> |
|
|
|
|
<uni-easyinput ref="inputRef" :inputBorder="false" :focus="true" @confirm="qucikScan" readonly |
|
|
|
|
v-model="quickScanData" class="uni-input" focus placeholder="请扫描或输入预约码" /> |
|
|
|
|
<image @click="qucikScan" src="@/static/images/index/icon_quick-check.svg"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="uni-form-item uni-columns" style="opacity: 0.9"> |
|
|
|
|
<uni-easyinput ref="inputRef" :inputBorder="false" :focus="isAutoFocus" @confirm="qucikScan" readonly |
|
|
|
|
v-model="quickScanData" class="uni-input" placeholder="请扫描或输入预约码" /> |
|
|
|
|
<image @click="qucikScan" src="@/static/images/index/icon_quick-check.svg"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn-group"> |
|
|
|
|
<view class="m-btn one" @click="btnClick('扫码检票')"> |
|
|
|
|
<image class="btn-img" src="/static/images/index/icon_vote-check.png" alt="" /> |
|
|
|
|
<view class="m-btn-text">扫码检票</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn-group"> |
|
|
|
|
<view class="m-btn one" @click="btnClick('扫码检票')"> |
|
|
|
|
<image class="btn-img" src="/static/images/index/icon_vote-check.png" alt="" /> |
|
|
|
|
<view class="m-btn-text">扫码检票</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-btn two" @click="btnClick('检票记录')"> |
|
|
|
|
<image class="btn-img" src="/static/images/index/icon_record.png" alt="" /> |
|
|
|
|
<view class="m-btn-text">检票记录</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-btn three" @click="btnClick('预约记录')"> |
|
|
|
|
<image class="btn-img" src="/static/images/index/icon_appointment-record.png" alt="" /> |
|
|
|
|
<view class="m-btn-text">预约记录</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-btn two" @click="btnClick('检票记录')"> |
|
|
|
|
<image class="btn-img" src="/static/images/index/icon_record.png" alt="" /> |
|
|
|
|
<view class="m-btn-text">检票记录</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-btn three" @click="btnClick('预约记录')"> |
|
|
|
|
<image class="btn-img" src="/static/images/index/icon_appointment-record.png" alt="" /> |
|
|
|
|
<view class="m-btn-text">预约记录</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
// // #ifdef APP-PLUS |
|
|
|
|
// var DCSunmiScanModule = uni.requireNativePlugin('DC-SunmiScan-Module'); |
|
|
|
|
// var globalEvent = uni.requireNativePlugin('globalEvent'); |
|
|
|
|
// // #endif |
|
|
|
|
// // #ifdef APP-PLUS |
|
|
|
|
// var DCSunmiScanModule = uni.requireNativePlugin('DC-SunmiScan-Module'); |
|
|
|
|
// var globalEvent = uni.requireNativePlugin('globalEvent'); |
|
|
|
|
// // #endif |
|
|
|
|
|
|
|
|
|
import profile from '../components/m-user-head/profile.vue'; |
|
|
|
|
import { |
|
|
|
|
getIndexData |
|
|
|
|
} from '@/api/seal/seal.js'; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
profile |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
menus: null, |
|
|
|
|
checkedNum: 0, |
|
|
|
|
ticketNum: 0, |
|
|
|
|
quickScanData: null, |
|
|
|
|
isAutoFocus: true |
|
|
|
|
}; |
|
|
|
|
import profile from '../components/m-user-head/profile.vue'; |
|
|
|
|
import { |
|
|
|
|
getIndexData |
|
|
|
|
} from '@/api/seal/seal.js'; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
profile |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
menus: null, |
|
|
|
|
checkedNum: 0, |
|
|
|
|
ticketNum: 0, |
|
|
|
|
quickScanData: null, |
|
|
|
|
isAutoFocus: true |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
windowHeight() { |
|
|
|
|
return uni.getSystemInfoSync().windowHeight; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 当前页面的 onShow 生命周期 |
|
|
|
|
onShow() { |
|
|
|
|
// 需要配合 nextTick 或 setTimeout 保证 DOM 更新完成 |
|
|
|
|
|
|
|
|
|
this.getIndexData(); |
|
|
|
|
this.quickScanData = null; |
|
|
|
|
this.isAutoFocus = false; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.isAutoFocus = true; |
|
|
|
|
}, 100); // 适当延迟100ms |
|
|
|
|
}, |
|
|
|
|
onLoad: function () { |
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
|
// this.timer = setInterval(() => { |
|
|
|
|
// uni.hideKeyboard(); |
|
|
|
|
// }, 50); |
|
|
|
|
// #endif |
|
|
|
|
}, |
|
|
|
|
onUnload() { |
|
|
|
|
// // #ifdef APP-PLUS |
|
|
|
|
// globalEvent.removeEventListener('myScanEvent'); |
|
|
|
|
// // #endif |
|
|
|
|
}, |
|
|
|
|
mounted() { }, |
|
|
|
|
methods: { |
|
|
|
|
handleFocus() { |
|
|
|
|
console.log('Input is focused'); |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
quickScanData: { |
|
|
|
|
handler(val) { |
|
|
|
|
this.isAutoFocus = true |
|
|
|
|
}, |
|
|
|
|
immediate: true |
|
|
|
|
//红外扫描 |
|
|
|
|
qucikScan() { |
|
|
|
|
let this_ = this; |
|
|
|
|
if (!this.quickScanData) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '请先扫描或输入票号', |
|
|
|
|
duration: 2000 |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/checkResult/checkResult?result=' + this.quickScanData + '&quick=1', |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
windowHeight() { |
|
|
|
|
return uni.getSystemInfoSync().windowHeight; |
|
|
|
|
//跳转路由 |
|
|
|
|
btnClick(val) { |
|
|
|
|
switch (val) { |
|
|
|
|
case '扫码检票': |
|
|
|
|
this.scanCode(); |
|
|
|
|
break; |
|
|
|
|
case '检票记录': |
|
|
|
|
this.goCheckList(); |
|
|
|
|
break; |
|
|
|
|
case '预约记录': |
|
|
|
|
this.getReservList(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 当前页面的 onShow 生命周期 |
|
|
|
|
onShow() { |
|
|
|
|
// 需要配合 nextTick 或 setTimeout 保证 DOM 更新完成 |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.isAutoFocus = true |
|
|
|
|
}, 100) |
|
|
|
|
this.getIndexData(); |
|
|
|
|
this.quickScanData = null; |
|
|
|
|
//今日数据 |
|
|
|
|
getIndexData() { |
|
|
|
|
let this_ = this; |
|
|
|
|
this.$Request.get(this.$config.getPeopleCounting).then(res => { |
|
|
|
|
if (res.data.totalTicketCapacity) { |
|
|
|
|
this.checkedNum = res.data.totalTicketCapacity |
|
|
|
|
} |
|
|
|
|
if (res.data.totalBookingCapacity) { |
|
|
|
|
this.ticketNum = res.data.totalBookingCapacity |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err, '错误信息') |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onLoad: function() { |
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
|
// this.timer = setInterval(() => { |
|
|
|
|
// uni.hideKeyboard(); |
|
|
|
|
// }, 50); |
|
|
|
|
// #endif |
|
|
|
|
//检票记录 |
|
|
|
|
goCheckList() { |
|
|
|
|
uni.removeStorageSync('ALL_TICKET'); |
|
|
|
|
uni.removeStorageSync('EVENT'); |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/ticketCheckingRecord' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
onUnload() { |
|
|
|
|
// // #ifdef APP-PLUS |
|
|
|
|
// globalEvent.removeEventListener('myScanEvent'); |
|
|
|
|
// // #endif |
|
|
|
|
//预约记录 |
|
|
|
|
getReservList() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/ticketReservingRecord' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
mounted() {}, |
|
|
|
|
methods: { |
|
|
|
|
handleFocus() { |
|
|
|
|
// 聚焦后关闭定时隐藏键盘逻辑(若采用方案一需注意) |
|
|
|
|
clearInterval(this.timer); |
|
|
|
|
}, |
|
|
|
|
//红外扫描 |
|
|
|
|
qucikScan() { |
|
|
|
|
if (!this.quickScanData) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '请先扫描或输入票号', |
|
|
|
|
duration: 2000 |
|
|
|
|
//扫码验票 |
|
|
|
|
scanCode() { |
|
|
|
|
uni.removeStorageSync('ALL_TICKET'); |
|
|
|
|
uni.removeStorageSync('EVENT'); |
|
|
|
|
uni.scanCode({ |
|
|
|
|
onlyFromCamera: true, |
|
|
|
|
scanType: ['qrCode'], |
|
|
|
|
autoDecodeCharset: true, |
|
|
|
|
hideAlbum: true, |
|
|
|
|
success: function (res) { |
|
|
|
|
console.log('条码类型:' + res.scanType); |
|
|
|
|
console.log('条码内容:' + res.result); |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/checkResult/checkResult?result=' + res.result + '&quick=0', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/checkResult/checkResult?result=' + this.quickScanData + '&quick=1', |
|
|
|
|
events: { |
|
|
|
|
updateInvoice: (result) => { |
|
|
|
|
console.log('返回传输的数据', result); |
|
|
|
|
this.quickScanData = null; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$set(this, 'isAutoFocus', true) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
success() { |
|
|
|
|
this.quickScanData = null; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//跳转路由 |
|
|
|
|
btnClick(val) { |
|
|
|
|
switch (val) { |
|
|
|
|
case '扫码检票': |
|
|
|
|
this.scanCode(); |
|
|
|
|
break; |
|
|
|
|
case '检票记录': |
|
|
|
|
this.goCheckList(); |
|
|
|
|
break; |
|
|
|
|
case '预约记录': |
|
|
|
|
this.getReservList(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//今日数据 |
|
|
|
|
getIndexData() { |
|
|
|
|
let this_ = this; |
|
|
|
|
this.$Request.get(this.$config.getPeopleCounting).then(res => { |
|
|
|
|
if(res.data.totalTicketCapacity){ |
|
|
|
|
this.checkedNum=res.data.totalTicketCapacity |
|
|
|
|
} |
|
|
|
|
if(res.data.totalBookingCapacity){ |
|
|
|
|
this.ticketNum=res.data.totalBookingCapacity |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err, '错误信息') |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//检票记录 |
|
|
|
|
goCheckList() { |
|
|
|
|
uni.removeStorageSync('ALL_TICKET'); |
|
|
|
|
uni.removeStorageSync('EVENT'); |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/ticketCheckingRecord' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//预约记录 |
|
|
|
|
getReservList() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/ticketReservingRecord' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//扫码验票 |
|
|
|
|
scanCode() { |
|
|
|
|
uni.removeStorageSync('ALL_TICKET'); |
|
|
|
|
uni.removeStorageSync('EVENT'); |
|
|
|
|
uni.scanCode({ |
|
|
|
|
onlyFromCamera: true, |
|
|
|
|
scanType: ['qrCode'], |
|
|
|
|
autoDecodeCharset: true, |
|
|
|
|
hideAlbum: true, |
|
|
|
|
success: function(res) { |
|
|
|
|
console.log('条码类型:' + res.scanType); |
|
|
|
|
console.log('条码内容:' + res.result); |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/checkResult/checkResult?result=' + res.result + '&quick=0', |
|
|
|
|
events: { |
|
|
|
|
updateInvoice: (result) => { |
|
|
|
|
console.log('返回传输的数据', result); |
|
|
|
|
this.quickScanData = null; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$set(this, 'isAutoFocus', true) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// // #ifdef APP-PLUS |
|
|
|
|
// var main = plus.android.runtimeMainActivity(); |
|
|
|
|
// DCSunmiScanModule.openCameraByScan(main); |
|
|
|
|
// // #endif |
|
|
|
|
} |
|
|
|
|
// // #ifdef APP-PLUS |
|
|
|
|
// var main = plus.android.runtimeMainActivity(); |
|
|
|
|
// DCSunmiScanModule.openCameraByScan(main); |
|
|
|
|
// // #endif |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
<style scoped |
|
|
|
|
lang="scss"> |
|
|
|
|
.content { |
|
|
|
|
justify-content: center; |
|
|
|
|
background-image: url('/static/images/index/bg.png'); |
|
|
|
|