12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2172f842"],{"2b43":function(t,e,n){"use strict";var i=n("38e2"),a=n.n(i);a.a},"38e2":function(t,e,n){},5294:function(t,e,n){"use strict";n.r(e);var i,a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("nav-bar",{attrs:{path:"index",title:"身份验证"}}),n("div",{staticClass:"card"},[t._m(0),n("van-cell-group",{attrs:{border:!1}},[n("van-field",{attrs:{required:"",clearable:"",label:"手机号",placeholder:"请输入手机号",error:t.phoneError},on:{click:function(e){t.phoneError=!1}},model:{value:t.phone,callback:function(e){t.phone=e},expression:"phone"}}),n("van-field",{attrs:{required:"",clearable:"",label:"昵称",placeholder:"请输入昵称",maxlength:"12",error:t.usernameError},on:{click:function(e){t.usernameError=!1}},model:{value:t.username,callback:function(e){t.username=e},expression:"username"}}),n("van-field",{attrs:{required:"",clearable:"",label:"微信号",placeholder:"请输入微信号",maxlength:"20",error:t.wechatError},on:{click:function(e){t.wechatError=!1}},model:{value:t.wechat,callback:function(e){t.wechat=e},expression:"wechat"}})],1),n("p",[t._v("性别")]),n("van-radio-group",{model:{value:t.radio,callback:function(e){t.radio=e},expression:"radio"}},[n("van-radio",{staticStyle:{float:"left","margin-right":"20px"},attrs:{name:"1","checked-color":"#fd6740"}},[t._v("男")]),n("van-radio",{attrs:{name:"2","checked-color":"#fd6740"}},[t._v("女")])],1),n("p",[t._v("宿舍区")]),n("van-button",{attrs:{size:"large"},on:{click:function(e){t.show=!0}}},[t._v(t._s(t.dormitory))]),n("van-actionsheet",{attrs:{actions:t.actions,"cancel-text":"取消"},on:{select:t.onSelect},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}})],1),n("div",{staticClass:"card",staticStyle:{"margin-bottom":"10px"}},[n("p",[t._v("上传校卡照片")]),n("div",{staticStyle:{"margin-bottom":"10px"}},[n("add-photo",{on:{onRead:t.onRead}})],1),n("p",[t._v("活动仅允许深大学生参与,请上传正面校卡照片审核~")])]),n("van-button",{staticClass:"submit_button",attrs:{type:"primary",loading:t.loading},on:{click:t.next}},[t._v("下一步\n ")])],1)},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h3",[n("strong",[t._v("个人资料")])])}],s=(n("34ef"),n("4917"),n("28a5"),n("e7e5"),n("d399")),r=n("ade3"),l=(n("68ef"),n("4d75"),n("8c8e"),n("fe7e")),c=n("6605"),u=Object(l["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-slide-up"}},[t.shouldRender?n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:t.b({withtitle:t.title})},[t.title?n("div",{staticClass:"van-hairline--top-bottom",class:t.b("header")},[n("div",{domProps:{textContent:t._s(t.title)}}),n("icon",{attrs:{name:"close"},on:{click:t.onCancel}})],1):n("ul",{staticClass:"van-hairline--bottom"},t._l(t.actions,function(e){return n("li",{class:[t.b("item",{disabled:e.disabled||e.loading}),e.className,"van-hairline--top"],on:{click:function(n){n.stopPropagation(),t.onSelect(e)}}},[e.loading?n("loading",{class:t.b("loading"),attrs:{size:"20px"}}):[n("span",{class:t.b("name")},[t._v(t._s(e.name))]),e.subname?n("span",{class:t.b("subname")},[t._v("\n "+t._s(e.subname)+"\n ")]):t._e()]],2)})),t.cancelText?n("div",{class:[t.b("cancel"),"van-hairline--top"],domProps:{textContent:t._s(t.cancelText)},on:{click:t.onCancel}}):n("div",{class:t.b("content")},[t._t("default")],2)]):t._e()])},name:"actionsheet",mixins:[c["a"]],props:{title:String,value:Boolean,actions:Array,cancelText:String,overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}},methods:{onSelect:function(t){t.disabled||t.loading||(t.callback&&t.callback(t),this.$emit("select",t))},onCancel:function(){this.$emit("input",!1),this.$emit("cancel")}}}),d=(n("66b9"),n("b650")),h=(n("5f5f"),n("f253")),f=(n("4ddd"),n("9f14")),m=(n("a44c"),n("e27c")),p=(n("be7f"),n("565f")),v=(n("0653"),n("34e9")),g=(n("c3a6"),n("ad06")),b=(n("7f7f"),n("e930"),n("8f80")),x=(n("cadf"),n("551c"),n("097d"),n("6ef9")),y=n("da1d"),_=n("1901"),C={name:"SecurityVerify",components:(i={AddPhoto:_["a"],NavBar:y["a"]},Object(r["a"])(i,b["a"].name,b["a"]),Object(r["a"])(i,g["a"].name,g["a"]),Object(r["a"])(i,v["a"].name,v["a"]),Object(r["a"])(i,p["a"].name,p["a"]),Object(r["a"])(i,m["a"].name,m["a"]),Object(r["a"])(i,f["a"].name,f["a"]),Object(r["a"])(i,h["a"].name,h["a"]),Object(r["a"])(i,d["a"].name,d["a"]),Object(r["a"])(i,u.name,u),i),data:function(){return{phone:"",phoneError:!1,sms:"",username:"",usernameError:!1,wechat:"",wechatError:!1,radio:"1",show:!1,dormitory:"点击选择宿舍区",dorId:-1,actions:[{id:0,name:"斋区"},{id:1,name:"西南"},{id:2,name:"南区"},{id:3,name:"桂庙"},{id:4,name:"西丽"}],photo:null,loading:!1,userDo:{},identityDo:{},identityUpload:!1,userUpload:!1}},methods:{next:function(){return s["a"].loading({mask:!0,message:"此过程大约需要15s,你的校卡正在拼命上传,请耐心等待...",duration:2e4}),this.loading=!0,11!==this.phone.length?(s["a"].fail("请输入11位手机号"),this.phoneError=!0,void(this.loading=!1)):I(this.phone)?w(this.username)?(s["a"].fail("不支持表情哦"),this.usernameError=!0,void(this.loading=!1)):this.username.length<1?(s["a"].fail("请输入昵称"),this.usernameError=!0,void(this.loading=!1)):w(this.wechat)||this.wechat.length<6?(this.wechatError=!0,s["a"].fail("请输入正确格式的微信号"),void(this.loading=!1)):-1===this.dorId?(s["a"].fail("请选择宿舍区"),void(this.loading=!1)):null===this.photo?(s["a"].fail("请上传校卡正面照片"),void(this.loading=!1)):void this.compressImg():(s["a"].fail("请输入正确格式的手机号"),this.phoneError=!0,void(this.loading=!1))},compressImg:function(){var t=this,e=this.photo;S(e,{quality:.2},function(e){var n=new FormData,i=O(e);n.append("file",i),t.uploadImg(n)})},uploadImg:function(t){var e=this;x["a"].get_data("fileserver/upload?sign=abcdefg",function(t){try{if("10000"===t.ret&&void 0!==t.model&&0!==t.model.length){var n=t.model;e.updateInfo(n)}else s["a"].fail("上传图片失败,请检查网络"),e.loading=!1}catch(i){console.warn(i),s["a"].fail("上传图片失败,请检查网络"),e.loading=!1}},t)},updateInfo:function(t){var e=this,n=e.identityDo;n.userWxAccount=e.wechat,n.dormDistrict=e.dorId,n.userSex=parseInt(e.radio),null!=t&&(n.userSchoolCardPic=t);var i=t;n.userSchoolCardPic=t,n.userReviewStatus=100,n.reviewerNote="等待审核",n.reviewerNoteToUser="等待审核",x["a"].get_data("smartIdentity/updateBatch",function(t){if("10000"===t.ret){if(null!=i&&(e.identityUpload=!0,1==e.userUpload))return s["a"].success("注册成功"),void e.$router.push("presentRegister")}else s["a"].fail("注册失败,请检查网络"),e.loading=!1},[n]);var a=e.userDo;a.name=e.username,a.phone=e.phone,x["a"].get_data("smartUsers/updateBatch",function(t){if(void 0!==t&&"10000"===t.ret){if(e.userUpload=!0,1==e.identityUpload&&null!=i)return s["a"].success("注册成功"),void e.$router.push("presentRegister")}else s["a"].fail("注册失败,请稍后再试"),e.loading=!1},[a])},onSelect:function(t){this.show=!1,this.dormitory=t.name,this.dorId=t.id},onRead:function(t){this.photo=t}},created:function(){s["a"].fail("活动已结束!"),this.$router.push("index")}};function w(t){for(var e=0;e<t.length;e++){var n=t.charCodeAt(e);if(55296<=n&&n<=56319){if(t.length>1){var i=t.charCodeAt(e+1),a=1024*(n-55296)+(i-56320)+65536;if(118784<=a&&a<=128895)return!0}}else if(t.length>1){i=t.charCodeAt(e+1);if(8419==i)return!0}else{if(8448<=n&&n<=10239)return!0;if(11013<=n&&n<=11015)return!0;if(10548<=n&&n<=10549)return!0;if(12951<=n&&n<=12953)return!0;if(169==n||174==n||12349==n||12336==n||11093==n||11036==n||11035==n||11088==n)return!0}}}function I(t){for(var e=0;e<t.length;e++)if(t[e]<"0"||t[e]>"9")return!1;return!0}function S(t,e,n){var i=new FileReader;i.readAsDataURL(t),i.onload=function(){var t=this.result;k(t,e,n)}}function k(t,e,n){var i=new Image;i.src=t,i.onload=function(){var t=this,i=t.width,a=t.height,o=i/a;i=e.width||i,a=e.height||i/o;var s=.7,r=document.createElement("canvas"),l=r.getContext("2d"),c=document.createAttribute("width");c.nodeValue=i;var u=document.createAttribute("height");u.nodeValue=a,r.setAttributeNode(c),r.setAttributeNode(u),l.drawImage(t,0,0,i,a),e.quality&&e.quality<=1&&e.quality>0&&(s=e.quality);var d=r.toDataURL("image/jpeg",s);n(d)}}function O(t){var e=t.split(","),n=e[0].match(/:(.*?);/)[1],i=atob(e[1]),a=i.length,o=new Uint8Array(a);while(a--)o[a]=i.charCodeAt(a);return new Blob([o],{type:n})}var T=C,$=(n("2b43"),n("2877")),E=Object($["a"])(T,a,o,!1,null,"f15c6c34",null);E.options.__file="SecurityVerify.vue";e["default"]=E.exports},"5f5f":function(t,e,n){"use strict";n("68ef"),n("a526")},"62d0":function(t,e,n){},"8a0b":function(t,e,n){},"8c8e":function(t,e,n){},"8f80":function(t,e,n){"use strict";var i=n("fe7e");e["a"]=Object(i["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t._t("default"),n("input",t._b({ref:"input",class:t.b("input"),attrs:{type:"file",accept:t.accept,disabled:t.disabled},on:{change:t.onChange}},"input",t.$attrs,!1))],2)},name:"uploader",inheritAttrs:!1,props:{disabled:Boolean,beforeRead:Function,afterRead:Function,accept:{type:String,default:"image/*"},resultType:{type:String,default:"dataUrl"},maxSize:{type:Number,default:Number.MAX_VALUE}},methods:{onChange:function(t){var e=this,n=t.target.files;!this.disabled&&n.length&&(n=1===n.length?n[0]:[].slice.call(n,0),!n||this.beforeRead&&!this.beforeRead(n)||(Array.isArray(n)?Promise.all(n.map(this.readFile)).then(function(t){var i=!1,a=n.map(function(a,o){return a.size>e.maxSize&&(i=!0),{file:n[o],content:t[o]}});e.onAfterRead(a,i)}):this.readFile(n).then(function(t){e.onAfterRead({file:n,content:t},n.size>e.maxSize)})))},readFile:function(t){var e=this;return new Promise(function(n){var i=new FileReader;i.onload=function(t){n(t.target.result)},"dataUrl"===e.resultType?i.readAsDataURL(t):"text"===e.resultType&&i.readAsText(t)})},onAfterRead:function(t,e){e?this.$emit("oversize",t):(this.afterRead&&this.afterRead(t),this.$refs.input&&(this.$refs.input.value=""))}}})},a526:function(t,e,n){},aeeb:function(t,e,n){"use strict";var i=n("62d0"),a=n.n(i);a.a},bcd3:function(t,e,n){},c3a6:function(t,e,n){"use strict";n("68ef")},da1d:function(t,e,n){"use strict";var i,a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("van-nav-bar",{staticStyle:{"background-color":"#fff6e3"},attrs:{title:t.title,border:!1}},[t._v('\n style="max-width: 30px;"\n />\n '),n("van-icon",{attrs:{slot:"left",name:"arrow-left",color:"black"},on:{click:t.onClickLeft},slot:"left"})],1)],1)},o=[],s=n("ade3"),r=(n("c3a6"),n("ad06")),l=(n("7f7f"),n("68ef"),n("8a0b"),n("fe7e")),c=Object(l["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b({fixed:t.fixed}),{"van-hairline--bottom":t.border}],style:t.style},[n("div",{class:t.b("left"),on:{click:function(e){t.$emit("click-left")}}},[t._t("left",[t.leftArrow?n("icon",{class:t.b("arrow"),attrs:{name:"arrow-left"}}):t._e(),t.leftText?n("span",{class:t.b("text"),domProps:{textContent:t._s(t.leftText)}}):t._e()])],2),n("div",{staticClass:"van-ellipsis",class:t.b("title")},[t._t("title",[t._v(t._s(t.title))])],2),n("div",{class:t.b("right"),on:{click:function(e){t.$emit("click-right")}}},[t._t("right",[t.rightText?n("span",{class:t.b("text"),domProps:{textContent:t._s(t.rightText)}}):t._e()])],2)])},name:"nav-bar",props:{title:String,fixed:Boolean,leftText:String,rightText:String,leftArrow:Boolean,border:{type:Boolean,default:!0},zIndex:{type:Number,default:1}},computed:{style:function(){return{zIndex:this.zIndex}}}}),u=(n("cadf"),n("551c"),n("097d"),{name:"navBar",components:(i={},Object(s["a"])(i,c.name,c),Object(s["a"])(i,r["a"].name,r["a"]),i),props:{path:{type:String,default:"index"},title:{type:String,default:"深大换换礼物交换"}},methods:{onClickLeft:function(){this.$router.push(this.path)}}}),d=u,h=(n("aeeb"),n("2877")),f=Object(h["a"])(d,a,o,!1,null,"7f9774c3",null);f.options.__file="navBar.vue";e["a"]=f.exports},e930:function(t,e,n){"use strict";n("68ef"),n("bcd3")},f253:function(t,e,n){"use strict";var i=n("fe7e"),a=n("1128");function o(t){return Array.isArray(t)?t.map(function(t){return o(t)}):"object"===typeof t?Object(a["a"])({},t):t}var s=n("a142"),r=200,l=Object(i["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b(),t.className],style:t.columnStyle,on:{touchstart:t.onTouchStart,touchmove:function(e){return e.preventDefault(),t.onTouchMove(e)},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}},[n("ul",{style:t.wrapperStyle},t._l(t.options,function(e,i){return n("li",{staticClass:"van-ellipsis",class:t.b("item",{disabled:t.isDisabled(e),selected:i===t.currentIndex}),style:t.optionStyle,domProps:{innerHTML:t._s(t.getOptionText(e))},on:{click:function(e){t.setIndex(i,!0)}}})}))])},name:"picker-column",props:{valueKey:String,className:String,itemHeight:Number,defaultIndex:Number,initialOptions:Array,visibleItemCount:Number},data:function(){return{startY:0,offset:0,duration:0,startOffset:0,options:o(this.initialOptions),currentIndex:this.defaultIndex}},created:function(){this.$parent.children&&this.$parent.children.push(this),this.setIndex(this.currentIndex)},destroyed:function(){var t=this.$parent.children;t&&t.splice(t.indexOf(this),1)},watch:{defaultIndex:function(){this.setIndex(this.defaultIndex)}},computed:{count:function(){return this.options.length},baseOffset:function(){return this.itemHeight*(this.visibleItemCount-1)/2},columnStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},wrapperStyle:function(){return{transition:this.duration+"ms",transform:"translate3d(0, "+(this.offset+this.baseOffset)+"px, 0)",lineHeight:this.itemHeight+"px"}},optionStyle:function(){return{height:this.itemHeight+"px"}}},methods:{onTouchStart:function(t){this.startY=t.touches[0].clientY,this.startOffset=this.offset,this.duration=0},onTouchMove:function(t){var e=t.touches[0].clientY-this.startY;this.offset=Object(s["f"])(this.startOffset+e,-this.count*this.itemHeight,this.itemHeight)},onTouchEnd:function(){if(this.offset!==this.startOffset){this.duration=r;var t=Object(s["f"])(Math.round(-this.offset/this.itemHeight),0,this.count-1);this.setIndex(t,!0)}},adjustIndex:function(t){t=Object(s["f"])(t,0,this.count);for(var e=t;e<this.count;e++)if(!this.isDisabled(this.options[e]))return e;for(var n=t-1;n>=0;n--)if(!this.isDisabled(this.options[n]))return n},isDisabled:function(t){return Object(s["d"])(t)&&t.disabled},getOptionText:function(t){return Object(s["d"])(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){t=this.adjustIndex(t)||0,this.offset=-t*this.itemHeight,t!==this.currentIndex&&(this.currentIndex=t,e&&this.$emit("change",t))},setValue:function(t){for(var e=this.options,n=0;n<e.length;n++)if(this.getOptionText(e[n])===t)return this.setIndex(n)},getValue:function(){return this.options[this.currentIndex]}}}),c={props:{title:String,loading:Boolean,showToolbar:Boolean,cancelButtonText:String,confirmButtonText:String,visibleItemCount:{type:Number,default:5},itemHeight:{type:Number,default:44}}};e["a"]=Object(i["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t.showToolbar?n("div",{staticClass:"van-hairline--top-bottom",class:t.b("toolbar")},[t._t("default",[n("div",{class:t.b("cancel"),on:{click:function(e){t.emit("cancel")}}},[t._v("\n "+t._s(t.cancelButtonText||t.$t("cancel"))+"\n ")]),t.title?n("div",{staticClass:"van-ellipsis",class:t.b("title"),domProps:{textContent:t._s(t.title)}}):t._e(),n("div",{class:t.b("confirm"),on:{click:function(e){t.emit("confirm")}}},[t._v("\n "+t._s(t.confirmButtonText||t.$t("confirm"))+"\n ")])])],2):t._e(),t.loading?n("div",{class:t.b("loading")},[n("loading")],1):t._e(),n("div",{class:t.b("columns"),style:t.columnsStyle,on:{touchmove:function(t){t.preventDefault()}}},[t._l(t.simple?[t.columns]:t.columns,function(e,i){return n("picker-column",{key:i,attrs:{"value-key":t.valueKey,"initial-options":t.simple?e:e.values,"class-name":e.className,"default-index":e.defaultIndex,"item-height":t.itemHeight,"visible-item-count":t.visibleItemCount},on:{change:function(e){t.onChange(i)}}})}),n("div",{staticClass:"van-hairline--top-bottom",class:t.b("frame"),style:t.frameStyle})],2)])},name:"picker",mixins:[c],components:{PickerColumn:l},props:{columns:Array,valueKey:{type:String,default:"text"}},data:function(){return{children:[]}},computed:{frameStyle:function(){return{height:this.itemHeight+"px"}},columnsStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},simple:function(){return this.columns.length&&!this.columns[0].values}},watch:{columns:function(){this.setColumns()}},methods:{setColumns:function(){var t=this,e=this.simple?[{values:this.columns}]:this.columns;e.forEach(function(e,n){t.setColumnValues(n,o(e.values))})},emit:function(t){this.simple?this.$emit(t,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit(t,this.getValues(),this.getIndexes())},onChange:function(t){this.simple?this.$emit("change",this,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit("change",this,this.getValues(),t)},getColumn:function(t){return this.children[t]},getColumnValue:function(t){var e=this.getColumn(t);return e&&e.getValue()},setColumnValue:function(t,e){var n=this.getColumn(t);n&&n.setValue(e)},getColumnIndex:function(t){return(this.getColumn(t)||{}).currentIndex},setColumnIndex:function(t,e){var n=this.getColumn(t);n&&n.setIndex(e)},getColumnValues:function(t){return(this.children[t]||{}).options},setColumnValues:function(t,e){var n=this.children[t];n&&JSON.stringify(n.options)!==JSON.stringify(e)&&(n.options=e,n.setIndex(0))},getValues:function(){return this.children.map(function(t){return t.getValue()})},setValues:function(t){var e=this;t.forEach(function(t,n){e.setColumnValue(n,t)})},getIndexes:function(){return this.children.map(function(t){return t.currentIndex})},setIndexes:function(t){var e=this;t.forEach(function(t,n){e.setColumnIndex(n,t)})}}})}}]);
- //# sourceMappingURL=chunk-2172f842.2c10d880.js.map
|