From 0fa8f492ae7ecf6127e7e2b9dbcc1343de90e796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=BF=94=E5=AE=87-=E6=97=85=E7=AE=A1=E5=AE=B6?= <153298343@qq.com> Date: Thu, 30 Jun 2022 08:59:45 +0800 Subject: [PATCH] up --- pages/visit/book.vue | 708 ++++++++++++++++++++++--------------------- 1 file changed, 368 insertions(+), 340 deletions(-) diff --git a/pages/visit/book.vue b/pages/visit/book.vue index 402a679..b609ef8 100644 --- a/pages/visit/book.vue +++ b/pages/visit/book.vue @@ -89,35 +89,38 @@ 每单限购{{maxCount}}张,同一身份证当天限购1张 {{minCount}}人以上可团体预约,一个团体最多{{maxCount}}人 - - - - - - - 常用人 - - - - - - - - - - {{item.name}} - - - - - - - - - - - - + + + + + + + 常用人 + + + + + + + + + + {{item.name}} + + + + + + + + + + + + @@ -159,15 +162,15 @@ - - @@ -187,9 +190,10 @@ - --> - - + --> + + @@ -200,14 +204,14 @@ - - - - - - - - + + + + + + + + @@ -229,24 +233,25 @@ - --> - - - - + --> + + + + + - - - - - - - - - + + + + + + + + + @@ -255,42 +260,46 @@ 确定 - - - - - + + + + + - - + + {{currentNotice.title}} - - - - - - + + + + + + + - + 知道了 - - - - - - - - 您已经预约成功 - 即将跳转到参观预约 {{time}} s - - 返回首页 - + + + + + + + + 您已经预约成功 + 即将跳转到参观预约 {{time}} s + + 返回首页 + 1.批量上传EXCEL的以xlsx结尾

2.第一列为标题列 姓名 手机号 证件号 行动不便者

3.文件是从微信聊天记录中选取或者微信文件传输助手

" - }], - specialtype:false, - specialid:0, - common_user:[], - t:null, - timer:null, + content: "

1.批量上传EXCEL的以xlsx结尾

2.第一行为标题行 姓名 手机号 证件号 行动不便者

3.文件是从微信聊天记录中选取或者微信文件传输助手

