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