GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
hanfei
/
VueSharedPrinting
Browse code
han
master
1 parent
0828bb2
commit
45d4f8df742386491a88090615f90e8fcbaf7a2d
hanfei
authored
on 7 Jan
Patch
Showing
6 changed files
src/api/bdResultApi.js
src/components/global.vue
src/components/top.vue
src/utils/cite.js
src/views/expense.vue
src/views/operationGuide.vue
Ignore Space
Show notes
View
src/api/bdResultApi.js
import request from '../utils/bdRequest' // 获取打印文件列表 export const printOrderList = data => { return request({ method: 'GET', post: '8888', url: '/client/getPrintOrderList', params: data }) } // 获取设备任务 export const deviceAndOrder = data => { return request({ method: 'GET', post: '8888', url: '/client/getDeviceAndOrder', params: data }) } // 获取设备编号 export const getDeviceCode = data => { return request({ method: 'GET', post: '8888', url: '/client/getDeviceCode', params: data }) } // 调用打印机打印 export const apiPrint = data => { return request({ method: 'POST', post: '8080', url: '/api/Printer/Print', data }) } // 获取身份证信息 export const readCard = data => { return request({ method: 'GET', post: '7846', url: '/api/readCard', params: data }) } // 读取U盘 export const readUsb = data => { return request({ method: 'GET', post: '8888', url: '/read/usb', params: data }) } // 本地文件获取文件流 export const readFile = data => { return request({ post: '8888', url: '/read/upload2Pdf', params: data }) } // 本地文件获取大文件oss export const readFile2 = data => { return request({ post: '8888', url: '/read/upload2PdfOss', params: data }) } // 通过文件路径下载给打印机打印 export const readDownload = data => { return request({ method: 'POST', post: '8888', url: '/read/download', params: data }) } // 高拍仪打不开调用 export const shutdown = data => { return request({ method: 'POST', post: '8888', url: '/client/shutdown', params: data }) } // 高拍仪是否异常 export const gpyError = data => { return request({ method: 'POST', post: '8888', url: '/client/error', params: data }) } // 订单状态,进度查询 export const bdGetTransactionStatus = data => { return request({ post: '8888', url: '/client/getTransactionStatus', params: data }) } // 订单-当前订单信息 export const bdGetPrintOrderPush = data => { return request({ post: '8888', url: '/client/getPrintOrderPush', params: data }) } // 播放声音 export const bdPlayAudio = data => { return request({ post: '8888', url: '/client/playAudio', params: data }) } // 当前是否有订单或异常 export const bdGetDeviceAndOrder = data => { return request({ post: '8888', url: '/client/getDeviceAndOrder', params: data }) } // socket状态刷新 export const bdSocket = data => { return request({ post: '8888', url: '/client/socket', params: data }) } // 重启机器 export const bdStop = data => { return request({ post: '8888', url: '/client/stop', params: data }) }
import request from '../utils/bdRequest' // 获取打印文件列表 export const printOrderList = data => { return request({ method: 'GET', post: '8888', url: '/client/getPrintOrderList', params: data }) } // 获取设备任务 export const deviceAndOrder = data => { return request({ method: 'GET', post: '8888', url: '/client/getDeviceAndOrder', params: data }) } // 获取设备编号 export const getDeviceCode = data => { return request({ method: 'GET', post: '8888', url: '/client/getDeviceCode', params: data }) } // 调用打印机打印 export const apiPrint = data => { return request({ method: 'POST', post: '8080', url: '/api/Printer/Print', data }) } // 获取身份证信息 export const readCard = data => { return request({ method: 'GET', post: '7846', url: '/api/readCard', params: data }) } // 读取U盘 export const readUsb = data => { return request({ method: 'GET', post: '8888', url: '/read/usb', params: data }) } // 本地文件获取文件流 export const readFile = data => { return request({ post: '8888', url: '/read/upload2Pdf', params: data }) } // 本地文件获取大文件oss export const readFile2 = data => { return request({ post: '8888', url: '/read/upload2PdfOss', params: data }) } // 通过文件路径下载给打印机打印 export const readDownload = data => { return request({ method: 'POST', post: '8888', url: '/read/download', params: data }) } // 高拍仪打不开调用 export const shutdown = data => { return request({ method: 'POST', post: '8888', url: '/client/shutdown', params: data }) } // 高拍仪是否异常 export const gpyError = data => { return request({ method: 'POST', post: '8888', url: '/client/error', params: data }) } // 订单状态,进度查询 export const bdGetTransactionStatus = data => { return request({ post: '8888', url: '/client/getTransactionStatus', params: data }) } // 订单-当前订单信息 export const bdGetPrintOrderPush = data => { return request({ post: '8888', url: '/client/getPrintOrderPush', params: data }) }
Ignore Space
Show notes
View
src/components/global.vue
<template> <div> <!-- 打印中提示--> <div v-if="(DYZshow && DYZlist)" class="dyzTip"> <div class="curtain"></div> <div class="content"> <img alt="" src="../assets/printing.png"/> <div v-if="ztyc" style="margin: 1rem;text-align: left;"> <div class="flex-between" style="font-size: 1rem;margin: 0;line-height: 1.6rem;flex-wrap: wrap;"> <p>订单编号 {{orderInfo.taskCode}}</p> <p>时间 {{ycTime}}</p> </div> <div class="flex-between" style="font-size: 1rem;margin: 0;line-height: 1.6rem;flex-wrap: wrap;"> <p>异常原因 {{orderInfo.abnormalReason}}</p> </div> <div style="font-size: 1rem;margin: 0;line-height: 1.6rem;text-indent: 2em;">用户您好,抱歉地通知您:系统检测到打印遇到了异常问题,正在打印中的订单和排队即将处理的订单,都将转变为取件码再次自助打印的订单(取件码可通过小程序【我的】\打印记录-预约记录找到),您可以稍后等机器恢复正常后使用取件码重新打印文件。</div> <div style="font-size: 1rem;margin: 0;line-height: 1.6rem;text-indent: 2em;">您也可以通过小程序首页的更多服务-微信客服,联系客服人员进行问题沟通和跟进处理。</div> </div> <div class="taskBox" v-else> <div class="text1">{{ `NO.1文档打印机总进度` }}</div> <div class="progressContainer"> <div :style="{ width: `${(lastPrintList.length/printBackList.length)*100}%`}" class="progressBar"></div> </div> <div class="fileBox"> <div class="file"> <div class="text2"> 任务 {{ `${currentPrint + 1}/${printBackList.length}: ${lastPrintList[lastPrintList.length]?.sourceFileName || ''}` }} </div> <div class="text3">{{ downLoadMessage || '' }}</div> <div class="JDT" style="width: 100%;"> <!-- <span :style="'width:' + progressPercentage +'%'"></span> --> <span v-show="progressType=='real'" :style="'width:' + progressPercentage +'%'"></span> <span v-show="progressType=='fake'" style="width:100%;background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, red 100%);"></span> </div> </div> </div> </div> <div v-if="ztyc" class="btn flex-center" @click="onCloneZt()">我已知晓({{ numZt }}秒)</div> </div> </div> <!-- 提示--> <div v-if="state.sta" class="tkTip flex-center"> <div v-if="state.name">{{ state.name }}</div> <div v-if="state.name2" style="width: 50%;margin-top: 3%;">{{ state.name2 }}</div> </div> <!-- 敏感词提示--> <div v-if="mgcData.show" class="dyzTip flex-center"> <div class="curtain"></div> <div class="content" style="margin-top: 0;top: 20%;height: auto;"> <div class="name flex-center" style="font-size: 1.5rem;line-height: 2rem;">{{ mgcData.re }}</div> <div class="btn flex-center" style="margin: 2rem auto;" @click="onCloneZt()">我已知晓({{ numZt }}秒)</div> </div> </div> <div v-if="citeL.cqjqSta" class="dyzTip flex-center"> <div class="curtain"></div> <div class="content" style="margin-top: 0;top: 20%;height: auto;"> <div class="name flex-center" style="font-size: 1.5rem;line-height: 2rem;">提醒!该操作适用于在打印遇到问题时,复位重启机器以恢复正常打印服务,请确认是否继续该操作?</div> <div class="flex-center" style="margin: 2rem auto;"> <div class="btn btn2 flex-center" @click="onJqzt(1)">马上重启恢复服务</div> <div class="btn btn2 flex-center" style="margin-left: 2rem;" @click="onJqzt(0)">关闭</div> </div> </div> </div> <!-- 小程序支付--> <div v-if="zfShow" class="dyzTip"> <div class="curtain"></div> <div class="content content2"> <VueQr v-show="src" :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="300" :text="src" logoBackgroundColor="white"></VueQr> <p> <img alt="" class="icon" src="../assets/demo10.png" @click="onChange('zfShow', false)"/> </p> </div> </div> <!-- 页面加载中--> <div v-if="citeL.loadingSta.sta" class="dyzTip"> <div class="curtain"></div> <div class="loadingDH"> <!-- 绘制齿轮 --> <div class="load"> <div class="gear first"> <svg id="purple" fill="#afb4db" viewbox="0 0 100 100"> <path d="m88.22905,52.73842l12.66081,-6.69624c-0.24889,-2.48103 -0.7299,-4.88779 -1.33165,-7.25374l-14.06435,-1.94757c-1.21732,-2.93246 -2.82483,-5.65223 -4.71443,-8.14886l5.36114,-13.18525c-1.76284,-1.71922 -3.66664,-3.28664 -5.67042,-4.72891l-11.94246,7.49732c-2.80052,-1.47273 -5.81781,-2.59129 -8.98524,-3.30968l-4.31582,-13.37042c-1.22401,-0.09243 -2.44766,-0.19008 -3.69591,-0.19008s-2.46845,0.0954 -3.69613,0.19008l-4.27306,13.25199c-3.25234,0.69537 -6.33625,1.82692 -9.20876,3.31783l-11.75647,-7.38703c-2.00124,1.44227 -3.90496,3.0097 -5.66766,4.72891l5.2136,12.82104c-2.03201,2.60429 -3.73326,5.47776 -5.01105,8.57467l-13.62035,1.8837c-0.59921,2.36263 -1.08274,4.76684 -1.32906,7.25345l12.2246,6.46784c0.1385,3.4047 0.70298,6.7044 1.70254,9.8117l-9.22158,10.19626c1.07271,2.22493 2.26701,4.38264 3.64861,6.40699l13.5767,-2.91464c2.226,2.422 4.76215,4.54406 7.56029,6.29894l-0.51461,13.89098c2.22975,1.00564 4.54649,1.84729 6.93396,2.52003l8.5892,-11.04055c1.52399,0.19456 3.06723,0.3256 4.64128,0.3256c1.70519,0 3.37278,-0.15405 5.01352,-0.37947l8.63392,11.1018c2.39122,-0.67196 4.70444,-1.51356 6.93395,-2.51926l-0.52454,-14.14044c2.66699,-1.72661 5.08534,-3.79226 7.21739,-6.12444l13.92978,2.98893c1.38161,-2.02403 2.57607,-4.17945 3.64839,-6.40624l-9.52026,-10.5301c0.91453,-2.94323 1.42539,-6.05022 1.57412,-9.25513l0,0l0.00001,-0.00001zm-21.0432,16.08496l-6.00271,3.90775l-3.69207,-5.67259c-1.92067,0.73877 -3.98849,1.18799 -6.1683,1.18799c-9.52022,0 -17.23546,-7.71828 -17.23546,-17.23701c0,-9.51912 7.71525,-17.23441 17.23546,-17.23441c9.51773,0 17.2358,7.71529 17.2358,17.23441c0,4.75679 -1.92697,9.05688 -5.04179,12.17683l3.66907,5.63703z"> </path> </svg> </div> <div class="gear second"> <svg id="pink" fill="#FFB5C5" viewbox="0 0 100 100"> <path d="m88.22905,52.73842l12.66081,-6.69624c-0.24889,-2.48103 -0.7299,-4.88779 -1.33165,-7.25374l-14.06435,-1.94757c-1.21732,-2.93246 -2.82483,-5.65223 -4.71443,-8.14886l5.36114,-13.18525c-1.76284,-1.71922 -3.66664,-3.28664 -5.67042,-4.72891l-11.94246,7.49732c-2.80052,-1.47273 -5.81781,-2.59129 -8.98524,-3.30968l-4.31582,-13.37042c-1.22401,-0.09243 -2.44766,-0.19008 -3.69591,-0.19008s-2.46845,0.0954 -3.69613,0.19008l-4.27306,13.25199c-3.25234,0.69537 -6.33625,1.82692 -9.20876,3.31783l-11.75647,-7.38703c-2.00124,1.44227 -3.90496,3.0097 -5.66766,4.72891l5.2136,12.82104c-2.03201,2.60429 -3.73326,5.47776 -5.01105,8.57467l-13.62035,1.8837c-0.59921,2.36263 -1.08274,4.76684 -1.32906,7.25345l12.2246,6.46784c0.1385,3.4047 0.70298,6.7044 1.70254,9.8117l-9.22158,10.19626c1.07271,2.22493 2.26701,4.38264 3.64861,6.40699l13.5767,-2.91464c2.226,2.422 4.76215,4.54406 7.56029,6.29894l-0.51461,13.89098c2.22975,1.00564 4.54649,1.84729 6.93396,2.52003l8.5892,-11.04055c1.52399,0.19456 3.06723,0.3256 4.64128,0.3256c1.70519,0 3.37278,-0.15405 5.01352,-0.37947l8.63392,11.1018c2.39122,-0.67196 4.70444,-1.51356 6.93395,-2.51926l-0.52454,-14.14044c2.66699,-1.72661 5.08534,-3.79226 7.21739,-6.12444l13.92978,2.98893c1.38161,-2.02403 2.57607,-4.17945 3.64839,-6.40624l-9.52026,-10.5301c0.91453,-2.94323 1.42539,-6.05022 1.57412,-9.25513l0,0l0.00001,-0.00001zm-21.0432,16.08496l-6.00271,3.90775l-3.69207,-5.67259c-1.92067,0.73877 -3.98849,1.18799 -6.1683,1.18799c-9.52022,0 -17.23546,-7.71828 -17.23546,-17.23701c0,-9.51912 7.71525,-17.23441 17.23546,-17.23441c9.51773,0 17.2358,7.71529 17.2358,17.23441c0,4.75679 -1.92697,9.05688 -5.04179,12.17683l3.66907,5.63703z"> </path> </svg> </div> <div class="gear third"> <svg id="orange" fill="#fedcbd" viewbox="0 0 100 100"> <path d="m88.22905,52.73842l12.66081,-6.69624c-0.24889,-2.48103 -0.7299,-4.88779 -1.33165,-7.25374l-14.06435,-1.94757c-1.21732,-2.93246 -2.82483,-5.65223 -4.71443,-8.14886l5.36114,-13.18525c-1.76284,-1.71922 -3.66664,-3.28664 -5.67042,-4.72891l-11.94246,7.49732c-2.80052,-1.47273 -5.81781,-2.59129 -8.98524,-3.30968l-4.31582,-13.37042c-1.22401,-0.09243 -2.44766,-0.19008 -3.69591,-0.19008s-2.46845,0.0954 -3.69613,0.19008l-4.27306,13.25199c-3.25234,0.69537 -6.33625,1.82692 -9.20876,3.31783l-11.75647,-7.38703c-2.00124,1.44227 -3.90496,3.0097 -5.66766,4.72891l5.2136,12.82104c-2.03201,2.60429 -3.73326,5.47776 -5.01105,8.57467l-13.62035,1.8837c-0.59921,2.36263 -1.08274,4.76684 -1.32906,7.25345l12.2246,6.46784c0.1385,3.4047 0.70298,6.7044 1.70254,9.8117l-9.22158,10.19626c1.07271,2.22493 2.26701,4.38264 3.64861,6.40699l13.5767,-2.91464c2.226,2.422 4.76215,4.54406 7.56029,6.29894l-0.51461,13.89098c2.22975,1.00564 4.54649,1.84729 6.93396,2.52003l8.5892,-11.04055c1.52399,0.19456 3.06723,0.3256 4.64128,0.3256c1.70519,0 3.37278,-0.15405 5.01352,-0.37947l8.63392,11.1018c2.39122,-0.67196 4.70444,-1.51356 6.93395,-2.51926l-0.52454,-14.14044c2.66699,-1.72661 5.08534,-3.79226 7.21739,-6.12444l13.92978,2.98893c1.38161,-2.02403 2.57607,-4.17945 3.64839,-6.40624l-9.52026,-10.5301c0.91453,-2.94323 1.42539,-6.05022 1.57412,-9.25513l0,0l0.00001,-0.00001zm-21.0432,16.08496l-6.00271,3.90775l-3.69207,-5.67259c-1.92067,0.73877 -3.98849,1.18799 -6.1683,1.18799c-9.52022,0 -17.23546,-7.71828 -17.23546,-17.23701c0,-9.51912 7.71525,-17.23441 17.23546,-17.23441c9.51773,0 17.2358,7.71529 17.2358,17.23441c0,4.75679 -1.92697,9.05688 -5.04179,12.17683l3.66907,5.63703z"> </path> </svg> </div> <!-- 绘制圆形水珠 --> <div class="lil-circle"></div> <svg class="blur-circle"> <filter id="blur"> <fegaussianblur in="SourceGraphic" stddeviation="13"></fegaussianblur> </filter> <circle cx="70" cy="70" fill="transparent" filter="url(#blur)" r="66" stroke="white" stroke-width="40"> </circle> </svg> </div> <!-- 文字 --> <div class="text">{{ citeL.loadingSta.name }}</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/Wait4Printing.mp3"/> </audio> </div> </template> <script> import {getAdvertisement, getDeviceByCode} from '@/api/resultApi' import VueQr from 'vue-qr' import {getDeviceCode, bdGetDeviceAndOrder, printOrderList, bdSocket} from '@/api/bdResultApi' import alert from '../utils/alert' import {bdStop} from "../api/bdResultApi"; export default { name: 'global', components: { VueQr }, data() { return { isOnLine: false, intervalTask: null, currentTaskCode: null, currentPrint: null, taskCode: null, progressInterval: null, progressPercentage: 0, progressType: 'real', downLoadMessage: '', printBackList: [], lastPrintList: [], client: null, code: '', DYZshow: false, // 是否显示打印中 downloadPath: 'D:\\TZDYSHARE\\TEMPFILES\\', state: { name: '', sta: false }, src: '', zfShow: false, DYZlist: [], DYZlist2: [], DYZlistNum: 1, Progress: { rate: '0%' }, djsM: { num: 0, total: 0, rate: '0%' }, numZt: 120, ztyc: false, citeL: { loadingSta: { sta: false, name: 'Loading' } }, mgcData: { show: false, re: '尊敬的用户您好,打印系统智慧引擎检测到要打印的文件中可能包含一些敏感信息或内容,打印请求即将转入快速审核通道。稍后请您留意手机小程序-个人中心-打印记记录的订单详情,系统审核通过即分配取件码。凭借取件码,可以稍后在任意一台打印服务终端上通过' }, orderInfo: '', ycTime: '', } }, created() { console.log(this.cite.ztyc) this.cite.loadingSta = { sta: true, name: '页面重启中,请稍后' } this.toLoad() setInterval(() => { if (this.cite != this.citeL) { this.citeL = this.cite } if (this.code == '') { this.toLoad() } }, 3000) }, mounted() { console.log('开始定时任务???'); }, methods: { onJqzt(num) { if (num === 0) { this.citeL.cqjqSta = false } else if (num === 1) { bdStop().then(() => { this.citeL.cqjqSta = false }) } }, add(t) { if(t<10) { return '0' + t } return t }, format() { let that = this let date = new Date(); let o = { "y": date.getFullYear(), //年 "M": that.add(date.getMonth() + 1), //月份 "d": that.add(date.getDate()), //日 "h": that.add(date.getHours()), //小时 "m": that.add(date.getMinutes()), //分 }; return o.y+'/'+o.M+'/'+o.d+' '+o.h+':'+o.m }, getDeviceAndOrder() { let that = this; bdGetDeviceAndOrder().then(res => { let {deviceStatus, hasOrder, taskCode, currentTask, downLoadMessage} = res; if (hasOrder) {// 先判断是否有订单进来 if(deviceStatus=='ABNORMAL') { if (!that.cite.ztyc) { that.ycTime = this.format() that.numZt = 120 that.onNum() } that.cite.ztyc = true }else if (taskCode) { if (taskCode == that.taskCode) {//非新任务 if (currentTask) { console.log('progressPercentage???', that.progressPercentage); let completeItem = that.printBackList[that.currentPrint]; if (currentTask == that.currentTaskCode) {//非新的打印文件 // if (deviceStatus == "RUN") { // this.progressType='real' // } else { // this.progressType='fake' // } } else {//新的打印文件 that.currentTaskCode = currentTask; that.currentPrint = Number(currentTask.slice(-1)); that.lastPrintList = [...that.lastPrintList, completeItem]; that.startProgress(completeItem?.expectedTime || 3); } } } else {//获取新任务的数据并显示打印框 that.getPrintList(taskCode); that.DYZshow = true; } } } else {// 没有订单不显示打印框 that.DYZshow = false; that.cite.ztyc = false } that.isOnLine = deviceStatus; that.cite.deviceStatus = deviceStatus; that.downLoadMessage = downLoadMessage; that.orderInfo = res }).catch(error => { alert(error, that) }) if(this.code === '20240326-066184') { bdSocket().then(res => { let {content, idCard, mgc, refreshAD, scan, udisk} = res if(idCard) { // 跳转到身份证打印 this.$router.push({ name: 'operationGuide', params: { name: '身份证打印' } }) }else if(mgc) { // 是否敏感词 this.mgcData = { show: true, re: content } this.numZt = 30 this.onNum() }else if(refreshAD) { // 立即刷新广告 this.getAdvertisement() }else if(scan) { // 跳转到扫描打印 this.$router.push({ name: 'operationGuide', params: { name: '扫描打印' } }) }else if(udisk) { // 跳转到U盘打印 this.$router.push({ name: 'operationGuide', params: { name: 'U盘打印' } }) } }).catch(error => { console.log(error) }) } }, getPrintList() { printOrderList().then(res => { let {printBackList, code} = res; console.log('getPrintList????', res); if (code != this.taskCode) { this.taskCode = code; printBackList.map((item) => { item.complete = false }); this.printBackList = printBackList; this.lastPrintList = []; this.DYZshow = true; console.log('printBackList????', printBackList); } }).catch(error => { alert(error, this) }) }, startProgress(duration) { console.log('duration???', duration); duration = duration * 1000; // 转换成毫秒 let interval = duration / 100; // 每增加1%所需的毫秒数 this.progressPercentage = 0; this.progressInterval = setInterval(() => { if (this.progressPercentage >= 100) { clearInterval(this.progressInterval); // 完成时清除定时器 this.progressType = 'fake' this.progressPercentage = 0; } else { this.progressType = 'real' this.progressPercentage += 1; } }, interval); }, onCloneZt() { this.numZt = 0 this.onNum() }, onNum() { if (this.numZt == 0) { this.cite.ztyc = false this.DYZshow = false this.DYZlist = [] this.mgcData = { show: false, re: '' } } else { this.numZt = this.numZt - 1 setTimeout(() => { this.onNum() }, 1000) } this.ztyc = this.cite.ztyc }, onChange(name, val) { this[name] = val }, toLoad() { // this.cite.code = '20240326-066184'; //'20240430-940955';// // this.cite.code = 'TZLC001' // this.code = this.cite.code // this.load() // this.cite.loadingSta = { // sta: false // } // this.mgcData = { // show: true, // re: '铭感次提示' // } // this.numZt = 30 // this.onNum() // this.DYZshow = true if (this.code) { return } getDeviceCode().then(res => { if (this.code == '') { this.cite.code = res.data this.code = res.data this.load() } else { this.cite.code = res.data this.code = res.data } this.cite.loadingSta = { sta: false } }).catch(error => { alert(error, this) }) }, load() { if (this.cite.facility === '') { this.getDeviceByCode() } // 判断是否是广告屏 if (this.cite.name != 'advertising') { // this.initMqtt() setInterval(() => { this.getDeviceAndOrder(); if (!this.state.sta && this.cite.state.sta) { let time = 3000 if (this.cite.state.name2) { time = 6000 } setTimeout(() => { this.cite.state.sta = false }, time) } this.state = this.cite.state }, 2000) } }, //获取设备信息 getDeviceByCode() { if (this.code) { getDeviceByCode({code: this.code}).then(res => { console.log(res); this.cite.facility = res this.getAdvertisement() }).catch(error => { alert(error, this) }) } }, // 获取广告链接 getAdvertisement() { let name = 'DeviceScreen' if (this.cite.name == 'advertising') { name = 'AdvertisingScreen' } getAdvertisement({deviceId: this.cite.facility.id, screen: name}).then(res => { // console.log(res) this.cite.advertisement = res || '' }).catch(error => { alert(error, this) }) }, play() { console.log(this.$refs.audio) this.$refs.audio.play() } } } </script> <style lang="less" scoped> .dyzTip { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 99; .curtain { background: #000; width: 100%; height: 100%; opacity: 0.3; } .content { position: absolute; left: 50%; margin-left: -19rem; top: 50%; margin-top: -14.5rem; width: 38.56rem; // height: 29rem; background: #ffffff; border-radius: 1.25rem; overflow: hidden; img { width: 100%; } div { font-size: 1.38rem; font-family: PingFang SC, PingFang SC; font-weight: bold; color: #323232; line-height: 1.88rem; margin-top: 1.3rem; } .name { font-size: 1rem; font-family: PingFang SC, PingFang SC; font-weight: 400; color: #323232; line-height: 1.38rem; text-align: left; padding: 0 3rem; } .btn { width: 18rem; height: 3rem; margin: 1rem auto; color: #fff; background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, #81d012 100%); border-radius: 1rem; } .btn2 { margin: 0; width: 14rem; } .JDT { width: 100%; margin: 1rem auto 0; height: 1rem; border-radius: 1rem; position: relative; border: 1px solid #323232; overflow: hidden; span { position: absolute; background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, #81d012 100%); top: 0; left: 0; bottom: 0; transition: width 0.5s ease; } } .taskBox { text-align: left; margin: unset; .progressContainer { width: 100%; height: 30px; background-color: #EBEBEB; /* 背景颜色 */ border-radius: 5px; /* 圆角 */ overflow: hidden; /* 隐藏溢出部分 */ margin: unset; /* 外边距 */ } .progressBar { height: 100%; /* 高度 */ background: repeating-linear-gradient(130deg, /* 斜线角度 */ #ffcc00, /* 黄色 */ #ffcc00 10px, /* 黄色条纹宽度 */ #ff9900 10px, /* 橙色开始位置 */ #ff9900 20px /* 橙色条纹宽度 */); width: 70%; /* 进度条的宽度,可以根据需要调整 */ transition: width 0.5s ease; /* 平滑过渡效果 */ margin: unset; } .fileBox { width: 100%; padding: 20px 30px; box-sizing: border-box; margin: unset; } } .text1 { font-weight: bold; font-size: 20px; color: #333333; margin: 10px; } .text2 { font-weight: bold; font-size: 18px; color: #333333; margin: 10px 0; } .text3 { font-weight: bold; font-size: 14px; color: #666666; margin: 10px 0; } } .content2 { background: transparent; height: auto; img { width: 18rem; } .icon { width: 3rem; margin-top: 3rem; } } } .tkTip { position: fixed; top: 5%; width: 100%; z-index: 99; div { background: rgba(51, 51, 51, 0.5); color: #fff; padding: 1rem 2rem; border-radius: 1rem; } } .loadingDH { position: absolute; top: 30%; width: 100%; .load { position: relative; margin: 3.125rem auto; width: 6.25rem; height: 5rem; .gear { position: absolute; z-index: -10; width: 2.5rem; height: 2.5rem; -webkit-animation: spin 5s infinite; animation: spin 5s infinite; } .second { left: 2.5rem; width: 5rem; height: 5rem; -webkit-animation: spin-reverse 5s infinite; animation: spin-reverse 5s infinite; } .third { top: 2.8125rem; left: -0.625rem; width: 3.75rem; height: 3.75rem; } @-webkit-keyframes spin { 50% { transform: rotate(360deg); } } @keyframes spin { 50% { transform: rotate(360deg); } } @-webkit-keyframes spin-reverse { 50% { transform: rotate(-360deg); } } @keyframes spin-reverse { 50% { transform: rotate(-360deg); } } .lil-circle { position: absolute; border-radius: 50%; box-shadow: inset 0 0 0.625rem 0.125rem gray, 0 0 3.125rem white; width: 6.25rem; height: 6.25rem; opacity: 0.65; } .blur-circle { position: absolute; top: -1.1875rem; left: -1.1875rem; } } .text { color: lightgray; font-size: 1.125rem; font-family: 'Open Sans', sans-serif; text-align: center; padding-top: 3rem; } } </style>
<template> <div> <!-- 打印中提示--> <div v-if="(DYZshow && DYZlist)" class="dyzTip"> <div class="curtain"></div> <div class="content"> <img alt="" src="../assets/printing.png" /> <div class="taskBox"> <div class="text1">{{ `NO.1文档打印机总进度` }}</div> <div class="progressContainer"> <div class="progressBar" :style="{ width: `${(lastPrintList.length/printBackList.length)*100}%`}"></div> </div> <div class="fileBox"> <div class="file"> <div class="text2"> 任务 {{ `${currentPrint+1}/${printBackList.length}: ${lastPrintList[lastPrintList.length]?.sourceFileName||''}`}} </div> <div class="text3">{{ downLoadMessage||'' }}</div> <div class="JDT" style="width: 100%;"> <!-- <span :style="'width:' + progressPercentage +'%'"></span> --> <span v-show="progressType=='real'" :style="'width:' + progressPercentage +'%'"></span> <span v-show="progressType=='fake'" style="width:100%;background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, red 100%);"></span> </div> </div> </div> </div> </div> </div> <!-- 提示--> <div v-if="state.sta" class="tkTip flex-center"> <div v-if="state.name">{{ state.name }}</div> <div v-if="state.name2" style="width: 50%;margin-top: 3%;">{{ state.name2 }}</div> </div> <!-- 敏感词提示--> <div v-if="mgcData.show" class="dyzTip flex-center"> <div class="curtain"></div> <div class="content" style="margin-top: 0;top: 20%;height: auto;"> <div class="name flex-center" style="font-size: 1.5rem;line-height: 2rem;">{{ mgcData.re }}</div> <div class="btn flex-center" style="margin: 2rem auto;" @click="onCloneZt()">我已知晓({{ numZt }}秒)</div> </div> </div> <!-- 小程序支付--> <div v-if="zfShow" class="dyzTip"> <div class="curtain"></div> <div class="content content2"> <VueQr v-show="src" :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="300" :text="src" logoBackgroundColor="white"></VueQr> <p> <img alt="" class="icon" src="../assets/demo10.png" @click="onChange('zfShow', false)" /> </p> </div> </div> <!-- 页面加载中--> <div v-if="citeL.loadingSta.sta" class="dyzTip"> <div class="curtain"></div> <div class="loadingDH"> <!-- 绘制齿轮 --> <div class="load"> <div class="gear first"> <svg id="purple" fill="#afb4db" viewbox="0 0 100 100"> <path d="m88.22905,52.73842l12.66081,-6.69624c-0.24889,-2.48103 -0.7299,-4.88779 -1.33165,-7.25374l-14.06435,-1.94757c-1.21732,-2.93246 -2.82483,-5.65223 -4.71443,-8.14886l5.36114,-13.18525c-1.76284,-1.71922 -3.66664,-3.28664 -5.67042,-4.72891l-11.94246,7.49732c-2.80052,-1.47273 -5.81781,-2.59129 -8.98524,-3.30968l-4.31582,-13.37042c-1.22401,-0.09243 -2.44766,-0.19008 -3.69591,-0.19008s-2.46845,0.0954 -3.69613,0.19008l-4.27306,13.25199c-3.25234,0.69537 -6.33625,1.82692 -9.20876,3.31783l-11.75647,-7.38703c-2.00124,1.44227 -3.90496,3.0097 -5.66766,4.72891l5.2136,12.82104c-2.03201,2.60429 -3.73326,5.47776 -5.01105,8.57467l-13.62035,1.8837c-0.59921,2.36263 -1.08274,4.76684 -1.32906,7.25345l12.2246,6.46784c0.1385,3.4047 0.70298,6.7044 1.70254,9.8117l-9.22158,10.19626c1.07271,2.22493 2.26701,4.38264 3.64861,6.40699l13.5767,-2.91464c2.226,2.422 4.76215,4.54406 7.56029,6.29894l-0.51461,13.89098c2.22975,1.00564 4.54649,1.84729 6.93396,2.52003l8.5892,-11.04055c1.52399,0.19456 3.06723,0.3256 4.64128,0.3256c1.70519,0 3.37278,-0.15405 5.01352,-0.37947l8.63392,11.1018c2.39122,-0.67196 4.70444,-1.51356 6.93395,-2.51926l-0.52454,-14.14044c2.66699,-1.72661 5.08534,-3.79226 7.21739,-6.12444l13.92978,2.98893c1.38161,-2.02403 2.57607,-4.17945 3.64839,-6.40624l-9.52026,-10.5301c0.91453,-2.94323 1.42539,-6.05022 1.57412,-9.25513l0,0l0.00001,-0.00001zm-21.0432,16.08496l-6.00271,3.90775l-3.69207,-5.67259c-1.92067,0.73877 -3.98849,1.18799 -6.1683,1.18799c-9.52022,0 -17.23546,-7.71828 -17.23546,-17.23701c0,-9.51912 7.71525,-17.23441 17.23546,-17.23441c9.51773,0 17.2358,7.71529 17.2358,17.23441c0,4.75679 -1.92697,9.05688 -5.04179,12.17683l3.66907,5.63703z"> </path> </svg> </div> <div class="gear second"> <svg id="pink" fill="#FFB5C5" viewbox="0 0 100 100"> <path d="m88.22905,52.73842l12.66081,-6.69624c-0.24889,-2.48103 -0.7299,-4.88779 -1.33165,-7.25374l-14.06435,-1.94757c-1.21732,-2.93246 -2.82483,-5.65223 -4.71443,-8.14886l5.36114,-13.18525c-1.76284,-1.71922 -3.66664,-3.28664 -5.67042,-4.72891l-11.94246,7.49732c-2.80052,-1.47273 -5.81781,-2.59129 -8.98524,-3.30968l-4.31582,-13.37042c-1.22401,-0.09243 -2.44766,-0.19008 -3.69591,-0.19008s-2.46845,0.0954 -3.69613,0.19008l-4.27306,13.25199c-3.25234,0.69537 -6.33625,1.82692 -9.20876,3.31783l-11.75647,-7.38703c-2.00124,1.44227 -3.90496,3.0097 -5.66766,4.72891l5.2136,12.82104c-2.03201,2.60429 -3.73326,5.47776 -5.01105,8.57467l-13.62035,1.8837c-0.59921,2.36263 -1.08274,4.76684 -1.32906,7.25345l12.2246,6.46784c0.1385,3.4047 0.70298,6.7044 1.70254,9.8117l-9.22158,10.19626c1.07271,2.22493 2.26701,4.38264 3.64861,6.40699l13.5767,-2.91464c2.226,2.422 4.76215,4.54406 7.56029,6.29894l-0.51461,13.89098c2.22975,1.00564 4.54649,1.84729 6.93396,2.52003l8.5892,-11.04055c1.52399,0.19456 3.06723,0.3256 4.64128,0.3256c1.70519,0 3.37278,-0.15405 5.01352,-0.37947l8.63392,11.1018c2.39122,-0.67196 4.70444,-1.51356 6.93395,-2.51926l-0.52454,-14.14044c2.66699,-1.72661 5.08534,-3.79226 7.21739,-6.12444l13.92978,2.98893c1.38161,-2.02403 2.57607,-4.17945 3.64839,-6.40624l-9.52026,-10.5301c0.91453,-2.94323 1.42539,-6.05022 1.57412,-9.25513l0,0l0.00001,-0.00001zm-21.0432,16.08496l-6.00271,3.90775l-3.69207,-5.67259c-1.92067,0.73877 -3.98849,1.18799 -6.1683,1.18799c-9.52022,0 -17.23546,-7.71828 -17.23546,-17.23701c0,-9.51912 7.71525,-17.23441 17.23546,-17.23441c9.51773,0 17.2358,7.71529 17.2358,17.23441c0,4.75679 -1.92697,9.05688 -5.04179,12.17683l3.66907,5.63703z"> </path> </svg> </div> <div class="gear third"> <svg id="orange" fill="#fedcbd" viewbox="0 0 100 100"> <path d="m88.22905,52.73842l12.66081,-6.69624c-0.24889,-2.48103 -0.7299,-4.88779 -1.33165,-7.25374l-14.06435,-1.94757c-1.21732,-2.93246 -2.82483,-5.65223 -4.71443,-8.14886l5.36114,-13.18525c-1.76284,-1.71922 -3.66664,-3.28664 -5.67042,-4.72891l-11.94246,7.49732c-2.80052,-1.47273 -5.81781,-2.59129 -8.98524,-3.30968l-4.31582,-13.37042c-1.22401,-0.09243 -2.44766,-0.19008 -3.69591,-0.19008s-2.46845,0.0954 -3.69613,0.19008l-4.27306,13.25199c-3.25234,0.69537 -6.33625,1.82692 -9.20876,3.31783l-11.75647,-7.38703c-2.00124,1.44227 -3.90496,3.0097 -5.66766,4.72891l5.2136,12.82104c-2.03201,2.60429 -3.73326,5.47776 -5.01105,8.57467l-13.62035,1.8837c-0.59921,2.36263 -1.08274,4.76684 -1.32906,7.25345l12.2246,6.46784c0.1385,3.4047 0.70298,6.7044 1.70254,9.8117l-9.22158,10.19626c1.07271,2.22493 2.26701,4.38264 3.64861,6.40699l13.5767,-2.91464c2.226,2.422 4.76215,4.54406 7.56029,6.29894l-0.51461,13.89098c2.22975,1.00564 4.54649,1.84729 6.93396,2.52003l8.5892,-11.04055c1.52399,0.19456 3.06723,0.3256 4.64128,0.3256c1.70519,0 3.37278,-0.15405 5.01352,-0.37947l8.63392,11.1018c2.39122,-0.67196 4.70444,-1.51356 6.93395,-2.51926l-0.52454,-14.14044c2.66699,-1.72661 5.08534,-3.79226 7.21739,-6.12444l13.92978,2.98893c1.38161,-2.02403 2.57607,-4.17945 3.64839,-6.40624l-9.52026,-10.5301c0.91453,-2.94323 1.42539,-6.05022 1.57412,-9.25513l0,0l0.00001,-0.00001zm-21.0432,16.08496l-6.00271,3.90775l-3.69207,-5.67259c-1.92067,0.73877 -3.98849,1.18799 -6.1683,1.18799c-9.52022,0 -17.23546,-7.71828 -17.23546,-17.23701c0,-9.51912 7.71525,-17.23441 17.23546,-17.23441c9.51773,0 17.2358,7.71529 17.2358,17.23441c0,4.75679 -1.92697,9.05688 -5.04179,12.17683l3.66907,5.63703z"> </path> </svg> </div> <!-- 绘制圆形水珠 --> <div class="lil-circle"></div> <svg class="blur-circle"> <filter id="blur"> <fegaussianblur in="SourceGraphic" stddeviation="13"></fegaussianblur> </filter> <circle cx="70" cy="70" fill="transparent" filter="url(#blur)" r="66" stroke="white" stroke-width="40"> </circle> </svg> </div> <!-- 文字 --> <div class="text">{{ citeL.loadingSta.name }}</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/Wait4Printing.mp3" /> </audio> </div> </template> <script> import { getAdvertisement, getDeviceByCode } from '@/api/resultApi' import VueQr from 'vue-qr' import { getDeviceCode, deviceAndOrder, printOrderList } from '@/api/bdResultApi' import alert from '../utils/alert' export default { name: 'global', components: { VueQr }, data() { return { isOnLine:false, intervalTask:null, currentTaskCode:null, currentPrint:null, taskCode:null, progressInterval:null, progressPercentage:0, progressType:'real', downLoadMessage:'', printBackList:[], lastPrintList:[], client: null, code: '', DYZshow: false, // 是否显示打印中 downloadPath: 'D:\\TZDYSHARE\\TEMPFILES\\', state: { name: '', sta: false }, src: '', zfShow: false, DYZlist: [], DYZlist2: [], DYZlistNum: 1, Progress: { rate: '0%' }, djsM: { num: 0, total: 0, rate: '0%' }, numZt: 120, ztyc: false, citeL: { loadingSta: { sta: false, name: 'Loading' } }, mgcData: { show: false, re: '尊敬的用户您好,打印系统智慧引擎检测到要打印的文件中可能包含一些敏感信息或内容,打印请求即将转入快速审核通道。稍后请您留意手机小程序-个人中心-打印记记录的订单详情,系统审核通过即分配取件码。凭借取件码,可以稍后在任意一台打印服务终端上通过' } } }, created() { console.log(this.cite.ztyc) this.cite.loadingSta = { sta: true, name: '页面重启中,请稍后' } this.toLoad() setInterval(() => { if (this.cite != this.citeL) { this.citeL = this.cite } if (this.code == '') { this.toLoad() } }, 3000) }, mounted() { console.log('开始定时任务???'); }, methods: { getDeviceAndOrder() { let that = this; deviceAndOrder().then(res => { let {deviceStatus,hasOrder,taskCode,currentTask,downLoadMessage} = res; if (hasOrder){// 先判断是否有订单进来 if (taskCode) { if (taskCode == this.taskCode) {//非新任务 if (currentTask) { console.log('progressPercentage???', this.progressPercentage); let completeItem = that.printBackList[that.currentPrint]; if (currentTask == that.currentTaskCode) {//非新的打印文件 // if (deviceStatus == "RUN") { // this.progressType='real' // } else { // this.progressType='fake' // } } else {//新的打印文件 that.currentTaskCode = currentTask; that.currentPrint = Number(currentTask.slice(-1)); that.lastPrintList = [...that.lastPrintList, completeItem]; that.startProgress(completeItem?.expectedTime || 3); } } } else {//获取新任务的数据并显示打印框 that.getPrintList(taskCode); that.DYZshow = true; } } }else{// 没有订单不显示打印框 that.DYZshow = false; } that.isOnLine = deviceStatus; that.cite.deviceStatus = deviceStatus; that.downLoadMessage = downLoadMessage; }).catch(error => { alert(error, that) }) }, getPrintList() { printOrderList().then(res => { let {printBackList,code} = res; console.log('getPrintList????',res); if (code!=this.taskCode) { this.taskCode = code; printBackList.map((item)=>{item.complete=false}); this.printBackList = printBackList; this.lastPrintList = []; this.DYZshow = true; console.log('printBackList????',printBackList); } }).catch(error => { alert(error, this) }) }, startProgress(duration) { console.log('duration???',duration); duration = duration*1000; // 转换成毫秒 let interval = duration / 100; // 每增加1%所需的毫秒数 this.progressPercentage = 0; this.progressInterval = setInterval(() => { if (this.progressPercentage >= 100) { clearInterval(this.progressInterval); // 完成时清除定时器 this.progressType='fake' this.progressPercentage = 0; }else{ this.progressType='real' this.progressPercentage += 1; } }, interval); }, onCloneZt() { this.numZt = 0 this.onNum() }, onNum() { if (this.numZt == 0) { this.cite.ztyc = false this.DYZshow = false this.DYZlist = [] this.mgcData = { show: false, re: '' } } else { this.numZt = this.numZt - 1 setTimeout(() => { this.onNum() }, 1000) } this.ztyc = this.cite.ztyc }, onChange(name, val) { this[name] = val }, toLoad() { // this.cite.code = '20240326-066184'; //'20240430-940955';// // this.cite.code = 'TZLC001' // this.code = this.cite.code // this.load() // this.cite.loadingSta = { // sta: false // } // this.mgcData = { // show: true, // re: '铭感次提示' // } // this.numZt = 30 // this.onNum() // this.DYZshow = true if(this.code) {return} getDeviceCode().then(res => { if (this.code == '') { this.cite.code = res.data this.code = res.data this.load() } else { this.cite.code = res.data this.code = res.data } this.cite.loadingSta = { sta: false } }).catch(error => { alert(error, this) }) }, load() { if (this.cite.facility === '') { this.getDeviceByCode() } // 判断是否是广告屏 if (this.cite.name != 'advertising') { // this.initMqtt() setInterval(() => { this.getDeviceAndOrder(); if (!this.state.sta && this.cite.state.sta) { let time = 3000 if (this.cite.state.name2) { time = 6000 } setTimeout(() => { this.cite.state.sta = false }, time) } this.state = this.cite.state }, 2000) } }, //获取设备信息 getDeviceByCode() { if (this.code) { getDeviceByCode({code: this.code}).then(res => { console.log(res); this.cite.facility = res this.getAdvertisement() }).catch(error => { alert(error, this) }) } }, // 获取广告链接 getAdvertisement() { let name = 'DeviceScreen' if (this.cite.name == 'advertising') { name = 'AdvertisingScreen' } getAdvertisement({deviceId: this.cite.facility.id, screen: name}).then(res => { // console.log(res) this.cite.advertisement = res || '' }).catch(error => { alert(error, this) }) }, play() { console.log(this.$refs.audio) this.$refs.audio.play() } } } </script> <style lang="less" scoped> .dyzTip { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 99; .curtain { background: #000; width: 100%; height: 100%; opacity: 0.3; } .content { position: absolute; left: 50%; margin-left: -19rem; top: 50%; margin-top: -14.5rem; width: 38.56rem; // height: 29rem; background: #ffffff; border-radius: 1.25rem; overflow: hidden; img { width: 100%; } div { font-size: 1.38rem; font-family: PingFang SC, PingFang SC; font-weight: bold; color: #323232; line-height: 1.88rem; margin-top: 1.3rem; } .name { font-size: 1rem; font-family: PingFang SC, PingFang SC; font-weight: 400; color: #323232; line-height: 1.38rem; text-align: left; padding: 0 3rem; } .btn { width: 18rem; height: 3rem; margin: 1rem auto; color: #fff; background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, #81d012 100%); border-radius: 1rem; } .JDT { width: 100%; margin: 1rem auto 0; height: 1rem; border-radius: 1rem; position: relative; border: 1px solid #323232; overflow: hidden; span { position: absolute; background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, #81d012 100%); top: 0; left: 0; bottom: 0; transition: width 0.5s ease; } } .taskBox { text-align: left; margin: unset; .progressContainer { width: 100%; height: 30px; background-color: #EBEBEB; /* 背景颜色 */ border-radius: 5px; /* 圆角 */ overflow: hidden; /* 隐藏溢出部分 */ margin: unset; /* 外边距 */ } .progressBar { height: 100%; /* 高度 */ background: repeating-linear-gradient(130deg, /* 斜线角度 */ #ffcc00, /* 黄色 */ #ffcc00 10px, /* 黄色条纹宽度 */ #ff9900 10px, /* 橙色开始位置 */ #ff9900 20px /* 橙色条纹宽度 */ ); width: 70%; /* 进度条的宽度,可以根据需要调整 */ transition: width 0.5s ease; /* 平滑过渡效果 */ margin: unset; } .fileBox { width: 100%; padding: 20px 30px; box-sizing: border-box; margin: unset; } } .text1 { font-weight: bold; font-size: 20px; color: #333333; margin: 10px; } .text2 { font-weight: bold; font-size: 18px; color: #333333; margin: 10px 0; } .text3 { font-weight: bold; font-size: 14px; color: #666666; margin: 10px 0; } } .content2 { background: transparent; height: auto; img { width: 18rem; } .icon { width: 3rem; margin-top: 3rem; } } } .tkTip { position: fixed; top: 5%; width: 100%; z-index: 99; div { background: rgba(51, 51, 51, 0.5); color: #fff; padding: 1rem 2rem; border-radius: 1rem; } } .loadingDH { position: absolute; top: 30%; width: 100%; .load { position: relative; margin: 3.125rem auto; width: 6.25rem; height: 5rem; .gear { position: absolute; z-index: -10; width: 2.5rem; height: 2.5rem; -webkit-animation: spin 5s infinite; animation: spin 5s infinite; } .second { left: 2.5rem; width: 5rem; height: 5rem; -webkit-animation: spin-reverse 5s infinite; animation: spin-reverse 5s infinite; } .third { top: 2.8125rem; left: -0.625rem; width: 3.75rem; height: 3.75rem; } @-webkit-keyframes spin { 50% { transform: rotate(360deg); } } @keyframes spin { 50% { transform: rotate(360deg); } } @-webkit-keyframes spin-reverse { 50% { transform: rotate(-360deg); } } @keyframes spin-reverse { 50% { transform: rotate(-360deg); } } .lil-circle { position: absolute; border-radius: 50%; box-shadow: inset 0 0 0.625rem 0.125rem gray, 0 0 3.125rem white; width: 6.25rem; height: 6.25rem; opacity: 0.65; } .blur-circle { position: absolute; top: -1.1875rem; left: -1.1875rem; } } .text { color: lightgray; font-size: 1.125rem; font-family: 'Open Sans', sans-serif; text-align: center; padding-top: 3rem; } } </style>
Ignore Space
Show notes
View
src/components/top.vue
<template> <div class="top flex-between"> <div class="logo flex-start" @click="_goHome()"> <img src="../assets/logo.png" /> <span></span> <div>天章自助打印</div> </div> <!-- <div class="sbzt">{{cite.memberLoginVo?'当前设备正在被使用!':''}}</div>--> <div class="time flex-start" @click="onDj()"> <div> <div>{{ time.week }}</div> <div>{{ time.y }}/{{ time.M }}/{{ time.d }}</div> </div> <div class="info">{{ time.h }}:{{ time.m }}</div> </div> <div class="tip flex-start"> <!-- <div v-for="(item, index) in cite.facility.paperNumber" :key="index">{{ item.name }}剩余{{ item.residue }}张</div> --> <!-- <div>{{cite.memberLoginVo?'已登录':'未登录'}}</div>--> </div> </div> </template> <script> export default { name: "top", data() { return { time: {}, djData: { time: '', num: 0 } } }, mounted() { this.format() }, methods: { add(t) { if(t<10) { return '0' + t } return t }, format() { let date = new Date(); let o = { "y": date.getFullYear(), //年 "M": this.add(date.getMonth() + 1), //月份 "d": this.add(date.getDate()), //日 "h": this.add(date.getHours()), //小时 "m": this.add(date.getMinutes()), //分 "week": '', }; let str = "星期"; switch (date.getDay()) { case 0 : str += "日"; break; case 1 : str += "一"; break; case 2 : str += "二"; break; case 3 : str += "三"; break; case 4 : str += "四"; break; case 5 : str += "五"; break; case 6 : str += "六"; break; } o.week = str this.time = o setTimeout(() =>{ this.format() },1000) }, _goHome() { // this.quit() this.$router.push({ name: 'device' }) }, onDj() { let {time,num} = this.djData if(!time) { time = new Date().getTime(); } const currentTime = new Date().getTime(); const elsp = currentTime - time; if (elsp > 3000) { num = 0; time = '' }else if(num<5){ num = num+1; }else{ this.cite.cqjqSta = true } this.djData.time = time this.djData.num = num } } } </script> <style scoped lang="less"> .top { width: 100%; height: 9.81rem; background: #52A39D; position: relative; .logo { padding-left: 5.5rem; font-size: 3.5rem; font-weight: 400; color: #FFFFFF; line-height: 3.69rem; img { width: 5.56rem; height: 5.56rem; } span { width: 0; height: 4.43rem; border-left: 1px solid #FFFFFF; margin: 0 1.94rem; } } .time { padding-right: 3.88rem; font-size: 1.38rem; font-weight: 400; color: #FFFFFF; line-height: 1.94rem; text-align: right; .info { font-weight: bold; color: #FFFFFF; margin-left: 1.13rem; font-size: 3.69rem; line-height: 5.2rem; } } .tip { position: absolute; bottom: .5rem; right: 3.88rem; font-size: 1.2rem; color: #fff; div { margin-left: 2rem; } } .sbzt { font-size: 3rem; font-weight: bold; color: #FFFFFF; } } </style>
<template> <div class="top flex-between"> <div class="logo flex-start" @click="_goHome()"> <img src="../assets/logo.png" /> <span></span> <div>天章自助打印</div> </div> <!-- <div class="sbzt">{{cite.memberLoginVo?'当前设备正在被使用!':''}}</div>--> <div class="time flex-start"> <div> <div>{{ time.week }}</div> <div>{{ time.y }}/{{ time.M }}/{{ time.d }}</div> </div> <div class="info">{{ time.h }}:{{ time.m }}</div> </div> <div class="tip flex-start"> <!-- <div v-for="(item, index) in cite.facility.paperNumber" :key="index">{{ item.name }}剩余{{ item.residue }}张</div> --> <!-- <div>{{cite.memberLoginVo?'已登录':'未登录'}}</div>--> </div> </div> </template> <script> export default { name: "top", data() { return { time: {}, } }, mounted() { this.format() }, methods: { add(t) { if(t<10) { return '0' + t } return t }, format() { let date = new Date(); let o = { "y": date.getFullYear(), //年 "M": this.add(date.getMonth() + 1), //月份 "d": this.add(date.getDate()), //日 "h": this.add(date.getHours()), //小时 "m": this.add(date.getMinutes()), //分 "week": '', }; let str = "星期"; switch (date.getDay()) { case 0 : str += "日"; break; case 1 : str += "一"; break; case 2 : str += "二"; break; case 3 : str += "三"; break; case 4 : str += "四"; break; case 5 : str += "五"; break; case 6 : str += "六"; break; } o.week = str this.time = o setTimeout(() =>{ this.format() },1000) }, _goHome() { // this.quit() this.$router.push({ name: 'device' }) } } } </script> <style scoped lang="less"> .top { width: 100%; height: 9.81rem; background: #52A39D; position: relative; .logo { padding-left: 5.5rem; font-size: 3.5rem; font-weight: 400; color: #FFFFFF; line-height: 3.69rem; img { width: 5.56rem; height: 5.56rem; } span { width: 0; height: 4.43rem; border-left: 1px solid #FFFFFF; margin: 0 1.94rem; } } .time { padding-right: 3.88rem; font-size: 1.38rem; font-weight: 400; color: #FFFFFF; line-height: 1.94rem; text-align: right; .info { font-weight: bold; color: #FFFFFF; margin-left: 1.13rem; font-size: 3.69rem; line-height: 5.2rem; } } .tip { position: absolute; bottom: .5rem; right: 3.88rem; font-size: 1.2rem; color: #fff; div { margin-left: 2rem; } } .sbzt { font-size: 3rem; font-weight: bold; color: #FFFFFF; } } </style>
Ignore Space
Show notes
View
src/utils/cite.js
// 引用地址 let inWebURL = 'ws://127.0.0.1:7000/' let baseURL = 'http://127.0.0.1' // let baseURL = "http://192.168.1.102"; // 刘竞 // let baseURL = "http://192.168.250.29"; // 家亮 // 记录首页名称 let name = '' // 设备编号 let code = '' // 用户信息 let memberLoginVo = '' // 设备信息 let facility = '' // 选中的文件 let selectedFile = [] // 选中的文件数 let fileNum = 0 // 打印的参数 let parameter = '' // 订单id let orderId = '' // 广告位 let advertisement = '' // 页面停留时间(秒) let tlTime = { djs: 2 * 60, //倒计时时间 mrT: 2 * 60 //默认时间 } let url = '' // 打印方式名称 let modeName = '' // 提示的内容及状态 let state = { name: '', name2: '', sta: false } // 打印数据 let printData = '' //异常提醒状态 let ztyc = false // loading提醒 let loadingSta = { sta: false, name: 'Loading' } // 判断是否是竖屏 默认不是 let isVertical = false // 判断语音是否正常 let serveError = false // 判断是否重启机器弹框 let cqjqSta = false export default { loadingSta, ztyc, printData, state, modeName, url, inWebURL, baseURL, facility, selectedFile, fileNum, parameter, orderId, code, memberLoginVo, name, advertisement, tlTime, isVertical, serveError, cqjqSta }
// 引用地址 let inWebURL = 'ws://127.0.0.1:7000/' let baseURL = 'http://127.0.0.1' // let baseURL = "http://192.168.1.102"; // 刘竞 // let baseURL = "http://192.168.250.29"; // 家亮 // 记录首页名称 let name = '' // 设备编号 let code = '' // 用户信息 let memberLoginVo = '' // 设备信息 let facility = '' // 选中的文件 let selectedFile = [] // 选中的文件数 let fileNum = 0 // 打印的参数 let parameter = '' // 订单id let orderId = '' // 广告位 let advertisement = '' // 页面停留时间(秒) let tlTime = { djs: 2 * 60, //倒计时时间 mrT: 2 * 60 //默认时间 } let url = '' // 打印方式名称 let modeName = '' // 提示的内容及状态 let state = { name: '', name2: '', sta: false } // 打印数据 let printData = '' //异常提醒状态 let ztyc = false // loading提醒 let loadingSta = { sta: false, name: 'Loading' } // 判断是否是竖屏 默认不是 let isVertical = false // 判断语音是否正常 let serveError = false export default { loadingSta, ztyc, printData, state, modeName, url, inWebURL, baseURL, facility, selectedFile, fileNum, parameter, orderId, code, memberLoginVo, name, advertisement, tlTime, isVertical, serveError }
Ignore Space
Show notes
View
src/views/expense.vue
<template> <!-- 费用支付--> <div class="expense"> <navbar :name="name" /> <div :class="['box', 'flex-center', { 'vertical-box-colum': isVertical }]"> <div :class="['left', { 'vertical-box': isVertical }]"> <div class="title">温馨提示</div> <div class="content">请在二维码区域提示的时限内,尽快完成支付。如果操作超时,本次打印业务可能需要重新提交。</div> </div> <div :class="['right', { 'vertical-box': isVertical }]"> <div class="code"> <VueQr v-if="appSrc != ''" :logo-src="require('@/assets/logo.png')" :logoScale="0.2" :logoMargin="0" logoBackgroundColor="white" :size="300" :margin="0" :auto-color="true" :dot-scale="1" :text="appSrc" ></VueQr> </div> <div class="flex-center tip">提示:请在 {{ num }} 秒内完成扫码支付</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/Remind2Pay.mp3" autoplay /> </audio> </div> </template> <script> import navbar from '@/components/nav' // import {getPayQrCode, downloadPDF, getPrintTask} from "../api/resultApi"; import { downloadPDF, getPrintTask } from '../api/resultApi' import VueQr from 'vue-qr' import bdRequest from '../utils/bdRequest' import alert from "@/utils/alert"; import {bdPlayAudio} from "../api/bdResultApi"; export default { name: 'expense', components: { navbar, VueQr }, provide() { return { title: '', type: this.name } }, data() { return { name: this.cite.modeName, appSrc: '', client: '', num: 120, selectedFile: this.cite.selectedFile, listData: { code: '20240104231724631239-0', copies: 1, printFileId: 112, printFileType: 'PDF', printingColor: 'BW', printingFaces: 'SINGLE' }, isVertical: false } }, methods: { skip(href, name) { this.$router.push({ name: href, params: { name: name } }) }, downloadPDF(id, name) { downloadPDF({ id: id }) .then(res => { const fileName = name const blob = new Blob([res], { type: 'application/octet-stream' }) if (window.navigator.msSaveOrOpenBlob) { navigator.msSaveBlob(blob, fileName) } else { let link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.download = fileName link.click() window.URL.revokeObjectURL(link.href) } }).catch(error => {alert(error,this)}) }, async dayin() { let _this = this let { listData, selectedFile } = _this let i = '', deta = '' selectedFile.forEach((item, index) => { if (listData.printFileId == item.id) { i = index deta = item } }) await this.downloadPDF(listData.printFileId, listData.printFileName) console.log('打印', deta, listData.copies) setTimeout(() => { _this.selectedFile.splice(i, 1) // 按份数循环打印 // for(let i=0;i<listData.copies;i++) { // } let res = bdRequest({ method: 'post', url: '/api/Printer/Print', post: '8080', data: { PrinterName: 'EPSON WF-C5890 Series', // "SourceFile": 'D:\\TZDYSHARE\\TEMPFILES\\'+listData.printFileName, SourceFile: 'C:\\datasource\\' + listData.printFileName, FileType: 'pdf', PrintColor: listData.printingColor || '', DblPrt: listData.printingFaces || '' } }) console.log(res) setTimeout(() => { if (_this.selectedFile.length > 0) { _this.getPrintTask() } else { _this.cite.orderId = '' _this.skip('complete', _this.name) } }, 1000) }, 2000) }, async getPrintTask() { let _this = this if (_this.cite.orderId) { let res = await getPrintTask({ orderId: _this.cite.orderId }) console.log(res, 'getPrintTask数据') if (res) { _this.listData = res _this.dayin() } else { setTimeout(() => { _this.getPrintTask() }, 1000) } } }, load() { let _this = this setTimeout(() => { _this.appSrc = 'https://mps.xlmalls.com/web/payment/' + JSON.stringify(_this.cite.printData) }, 800) // getPayQrCode({orderId: _this.cite.orderId,payMode: 'TZ_PAY'}).then(res => { // // console.log(res.data.qrCode) // if(res.qrCode) { // // _this.appSrc = res.qrCode // // _this.appSrc = 'https://mps.xlmalls.com/web/payment/' + JSON.stringify(_this.cite.printData) // // 循环查询是否需要调打印 // // setTimeout(() =>{ // // // _this.dayin() // // _this.getPrintTask() // // },1000) // } // }) }, countDown() { if (this.$route.name == 'expense') { let num = this.num if (num == 0) { this.quit() return } else if (num > 0) { setTimeout(() => { this.num = num - 1 this.countDown() }, 1000) } } }, play() { // this.$refs.audio.play() bdPlayAudio({fileName: 'Remind2Pay'}).then(res => { console.log('音频触发', res) }) } }, destroyed() { // 销毁监听 // clearTimeout() this.num = -1 }, created() { this.isVertical = this.cite.isVertical }, mounted() { this.play() this.num = 120 this.countDown() this.load() } } </script> <style scoped lang="less"> .box { height: 42.13rem; .css1 { height: 100%; background: #ffffff; box-shadow: 0rem 0.31rem 0.63rem 0.06rem rgba(0, 0, 0, 0.14); border-radius: 1.63rem; } .left { width: 46.44rem; margin-right: 1.88rem; .css1(); .title { font-size: 2.88rem; font-weight: bold; color: #d41212; line-height: 4.06rem; padding: 4.13rem 0 2.44rem; } .content { width: 37rem; font-size: 2.25rem; font-weight: bold; color: #323232; line-height: 3rem; margin: 0 auto; text-align: left; } } .right { width: 62.81rem; .css1(); font-size: 2.25rem; font-weight: bold; color: #323232; line-height: 3.13rem; .code { display: inline-block; width: 23.25rem; height: 22.88rem; background: #ffffff; //border: 0.06rem solid #707070; margin: 2.94rem auto 1.19rem; img { width: 100%; height: auto; } } } } .vertical-box { width: 80% !important; height: 35rem !important; } .vertical-box-colum { height: 90rem; flex-direction: column-reverse; justify-content: space-around; align-items: center; } </style>
<template> <!-- 费用支付--> <div class="expense"> <navbar :name="name" /> <div :class="['box', 'flex-center', { 'vertical-box-colum': isVertical }]"> <div :class="['left', { 'vertical-box': isVertical }]"> <div class="title">温馨提示</div> <div class="content">请在二维码区域提示的时限内,尽快完成支付。如果操作超时,本次打印业务可能需要重新提交。</div> </div> <div :class="['right', { 'vertical-box': isVertical }]"> <div class="code"> <VueQr v-if="appSrc != ''" :logo-src="require('@/assets/logo.png')" :logoScale="0.2" :logoMargin="0" logoBackgroundColor="white" :size="300" :margin="0" :auto-color="true" :dot-scale="1" :text="appSrc" ></VueQr> </div> <div class="flex-center tip">提示:请在 {{ num }} 秒内完成扫码支付</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/Remind2Pay.mp3" autoplay /> </audio> </div> </template> <script> import navbar from '@/components/nav' // import {getPayQrCode, downloadPDF, getPrintTask} from "../api/resultApi"; import { downloadPDF, getPrintTask } from '../api/resultApi' import VueQr from 'vue-qr' import bdRequest from '../utils/bdRequest' import alert from "@/utils/alert"; export default { name: 'expense', components: { navbar, VueQr }, provide() { return { title: '', type: this.name } }, data() { return { name: this.cite.modeName, appSrc: '', client: '', num: 120, selectedFile: this.cite.selectedFile, listData: { code: '20240104231724631239-0', copies: 1, printFileId: 112, printFileType: 'PDF', printingColor: 'BW', printingFaces: 'SINGLE' }, isVertical: false } }, methods: { skip(href, name) { this.$router.push({ name: href, params: { name: name } }) }, downloadPDF(id, name) { downloadPDF({ id: id }) .then(res => { const fileName = name const blob = new Blob([res], { type: 'application/octet-stream' }) if (window.navigator.msSaveOrOpenBlob) { navigator.msSaveBlob(blob, fileName) } else { let link = document.createElement('a') link.href = window.URL.createObjectURL(blob) link.download = fileName link.click() window.URL.revokeObjectURL(link.href) } }).catch(error => {alert(error,this)}) }, async dayin() { let _this = this let { listData, selectedFile } = _this let i = '', deta = '' selectedFile.forEach((item, index) => { if (listData.printFileId == item.id) { i = index deta = item } }) await this.downloadPDF(listData.printFileId, listData.printFileName) console.log('打印', deta, listData.copies) setTimeout(() => { _this.selectedFile.splice(i, 1) // 按份数循环打印 // for(let i=0;i<listData.copies;i++) { // } let res = bdRequest({ method: 'post', url: '/api/Printer/Print', post: '8080', data: { PrinterName: 'EPSON WF-C5890 Series', // "SourceFile": 'D:\\TZDYSHARE\\TEMPFILES\\'+listData.printFileName, SourceFile: 'C:\\datasource\\' + listData.printFileName, FileType: 'pdf', PrintColor: listData.printingColor || '', DblPrt: listData.printingFaces || '' } }) console.log(res) setTimeout(() => { if (_this.selectedFile.length > 0) { _this.getPrintTask() } else { _this.cite.orderId = '' _this.skip('complete', _this.name) } }, 1000) }, 2000) }, async getPrintTask() { let _this = this if (_this.cite.orderId) { let res = await getPrintTask({ orderId: _this.cite.orderId }) console.log(res, 'getPrintTask数据') if (res) { _this.listData = res _this.dayin() } else { setTimeout(() => { _this.getPrintTask() }, 1000) } } }, load() { let _this = this setTimeout(() => { _this.appSrc = 'https://mps.xlmalls.com/web/payment/' + JSON.stringify(_this.cite.printData) }, 800) // getPayQrCode({orderId: _this.cite.orderId,payMode: 'TZ_PAY'}).then(res => { // // console.log(res.data.qrCode) // if(res.qrCode) { // // _this.appSrc = res.qrCode // // _this.appSrc = 'https://mps.xlmalls.com/web/payment/' + JSON.stringify(_this.cite.printData) // // 循环查询是否需要调打印 // // setTimeout(() =>{ // // // _this.dayin() // // _this.getPrintTask() // // },1000) // } // }) }, countDown() { if (this.$route.name == 'expense') { let num = this.num if (num == 0) { this.quit() return } else if (num > 0) { setTimeout(() => { this.num = num - 1 this.countDown() }, 1000) } } }, play() { this.$refs.audio.play() } }, destroyed() { // 销毁监听 // clearTimeout() this.num = -1 }, created() { this.isVertical = this.cite.isVertical }, mounted() { this.play() this.num = 120 this.countDown() this.load() } } </script> <style scoped lang="less"> .box { height: 42.13rem; .css1 { height: 100%; background: #ffffff; box-shadow: 0rem 0.31rem 0.63rem 0.06rem rgba(0, 0, 0, 0.14); border-radius: 1.63rem; } .left { width: 46.44rem; margin-right: 1.88rem; .css1(); .title { font-size: 2.88rem; font-weight: bold; color: #d41212; line-height: 4.06rem; padding: 4.13rem 0 2.44rem; } .content { width: 37rem; font-size: 2.25rem; font-weight: bold; color: #323232; line-height: 3rem; margin: 0 auto; text-align: left; } } .right { width: 62.81rem; .css1(); font-size: 2.25rem; font-weight: bold; color: #323232; line-height: 3.13rem; .code { display: inline-block; width: 23.25rem; height: 22.88rem; background: #ffffff; //border: 0.06rem solid #707070; margin: 2.94rem auto 1.19rem; img { width: 100%; height: auto; } } } } .vertical-box { width: 80% !important; height: 35rem !important; } .vertical-box-colum { height: 90rem; flex-direction: column-reverse; justify-content: space-around; align-items: center; } </style>
Ignore Space
Show notes
View
src/views/operationGuide.vue
<template> <!-- 操作指南--> <div class="operationGuide"> <navbar :name="name" /> <div :class="['box', 'flex-between', { 'vertical-width-direction': isVertical }]"> <div class="picture" v-show="name == 'U盘打印'"> <img class="icon" src="../assets/typeUp.png" /> <div class="flex-between name"> <div>U盘</div> <div>USB接口</div> </div> </div> <div class="picture" v-show="name == '扫描打印'"> <img src="../assets/typeSMFY.png" :class="[{ 'vertical-img-margin': isVertical }]" /> </div> <div class="picture" v-show="name == '身份证打印'"> <img src="../assets/typeSFZ.png" :class="[{ 'vertical-img-margin': isVertical }]" /> </div> <div :class="['tip', { 'vertical-bottom-btn': isVertical }]"> <div class="title">温馨提示</div> <div class="content">{{ content }}</div> <div class="btn flex-center" @click="skip('selectFile', name)">{{ btnName }}</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/IdCardReaderGuide.mp3" autoplay /> </audio> </div> </template> <script> import navbar from '@/components/nav' import {bdPlayAudio} from "../api/bdResultApi"; export default { name: 'operationGuide', components: { navbar }, provide() { return { title: this.tit, type: this.name } }, data() { return { tit: this.cite.modeName == 'U盘打印' ? '资料选取提交' : '资料扫描提交', name: this.cite.modeName, content: '', btnName: '', isVertical: false } }, methods: { skip(href, name) { this.$router.push({ name: href, params: { name: name } }) }, play(addr) { console.log(addr) let music = new Audio() music = addr this.$refs.audio.src = music this.$refs.audio.play() }, playYp(name) { bdPlayAudio({fileName: name}).then(res => { console.log('音频触发', res) }) }, }, created() { this.isVertical = this.cite.isVertical }, mounted() { let name = this.cite.modeName if (name == 'U盘打印') { this.content = '如图所示,请先将存放打印资料的U盘插入打印终端机器上标记有"USB"字样的接口中,确认正确插入后,请按下面的“选取文件”按钮开始选取需要打印的资料。' this.btnName = '选取文件' this.playYp('Remind4PluginUSB') } else if (name == '扫描打印') { this.content = '如左图所示,请先把需要扫码的资料页面展开,将需要的版面朝上放置在机器的“扫描复印”口中,并保持页面纸张靠格口右上角紧贴放好,这时您可以在实时预览小窗中查看并确认是否是自己需要的版面。确认无误后,请按下面的“开始扫描”按钮开始资料的扫描。' this.btnName = '开始扫描' } else if (name == '身份证打印') { this.content = '身份证件信息已读取成功。请您核对个人信息确认无误后,按“信息无读,继续提按钮进行后续操作。此时您可以取回您的身份证卡片并妥善保存。' this.btnName = '开始读卡' this.playYp('ldCardReaderGuide') // this.$refs.audio.play() // this.speackFont('您好,请先将身份证水平放置在机器的“身份证”读卡窗口中,准备就绪后,请按下面的“开始读卡”开始身份证信息读取。') } } } </script> <style scoped lang="less"> .operationGuide { .box { width: 114.06rem; height: 42.13rem; background: #ffffff; box-shadow: 0rem 0.31rem 0.63rem 0.06rem rgba(0, 0, 0, 0.14); border-radius: 1.63rem; margin: 0 auto; .picture { margin-left: 4.75rem; img { width: 29.06rem; margin-left: 11.81rem; } .icon { margin-left: 0; width: 56rem; margin-bottom: 2.69rem; } .name { font-size: 2.13rem; font-weight: bold; color: #323232; line-height: 3rem; div { width: 30%; text-align: center; } } } .tip { margin-right: 7.81rem; width: 40rem; font-size: 2.25rem; font-weight: bold; color: #323232; line-height: 3rem; .title { font-size: 2.88rem; font-weight: bold; color: #d41212; line-height: 4.06rem; } .content { margin: 3rem auto 3.69rem; text-align: center; } .btn { width: 100%; height: 5.5rem; background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, #81d012 100%); border-radius: 1.25rem; font-size: 1.88rem; font-weight: 400; color: #ffffff; line-height: 2.63rem; cursor: pointer; } } } } .vertical-width-direction { width: 95% !important; flex-direction: column; height: 78rem !important; padding-bottom: 10rem; padding-top: 8rem; } .vertical-bottom-btn { margin-right: 0 !important; } .vertical-img-margin { margin-left: 0 !important; } </style>
<template> <!-- 操作指南--> <div class="operationGuide"> <navbar :name="name" /> <div :class="['box', 'flex-between', { 'vertical-width-direction': isVertical }]"> <div class="picture" v-show="name == 'U盘打印'"> <img class="icon" src="../assets/typeUp.png" /> <div class="flex-between name"> <div>U盘</div> <div>USB接口</div> </div> </div> <div class="picture" v-show="name == '扫描打印'"> <img src="../assets/typeSMFY.png" :class="[{ 'vertical-img-margin': isVertical }]" /> </div> <div class="picture" v-show="name == '身份证打印'"> <img src="../assets/typeSFZ.png" :class="[{ 'vertical-img-margin': isVertical }]" /> </div> <div :class="['tip', { 'vertical-bottom-btn': isVertical }]"> <div class="title">温馨提示</div> <div class="content">{{ content }}</div> <div class="btn flex-center" @click="skip('selectFile', name)">{{ btnName }}</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/IdCardReaderGuide.mp3" autoplay /> </audio> </div> </template> <script> import navbar from '@/components/nav' export default { name: 'operationGuide', components: { navbar }, provide() { return { title: this.tit, type: this.name } }, data() { return { tit: this.cite.modeName == 'U盘打印' ? '资料选取提交' : '资料扫描提交', name: this.cite.modeName, content: '', btnName: '', isVertical: false } }, methods: { skip(href, name) { this.$router.push({ name: href, params: { name: name } }) }, play(addr) { console.log(addr) let music = new Audio() music = addr this.$refs.audio.src = music this.$refs.audio.play() } }, created() { this.isVertical = this.cite.isVertical }, mounted() { let name = this.cite.modeName if (name == 'U盘打印') { this.content = '如图所示,请先将存放打印资料的U盘插入打印终端机器上标记有"USB"字样的接口中,确认正确插入后,请按下面的“选取文件”按钮开始选取需要打印的资料。' this.btnName = '选取文件' } else if (name == '扫描打印') { this.content = '如左图所示,请先把需要扫码的资料页面展开,将需要的版面朝上放置在机器的“扫描复印”口中,并保持页面纸张靠格口右上角紧贴放好,这时您可以在实时预览小窗中查看并确认是否是自己需要的版面。确认无误后,请按下面的“开始扫描”按钮开始资料的扫描。' this.btnName = '开始扫描' } else if (name == '身份证打印') { this.content = '身份证件信息已读取成功。请您核对个人信息确认无误后,按“信息无读,继续提按钮进行后续操作。此时您可以取回您的身份证卡片并妥善保存。' this.btnName = '开始读卡' // this.$refs.audio.play() // this.speackFont('您好,请先将身份证水平放置在机器的“身份证”读卡窗口中,准备就绪后,请按下面的“开始读卡”开始身份证信息读取。') } } } </script> <style scoped lang="less"> .operationGuide { .box { width: 114.06rem; height: 42.13rem; background: #ffffff; box-shadow: 0rem 0.31rem 0.63rem 0.06rem rgba(0, 0, 0, 0.14); border-radius: 1.63rem; margin: 0 auto; .picture { margin-left: 4.75rem; img { width: 29.06rem; margin-left: 11.81rem; } .icon { margin-left: 0; width: 56rem; margin-bottom: 2.69rem; } .name { font-size: 2.13rem; font-weight: bold; color: #323232; line-height: 3rem; div { width: 30%; text-align: center; } } } .tip { margin-right: 7.81rem; width: 40rem; font-size: 2.25rem; font-weight: bold; color: #323232; line-height: 3rem; .title { font-size: 2.88rem; font-weight: bold; color: #d41212; line-height: 4.06rem; } .content { margin: 3rem auto 3.69rem; text-align: center; } .btn { width: 100%; height: 5.5rem; background: linear-gradient(132deg, #52a39d 0%, #a1c553 50%, #81d012 100%); border-radius: 1.25rem; font-size: 1.88rem; font-weight: 400; color: #ffffff; line-height: 2.63rem; cursor: pointer; } } } } .vertical-width-direction { width: 95% !important; flex-direction: column; height: 78rem !important; padding-bottom: 10rem; padding-top: 8rem; } .vertical-bottom-btn { margin-right: 0 !important; } .vertical-img-margin { margin-left: 0 !important; } </style>
Show line notes below