submit
This commit is contained in:
parent
731ad48407
commit
2c0698910e
@ -85,3 +85,9 @@ export const getTicketPerInfo= (data) => {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const socketImg= (data) => {
|
||||||
|
return uniReq.post({
|
||||||
|
url: '/api/smart/appointment/pass/picUrl',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/home/index",
|
"path": "pages/home/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
|
@ -14,37 +14,66 @@
|
|||||||
|
|
||||||
</camera>
|
</camera>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content3" @click="submit">
|
<div class="content3" @click="submit">
|
||||||
提交
|
点击拍摄
|
||||||
</div>
|
</div>
|
||||||
|
<tm-drawer inContent :width="700" :height="800" hide-header ref="calendarView" placement="center" v-model:show="showWin2">
|
||||||
|
<div class="content4">
|
||||||
|
<div class="wrap1">
|
||||||
|
<image :src="tempImage"></image>
|
||||||
|
</div>
|
||||||
|
<div class="wrap2" @click="submitFace">提交</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</tm-drawer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import displayBox from '../../components/display-box/index.vue'
|
import displayBox from '../../components/display-box/index.vue'
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import {getInfo, updateInfo} from "@/http/apis";
|
import {getInfo, socketImg, updateInfo, upload} from "@/http/apis";
|
||||||
const msg=ref(null)
|
const msg=ref(null)
|
||||||
|
const showWin2=ref(false)
|
||||||
|
const statusValue=ref(0)
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
const res=await getInfo()
|
const res=await getInfo()
|
||||||
if (res.code===200){
|
if (res.code===200){
|
||||||
uni.setStorageSync('userInfo',res.data);
|
uni.setStorageSync('userInfo',res.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const submit=async ()=>{
|
const submitFace=async ()=>{
|
||||||
const res=await updateInfo({
|
const res1= await upload({
|
||||||
idNum:idInfo.value.idCard,
|
name:'file',
|
||||||
realName:idInfo.value.name
|
filePath:tempImage.value
|
||||||
})
|
})
|
||||||
if (res.code===200){
|
const res= await socketImg({
|
||||||
uni.showToast({
|
appointmentUid: uni.getStorageSync('ticket').appointmentUid,
|
||||||
title: '实名成功',
|
imageUrl: res1.data.path
|
||||||
icon: 'none',
|
})
|
||||||
duration: 1000
|
if (res.code===200){
|
||||||
})
|
uni.showToast({
|
||||||
getUserInfo()
|
title:'提交成功',
|
||||||
uni.navigateBack()
|
icon: 'none',
|
||||||
|
duration: 50000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const tempImage=ref('')
|
||||||
|
const submit=async ()=>{
|
||||||
|
if (statusValue.value===0){
|
||||||
|
const ctx = uni.createCameraContext();
|
||||||
|
ctx.takePhoto({
|
||||||
|
quality: 'high',
|
||||||
|
success: (res) => {
|
||||||
|
tempImage.value=res.tempImagePath
|
||||||
|
showWin2.value=true
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const idInfo=ref({
|
const idInfo=ref({
|
||||||
@ -57,6 +86,32 @@ const validateIDCardNumber=(idNumber)=> {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.content4{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding-right: 20rpx;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
.wrap1{
|
||||||
|
margin-top: 50rpx;
|
||||||
|
image{
|
||||||
|
width: 600rpx;
|
||||||
|
height: 600rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wrap2{
|
||||||
|
margin-top: 40rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 436rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
background-color: #000;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.container{
|
.container{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -69,6 +124,7 @@ const validateIDCardNumber=(idNumber)=> {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
background-image: url('https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/16968647-fc99-46fe-b95c-620c55b7646f.png');
|
background-image: url('https://cdns.fontree.cn/fonchain-main/prod/image/1833/avatar/16968647-fc99-46fe-b95c-620c55b7646f.png');
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
|
|
||||||
.content3{
|
.content3{
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
@ -61,15 +61,14 @@
|
|||||||
<image @click="goViewVenues(item)" v-if="item.isBlindBox===1" src="../../static/zu762@3x.png" alt=""/>
|
<image @click="goViewVenues(item)" v-if="item.isBlindBox===1" src="../../static/zu762@3x.png" alt=""/>
|
||||||
<image @click.stop="exchange(item)" v-if="item.isBlindBox===2" style="width: 79rpx;height: 34rpx" src="../../static/zu1216@3x.png" alt=""/>
|
<image @click.stop="exchange(item)" v-if="item.isBlindBox===2" style="width: 79rpx;height: 34rpx" src="../../static/zu1216@3x.png" alt=""/>
|
||||||
</div>
|
</div>
|
||||||
<tm-drawer hideHeader :width="510" :height="636" ref="calendarView" placement="center" v-model:show="showWin4">
|
<tm-drawer hideHeader :width="510" :height="606" ref="calendarView" placement="center" v-model:show="showWin4">
|
||||||
<div class="content8">
|
<div class="content8">
|
||||||
<div class="wrap1">领取成功</div>
|
<div class="wrap1">{{ticketInfo?.ticketName}}</div>
|
||||||
<div class="wrap2">1人1码请与工作人员核验领取</div>
|
<div class="wrap2">1人1码请与工作人员核验领取</div>
|
||||||
<div class="wrap3">
|
<div class="wrap3">
|
||||||
<image :src="imageSrc"></image>
|
<image :src="imageSrc"></image>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap4" @click="showWin4=false">确定</div>
|
<div class="wrap4" :style="{backgroundColor:ticketInfo?.status===3?'#AFAFAF':''}" @click="showWin4=false">{{ticketInfo?.status===3?'已核验':'未核验'}}</div>
|
||||||
<div class="wrap5">*可从“我的票库”查看</div>
|
|
||||||
</div>
|
</div>
|
||||||
</tm-drawer>
|
</tm-drawer>
|
||||||
</div>
|
</div>
|
||||||
@ -85,6 +84,9 @@ const currentTab = ref(0)
|
|||||||
const showWin4=ref(false)
|
const showWin4=ref(false)
|
||||||
const show = ref(true)
|
const show = ref(true)
|
||||||
const imageSrc=ref('')
|
const imageSrc=ref('')
|
||||||
|
const ticket=()=>{
|
||||||
|
return uni.getStorageSync('ticket')
|
||||||
|
}
|
||||||
const userInfo =()=>{
|
const userInfo =()=>{
|
||||||
return uni.getStorageSync('userInfo')
|
return uni.getStorageSync('userInfo')
|
||||||
}
|
}
|
||||||
@ -145,11 +147,15 @@ const switchOptions=async (num)=>{
|
|||||||
}
|
}
|
||||||
currentTab.value=num
|
currentTab.value=num
|
||||||
}
|
}
|
||||||
|
const ticketInfo=ref(null)
|
||||||
const exchange=async (item)=>{
|
const exchange=async (item)=>{
|
||||||
const res1= await getQrCode({appointUid:item.appointmentUid})
|
const res1= await getQrCode({appointUid:item.appointmentUid})
|
||||||
const arrayBuffer = new Uint8Array(res1)
|
const arrayBuffer = new Uint8Array(res1)
|
||||||
imageSrc.value = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBuffer)
|
imageSrc.value = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBuffer)
|
||||||
|
ticketInfo.value=item
|
||||||
|
uni.setStorageSync('ticket',item)
|
||||||
showWin4.value=true
|
showWin4.value=true
|
||||||
|
|
||||||
uni.connectSocket({
|
uni.connectSocket({
|
||||||
url: `ws://warehouse.szjixun.cn/ticket/api/smart/appointment/subscribe/msg?AppointmentUid=${item.appointmentUid}`,
|
url: `ws://warehouse.szjixun.cn/ticket/api/smart/appointment/subscribe/msg?AppointmentUid=${item.appointmentUid}`,
|
||||||
success: function() {
|
success: function() {
|
||||||
@ -161,10 +167,15 @@ const exchange=async (item)=>{
|
|||||||
});
|
});
|
||||||
uni.onSocketMessage((res)=>{
|
uni.onSocketMessage((res)=>{
|
||||||
if (res.data==='start the camera'){
|
if (res.data==='start the camera'){
|
||||||
uni.closeSocket()
|
/* uni.closeSocket()*/
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/face-auth/index'
|
url: '/pages/face-auth/index'
|
||||||
})
|
})
|
||||||
|
}else if (res.data==='Check Finish'){
|
||||||
|
uni.closeSocket()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/index?acc=1'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
console.log('WebSocket接收到消息:', res);
|
console.log('WebSocket接收到消息:', res);
|
||||||
|
|
||||||
@ -215,7 +226,7 @@ const goSetUp = () => {
|
|||||||
}
|
}
|
||||||
.wrap4{
|
.wrap4{
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
width: 436rpx;
|
width: 134rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
background-color:#F7963B;
|
background-color:#F7963B;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
Loading…
Reference in New Issue
Block a user