" + }], + specialtype: false, + specialid: 0, + common_user: [], + t: null, + timer: null, form: { date: "", rule_id: "", @@ -338,13 +347,13 @@ mobile: "", type: "", details_list: [] - }, + }, formUser: { name: "", idcard: "", mobile: "", - card_type: 1, + card_type: 1, is_disability: 0, }, rules: { @@ -384,42 +393,45 @@ maxCount: 1, config: {}, info: {}, - editIndex: -1, - disabilitys:[{ - idx: 0, - name: '否' - }, - { - idx: 1, - name: '是' - }], - cardshow:false, - cardshows:false, - card_type_name:"身份证", - card_type_names:"身份证", - // cardLists:['身份证','港澳台居民居住证','护照','台胞证','港澳证'], - cardLists: [[{ - value: 1, - label: '身份证' - }, - { - value: 3, - label: '港澳台居民居住证' - }, - { - value: 2, - label: '护照' - }, - { - value: 4, - label: '台胞证' - }, - { - value: 5, - label: '港澳证' - } - ]], - + editIndex: -1, + disabilitys: [{ + idx: 0, + name: '否' + }, + { + idx: 1, + name: '是' + } + ], + cardshow: false, + cardshows: false, + card_type_name: "身份证", + card_type_names: "身份证", + // cardLists:['身份证','港澳台居民居住证','护照','台胞证','港澳证'], + cardLists: [ + [{ + value: 1, + label: '身份证' + }, + { + value: 3, + label: '港澳台居民居住证' + }, + { + value: 2, + label: '护照' + }, + { + value: 4, + label: '台胞证' + }, + { + value: 5, + label: '港澳证' + } + ] + ], + } }, onReady() { @@ -429,7 +441,7 @@ }, onLoad(options) { this.loadConfig(); - this.loadInfo(); + this.loadInfo(); this.openNoticeInfo(0); if (options.currentDate) { this.bcurrentDate = JSON.parse(options.currentDate); @@ -451,92 +463,92 @@ that.util.getUserInfo(function(r) { that.user = r; that.form.mobile = r.mobile; - }, true); - - that.loadCommonUser(); - that.maxheight = wx.getSystemInfoSync().windowHeight*0.6 + "px" - that.scrollheight = wx.getSystemInfoSync().windowHeight*0.6*0.7 + "px" - }, - onHide() { - clearInterval(this.t) - clearTimeout(this.timer) - }, - - onUnload() { - clearInterval(this.t) - clearTimeout(this.timer) + }, true); + + that.loadCommonUser(); + that.maxheight = wx.getSystemInfoSync().windowHeight * 0.6 + "px" + that.scrollheight = wx.getSystemInfoSync().windowHeight * 0.6 * 0.7 + "px" }, - methods: { - confirmCards(e){ - this.card_type_names = e.value[0].label - this.form.card_type = e.value[0].value - this.cardshows = false - }, - cancel(){ - this.cardshow = false - }, - cancels(){ - this.cardshows = false - }, - showCards(){ - this.cardshows = true - }, - confirmCard(e){ - this.card_type_name = e.value[0].label - this.formUser.card_type = e.value[0].value - this.cardshow = false - }, - showCard(){ - this.cardshow = true - }, - goHome(){ - uni.switchTab({ - url: "/pages/index/index" - }) - }, - radioChange(val){ - console.log(val) - this.specialtype = !this.specialtype; - if(this.specialtype){ - this.specialid = val[0] - }else{ - this.specialid = 0 - } - // if(this.$refs.radio.currentValue){ - // this.specialtype = val; - // } - }, - loadCommonUser(){ - var that = this; - this.util.request({ - api: '/api/mobile/visit/address-book', - utilSuccess: function(res) { - - for(var m of res){ - m.checked = false - } - that.common_user = res; - console.log(that.common_user) - }, - utilFail: function(res) { - - } - }) - }, - handleCommonUser(obj){ - obj.checked = !obj.checked - if(obj.checked){ - this.form.details_list.push(obj) - }else{ - for(var i=0;i 0) - that.time = that.time - 1; - }, 1000) - that.timer = setTimeout(function() { - uni.redirectTo({ - url: '/pages/order/visitorder' - }) - clearInterval(that.t); - clearTimeout(that.timer) - }, 3000) - + console.log(res) + that.successshow = true; + that.t = setInterval(function() { + if (that.time > 0) + that.time = that.time - 1; + }, 1000) + that.timer = setTimeout(function() { + uni.redirectTo({ + url: '/pages/order/visitorder' + }) + clearInterval(that.t); + clearTimeout(that.timer) + }, 3000) + // uni.showToast({ // icon: "none", // title: "下单成功", - // complete() { - + // complete() { + // uni.redirectTo({ // url: "/pages/success/success?from=visit&id=" + res.id // }) @@ -721,21 +733,31 @@ "token": uni.getStorageSync("userInfo_token").token }, success(res) { - var jsonlist = JSON.parse(res.data) - for (var m of jsonlist) { - - _that.form.details_list.push({ - name: m.name, - idcard: m.idcard, - mobile: m.mobile, - card_type: 1, - is_disability:0 - }) + console.log(res); + if (res.data.indexOf("err") > -1) { + var err = JSON.parse(res.data); + _that.util.toast("导入失败,原因‘" + err.errmsg + "’请查看批量导入说明"); + + } else { + var jsonlist = JSON.parse(res.data); + for (var m of jsonlist) { + _that.form.details_list.push({ + name: m.name, + idcard: m.idcard, + mobile: m.mobile, + card_type: 1, + is_disability: 0 + }) + } } - uni.hideLoading(); + }, + fail(error) { + + console.log(error); + } }) - console.log('上传到服务器') + uni.hideLoading(); } } }) @@ -767,18 +789,18 @@ // title: "请正确填写手机号" // }) // return false; - // } - if(!this.util.isNull(this.formUser.mobile)){ - if (!this.util.phoneRegex.test(this.formUser.mobile)) { - uni.showToast({ - icon: "none", - title: "请正确填写手机号" - }) - return false; - } - } - - + // } + if (!this.util.isNull(this.formUser.mobile)) { + if (!this.util.phoneRegex.test(this.formUser.mobile)) { + uni.showToast({ + icon: "none", + title: "请正确填写手机号" + }) + return false; + } + } + + //判断是不是编辑 如果是编辑 if (that.editIndex != -1) { that.form.details_list.splice(that.editIndex, 1, that.formUser) @@ -856,8 +878,8 @@ } } return day - }, - + }, + handleDate(index) { var nt = this.$moment().format("yyyy-MM-DD"); let list = this.listDatePrice; @@ -1013,11 +1035,11 @@ this.editIndex = -1; this.showAdd = true }, - delUser(index) { - for(var i=0;i