You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
3.8 KiB
Vue

9 months ago
<template>
<div class="main">
9 months ago
<up-button type="primary" :text="'审核员 ' + name" shape="circle" color="#AB2F23" style="width:700rpx "></up-button>
9 months ago
<image src="" mode="scaleToFill" class="img" style="" />
<card>
<template #l1>
<div class="box-left">
姓名
</div>
</template>
<template #r1>
9 months ago
{{ userInfo[0]?.userName }}
9 months ago
</template>
<template #l2>
<div class="box-left">
身份证号
</div>
</template>
<template #r2>
<div class="box-right">
9 months ago
{{ userInfo[0]?.idCard }}
9 months ago
</div>
</template>
<template #l3>
<div class="box-left">
领票日期
</div>
</template>
<template #r3>
9 months ago
{{ ticketsInfo.drawDay }}
9 months ago
</template>
<template #l4>
<div class="box-left">
核验项目
</div>
</template>
<template #r4>
9 months ago
{{ ticketsInfo.ticketName }}
9 months ago
</template>
9 months ago
<template #l5 v-if="userInfo[0]?.checkTime">
9 months ago
<div class="box-left">
核验日期
</div>
</template>
9 months ago
<template #r5 v-if="userInfo[0]?.checkTime">
{{ userInfo[0]?.checkTime }}
9 months ago
</template>
</card>
9 months ago
<up-button type="primary" text="核验人像" shape="circle" color="#000" style="width:436rpx " @click="checkPerson"
v-if="ticketsInfo.status === 1"></up-button>
9 months ago
</div>
</template>
<script setup>
import card from '@/components/card/index.vue'
9 months ago
import { reactive } from "vue";
9 months ago
import { onLoad } from "@dcloudio/uni-app"
9 months ago
import { ref, getCurrentInstance } from 'vue';
const currentInstance = getCurrentInstance();
const { $request } =
currentInstance.appContext.config.globalProperties;
9 months ago
onLoad((option) => {
console.log(option);
getQrInfo()
});
9 months ago
let ticketsInfo = reactive({})
let userInfo = ref([])
const name = ref(uni.getStorageSync('nickName'))
9 months ago
const getQrInfo = () => {
9 months ago
$request.qrCodeInfo({ appointmentUid: 'd7db1538-eb98-4ef8-86ed-0400adcee6ac' }).then((res) => {
9 months ago
if (res.status === 0) {
9 months ago
ticketsInfo = res.data.ticketsInfo
userInfo.value = res.data.userInfo
console.log(res.data.userInfo)
} else {
uni.$u.toast(res.msg);
}
})
}
const checkPerson = () => {
uni.connectSocket({
url: `ws://warehouse.szjixun.cn/ticket/api/smart/check/issue/msg?AppointmentUid=d7db1538-eb98-4ef8-86ed-0400adcee6ac`,
success: function () {
console.log('WebSocket连接已创建成功');
}
});
uni.onSocketOpen((res) => {
console.log(res, 'onSocketOpen')
});
uni.onSocketMessage((res) => {
console.log('WebSocket接收到消息', res);
if (res.data) {
checkQr(res.data)
}
});
uni.onSocketError(function (res) {
console.log(res);
});
9 months ago
9 months ago
}
const checkQr = (img) => {
$request.checkQr({
appointmentUid: '',
imageUrl: img
}).then((res) => {
if (res.status === 0) {
getQrInfo()
} else {
uni.$u.toast(res.msg);
9 months ago
}
})
}
9 months ago
</script>
<style lang="scss" scoped>
.main {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-around;
background: url('@/static/bg.png');
background-size: cover;
box-sizing: border-box;
padding: 42rpx 26rpx;
.img {
width: 100%;
height: 354rpx;
margin-top: 40rpx;
}
.box-left {
font-size: 28rpx;
}
}
</style>