From eab282f1e8e5842d0efdacc331ac2c3dcd7d90d6 Mon Sep 17 00:00:00 2001
From: xingyy <373639591@qq.com>
Date: Tue, 9 Jan 2024 15:31:13 +0800
Subject: [PATCH] submit
---
pages/control-gate/index.vue | 12 ++++++++++++
pages/entry-app/index.vue | 35 ++++++++++++++---------------------
2 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/pages/control-gate/index.vue b/pages/control-gate/index.vue
index 31dae83..d20f843 100644
--- a/pages/control-gate/index.vue
+++ b/pages/control-gate/index.vue
@@ -24,7 +24,19 @@ export default {
imgUrl:'',
}
},
+ onShow(){
+ console.log('ererer')
+ uni.login({
+ provider: 'weixin',
+ success(res) {
+ console.log(res,'resssssss')
+ },
+ fail(err) {
+ }
+ });
+ },
onLoad(options){
+
this.sn=options.sn
this.getPhoto()
},
diff --git a/pages/entry-app/index.vue b/pages/entry-app/index.vue
index bc23163..06da682 100644
--- a/pages/entry-app/index.vue
+++ b/pages/entry-app/index.vue
@@ -16,7 +16,10 @@
-
+
+
+
+
提交数据
请注意资料的上传,必填项。
@@ -31,11 +34,10 @@ export default {
return {
sn:'',
chelianglis:[
- {title:"SUV",id:21},
- {title:"面包车",id:31},
- {title:"跑车",id:41},
- {title:"轿车",id:51},
- {title:"房车",id:61},
+ {title:"商务洽谈",id:21},
+ {title:"人才招聘",id:31},
+ {title:"市场推广",id:41},
+ {title:"文化交流",id:51},
],
shifoushiguche:[
{title:"男",checked:false,value:0},
@@ -44,7 +46,7 @@ export default {
],
reqData:{
receiver:'',
- reasonVisit:'',
+ reasonVisit:[],
tel:'',
userName:'',
gender:0,
@@ -75,7 +77,6 @@ export default {
},
methods: {
submit(){
-
if (!this.reqData.userName?.trim()){
uni.showToast({ title: '请输入访客姓名', icon: 'none' });
return
@@ -84,20 +85,19 @@ export default {
uni.showToast({ title: '请输入手机号', icon: 'none' });
return
}
- if (!this.reqData.reasonVisit?.trim()){
- uni.showToast({ title: '请输入访问事由', icon: 'none' });
- return
- }
if (!this.reqData.receiver?.trim()){
uni.showToast({ title: '请输入接待人姓名', icon: 'none' });
return
}
+ if (!this.reqData.reasonVisit?.[0]?.title?.trim()){
+ uni.showToast({ title: '请选择访问事由', icon: 'none' });
+ return
+ }
this.$refs.toast.show({model:'load',mask:true})
-
uni.request({
method:'post',
url:'https://erpapi.fontree.cn/secret/visitor',
- data:{...this.reqData,gender: this.shifoushiguche.find(x=>x.checked).value,sn:this.sn},
+ data:{...this.reqData,gender: this.shifoushiguche.find(x=>x.checked).value,sn:this.sn,reasonVisit:this.reqData.reasonVisit?.[0]?.title},
complete:(res)=>{
this.$refs.toast.hide()
if (res.data.code===200){
@@ -125,13 +125,6 @@ export default {
//提交成功 。
uni.$tm.toast(e.msg)
},
- obTstr(o){
- if(Array.isArray(o)){
- if(o.length.length===0) return "";
- return o.join(",")
- }
- return JSON.stringify(o)
- },
obTstr2(o){
if(Array.isArray(o)){
if(o.length.length===0) return "";