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
e49e3d5
commit
1a389d1343913b24c9bb36cfb125265ac17b0902
hanfei
authored
on 8 Jan
Patch
Showing
4 changed files
src/components/global.vue
src/components/top.vue
src/utils/cite.js
src/views/device.vue
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 that.cite.orderInfoTop = res }).catch(error => { alert(error, that) }) if(this.citeL.zxPage) { bdSocket().then(res => { let {content, idCard, mgc, refreshAD, scan, udisk} = res if(idCard) { // 跳转到身份证打印 this.cite.modeName = '身份证打印' that.$router.push({ name: 'operationGuide', params: { name: '身份证打印' } }) }else if(refreshAD) { // 立即刷新广告 this.getAdvertisement() }else if(scan) { // 跳转到扫描打印 this.cite.modeName = '扫描打印' this.$router.push({ name: 'operationGuide', params: { name: '扫描打印' } }) }else if(udisk) { // 跳转到U盘打印 this.cite.modeName = 'U盘打印' this.$router.push({ name: 'operationGuide', params: { name: 'U盘打印' } }) }else if(mgc) { // 是否敏感词 this.mgcData = { show: true, re: content } this.numZt = 30 this.onNum() } }).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.zxPage = this.cite.onChange(this.code) 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 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 that.cite.orderInfoTop = 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.cite.modeName = '身份证打印' that.$router.push({ name: 'operationGuide', params: { name: '身份证打印' } }) }else if(refreshAD) { // 立即刷新广告 this.getAdvertisement() }else if(scan) { // 跳转到扫描打印 this.cite.modeName = '扫描打印' this.$router.push({ name: 'operationGuide', params: { name: '扫描打印' } }) }else if(udisk) { // 跳转到U盘打印 this.cite.modeName = 'U盘打印' this.$router.push({ name: 'operationGuide', params: { name: 'U盘打印' } }) }else if(mgc) { // 是否敏感词 this.mgcData = { show: true, re: content } this.numZt = 30 this.onNum() } }).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>
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 v-show="zxPage">网络状态:{{info.netStatus?'连通':'断开'}}</div> <div> 设备状态:{{info.deviceStatus=='NOT_ACTIVE'?'未激活':''}} {{info.deviceStatus=='ONLINE'?'在线':''}} {{info.deviceStatus=='0FFLINE'?'离线':''}} {{info.deviceStatus=='RUN'?'运行':''}} {{info.deviceStatus=='ABNORMAL'?'异常':''}} {{info.deviceStatus=='STOP'?'停用':''}} </div> </div> </div> </template> <script> export default { name: "top", data() { return { zxPage: false, info: '', 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 this.info = this.cite.orderInfoTop this.zxPage = this.cite.zxPage // console.log(this.cite.zxPage) 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" @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>网络状态:{{info.netStatus?'连通':'断开'}}</div> <div> 设备状态:{{info.deviceStatus=='NOT_ACTIVE'?'未激活':''}} {{info.deviceStatus=='ONLINE'?'在线':''}} {{info.deviceStatus=='0FFLINE'?'离线':''}} {{info.deviceStatus=='RUN'?'运行':''}} {{info.deviceStatus=='ABNORMAL'?'异常':''}} {{info.deviceStatus=='STOP'?'停用':''}} </div> </div> </div> </template> <script> export default { name: "top", data() { return { info: '', 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 console.log(this.cite.orderInfoTop) this.info = this.cite.orderInfoTop 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>
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 let orderInfoTop = {} let zxPage = false function onChange(code) { let msCode = [ '20240326-066184', '20240513-242406', '20240226-272018', '20240226-583456', '20240517-737857', '20240530-306590', '20240513-536851', ] console.log('code',code,zxPage) msCode.forEach(item=>{ if(item===code) { zxPage = true } }) return zxPage } export default { loadingSta, ztyc, printData, state, modeName, url, inWebURL, baseURL, facility, selectedFile, fileNum, parameter, orderId, code, memberLoginVo, name, advertisement, tlTime, isVertical, serveError, cqjqSta, orderInfoTop, zxPage, onChange }
// 引用地址 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 let orderInfoTop = {} export default { loadingSta, ztyc, printData, state, modeName, url, inWebURL, baseURL, facility, selectedFile, fileNum, parameter, orderId, code, memberLoginVo, name, advertisement, tlTime, isVertical, serveError, cqjqSta, orderInfoTop }
Ignore Space
Show notes
View
src/views/device.vue
<template> <div class="device"> <div :class="['box', 'flex-between', { 'vertical-width-direction': isVertical }]"> <div v-if="false" class="left"> <div v-if="advertisement == []" class="advertising icon1 flex-center">广告位招租</div> <div v-else class="advertising flex-center"> <img :src="advertisement[0].previewPath" model="scaleToFill" /> </div> </div> <div :class="['left', { 'vertical-width': isVertical }]"> <!-- <div class="zzc"></div> --> <div class="swiper-container"> <div class="swiper-wrapper"> <div v-for="(item, index) in advertisement" :key="index" class="swiper-slide"> <!-- 图片--> <div v-if="item.fileType == 'image/jpeg'" :class="['advertising', 'flex-center', { 'vertical-height': isVertical }]"> <img :src="item.previewPath" model="scaleToFill" /> </div> <div v-else-if="item.fileType == 'image/png'" :class="['advertising', 'flex-center', { 'vertical-height': isVertical }]"> <img :src="item.previewPath" model="scaleToFill" /> </div> <!-- 视频--> <div v-else :class="['advertising', 'flex-center', { 'vertical-height': isVertical }]"> <video v-if="index == swIndex" @pause="onPause" @timeupdate="onTimeupdate" @loadedmetadata="loadEdmetadata" :src="item.previewPath" autoplay muted style="width: 100%; height: 100%" ></video> </div> </div> </div> <div class="swiper-pagination"></div> </div> </div> <div v-if="false" class="left"> <!-- 广告--> <div v-if="advertisement == ''" class="advertising icon1 flex-center">广告位招租</div> <!-- 图片--> <div v-else-if="advertisement.fileType == 'image/png'" class="advertising icon1 flex-center"> <img :src="advertisement.previewPath" model="scaleToFill" /> </div> <!-- 视频--> <div v-else class="advertising icon1 flex-center"> <video :src="advertisement.outerChainPath" autoplay loop muted style="width: 100%; height: 100%"></video> </div> <div v-show="false" class="box2 flex-between"> <div class="main2 flex-center" @click="skip('explain', '联系客服')"> <img src="../assets/demo7.png" /> 联系客服 </div> <div class="main2 flex-center" @click="skip('explain', '价格查询')"> <img src="../assets/demo5.png" /> 价格查询 </div> </div> </div> <div class="right" v-if="!isVertical"> <div class="main4 flex-center"> <div> <!-- <div class="flex-center ewm" v-if="memberLoginVo!=''">--> <!-- <div class="zzc flex-center"></div>--> <!-- <VueQr :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')"--> <!-- :logoMargin="0"--> <!-- :logoScale=".2" :margin="0" :size="300" :text="''" logoBackgroundColor="white">--> <!-- </VueQr>--> <!-- </div>--> <div class="flex-center ewm" @click="openTip('staTip',true)"> <VueQr v-if="appSrc" :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="300" :text="appSrc" logoBackgroundColor="white" ></VueQr> </div> <div class="flex-center tip"> <img src="../assets/demo9.png" /> 扫码打印手机文件 </div> </div> </div> <!-- 功能--> <div class="feature"> <div class="main icon2 flex-start" @click="skip('operationGuide', 'U盘打印')"> <img src="../assets/demo2.png" /> <div>U盘打印</div> </div> <!-- <div class="main icon3 flex-start" :style="smdysta?'background: #ccc;':''" @click="skip('operationGuide', '扫描打印')">--> <!-- <img src="../assets/demo3.png" />--> <!-- <div>扫描打印</div>--> <!-- </div>--> <div class="main icon4 flex-start" @click="skip('operationGuide', '身份证打印')"> <img src="../assets/demo4.png" /> <div>身份证打印</div> </div> <div class="main icon5 flex-start" @click="skip('codeExtract', '取件码打印')"> <img class="qjmIcon" src="../assets/demo17.png" /> <div>取件码打印</div> </div> </div> </div> <!-- 竖版 --> <div class="right vertical-bottom vertical-width" v-if="isVertical"> <div class="main4 flex-center vertical-width50"> <div> <!-- <div class="flex-center ewm" v-if="memberLoginVo!=''">--> <!-- <div class="zzc flex-center"></div>--> <!-- <VueQr :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')"--> <!-- :logoMargin="0"--> <!-- :logoScale=".2" :margin="0" :size="300" :text="''" logoBackgroundColor="white">--> <!-- </VueQr>--> <!-- </div>--> <div class="flex-center ewm" @click="openTip('staTip',true)"> <VueQr v-if="appSrc" :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="300" :text="appSrc" logoBackgroundColor="white" ></VueQr> </div> <div class="flex-center tip"> <img src="../assets/demo9.png" /> 扫码打印手机文件 </div> </div> </div> <!-- 功能--> <div class="vertical-bottom-right"> <div class="main icon2 flex-start vertical-width" style="height: 8rem !important" @click="skip('operationGuide', 'U盘打印')"> <img src="../assets/demo2.png" /> <div>U盘打印</div> </div> <!-- <div class="main icon3 flex-start vertical-width50" @click="skip('operationGuide', '扫描打印')"> <img src="../assets/demo3.png" /> <div>扫描打印</div> </div> --> <div class="main icon4 flex-start vertical-width" style="height: 8rem !important" @click="skip('operationGuide', '身份证打印')"> <img src="../assets/demo4.png" /> <div>身份证打印</div> </div> <div class="main icon5 flex-start" style="height: 8rem !important" @click="skip('codeExtract', '取件码打印')"> <img class="qjmIcon" src="../assets/demo17.png" /> <div>取件码打印</div> </div> </div> </div> <div class="dbTip flex-between"> <div>机器编号:{{ cite.code }}</div> <!-- <div>机器状态:{{ cite.deviceStatus }}</div>--> <div>客服电话:{{ facility.servicePhone }}</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/ConnectingRemind.mp3" /> </audio> <!-- 小程序二维码弹窗--> <div class="onPopup" v-show="staTip"> <div class="curtain" @click="openTip('staTip')"></div> <div class="onBox ewmSm flex-between"> <img class="gbIcon" @click="openTip('staTip')" src="../assets/close.png"/> <div class="li" v-for="(item,index) in 2" :key="item"> <VueQr :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="260" :text="index==0?'https://mps.xlmalls.com/yn-shared-printer/yunying/yyd':'https://mps.xlmalls.com/files/ywd'" logoBackgroundColor="white" ></VueQr> <div class="name">{{index==0?'运营':'运维'}}端小程序</div> <div>扫码了解更多详情</div> </div> </div> </div> </div> </template> <script> import VueQr from 'vue-qr' import {gpyError} from "@/api/bdResultApi"; export default { name: 'device', components: { VueQr }, data() { return { swIndex: 0, mySwiper: '', appSrc: '', memberLoginVo: '', advertisement: '', facility: '', src: '', isVertical: false, playTimer: '', //播放的定时任务 errTimer: null, //异常的定时器 smdysta: false, staTip: false } }, methods: { openTip(name, sta=false) { this[name] = sta }, skip(href, name) { let { facility } = this let { sta, name2 } = '' facility.paperNumber.forEach(item => { if (item.name.indexOf('A4') != -1) { if (item.residue < 1) { name2 = '请联系管理员添加' + item.name sta = true } } }) if (sta == true) { this.cite.state = { name: name2, sta: true } return } // if (this.cite.memberLoginVo == '') { // this.cite.state = { // name: '请扫码登录设备再操作!', // sta: true // } // return // } if (href == 'operationGuide') { if(this.smdysta) { this.cite.state = { name: '高拍仪异常暂停使用,请联系客服维修!', sta: true } return; } this.cite.modeName = name } this.$router.push({ name: href, params: { name: name } }) }, gpyError() { let _this = this gpyError().then(res => { _this.smdysta = res }) }, load() { if (this.src == '') { this.src = this.cite.url setTimeout(() => { this.load() }, 1000) } }, GGT(T) { let _this = this this.mySwiper = new this.Swiper('.swiper-container', { // allowSlidePrev: false, // allowSlideNext: false, // 改变swiper样式时,自动初始化swiper observer: true, // 监测swiper父元素,如果有变化则初始化swiper observeParents: true, loop: true, autoplay: { delay: T, disableOnInteraction: false }, pagination: { el: '.swiper-pagination' }, on: { slideChangeTransitionEnd: function () { // console.log(this.realIndex); _this.swIndex = this.realIndex if (_this.advertisement[this.realIndex].fileType == 'video/mp4') { _this.bannerLoop(false) } } } }) }, bannerLoop(sta, n) { let _this = this if (sta) { _this.mySwiper.slideTo(n) _this.mySwiper.autoplay.start() } else { _this.mySwiper.autoplay.stop() } }, onPause() { let n = this.swIndex + 1 if (n == this.advertisement.length) { n = 1 } this.bannerLoop(true, n) }, onTimeupdate() { // console.log(123,e) }, // 正在加载中 loadEdmetadata() { // console.log(456,e) }, play(addr) { let music = new Audio() music = addr this.$refs.audio.src = music this.$refs.audio.play() } }, created() {}, mounted() { this.gpyError() this.load() if (window.outerWidth === 1080 || window.outerWidth === 1064) { this.cite.isVertical = true this.isVertical = true } else { this.cite.isVertical = false this.isVertical = false } // 判断是不是设备是不是异常 this.playTimer = setInterval(() => { console.log(this.cite.serveError) if (this.cite.serveError) { const addr = require('../assets/audio/ExceptionNotice.mp3') this.play(addr) } }, 60000) setInterval(() => { if (this.cite.advertisement != this.advertisement) { this.advertisement = this.cite.advertisement setTimeout(() => { this.GGT(this.advertisement[0].intervalTime * 1000) }, 500) } if (this.cite.facility != this.facility) { this.facility = this.cite.facility } if (this.cite.memberLoginVo != this.memberLoginVo) { this.memberLoginVo = this.cite.memberLoginVo } if (this.appSrc == '' && this.cite.code != '') { this.appSrc = 'https://mps.xlmalls.com/web/code/' + this.cite.code // this.appSrc = 'https://mps.xlmalls.com/web/payment/' + this.cite.code // this.appSrc = 'https://mps.xlmalls.com/web/' + this.cite.code // console.log(this.appSrc) } }, 300) }, destroyed() { clearInterval(this.playTimer) } } </script> <style lang="less" scoped> .device { margin: 2rem 2rem 0; .box { align-items: flex-start; position: relative; .left { width: 92.5rem; margin: 0; position: relative; z-index: 1; .advertising { width: 100%; height: 52rem; border-radius: 1.63rem; //margin-bottom: 1.88rem; cursor: pointer; overflow: hidden; font-size: 8rem; font-weight: 400; color: #ffffff; line-height: 8rem; img { width: 100%; height: 100%; } } .zzc { position: absolute; width: 100%; height: 100%; z-index: 99; left: 0; right: 0; } } .right { width: 22rem; } } .main { width: 100%; //height: 8rem; height: 6rem; border-radius: 1.63rem; //font-size: 1.8rem; font-size: 1.6rem; font-weight: 400; color: #ffffff; line-height: 1.8rem; margin-top: 1rem; img { width: 8rem; margin-top: -1rem; } } .icon1 { background: linear-gradient(359deg, #3dbf51 0%, #47d1a9 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(120, 229, 217, 0.45); } .icon2 { background: linear-gradient(180deg, #f2c952 0%, #db572b 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(255, 147, 128, 0.57); } .icon3 { background: linear-gradient(180deg, #84b2f7 0%, #8774d2 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(150, 135, 232, 0.3); } .icon4 { background: linear-gradient(180deg, #5be7ff 0%, #309fd8 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(104, 202, 253, 0.42); } .icon5 { background: linear-gradient(0deg, #F95555 0%, #DE2F2F 100%); box-shadow: 0 0 0.75rem 0 rgba(233, 63, 63, 0.53); } .feature { padding: 0 1.25rem; } .qjmIcon { width: 2.875rem!important; height: 4.5rem; margin: 0 41px!important; } .css1 { background: #ffffff; box-shadow: 0rem 0.63rem 1.25rem 0.06rem rgba(0, 0, 0, 0.14); border-radius: 1.63rem; cursor: pointer; } .main2 { width: 100%; height: 6.44rem; .css1(); font-size: 1.88rem; font-weight: bold; color: #323232; line-height: 2.63rem; img { width: 3.75rem; margin-right: 0.38rem; } } .main3 { width: 100%; height: 9.94rem; .css1(); font-size: 2.13rem; font-weight: bold; color: #323232; line-height: 3rem; img { width: 4.25rem; margin-right: 0.88rem; } } .main4 { width: 100%; height: 25rem; .css1(); font-size: 1.88rem; font-weight: 400; color: #323232; line-height: 2rem; .ewm { width: 18rem; height: 18rem; background: #ffffff; border: 0.06rem solid #707070; position: relative; img { width: 100%; margin: 0; } } .tip { margin-top: 1rem; } img { width: 2.31rem; margin-right: 1.19rem; } .zzc { position: absolute; background: #333; opacity: 0.5; top: 0; left: 0; width: 100%; height: 100%; } } .dbTip { position: fixed; bottom: 0; left: 0; right: 0; font-size: 1.2rem; font-weight: 400; color: #323232; height: 3rem; padding: 0 3rem; } } // 广告高度 .vertical-height { height: 72rem !important; } .vertical-width-direction { width: 100%; flex-direction: column; } .vertical-width { width: 100% !important; } .vertical-width50 { width: 48% !important; } .vertical-bottom { display: flex; // align-items: center; justify-content: space-between; flex-direction: row-reverse; margin-top: 2rem; } .vertical-bottom-right { width: 60%; margin-right: 2rem; display: flex; flex-direction: column; justify-content: space-around; } .onPopup { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 99; .curtain { background: #000; width: 100%; height: 100%; opacity: 0.3; } .onBox { position: absolute; left: 50%; margin-left: -22rem; top: 50%; margin-top: -13.4375rem; width: 44rem; height: 26.875rem; background: #FFFFFF; border-radius: 1.25rem; } .ewmSm { height: 24.625rem; padding-top: 2.25rem; .li { width: 100%; text-align: center; div { font-weight: 500; font-size: 1.25rem; color: #666666; line-height: 1.25rem; margin-top: 0.625rem; } .name { color: #333333; } } .gbIcon { position: absolute; width: 2rem; height: 2rem; top: 0.9375rem; right: 0.9375rem; } } } </style>
<template> <div class="device"> <div :class="['box', 'flex-between', { 'vertical-width-direction': isVertical }]"> <div v-if="false" class="left"> <div v-if="advertisement == []" class="advertising icon1 flex-center">广告位招租</div> <div v-else class="advertising flex-center"> <img :src="advertisement[0].previewPath" model="scaleToFill" /> </div> </div> <div :class="['left', { 'vertical-width': isVertical }]"> <!-- <div class="zzc"></div> --> <div class="swiper-container"> <div class="swiper-wrapper"> <div v-for="(item, index) in advertisement" :key="index" class="swiper-slide"> <!-- 图片--> <div v-if="item.fileType == 'image/jpeg'" :class="['advertising', 'flex-center', { 'vertical-height': isVertical }]"> <img :src="item.previewPath" model="scaleToFill" /> </div> <div v-else-if="item.fileType == 'image/png'" :class="['advertising', 'flex-center', { 'vertical-height': isVertical }]"> <img :src="item.previewPath" model="scaleToFill" /> </div> <!-- 视频--> <div v-else :class="['advertising', 'flex-center', { 'vertical-height': isVertical }]"> <video v-if="index == swIndex" @pause="onPause" @timeupdate="onTimeupdate" @loadedmetadata="loadEdmetadata" :src="item.previewPath" autoplay muted style="width: 100%; height: 100%" ></video> </div> </div> </div> <div class="swiper-pagination"></div> </div> </div> <div v-if="false" class="left"> <!-- 广告--> <div v-if="advertisement == ''" class="advertising icon1 flex-center">广告位招租</div> <!-- 图片--> <div v-else-if="advertisement.fileType == 'image/png'" class="advertising icon1 flex-center"> <img :src="advertisement.previewPath" model="scaleToFill" /> </div> <!-- 视频--> <div v-else class="advertising icon1 flex-center"> <video :src="advertisement.outerChainPath" autoplay loop muted style="width: 100%; height: 100%"></video> </div> <div v-show="false" class="box2 flex-between"> <div class="main2 flex-center" @click="skip('explain', '联系客服')"> <img src="../assets/demo7.png" /> 联系客服 </div> <div class="main2 flex-center" @click="skip('explain', '价格查询')"> <img src="../assets/demo5.png" /> 价格查询 </div> </div> </div> <div class="right" v-if="!isVertical"> <div class="main4 flex-center"> <div> <!-- <div class="flex-center ewm" v-if="memberLoginVo!=''">--> <!-- <div class="zzc flex-center"></div>--> <!-- <VueQr :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')"--> <!-- :logoMargin="0"--> <!-- :logoScale=".2" :margin="0" :size="300" :text="''" logoBackgroundColor="white">--> <!-- </VueQr>--> <!-- </div>--> <div class="flex-center ewm" @click="openTip('staTip',true)"> <VueQr v-if="appSrc" :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="300" :text="appSrc" logoBackgroundColor="white" ></VueQr> </div> <div class="flex-center tip"> <img src="../assets/demo9.png" /> 扫码打印手机文件 </div> </div> </div> <!-- 功能--> <div class="feature"> <div class="main icon2 flex-start" @click="skip('operationGuide', 'U盘打印')"> <img src="../assets/demo2.png" /> <div>U盘打印</div> </div> <!-- <div class="main icon3 flex-start" :style="smdysta?'background: #ccc;':''" @click="skip('operationGuide', '扫描打印')">--> <!-- <img src="../assets/demo3.png" />--> <!-- <div>扫描打印</div>--> <!-- </div>--> <div class="main icon4 flex-start" @click="skip('operationGuide', '身份证打印')"> <img src="../assets/demo4.png" /> <div>身份证打印</div> </div> <div class="main icon5 flex-start" @click="skip('codeExtract', '取件码打印')"> <img class="qjmIcon" src="../assets/demo17.png" /> <div>取件码打印</div> </div> </div> </div> <!-- 竖版 --> <div class="right vertical-bottom vertical-width" v-if="isVertical"> <div class="main4 flex-center vertical-width50"> <div> <!-- <div class="flex-center ewm" v-if="memberLoginVo!=''">--> <!-- <div class="zzc flex-center"></div>--> <!-- <VueQr :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')"--> <!-- :logoMargin="0"--> <!-- :logoScale=".2" :margin="0" :size="300" :text="''" logoBackgroundColor="white">--> <!-- </VueQr>--> <!-- </div>--> <div class="flex-center ewm" @click="openTip('staTip',true)"> <VueQr v-if="appSrc" :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="300" :text="appSrc" logoBackgroundColor="white" ></VueQr> </div> <div class="flex-center tip"> <img src="../assets/demo9.png" /> 扫码打印手机文件 </div> </div> </div> <!-- 功能--> <div class="vertical-bottom-right"> <div class="main icon2 flex-start vertical-width" style="height: 8rem !important" @click="skip('operationGuide', 'U盘打印')"> <img src="../assets/demo2.png" /> <div>U盘打印</div> </div> <!-- <div class="main icon3 flex-start vertical-width50" @click="skip('operationGuide', '扫描打印')"> <img src="../assets/demo3.png" /> <div>扫描打印</div> </div> --> <div class="main icon4 flex-start vertical-width" style="height: 8rem !important" @click="skip('operationGuide', '身份证打印')"> <img src="../assets/demo4.png" /> <div>身份证打印</div> </div> <div class="main icon5 flex-start" style="height: 8rem !important" @click="skip('codeExtract', '取件码打印')"> <img class="qjmIcon" src="../assets/demo17.png" /> <div>取件码打印</div> </div> </div> </div> <div class="dbTip flex-between"> <div>机器编号:{{ cite.code }}</div> <div>机器状态:{{ cite.deviceStatus }}</div> <div>客服电话:{{ facility.servicePhone }}</div> </div> </div> <audio ref="audio" class="aud"> <source src="../assets/audio/ConnectingRemind.mp3" /> </audio> <!-- 小程序二维码弹窗--> <div class="onPopup" v-show="staTip"> <div class="curtain" @click="openTip('staTip')"></div> <div class="onBox ewmSm flex-between"> <img class="gbIcon" @click="openTip('staTip')" src="../assets/close.png"/> <div class="li" v-for="(item,index) in 2" :key="item"> <VueQr :auto-color="true" :dot-scale="1" :logo-src="require('@/assets/logo.png')" :logoMargin="0" :logoScale="0.2" :margin="0" :size="260" :text="index==0?'https://mps.xlmalls.com/yn-shared-printer/yunying/yyd':'https://mps.xlmalls.com/files/ywd'" logoBackgroundColor="white" ></VueQr> <div class="name">{{index==0?'运营':'运维'}}端小程序</div> <div>扫码了解更多详情</div> </div> </div> </div> </div> </template> <script> import VueQr from 'vue-qr' import {gpyError} from "@/api/bdResultApi"; export default { name: 'device', components: { VueQr }, data() { return { swIndex: 0, mySwiper: '', appSrc: '', memberLoginVo: '', advertisement: '', facility: '', src: '', isVertical: false, playTimer: '', //播放的定时任务 errTimer: null, //异常的定时器 smdysta: false, staTip: false } }, methods: { openTip(name, sta=false) { this[name] = sta }, skip(href, name) { let { facility } = this let { sta, name2 } = '' facility.paperNumber.forEach(item => { if (item.name.indexOf('A4') != -1) { if (item.residue < 1) { name2 = '请联系管理员添加' + item.name sta = true } } }) if (sta == true) { this.cite.state = { name: name2, sta: true } return } // if (this.cite.memberLoginVo == '') { // this.cite.state = { // name: '请扫码登录设备再操作!', // sta: true // } // return // } if (href == 'operationGuide') { if(this.smdysta) { this.cite.state = { name: '高拍仪异常暂停使用,请联系客服维修!', sta: true } return; } this.cite.modeName = name } this.$router.push({ name: href, params: { name: name } }) }, gpyError() { let _this = this gpyError().then(res => { _this.smdysta = res }) }, load() { if (this.src == '') { this.src = this.cite.url setTimeout(() => { this.load() }, 1000) } }, GGT(T) { let _this = this this.mySwiper = new this.Swiper('.swiper-container', { // allowSlidePrev: false, // allowSlideNext: false, // 改变swiper样式时,自动初始化swiper observer: true, // 监测swiper父元素,如果有变化则初始化swiper observeParents: true, loop: true, autoplay: { delay: T, disableOnInteraction: false }, pagination: { el: '.swiper-pagination' }, on: { slideChangeTransitionEnd: function () { // console.log(this.realIndex); _this.swIndex = this.realIndex if (_this.advertisement[this.realIndex].fileType == 'video/mp4') { _this.bannerLoop(false) } } } }) }, bannerLoop(sta, n) { let _this = this if (sta) { _this.mySwiper.slideTo(n) _this.mySwiper.autoplay.start() } else { _this.mySwiper.autoplay.stop() } }, onPause() { let n = this.swIndex + 1 if (n == this.advertisement.length) { n = 1 } this.bannerLoop(true, n) }, onTimeupdate() { // console.log(123,e) }, // 正在加载中 loadEdmetadata() { // console.log(456,e) }, play(addr) { let music = new Audio() music = addr this.$refs.audio.src = music this.$refs.audio.play() } }, created() {}, mounted() { this.gpyError() this.load() if (window.outerWidth === 1080 || window.outerWidth === 1064) { this.cite.isVertical = true this.isVertical = true } else { this.cite.isVertical = false this.isVertical = false } // 判断是不是设备是不是异常 this.playTimer = setInterval(() => { console.log(this.cite.serveError) if (this.cite.serveError) { const addr = require('../assets/audio/ExceptionNotice.mp3') this.play(addr) } }, 60000) setInterval(() => { if (this.cite.advertisement != this.advertisement) { this.advertisement = this.cite.advertisement setTimeout(() => { this.GGT(this.advertisement[0].intervalTime * 1000) }, 500) } if (this.cite.facility != this.facility) { this.facility = this.cite.facility } if (this.cite.memberLoginVo != this.memberLoginVo) { this.memberLoginVo = this.cite.memberLoginVo } if (this.appSrc == '' && this.cite.code != '') { this.appSrc = 'https://mps.xlmalls.com/web/code/' + this.cite.code // this.appSrc = 'https://mps.xlmalls.com/web/payment/' + this.cite.code // this.appSrc = 'https://mps.xlmalls.com/web/' + this.cite.code // console.log(this.appSrc) } }, 300) }, destroyed() { clearInterval(this.playTimer) } } </script> <style lang="less" scoped> .device { margin: 2rem 2rem 0; .box { align-items: flex-start; position: relative; .left { width: 92.5rem; margin: 0; position: relative; z-index: 1; .advertising { width: 100%; height: 52rem; border-radius: 1.63rem; //margin-bottom: 1.88rem; cursor: pointer; overflow: hidden; font-size: 8rem; font-weight: 400; color: #ffffff; line-height: 8rem; img { width: 100%; height: 100%; } } .zzc { position: absolute; width: 100%; height: 100%; z-index: 99; left: 0; right: 0; } } .right { width: 22rem; } } .main { width: 100%; //height: 8rem; height: 6rem; border-radius: 1.63rem; //font-size: 1.8rem; font-size: 1.6rem; font-weight: 400; color: #ffffff; line-height: 1.8rem; margin-top: 1rem; img { width: 8rem; margin-top: -1rem; } } .icon1 { background: linear-gradient(359deg, #3dbf51 0%, #47d1a9 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(120, 229, 217, 0.45); } .icon2 { background: linear-gradient(180deg, #f2c952 0%, #db572b 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(255, 147, 128, 0.57); } .icon3 { background: linear-gradient(180deg, #84b2f7 0%, #8774d2 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(150, 135, 232, 0.3); } .icon4 { background: linear-gradient(180deg, #5be7ff 0%, #309fd8 100%); box-shadow: 0rem 1.25rem 1.25rem 0.06rem rgba(104, 202, 253, 0.42); } .icon5 { background: linear-gradient(0deg, #F95555 0%, #DE2F2F 100%); box-shadow: 0 0 0.75rem 0 rgba(233, 63, 63, 0.53); } .feature { padding: 0 1.25rem; } .qjmIcon { width: 2.875rem!important; height: 4.5rem; margin: 0 41px!important; } .css1 { background: #ffffff; box-shadow: 0rem 0.63rem 1.25rem 0.06rem rgba(0, 0, 0, 0.14); border-radius: 1.63rem; cursor: pointer; } .main2 { width: 100%; height: 6.44rem; .css1(); font-size: 1.88rem; font-weight: bold; color: #323232; line-height: 2.63rem; img { width: 3.75rem; margin-right: 0.38rem; } } .main3 { width: 100%; height: 9.94rem; .css1(); font-size: 2.13rem; font-weight: bold; color: #323232; line-height: 3rem; img { width: 4.25rem; margin-right: 0.88rem; } } .main4 { width: 100%; height: 25rem; .css1(); font-size: 1.88rem; font-weight: 400; color: #323232; line-height: 2rem; .ewm { width: 18rem; height: 18rem; background: #ffffff; border: 0.06rem solid #707070; position: relative; img { width: 100%; margin: 0; } } .tip { margin-top: 1rem; } img { width: 2.31rem; margin-right: 1.19rem; } .zzc { position: absolute; background: #333; opacity: 0.5; top: 0; left: 0; width: 100%; height: 100%; } } .dbTip { position: fixed; bottom: 0; left: 0; right: 0; font-size: 1.2rem; font-weight: 400; color: #323232; height: 3rem; padding: 0 3rem; } } // 广告高度 .vertical-height { height: 72rem !important; } .vertical-width-direction { width: 100%; flex-direction: column; } .vertical-width { width: 100% !important; } .vertical-width50 { width: 48% !important; } .vertical-bottom { display: flex; // align-items: center; justify-content: space-between; flex-direction: row-reverse; margin-top: 2rem; } .vertical-bottom-right { width: 60%; margin-right: 2rem; display: flex; flex-direction: column; justify-content: space-around; } .onPopup { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 99; .curtain { background: #000; width: 100%; height: 100%; opacity: 0.3; } .onBox { position: absolute; left: 50%; margin-left: -22rem; top: 50%; margin-top: -13.4375rem; width: 44rem; height: 26.875rem; background: #FFFFFF; border-radius: 1.25rem; } .ewmSm { height: 24.625rem; padding-top: 2.25rem; .li { width: 100%; text-align: center; div { font-weight: 500; font-size: 1.25rem; color: #666666; line-height: 1.25rem; margin-top: 0.625rem; } .name { color: #333333; } } .gbIcon { position: absolute; width: 2rem; height: 2rem; top: 0.9375rem; right: 0.9375rem; } } } </style>
Show line notes below