This commit is contained in:
xingyy 2024-01-02 09:50:29 +08:00
parent 465a71fde2
commit dc1390fcaa

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="pb-50 text grey " > <view class="pb-50 text grey " >
<tm-menubars title="访客申请" color="bg-gradient-blue-accent" ></tm-menubars> <tm-menubars title="访客申请" color="bg-gradient-blue-accent" :showback="false"></tm-menubars>
<tm-message ref="toast"></tm-message>
<tm-sheet :shadow="24" :padding="[12,24]" :margin="[24,24]"> <tm-sheet :shadow="24" :padding="[12,24]" :margin="[24,24]">
<view class="py-12 px-24 mx-12 round-3 border-b-1 grey text" > <view class="py-12 px-24 mx-12 round-3 border-b-1 grey text" >
<text class="text-size-n text-weight-b ">当前设备编号{{sn}}</text> <text class="text-size-n text-weight-b ">当前设备编号{{sn}}</text>
@ -92,6 +92,8 @@ export default {
uni.showToast({ title: '请输入接待人姓名', icon: 'none' }); uni.showToast({ title: '请输入接待人姓名', icon: 'none' });
return return
} }
this.$refs.toast.show({model:'load',mask:true})
uni.request({ uni.request({
method:'post', method:'post',
url:'https://erpapi.fontree.cn/secret/visitor', url:'https://erpapi.fontree.cn/secret/visitor',
@ -100,7 +102,13 @@ export default {
if (res.data.code===200){ if (res.data.code===200){
uni.showToast({ title: '提交成功', icon: 'none' }); uni.showToast({ title: '提交成功', icon: 'none' });
}else { }else {
uni.showToast({ title: res.data.msg, icon: 'none' }); this.$refs.toast.hide()
if (!res.data.msg){
uni.showToast({ title: '服务器错误', icon: 'none' });
}else {
uni.showToast({ title: res.data.msg, icon: 'none' });
}
} }
} }
}) })