|
@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
<div class="machine-index">
|
|
|
<div class="machine-index" >
|
|
|
<div v-show="step==3&&rsType!=3&&!inOut" class="back-btn" @click="onPrev">
|
|
|
<img src="./img/fanhui_icon.png" alt="">
|
|
|
<span>{{times}}s</span>
|
|
@ -10,67 +10,75 @@
|
|
|
<van-field v-model="deviceNum" clearable label="" placeholder="请输入设备编号" />
|
|
|
</div>
|
|
|
<div class="tc mt20">
|
|
|
<van-button color="#17b3ec" @click="init" type="primary"> 启动 </van-button>
|
|
|
<van-button color="#17b3ec" @click="init(1)" type="primary"> 启动 </van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-show="step==1" class="step-1">
|
|
|
<div class="title-banner ">
|
|
|
<img src="./img/biaoti_img.png" alt="">
|
|
|
</div>
|
|
|
|
|
|
<div class="video-swipe">
|
|
|
<van-swipe :touchable="false" :autoplay="0" indicator-color="white">
|
|
|
<template v-if="videoList&& videoList.length">
|
|
|
<van-swipe-item v-for="(item, i) in videoList" :key="i">
|
|
|
<video class="swipe-item-video" :autoplay="i==0" loop controls muted :src="setImgUrl(item.url)"></video>
|
|
|
</van-swipe-item>
|
|
|
</template>
|
|
|
<van-swipe-item v-else>
|
|
|
<video class="swipe-item-video" autoplay loop controls muted src="./img/default.mp4"></video>
|
|
|
</van-swipe-item>
|
|
|
</van-swipe>
|
|
|
<div v-if="isErr==1" class="error-page">
|
|
|
<img src="./img/machineErr.png" alt="">
|
|
|
<div class="text-tip">
|
|
|
<div class="">该设备维护暂停止使用</div>
|
|
|
<div>如需取药请到药房柜台</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="img-swipe">
|
|
|
<van-swipe :touchable="false" :autoplay="3000" indicator-color="white">
|
|
|
<template v-if="imgList && imgList.length">
|
|
|
<van-swipe-item v-for="(item, i) in imgList" :key="i">
|
|
|
<img class="swipe-item-img" :src="setImgUrl(item.url)">
|
|
|
<template v-else-if="isErr==2">
|
|
|
<div class="video-swipe">
|
|
|
<van-swipe ref="videoSwipe" @change="videoSwipeChange" :touchable="false" :autoplay="0" indicator-color="white">
|
|
|
<template v-if="videoList&& videoList.length">
|
|
|
<van-swipe-item v-for="(item, i) in videoList" :key="i">
|
|
|
<video class="swipe-item-video" @ended="playEnded($event, i)" :loop="videoList.length==1" :autoplay="i==0" muted :src="setImgUrl(item.url)"></video>
|
|
|
</van-swipe-item>
|
|
|
</template>
|
|
|
<van-swipe-item v-else>
|
|
|
<video class="swipe-item-video" loop autoplay muted src="./img/default.mp4"></video>
|
|
|
</van-swipe-item>
|
|
|
</template>
|
|
|
<van-swipe-item v-else>
|
|
|
<img class="swipe-item-img" src="./img/banner01.png">
|
|
|
</van-swipe-item>
|
|
|
</van-swipe>
|
|
|
</div>
|
|
|
|
|
|
<div class="banner-list kitbox">
|
|
|
<div class="item">
|
|
|
<img @click="curImg=1;illustrationMskShow=true" src="./img/btn_ccfsm.png" alt="">
|
|
|
<img @click="curImg=2;illustrationMskShow=true" src="./img/btn_qylc.png" alt="">
|
|
|
</van-swipe>
|
|
|
</div>
|
|
|
<div class="arrow">
|
|
|
<img src="./img/jiantou_icon.png" alt="">
|
|
|
|
|
|
<div class="img-swipe">
|
|
|
<van-swipe :touchable="false" :autoplay="3000" indicator-color="white">
|
|
|
<template v-if="imgList && imgList.length">
|
|
|
<van-swipe-item v-for="(item, i) in imgList" :key="i">
|
|
|
<img class="swipe-item-img" :src="setImgUrl(item.url)">
|
|
|
</van-swipe-item>
|
|
|
</template>
|
|
|
<van-swipe-item v-else>
|
|
|
<img class="swipe-item-img" src="./img/banner01.png">
|
|
|
</van-swipe-item>
|
|
|
</van-swipe>
|
|
|
</div>
|
|
|
<div class="item">
|
|
|
<img @click="step=2" src="./img/btn_saoma.png" alt="">
|
|
|
<img @click="sendReadCard" src="./img/btn_ybk.png" alt="">
|
|
|
|
|
|
<div class="banner-list kitbox">
|
|
|
<div class="item">
|
|
|
<img @click="curImg=1;illustrationMskShow=true" src="./img/btn_ccfsm.png" alt="">
|
|
|
<img @click="curImg=2;illustrationMskShow=true" src="./img/btn_qylc.png" alt="">
|
|
|
</div>
|
|
|
<div class="arrow">
|
|
|
<img src="./img/jiantou_icon.png" alt="">
|
|
|
</div>
|
|
|
<div class="item">
|
|
|
<img @click="step=2" src="./img/btn_saoma.png" alt="">
|
|
|
<img @click="sendReadCard" src="./img/btn_ybk.png" alt="">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="footer">
|
|
|
<img src="./img/erweima.png" alt="">
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
<img src="./img/erweima.png" alt="">
|
|
|
</div>
|
|
|
|
|
|
<div class="illustration-mask" v-show="illustrationMskShow">
|
|
|
<div class="illustration-inner">
|
|
|
<img v-show="curImg==1" class="pic" src="./img/chufang_tankang_img.png" alt="">
|
|
|
<img v-show="curImg==2" class="pic" src="./img/quyao_tankuang_img.png" alt="">
|
|
|
<div class="close">
|
|
|
<img @click="illustrationMskShow=false;curImg=''" src="./img/guanbi_btn.png" alt="">
|
|
|
<div class="illustration-mask" v-show="illustrationMskShow">
|
|
|
<div class="illustration-inner">
|
|
|
<img v-show="curImg==1" class="pic" src="./img/chufang_tankang_img.png" alt="">
|
|
|
<img v-show="curImg==2" class="pic" src="./img/quyao_tankuang_img.png" alt="">
|
|
|
<div class="close">
|
|
|
<img @click="illustrationMskShow=false;curImg=''" src="./img/guanbi_btn.png" alt="">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
|
|
|
<Scan @onComplete="onComplete" v-show="step==2" @onBack="step=1"/>
|
|
@ -90,6 +98,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
isErr: 0,
|
|
|
deviceNum: this.$route.query.deviceNum || '',//14912202107000001500000000000000 14912202111000001000000000000000
|
|
|
step: 0, //0启动页 1首页 2扫码页 3订单页
|
|
|
curImg: '',
|
|
@ -137,7 +146,7 @@ export default {
|
|
|
this.path = "wss://zb.xmtyw.cn/cabinet/websocket/"
|
|
|
}
|
|
|
if(this.deviceNum){
|
|
|
this.init()
|
|
|
this.init(1)
|
|
|
}
|
|
|
window.SetPrintPage = this.SetPrintPage
|
|
|
},
|
|
@ -195,6 +204,11 @@ export default {
|
|
|
cardNum, //社保卡号 //"DA7292254" ||
|
|
|
ehcCard //电子社保卡
|
|
|
}
|
|
|
|
|
|
// p = {
|
|
|
// deviceId: this.deviceNum, //设备编号
|
|
|
// cardNum: 'DD4517690'
|
|
|
// }
|
|
|
console.log('params', p)
|
|
|
medicineAbinetApi
|
|
|
.checkOrderAndReturnOrderList(p)
|
|
@ -207,6 +221,13 @@ export default {
|
|
|
return v.status===0
|
|
|
})
|
|
|
if(list.length){
|
|
|
list.forEach(v=>{
|
|
|
var allPrice = 0
|
|
|
v.drugList.forEach(d=>{
|
|
|
allPrice += d.price * Number(d.quantity)
|
|
|
})
|
|
|
v.price = allPrice.toFixed(2)
|
|
|
})
|
|
|
this.orderList = list || []
|
|
|
if(list.length == 1){
|
|
|
this.showOrderDetail(list[0])
|
|
@ -238,11 +259,30 @@ export default {
|
|
|
this.rsType = item.orderStatus==1? 1 : 2
|
|
|
this.step = 3
|
|
|
},
|
|
|
init: function() {
|
|
|
findById(){
|
|
|
this.$loading('加载中..')
|
|
|
let p = {
|
|
|
equNum: this.deviceNum
|
|
|
}
|
|
|
medicineAbinetApi
|
|
|
.findDeviceByIdNoLogin(p)
|
|
|
.then(res=>{
|
|
|
console.log('findDeviceByIdNoLogin', res)
|
|
|
this.$toast.clear()
|
|
|
this.isErr = res.obj.saleStatus==1? 2 : 1
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
init: function(type) {
|
|
|
if(!this.deviceNum){
|
|
|
return
|
|
|
}
|
|
|
this.devinfoAdvList()
|
|
|
if(type == 1){
|
|
|
this.findById()
|
|
|
this.devinfoAdvList()
|
|
|
}
|
|
|
if(!this.socketUrl){
|
|
|
this.socketUrl = this.path + this.deviceNum + "_T"
|
|
|
}
|
|
@ -266,7 +306,7 @@ export default {
|
|
|
this.heartbit()
|
|
|
},
|
|
|
error: function() {
|
|
|
this.$dialog.confirm({
|
|
|
this.$dialog.alert({
|
|
|
title: '',
|
|
|
message: '连接服务器失败',
|
|
|
confirmButtonText: "重试"
|
|
@ -611,6 +651,25 @@ export default {
|
|
|
console.error(err)
|
|
|
})
|
|
|
}, 15 * 1000)
|
|
|
},
|
|
|
videoSwipeChange(i){
|
|
|
var video = this.$refs.videoSwipe.$el.getElementsByTagName("video")[i]
|
|
|
video&&video.play()
|
|
|
return
|
|
|
var videoList = this.$refs.videoSwipe.$el.getElementsByTagName("video")
|
|
|
if(videoList.length > 1){
|
|
|
i++
|
|
|
if(i >= videoList.length){
|
|
|
i = 0
|
|
|
}
|
|
|
videoList[i].play()
|
|
|
}
|
|
|
},
|
|
|
playEnded(event, i){
|
|
|
if(this.videoList.length==1){
|
|
|
return
|
|
|
}
|
|
|
this.$refs.videoSwipe.next()
|
|
|
}
|
|
|
},
|
|
|
destroyed() {
|
|
@ -648,6 +707,18 @@ export default {
|
|
|
height: 100%;
|
|
|
display: block;
|
|
|
}
|
|
|
.van-swipe-item{
|
|
|
&::after{
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
z-index: 2;
|
|
|
opacity: 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.img-swipe{
|
|
@ -780,5 +851,21 @@ export default {
|
|
|
-moz-user-select: none;
|
|
|
-ms-user-select: none;
|
|
|
}
|
|
|
|
|
|
.error-page{
|
|
|
img{
|
|
|
display: block;
|
|
|
margin: 0 auto;
|
|
|
width: calc(1466px / 6);
|
|
|
margin-top: calc(325px / 6);
|
|
|
}
|
|
|
.text-tip{
|
|
|
margin-top: calc(100px / 6);
|
|
|
font-size: calc(150px / 6);
|
|
|
text-align: center;
|
|
|
line-height: calc(250px / 6);
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style>
|