You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
12 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/visit/book"],{320:function(e,t,n){"use strict";(function(e){n(5);o(n(3));var t=o(n(321));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n(1)["createPage"])},321:function(e,t,n){"use strict";n.r(t);var o=n(322),r=n(324);for(var i in r)"default"!==i&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n(326);var a,s=n(15),u=Object(s["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],a);u.options.__file="pages/visit/book.vue",t["default"]=u.exports},322:function(e,t,n){"use strict";n.r(t);var o=n(323);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},323:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return r})),n.d(t,"staticRenderFns",(function(){return a})),n.d(t,"recyclableRender",(function(){return i})),n.d(t,"components",(function(){return o}));try{o={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,414))},"u-Form":function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u--form/u--form")]).then(n.bind(null,467))},uFormItem:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,473))},uNumberBox:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-number-box/u-number-box")]).then(n.bind(null,481))},uInput:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-input/u-input")]).then(n.bind(null,489))},uRadioGroup:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-radio-group/u-radio-group")]).then(n.bind(null,497))},uRadio:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-radio/u-radio")]).then(n.bind(null,505))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,423))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,406))},uCalendar:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-calendar/u-calendar")]).then(n.bind(null,433))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var e=this,t=e.$createElement;e._self._c},i=!1,a=[];r._withStripped=!0},324:function(e,t,n){"use strict";n.r(t);var o=n(325),r=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},325:function(e,t,n){"use strict";(function(e){function n(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a={data:function(){var e,t=new Date,n=t.getFullYear(),o=t.getMonth()+1;o=o<10?"0".concat(o):o;var r=t.getDate();return e={showInfo:!1,currentNotice:{},notice:[{title:"预约须知",content:"预约须知的内容"},{title:"批量上传帮助",content:"<p>1.批量上传EXCEL的以xlsx结尾</p><p>2.第一列为标题列‘姓名’,‘证件类型’,‘证件号’</p>"}],form:{date:"",rule_id:"",unit:"",leader:"",card_type:1,idcard:"",total:1,mobile:"",type:"",details_list:[]},formUser:{name:"",idcard:"",mobile:"",card_type:1},rules:{name:[{required:!0,message:"请输入姓名",trigger:"blur"}],idcard:[{required:!0,message:"请输入证件号",trigger:"blur"}],card_type:[{required:!0,message:"请选择证件类型",trigger:"change"}]},listVistor:[{},{}],showAdd:!1},i(e,"showInfo",!1),i(e,"showBook",!1),i(e,"minDate","".concat(n,"-").concat(o,"-").concat(r+1)),i(e,"maxDate","".concat(n,"-").concat(o,"-").concat(r+7)),i(e,"showCalendar",!1),i(e,"listDatePrice",[]),i(e,"currentDate",{}),i(e,"currentTime",{}),i(e,"bcurrentDate",{}),i(e,"bcurrentTime",{}),i(e,"currentIndex",0),i(e,"listCalendar",[]),i(e,"type","user"),i(e,"cardList",[{idx:1,name:"身份证"},{idx:2,name:"护照"}]),e},onReady:function(){this.$refs.calendar.setFormatter(this.formatter),this.$refs.formUser.setRules(this.rules)},onLoad:function(t){t.currentDate&&(this.bcurrentDate=JSON.parse(t.currentDate),this.currentDate=this.bcurrentDate),t.currentTime&&(this.bcurrentTime=JSON.parse(t.currentTime),this.currentTime=this.bcurrentTime),this.form.type="user"==t.from?1:2,this.type=t.from,this.load3Day(this.bcurrentDate.date),e.setNavigationBarTitle({title:"user"==t.from?"个人预约":"团队预约"})},methods:{closeInfo:function(){this.showInfo=!1},openNoticeInfo:function(e){this.showInfo=!0,this.currentNotice=this.notice[e]},submitOrder:function(){if(this.form.date=this.currentDate.date,this.form.rule_id=this.currentTime.id,this.util.isNull(this.form.leader))return"user"==this.type?e.showToast({icon:"none",title:"请填写联系人"}):e.showToast({icon:"none",title:"请填写领队姓名"}),!1;if("user"!=this.type){if(this.util.isNull(this.form.unit))return e.showToast({icon:"none",title:"请填写单位名称"}),!1;if(this.util.isNull(this.form.idcard))return e.showToast({icon:"none",title:"请填写证件号"}),!1;if(1==this.form.card_type&&!e.$u.test.idCard(this.form.idcard))return e.showToast({icon:"none",title:"请正确输入身份证号"}),!1}if(this.util.isNull(this.form.mobile))return e.showToast({icon:"none",title:"请填写手机号"}),!1;if(!e.$u.test.mobile(this.form.mobile))return e.showToast({icon:"none",title:"请正确填写手机号"}),!1;if(this.form.details_list.length!=this.form.total)return e.showToast({icon:"none",title:"请正确添加观众数量"}),!1;this.util.request({api:"/api/mobile/visit/order",method:"POST",data:this.form,utilSuccess:function(t){e.showToast({icon:"none",title:"下单成功",complete:function(){e.reLaunch({url:"/pages/success/success?from=visit&id="+t.id})}})},utilFail:function(t){e.showToast({icon:"none",title:t})}})},selectFile:function(){var t=this;wx.chooseMessageFile({count:1,type:"file",success:function(n){var o=n.tempFiles[0].path,r=n.tempFiles[0].name;-1!=r.indexOf(".xlsx")?(console.log("开始上传"),e.showLoading({title:"正在上传"}),wx.uploadFile({url:t.util.HOST+"/api/mobile/visit/excel-analyse",filePath:o,name:"file",formData:{token:e.getStorageSync("userInfo").token},success:function(t){console.log(t),e.hideLoading()}}),console.log("上传到服务器")):e.showToast({icon:"none",title:"暂时仅支持xlsx格式的文件"})}})},handleAddUser:function(){var t=this;try{this.$refs.formUser.validate().then((function(n){if(1==t.formUser.card_type&&!e.$u.test.idCard(t.formUser.idcard))return e.showToast({icon:"none",title:"请正确输入身份证号"}),!1;t.form.details_list.push(t.formUser),t.showAdd=!1})).catch((function(t){e.showToast({icon:"none",title:"观众信息提交不正确"})}))}catch(n){console.log(n)}},closecalendar:function(){this.showCalendar=!1},handleSelectDate:function(e){0!=e.length&&e[0]!=this.currentDate.date&&(this.load3Day(e[0]),this.showCalendar=!1)},openCalendar:function(){var e=this,t=this.$moment().add("days",7).format("yyyy-MM-DD"),n=this.$moment().add("days",1).format("yyyy-MM-DD");this.loadCalendar(n,t,(function(t){e.listCalendar=t,e.showCalendar=!0}))},formatter:function(e){var t,o=n(this.listCalendar);try{for(o.s();!(t=o.n()).done;){var r=t.value,i=this.$moment(e.date).format("yyyy-MM-DD");i==r.date&&(1==r.is_open?e.bottomInfo="余票":e.bottomInfo="售罄")}}catch(a){o.e(a)}finally{o.f()}return e},handleDate:function(t){var o=this.$moment().format("yyyy-MM-DD"),r=this.listDatePrice,i=r[t];if(o!=i.date){var a,s=n(r);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.checked=!1}}catch(f){s.e(f)}finally{s.f()}i.checked=!0;var c,l=0,d=n(i.rules);try{for(d.s();!(c=d.n()).done;){u=c.value;u.checked=!1,u.checked=0==l,u.checked&&(this.currentTime=u),l++}}catch(f){d.e(f)}finally{d.f()}this.currentDate=i,this.listDatePrice=r,this.$forceUpdate()}else e.showToast({icon:"none",title:"请提前一天预约"})},handleSelectTime:function(e){var t,o=n(this.currentDate.rules);try{for(o.s();!(t=o.n()).done;){var r=t.value;r.checked=!1}}catch(i){o.e(i)}finally{o.f()}this.currentDate.rules[e].checked=!0,this.currentTime=this.currentDate.rules[e],this.$forceUpdate()},load3Day:function(e){var t=this;t.listDatePrice=[];var o=this.$moment().format("yyyy-MM-DD");e=""==e?o:e;var r=this.$moment(e).add("days",2).format("yyyy-MM-DD"),i=this.$moment(e).add("days",1).format("yyyy-MM-DD"),a=this.$moment().add("days",1).format("yyyy-MM-DD"),s=this.$moment().add("days",2).format("yyyy-MM-DD"),u=o==e?i:e;this.loadCalendar(e,r,(function(e){t.listDatePrice=e;var r,i=0,c=n(t.listDatePrice);try{for(c.s();!(r=c.n()).done;){var l=r.value;l.checked=!1,l.datef=t.$moment(l.date).format("MM月DD日");var d=t.$moment(l.date).format("dddd");if(l.date==o?l.week="今天":l.date==a?l.week="明天":l.date==s?l.week="后天":l.week=d,l.date==u){l.checked=!0,t.currentDate=l,t.currentIndex=i;var f,m=0,h=n(l.rules);try{for(h.s();!(f=h.n()).done;){var y=f.value;y.checked=!1,t.bcurrentTime?(console.log(t.bcurrentTime),console.log("mod",y),y.id==t.bcurrentTime.id&&(y.checked=!0),t.currentTime=t.bcurrentTime):(y.checked=0==m,y.checked&&(t.currentTime=y)),m++}}catch(p){h.e(p)}finally{h.f()}}i++}}catch(p){c.e(p)}finally{c.f()}}))},loadCalendar:function(e,t,n){this.util.request({api:"/api/mobile/visit/get-calendar",data:{start_date:e,end_date:t},utilSuccess:function(e){n(e)},utilFail:function(e){}})},closeAdd:function(){this.showAdd=!1},openAdd:function(e){if(this.formUser=this.$options.data().formUser,console.log(e),e||0==e)Object.assign(this.formUser,this.form.details_list[e]);this.showAdd=!0},delUser:function(e){this.form.details_list.splice(e,1)}}};t.default=a}).call(this,n(1)["default"])},326:function(e,t,n){"use strict";n.r(t);var o=n(327),r=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},327:function(e,t,n){}},[[320,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/visit/book.js.map