This commit is contained in:
xingyy 2023-12-20 09:42:40 +08:00
parent fedcb33d15
commit c3ff3708c6

View File

@ -58,10 +58,21 @@
<div class="wrap1_2_2">预约日期:{{item.date?.replaceAll('/','.')}}</div> <div class="wrap1_2_2">预约日期:{{item.date?.replaceAll('/','.')}}</div>
<div class="wrap1_2_2">预约类型:{{item.isBlindBox===1?'正常预约':'盲盒预约'}}</div> <div class="wrap1_2_2">预约类型:{{item.isBlindBox===1?'正常预约':'盲盒预约'}}</div>
</div> </div>
<div class="wrap1_3" @click="goViewVenues" :style="{backgroundColor:item.isBlindBox===2?'#000':''}"> <div class="wrap1_3" :style="{backgroundColor:item.isBlindBox===2?'#000':''}">
<image v-if="item.isBlindBox===1" src="../../static/zu762@3x.png" alt=""/> <image @click="goViewVenues" v-if="item.isBlindBox===1" src="../../static/zu762@3x.png" alt=""/>
<image v-if="item.isBlindBox===2" style="width: 79rpx;height: 34rpx" src="../../static/zu1216@3x.png" alt=""/> <image @click="exchange" 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">
<div class="content8">
<div class="wrap1">领取成功</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>
</tm-drawer>
</div> </div>
</div> </div>
</div> </div>
@ -69,10 +80,12 @@
<script setup> <script setup>
import {ref} from 'vue' import {ref} from 'vue'
import {onShow} from "@dcloudio/uni-app"; import {onShow} from "@dcloudio/uni-app";
import {historicalTickets, unusedTickets} from "@/http/apis"; import {extractingBlindBoxes, getQrCode, historicalTickets, unusedTickets} from "@/http/apis";
const modeClass = ref('') const modeClass = ref('')
const currentTab = ref(0) const currentTab = ref(0)
const showWin4=ref(false)
const show = ref(true) const show = ref(true)
const imageSrc=ref('')
const userInfo = ref(uni.getStorageSync('userInfo') ?? {}) const userInfo = ref(uni.getStorageSync('userInfo') ?? {})
onShow(() => { onShow(() => {
show.value = true show.value = true
@ -123,6 +136,27 @@ const switchOptions=async (num)=>{
} }
currentTab.value=num currentTab.value=num
} }
const exchange=async ()=>{
const data={
"userName": userInfo.value.realName, //
"idCard": userInfo.value.idNum, //
"phone": userInfo.value.telNum, //
"blindBoxName": "博物馆开馆纪念盲盒" //
}
const res=await extractingBlindBoxes(data)
if (res.code===0){
uni.showToast({
title: res.msg,
icon:'success',
duration: 1000
})
}else if (res.code===200){
const res1= await getQrCode({appointUid:res.data.appointmentUid})
const arrayBuffer = new Uint8Array(res1)
imageSrc.value = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBuffer)
showWin4.value=true
}
}
const goViewVenues = () => { const goViewVenues = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/view-venues/index' url: '/pages/view-venues/index'