(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d231ec1"],{"21ab":function(t,e,s){"use strict";var i=s("c31d"),o=s("d282"),a=s("ea8e"),n=s("b1d2"),r=s("48f4"),l=s("9884"),c=s("6f2f"),h=s("ad06"),u=Object(o["a"])("grid-item"),d=u[0],p=u[1];e["a"]=d({mixins:[Object(l["a"])("vanGrid")],props:Object(i["a"])({},r["c"],{dot:Boolean,text:String,icon:String,iconPrefix:String,info:[Number,String],badge:[Number,String]}),computed:{style:function(){var t=this.parent,e=t.square,s=t.gutter,i=t.columnNum,o=100/i+"%",n={flexBasis:o};if(e)n.paddingTop=o;else if(s){var r=Object(a["a"])(s);n.paddingRight=r,this.index>=i&&(n.marginTop=r)}return n},contentStyle:function(){var t=this.parent,e=t.square,s=t.gutter;if(e&&s){var i=Object(a["a"])(s);return{right:i,bottom:i,height:"auto"}}}},methods:{onClick:function(t){this.$emit("click",t),Object(r["b"])(this.$router,this)},genIcon:function(){var t,e=this.$createElement,s=this.slots("icon"),i=null!=(t=this.badge)?t:this.info;return s?e("div",{class:p("icon-wrapper")},[s,e(c["a"],{attrs:{dot:this.dot,info:i}})]):this.icon?e(h["a"],{attrs:{name:this.icon,dot:this.dot,badge:i,size:this.parent.iconSize,classPrefix:this.iconPrefix},class:p("icon")}):void 0},getText:function(){var t=this.$createElement,e=this.slots("text");return e||(this.text?t("span",{class:p("text")},[this.text]):void 0)},genContent:function(){var t=this.slots();return t||[this.genIcon(),this.getText()]}},render:function(){var t,e=arguments[0],s=this.parent,i=s.center,o=s.border,a=s.square,r=s.gutter,l=s.direction,c=s.clickable;return e("div",{class:[p({square:a})],style:this.style},[e("div",{style:this.contentStyle,attrs:{role:c?"button":null,tabindex:c?0:null},class:[p("content",[l,{center:i,square:a,clickable:c,surround:o&&r}]),(t={},t[n["a"]]=o,t)],on:{click:this.onClick}},[this.genContent()])])}})},2830:function(t,e,s){"use strict";var i=s("d282"),o=s("ea8e"),a=s("b1d2"),n=s("9884"),r=Object(i["a"])("grid"),l=r[0],c=r[1];e["a"]=l({mixins:[Object(n["b"])("vanGrid")],props:{square:Boolean,gutter:[Number,String],iconSize:[Number,String],direction:String,clickable:Boolean,columnNum:{type:[Number,String],default:4},center:{type:Boolean,default:!0},border:{type:Boolean,default:!0}},computed:{style:function(){var t=this.gutter;if(t)return{paddingLeft:Object(o["a"])(t)}}},render:function(){var t,e=arguments[0];return e("div",{style:this.style,class:[c(),(t={},t[a["e"]]=this.border&&!this.gutter,t)]},[this.slots()])}})},"8ae5":function(t,e,s){},"8ef9":function(t,e,s){"use strict";s.r(e);var i,o,a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return t.show?s("div",{directives:[{name:"title",rawName:"v-title",value:"预约",expression:"'预约'"}]},[s("NavBar",{attrs:{title:"预约 - "+t.zxs.realname,"left-arrow":""},on:{"click-left":function(e){return t.$router.back()}}}),t.zxs.photo?s("img",{staticStyle:{width:"100%"},attrs:{src:t.zxs.photo}}):t._e(),s("div",{staticClass:"info"},[s("div",{staticClass:"title"},[s("h2",[t._v(" "+t._s(t.zxs.realname)+" ")])]),t.zxs.intro_aword?s("p",{staticClass:"lead"},[t._v(t._s(t.zxs.intro_aword))]):t._e(),s("div",{domProps:{innerHTML:t._s(t.zxs.intro)}})]),t._l(t.list,(function(e,i){return s("CellGroup",{key:e.date,attrs:{title:e.date+" "+e.week}},[s("Grid",{attrs:{"column-num":"3",clickable:""}},t._l(e.thetime,(function(e,o){return s("GridItem",{key:e.time,staticClass:"item"},[t._v(" "+t._s(e.time)+" "),s("br"),t._v(" "+t._s(1===e.way?"网络咨询":"面询")+" "),s("div",{staticClass:"remark"},[t._v(t._s(e.remark))]),s("Button",{attrs:{type:t.btn.type[e.status],size:"mini",disabled:e.status>=1,plain:"",block:""},on:{click:function(e){return t.checkWeekLimit(i,o)}}},[t._v(" "+t._s(t.btn.text[e.status])+" ")])],1)})),1)],1)})),s("Popup",{attrs:{position:"bottom",closeable:""},model:{value:t.apply.show,callback:function(e){t.$set(t.apply,"show",e)},expression:"apply.show"}},[s("br"),s("CellGroup",{scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" 抱歉,你本学期/年的咨询次数已有 "),s("span",{staticStyle:{color:"#ff976a"}},[t._v(t._s(t.user.zx_times))]),t._v(" 次。由于现有的心理咨询师资源有限,所以如果你想继续进行咨询的话,请填写申请原因,咨询中心会根据情况选择是否为你开放咨询,感谢你的理解与配合。 ")]},proxy:!0}],null,!1,1290083533)},[s("Field",{attrs:{rows:"2",autosize:"",type:"textarea"},model:{value:t.apply.content,callback:function(e){t.$set(t.apply,"content",e)},expression:"apply.content"}})],1),s("div",{staticClass:"gap"},[s("Button",{attrs:{type:"primary",icon:"certificate",block:""},on:{click:t.submitApply}},[t._v("提交申请")])],1)],1),s("Popup",{attrs:{position:"bottom",closeable:""},model:{value:t.popup.show,callback:function(e){t.$set(t.popup,"show",e)},expression:"popup.show"}},[s("div",{staticClass:"yuyue-content"},[s("CellGroup",{attrs:{title:"咨询信息"}},[s("Cell",[t._v(" 咨询师:"+t._s(t.popup.realname)+" "),s("br"),t._v(" 咨询时间:"+t._s(t.popup.timestr)+" "),s("br"),t.popup.room?s("span",[t._v("房间:"+t._s(t.popup.room))]):t._e(),s("br"),t._v(" 咨询方式:"+t._s(1===t.popup.way?"网络咨询":"面询")+" "),s("br"),t.popup.remark?s("span",[t._v("备注:"+t._s(t.popup.remark))]):t._e()])],1),s("CellGroup",{attrs:{title:"你现在最需要接受帮助的主要问题是什么?"}},[s("Field",{attrs:{rows:"1",autosize:"",type:"textarea"},model:{value:t.form.question,callback:function(e){t.$set(t.form,"question",e)},expression:"form.question"}})],1),s("CellGroup",{attrs:{title:"请输入最方便联系到你的手机号码:"}},[s("Field",{model:{value:t.form.mobile,callback:function(e){t.$set(t.form,"mobile",e)},expression:"form.mobile"}})],1),s("CellGroup",{attrs:{title:"请输入你主要使用的QQ号:"}},[s("Field",{model:{value:t.form.qq,callback:function(e){t.$set(t.form,"qq",e)},expression:"form.qq"}})],1),1===t.form.way?s("CellGroup",{attrs:{title:"紧急联系人及联系方式:"}},[s("Field",{model:{value:t.form.contact,callback:function(e){t.$set(t.form,"contact",e)},expression:"form.contact"}})],1):t._e(),s("div",{staticClass:"gap"},[s("Button",{attrs:{type:"primary",icon:"certificate",block:""},on:{click:t.submit}},[t._v("提交预约")])],1)],1)]),s("Popup",{attrs:{position:"bottom",closeable:""},model:{value:t.license.show,callback:function(e){t.$set(t.license,"show",e)},expression:"license.show"}},[s("div",{staticClass:"license-content"},[s("h2",[s("Icon",{attrs:{name:"bulb-o",size:"18"}}),t._v("预约协议")],1),s("div",{domProps:{innerHTML:t._s(t.license.message)}}),1===t.license.way?[s("p",[t._v("手持学生卡/证件照片:")]),s("Uploader",{attrs:{"max-count":"1","result-type":"file","after-read":t.Upload},model:{value:t.license.photo,callback:function(e){t.$set(t.license,"photo",e)},expression:"license.photo"}}),s("p",[t._v(" 手写签名 "),t.form.signature?s("span",[t._v("(可点击签名重写)")]):t._e(),t._v(": ")]),t.form.signature?s("img",{attrs:{src:t.form.signature},on:{click:function(e){return t.Signature("rewrite")}}}):s("div",{staticClass:"signature"},[s("div",{staticClass:"clear",on:{click:function(e){return t.Signature("clear")}}},[s("Icon",{attrs:{name:"cross"}})],1),s("canvas",{ref:"canvas"})])]:t._e()],2),s("Button",{attrs:{type:"primary",icon:"certificate",block:"",square:""},on:{click:t.agreeLicense}},[t._v("同意以上协议")])],1),s("RemoteScript",{attrs:{src:"//res.wx.qq.com/open/js/jweixin-1.6.0.js",async:"",defer:""}})],2):t._e()},n=[],r=s("6b41"),l=s("b650"),c=s("e41f"),h=s("565f"),u=s("7744"),d=s("34e9"),p=s("ad06"),m=s("8f80"),f=s("2830"),g=s("21ab"),y=s("5a0c"),b=s.n(y),w=s("a78e"),_=s.n(w),$=s("7c8d"),v=s.n($),x=s("90e2"),k={props:{src:{type:String,required:!0},async:Boolean,defer:Boolean},render(t){const e=this.src,s=e.substring(e.lastIndexOf(".")+1);return t("css"===s?"link":"script",{attrs:"css"===s?{rel:"stylesheet",href:e}:{src:e,async:this.async,defer:this.defer},on:{load:()=>this.$emit("on-load")}})}},S=k,z=s("2877"),C=Object(z["a"])(S,i,o,!1,null,null,null),q=C.exports;let j=null;var L={name:"Yuyue",components:{NavBar:r["a"],Button:l["a"],Popup:c["a"],Field:h["a"],Cell:u["a"],CellGroup:d["a"],Icon:p["a"],Uploader:m["a"],Grid:f["a"],GridItem:g["a"],RemoteScript:q},data(){const t=this.$store("user");return{user:t,root:"/school/student",school:{},zxs:{},show:!1,weekday:Object.freeze(["日","一","二","三","四","五","六"]),list:[],current:[0,0],license:{show:!1,message:"",way:0,photo:[]},popup:{show:!1,realname:"",timestr:"",room:"",remark:"",way:0},form:{school:0,consultant:Number(this.$route.query.id),yydate:"",yytime:"",room:"",question:"",mobile:t.mobile,qq:t.qq,contact:"",signature:"",way:0,realname:t.realname},apply:{show:!1,content:""},btn:Object.freeze({text:["我要预约","我已申请","已被预约"],type:["primary","warning","danger"]}),xiaogan:{AppID:"wx03059979bba13789",kefu:[]}}},beforeRouteUpdate(t,e,s){this.form.consultant=Number(t.query.id),s()},mounted(){this.getSchoolSetting()},methods:{getSchoolSetting(){const t=this.$store("school");t&&t.id===this.user.member_type_top?t.zixun_close_date&&b()().format("YYYY-MM-DD")>=t.zixun_close_date?this.$dialog.alert({title:"系统提示",message:t.yuyue_close_msg,messageAlign:"left"}).then(()=>this.$router.replace(this.root)):/\d+/.test(this.form.consultant)?(t.yydate=t.yydate||7,this.school=Object.freeze(t),this.form.school=t.id,this.getConsultantInfo()):this.$dialog.alert({title:"系统提示",message:"页面参数缺失,请返回首页重试。"}).then(()=>this.$router.replace(this.root)):this.$router.push("/school/"+this.user.member_type_top+"/student/login?redirect="+this.$route.fullPath)},getConsultantInfo(){this.school.fds&&this.user.bind_consultant_id&&this.user.bind_consultant_id!==this.form.consultant?this.$dialog.alert({title:"系统提示",message:"当前系统配置了首诊负责制,但该咨询师不是你之前绑定的咨询师,确定后返回首页重选。"}).then(()=>this.$router.replace(this.root)):(this.$loading.show(),this.$http.get("/school/"+this.school.id+"/consultant",{id:this.form.consultant}).then(t=>{if(0===t.code){this.$loading.hide();const e=t.data[0];e.intro="

"+(e.intro||"").replace(/\r\n/g,"

")+"

",this.zxs=e,this.show=!0,this.school.yuyue_arrange?this.$toast("系统已开通由中心安排预约功能,暂无排班表"):this.getTimeList()}}))},getTimeList(){this.$loading.show(),this.$http.get("/school/yuyue-by-consultant",{id:this.$number.encrypt(this.form.consultant),yyday:this.school.yydate,closedate:this.school.zixun_close_date,beforetime:this.school.yuyue_before_time}).then(t=>{0===t.code&&(this.$loading.hide(),t.data.length?(t.data.forEach(t=>{t.realname=this.zxs.realname,t.week="星期"+this.weekday[t.day],t.thetime.forEach(t=>t.status=0)}),this.list=t.data):this.$toast("当前咨询师没有可预约的时间"))})},checkWeekLimit(t,e){this.current[0]=t,this.current[1]=e;const s=this.school.yuyue_week_limit;s>0?(this.$loading.show(),this.$http.get("/school/yuyue-week-count",{yydate:this.list[t].date}).then(t=>{0===t.code&&(this.$loading.hide(),t.data>=s?this.$dialog.alert({title:"温馨提示",message:"该周的预约次数超过了限制,请选择其他时间。"}):this.checkSemesterLimit())})):this.checkSemesterLimit()},checkSemesterLimit(){const t=this.school.zixun_times_limit;t>0&&this.user.zx_times>=t?(this.$loading.show(),this.$http.get("/school/yuyue-apply").then(t=>{0===t.code&&(this.$loading.hide(),-1===t.data?this.apply.show=!0:0===t.data?this.$dialog.alert({title:"提示",message:"你上次的预约申请记录尚未处理,请耐心等待处理。"}):2===t.data?this.$dialog.alert({title:"提示",message:"由于咨询中心资源有限,咨询中心不能为你分配咨询师资源,谢谢你的理解与支持!"}):this.checkFeedback())})):this.checkFeedback()},checkFeedback(){this.school.zixun_needfeedback_next?(this.$loading.show(),this.$http.get("/school/last-zixun-feedback-exist").then(t=>{0===t.code&&(this.$loading.hide(),t.data?this.checkTest():this.$dialog.confirm({title:"提示",message:"上次的咨询你还没有对咨询师作反馈,为了了解咨询师的工作情况,以及后期提升咨询师的服务质量,请及时完成上次咨询的反馈表。\n你的反馈是我们不断完善的动力!",messageAlign:"left",confirmButtonText:"去反馈"}).then(()=>window.location="/m/school/student/zixun_list.asp"))})):this.checkTest()},checkTest(){if(this.school.yuyue_test_days>0&&this.school.yuyue_test_lb){const t=JSON.parse("["+this.school.yuyue_test_lb+"]"),e=b()().subtract(this.school.yuyue_test_days,"day").format("YYYY-MM-DD");this.$loading.show(),this.$http.get("/member/0/tested",{lb:t.join(),date1:e,valid:1,mini:1,top:5}).then(e=>{if(0===e.code){this.$loading.hide();let s=[];e.data.length?t.forEach(t=>!e.data.some(e=>e.lb===t)&&s.push(t)):s=s.concat(t),s.length?this.$dialog.confirm({title:"提示",message:"为了帮助我们及时、清楚地了解你的情况,请你先填写问卷,请根据自己的实际情况来回答问题。感谢你对我们工作的配合!请点击按钮开始测评。",messageAlign:"left",confirmButtonText:"去测评"}).then(()=>{_.a.set("TestList",s.join()),_.a.set("TestRedirect","/m/vant/#/school/student/yuyue?id="+this.form.consultant),this.$router.push("/test-start/"+s[0]+"?testtype=1")}):this.showLicense()}})}else this.showLicense()},showLicense(){const t=this.school.yuyuelicense;if(t){const e=this.list[this.current[0]].thetime[this.current[1]].way;this.license.message="

"+t.replace(/\n/g,"

")+"

",this.license.way=e,1===e&&(this.user.idcard_picture&&(this.license.photo=[{url:this.user.idcard_picture}]),""===this.form.signature&&this.$nextTick(()=>this.Signature("write"))),this.license.show=!0}else this.yuyue()},Upload(t){new v.a(t.file,{maxWidth:500,maxHeight:500,success:t=>{const e=new FormData;e.append("file",t,t.name),this.$loading.show(),this.$http.post("/upload",e).then(t=>{if(0===t.code){const e=Global.Dir+"/"+t.data;this.$http.post("/member/0",{idcard_picture:e}).then(t=>{0===t.code&&(this.$set(this.license.photo,0,{url:e}),this.$store.add("user",{idcard_picture:e}),this.$loading.hide(),this.$toast("照片设置成功"))})}else this.$toast.fail(t.message)})},error:()=>this.$toast.fail("压缩图片出错")})},Signature(t){if("clear"===t)j.clear();else if("rewrite"===t)this.form.signature="",this.$nextTick(()=>this.Signature("write"));else{const t=this.$refs.canvas,e=()=>{const e=Math.max(window.devicePixelRatio||1,1);t.width=t.offsetWidth*e,t.height=t.offsetHeight*e,t.getContext("2d").scale(e,e),j.clear()};j=new x["a"](t),e(),window.addEventListener("resize",e),this.$once("hook:beforeDestroy",()=>window.removeEventListener("resize",e))}},agreeLicense(){0===this.list[this.current[0]].thetime[this.current[1]].way?(this.license.show=!1,this.yuyue()):0===this.license.photo.length?this.$toast("你还没有上传照片"):""===this.form.signature&&j.isEmpty()?this.$toast("你还没有书写签名"):(""===this.form.signature&&(this.form.signature=T(this.$refs.canvas)),this.license.show=!1,this.yuyue())},yuyue(){const t=this.list[this.current[0]],e=t.thetime[this.current[1]];this.popup.realname=t.realname,this.popup.timestr=t.date+" "+t.week+" "+e.time,this.popup.room=e.room,this.popup.remark=e.remark,this.popup.way=e.way,this.popup.show=!0,this.form.yydate=t.date,this.form.yytime=e.time,this.form.room=e.room,this.form.way=e.way},submit(){this.$global.MobileValidateReg.test(this.form.mobile)?/^[1-9]\d{5,11}$/.test(this.form.qq)?""===this.form.question||1===this.form.way&&""===this.form.contact?this.$toast("所有项目都是必填"):(this.$loading.show(),this.$http.post("/school/yuyue",this.form).then(t=>{0===t.code?setTimeout(()=>{this.$loading.hide(),this.$toast.success({message:"预约申请发送成功",onClose:()=>{this.list[this.current[0]].thetime[this.current[1]].status=1,this.popup.show=!1}})},3e3):1===t.code?(this.$loading.hide(),this.$toast.fail({message:"该时间段已被预约,请选其他时间",onClose:()=>{this.list[this.current[0]].thetime[this.current[1]].status=2,this.popup.show=!1}})):(this.$loading.hide(),this.$toast(t.message))})):this.$toast("QQ号格式不正确"):this.$toast("手机号码格式不正确")},submitApply(){this.apply.content?(this.$loading.show(),this.$http.post("/school/yuyue-apply",{content:this.apply.content}).then(t=>{0===t.code&&(this.$loading.hide(),this.apply.show=!1,this.$toast.success("申请已经提交,请等待老师处理"))})):this.$toast("请输入申请原因")}}};function T(t){const e=document.createElement("canvas"),s=e.getContext("2d");let i,o,a;e.width=t.width,e.height=t.height,s.scale(.25,.25),s.drawImage(t,0,0);let n=e.width,r=e.height;const l={x:[],y:[]},c=s.getImageData(0,0,e.width,e.height);for(o=0;o0&&(l.x.push(i),l.y.push(o));l.x.sort((t,e)=>t-e),l.y.sort((t,e)=>t-e);const h=l.x.length-1;n=l.x[h]-l.x[0],r=l.y[h]-l.y[0];const u=s.getImageData(l.x[0],l.y[0],n,r);return e.width=n,e.height=r,s.putImageData(u,0,0),e.toDataURL()}var B=L,O=(s("b72a"),Object(z["a"])(B,a,n,!1,null,"1e547700",null));e["default"]=O.exports},b72a:function(t,e,s){"use strict";s("8ae5")}}]);