12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1fb320c3"],{"188e":function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"button_container"},[t.can_add?n("img",{staticClass:"add_button s",attrs:{src:"http://pjczv6ygf.bkt.clouddn.com/add-present-button/add_button_active.png"},on:{click:t.toAddPresent}}):t._e(),t.can_add?t._e():n("img",{staticClass:"add_button",attrs:{src:"http://pjczv6ygf.bkt.clouddn.com/add-present-button/add_button_inactive.png"}})])},o=[],i=(n("e7e5"),n("d399")),r={name:"add-present-button",props:{can_add:{type:Boolean,default:!0},disabled:{type:Boolean,default:!0}},methods:{toAddPresent:function(){i["a"].loading({mask:!0,message:"加载中...",duration:500}),this.disabled&&this.$router.push("verify")}}},s=r,l=(n("cf59"),n("2877")),c=Object(l["a"])(s,a,o,!1,null,"3b2d8fb3",null);c.options.__file="addPresentButton.vue";e["a"]=c.exports},2241:function(t,e,n){"use strict";var a,o=n("c31d"),i=n("2b0e"),r=n("fe7e"),s=n("b650"),l=n("6605"),c=Object(r["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-dialog-bounce"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:[t.b(),t.className]},[t.title?n("div",{class:t.b("header",{isolated:!t.message&&!t.$slots.default}),domProps:{textContent:t._s(t.title)}}):t._e(),t.message||t.$slots.default?n("div",{class:t.b("content")},[t._t("default",[t.message?n("div",{class:t.b("message",{"has-title":t.title}),domProps:{innerHTML:t._s(t.message)}}):t._e()])],2):t._e(),n("div",{staticClass:"van-hairline--top",class:t.b("footer",{buttons:t.showCancelButton&&t.showConfirmButton})},[n("van-button",{directives:[{name:"show",rawName:"v-show",value:t.showCancelButton,expression:"showCancelButton"}],class:t.b("cancel"),attrs:{loading:t.loading.cancel,size:"large"},on:{click:function(e){t.handleAction("cancel")}}},[t._v("\n "+t._s(t.cancelButtonText||t.$t("cancel"))+"\n ")]),n("van-button",{directives:[{name:"show",rawName:"v-show",value:t.showConfirmButton,expression:"showConfirmButton"}],class:[t.b("confirm"),{"van-hairline--left":t.showCancelButton&&t.showConfirmButton}],attrs:{size:"large",loading:t.loading.confirm},on:{click:function(e){t.handleAction("confirm")}}},[t._v("\n "+t._s(t.confirmButtonText||t.$t("confirm"))+"\n ")])],1)])])},name:"dialog",components:{VanButton:s["a"]},mixins:[l["a"]],props:{title:String,message:String,callback:Function,className:[String,Object,Array],beforeClose:Function,confirmButtonText:String,cancelButtonText:String,showCancelButton:Boolean,showConfirmButton:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!1}},data:function(){return{loading:{confirm:!1,cancel:!1}}},methods:{handleAction:function(t){var e=this;this.beforeClose?(this.loading[t]=!0,this.beforeClose(t,function(n){!1!==n&&e.onClose(t),e.loading[t]=!1})):this.onClose(t)},onClose:function(t){this.$emit("input",!1),this.$emit(t),this.callback&&this.callback(t)}}}),d=n("a142"),u=function(){a=new(i["a"].extend(c))({el:document.createElement("div")}),a.$on("input",function(t){a.value=t}),document.body.appendChild(a.$el)},f=function t(e){return d["e"]?Promise.resolve():new Promise(function(n,i){a||u(),Object(o["a"])(a,Object(o["a"])({resolve:n,reject:i},t.currentOptions,e))})};f.defaultOptions={value:!0,title:"",message:"",overlay:!0,className:"",lockScroll:!0,beforeClose:null,confirmButtonText:"",cancelButtonText:"",showConfirmButton:!0,showCancelButton:!1,closeOnClickOverlay:!1,callback:function(t){a["confirm"===t?"resolve":"reject"](t)}},f.alert=f,f.confirm=function(t){return f(Object(o["a"])({showCancelButton:!0},t))},f.close=function(){a&&(a.value=!1)},f.setDefaultOptions=function(t){Object(o["a"])(f.currentOptions,t)},f.resetDefaultOptions=function(){f.currentOptions=Object(o["a"])({},f.defaultOptions)},f.install=function(){i["a"].use(c)},i["a"].prototype.$dialog=f,f.resetDefaultOptions();e["a"]=f},"2f21":function(t,e,n){"use strict";var a=n("79e5");t.exports=function(t,e){return!!t&&a(function(){e?t.call(null,function(){},1):t.call(null)})}},"2fcb":function(t,e,n){},"384e":function(t,e,n){},4478:function(t,e,n){"use strict";var a=n("ddc3"),o=n.n(a);o.a},"4d48":function(t,e,n){"use strict";n("68ef"),n("bf60")},"55dd":function(t,e,n){"use strict";var a=n("5ca1"),o=n("d8e8"),i=n("4bf8"),r=n("79e5"),s=[].sort,l=[1,2,3];a(a.P+a.F*(r(function(){l.sort(void 0)})||!r(function(){l.sort(null)})||!n("2f21")(s)),"Array",{sort:function(t){return void 0===t?s.call(i(this)):s.call(i(this),o(t))}})},"7b0a":function(t,e,n){},"81e6":function(t,e,n){"use strict";n("68ef"),n("7b0a")},9072:function(t,e,n){"use strict";var a=n("fbd4"),o=n.n(a);o.a},9899:function(t,e,n){},"9c36":function(t,e,n){"use strict";var a=n("9899"),o=n.n(a);o.a},"9ffb":function(t,e,n){"use strict";var a=n("fe7e");e["a"]=Object(a["a"])({render:function(){var t,e=this,n=e.$createElement,a=e._self._c||n;return a(e.tag,{tag:"component",class:e.b((t={},t[e.span]=e.span,t["offset-"+e.offset]=e.offset,t)),style:e.style},[e._t("default")],2)},name:"col",props:{span:[Number,String],offset:[Number,String],tag:{type:String,default:"div"}},computed:{gutter:function(){return this.$parent&&Number(this.$parent.gutter)||0},style:function(){var t=this.gutter/2+"px";return this.gutter?{paddingLeft:t,paddingRight:t}:{}}}})},bf60:function(t,e,n){},cf59:function(t,e,n){"use strict";var a=n("384e"),o=n.n(a);o.a},d1e1:function(t,e,n){"use strict";var a=n("fe7e");e["a"]=Object(a["a"])({render:function(){var t,e=this,n=e.$createElement,a=e._self._c||n;return a(e.tag,{tag:"component",class:e.b((t={flex:e.flex},t["align-"+e.align]=e.flex&&e.align,t["justify-"+e.justify]=e.flex&&e.justify,t)),style:e.style},[e._t("default")],2)},name:"row",props:{type:String,align:String,justify:String,tag:{type:String,default:"div"},gutter:{type:[Number,String],default:0}},computed:{flex:function(){return"flex"===this.type},style:function(){var t="-"+Number(this.gutter)/2+"px";return this.gutter?{marginLeft:t,marginRight:t}:{}}}})},ddc3:function(t,e,n){},e17f:function(t,e,n){"use strict";n("68ef"),n("4d75"),n("2fcb")},e869:function(t,e,n){"use strict";n.r(e);var a,o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticStyle:{"margin-bottom":"20px"}},[n("schoolid-card"),n("school-card")],1),n("van-button",{staticStyle:{margin:"0 10px 90px 10px",width:"90%"},attrs:{type:"danger",size:"large"},on:{click:t.logout}},[t._v("退出登录\n ")]),n("add-present-button",{attrs:{can_add:!1}})],1)},i=[],r=(n("55dd"),n("ac6a"),n("e7e5"),n("d399")),s=(n("e17f"),n("2241")),l=n("ade3"),c=(n("7f7f"),n("66b9"),n("b650")),d=(n("cadf"),n("551c"),n("097d"),n("188e")),u=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("van-row",{staticStyle:{"border-bottom":"solid 1px #e4e4e4"}},[n("van-col",{attrs:{span:"14"}},[n("h3",[n("strong",[t._v("个人资料")])])]),n("van-col",{attrs:{span:"6"}},[n("p",{on:{click:function(e){t.toggleReadOnly()}}},[t._v(t._s(t.isReadonly?"编辑":"保存"))])])],1),n("p",[t._v("昵称")]),n("van-cell-group",[n("van-field",{attrs:{placeholder:"请输入昵称",error:t.personError,required:"",maxlength:"10",readonly:t.isReadonly},on:{click:function(e){t.personError=!1}},model:{value:t.personName,callback:function(e){t.personName=e},expression:"personName"}})],1),n("p",[t._v("性别")]),n("van-radio-group",{model:{value:t.gender,callback:function(e){t.gender=e},expression:"gender"}},[n("van-radio",{staticStyle:{float:"left","margin-right":"20px"},attrs:{name:"1","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("男")]),n("van-radio",{attrs:{name:"2","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("女")])],1),n("p",[t._v("微信号")]),n("van-cell-group",[n("van-field",{attrs:{placeholder:" ",error:t.weixinError,required:"",maxlength:"20",readonly:t.isReadonly},on:{click:function(e){t.weixinError=!1}},model:{value:t.weixinName,callback:function(e){t.weixinName=e},expression:"weixinName"}})],1),n("p",[t._v("宿舍区")]),n("van-radio-group",{model:{value:t.dormDistrict,callback:function(e){t.dormDistrict=e},expression:"dormDistrict"}},[n("van-radio",{staticStyle:{float:"left",margin:"0 0 15px 10px"},attrs:{name:"0","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("斋区\n ")]),n("van-radio",{staticStyle:{float:"left",margin:"0 10px 15px 10px"},attrs:{name:"1","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("西南\n ")]),n("van-radio",{staticStyle:{margin:"0 10px 15px 10px"},attrs:{name:"2","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("南区\n ")]),n("van-radio",{staticStyle:{float:"left",margin:"0 0 15px 10px"},attrs:{name:"3","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("桂庙\n ")]),n("van-radio",{staticStyle:{float:"left",margin:"0 10px 15px"},attrs:{name:"4","checked-color":"#fd6740",disabled:t.isReadonly}},[t._v("西丽\n ")])],1)],1)},f=[],m=(n("6b54"),n("81e6"),n("9ffb")),h=(n("4d48"),n("d1e1")),g=(n("4ddd"),n("9f14")),v=(n("a44c"),n("e27c")),p=(n("be7f"),n("565f")),b=(n("0653"),n("34e9")),y=n("6ef9"),_={name:"schoolidCard",components:(a={},Object(l["a"])(a,b["a"].name,b["a"]),Object(l["a"])(a,p["a"].name,p["a"]),Object(l["a"])(a,v["a"].name,v["a"]),Object(l["a"])(a,g["a"].name,g["a"]),Object(l["a"])(a,h["a"].name,h["a"]),Object(l["a"])(a,m["a"].name,m["a"]),a),data:function(){return{gender:"0",dormDistrict:"1",personName:"",personError:!1,weixinName:"",weixinError:!1,isReadonly:!0,userDo:{},reviewDo:{}}},methods:{uploadNameChange:function(){var t=this;y["a"].get_data("smartUsers/updateBatch",function(e){"10000"===e.ret?(t.isReadonly=!0,r["a"].success("上传成功")):r["a"].fail("上传失败,请检查网络")},[this.userDo])},uploadReviewChange:function(){var t=this;y["a"].get_data("smartIdentity/updateBatch",function(e){"10000"===e.ret?(t.isReadonly=!0,r["a"].success("上传成功")):r["a"].fail("上传失败,请检查网络")},[this.reviewDo])},toggleReadOnly:function(){this.isReadonly||this.savePage(),this.isReadonly=!this.isReadonly},savePage:function(){if(0!==this.personName.length){if(this.weixinName.length<6)return this.weixinError=!0,void r["a"].fail("请输入正确格式的微信号");this.userDo.name=this.personName,this.uploadNameChange(),this.reviewDo.userSex=parseInt(this.gender),this.reviewDo.dormDistrict=parseInt(this.dormDistrict),this.uploadReviewChange()}else this.personError=!0},getIdentityInfo:function(t){if(void 0==localStorage.getItem("frontend-userid")||null==localStorage.getItem("frontend-userid"))return localStorage.removeItem("frontend-userid"),void this.$router.push("login");var e=localStorage.getItem("frontend-userid"),n=this;y["a"].get_data("smartUsers/list?uid="+e,function(t){void 0!==t&&void 0!==t.model&&void 0!==t.model.list&&0!==t.model.list.length||(localStorage.removeItem("frontend-userid"),n.$router.push("login"));try{var e=t.model.list;"10000"===t.ret?(n.personName=e[0].name,n.userDo=e[0]):r["a"].fail("获取信息失败,请检查网络")}catch(a){console.warn(a),r["a"].fail("获取信息失败,请检查网络")}},[{}])},getReviewInfo:function(t){if(localStorage.getItem("frontend-userid")){var e=localStorage.getItem("frontend-userid"),n=this;y["a"].get_data("smartIdentity/list?userId="+e,function(t){if(void 0!=t&&void 0!=t.model&&void 0!=t.model.list&&0!=t.model.list.length)try{var e=t.model.list;"10000"===t.ret&&void 0!=e[0]&&void 0!=e[0].userSex?(n.gender=""+e[0].userSex,n.dormDistrict=e[0].dormDistrict.toString(),n.reviewDo=e[0],n.weixinName=e[0].userWxAccount):r["a"].fail("获取失败,请检查网络")}catch(a){console.warn(a),r["a"].fail("获取失败,请检查网络")}else n.$router.push("login")},[{}])}else this.$router.push("login")}},created:function(){if(localStorage.getItem("frontend-userid")){var t=this;this.getIdentityInfo(t),this.getReviewInfo(t)}else this.$router.push("login")}},w=_,x=(n("9c36"),n("2877")),S=Object(x["a"])(w,u,f,!1,null,"43576ccc",null);S.options.__file="schoolidCard.vue";var C,I=S.exports,O=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card",staticStyle:{"margin-bottom":"0"}},[n("van-row",{staticStyle:{"border-bottom":"solid 1px #e4e4e4"}},[n("van-col",{attrs:{span:"14"}},[n("h3",[n("strong",[t._v("校卡审核")])])]),n("van-col",{attrs:{span:"6"}},[n("p",{style:{color:t.statusColor}},[t._v(t._s(t.statusString))])])],1),30===t.status||500===t.status?n("div",[n("add-photo",{on:{onRead:t.onRead}}),n("p",[t._v(t._s(t.note))]),n("van-button",{staticStyle:{width:"100%"},attrs:{type:"primary",loading:t.loading},on:{click:t.schoolPresent}},[t._v("保存\n ")])],1):n("div",[n("img",{staticStyle:{"max-width":"100%"},attrs:{src:t.schoolpic}})])],1)},R=[],k=(n("34ef"),n("4917"),n("28a5"),n("1901")),j={name:"schoolCard",components:(C={AddPhoto:k["a"]},Object(l["a"])(C,h["a"].name,h["a"]),Object(l["a"])(C,m["a"].name,m["a"]),Object(l["a"])(C,c["a"].name,c["a"]),C),data:function(){return{statusColor:"",statusString:"-----",photo:null,loading:!1,status:0,imgage:null,imgDo:{},schoolpic:"",IMGPREFIX:"http://gift.fogice.com",note:""}},methods:{schoolPresent:function(){if(this.loading=!0,null===this.photo)return r["a"].fail("请上传礼物照片"),void(this.loading=!1);this.compressImg()},compressImg:function(){var t=this,e=this.photo;B(e,{quality:.2},function(e){var n=new FormData,a=$(e);n.append("file",a),t.uploadImg(n)})},uploadImg:function(t){var e=this;y["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 r["a"].fail("上传图片失败,请检查网络"),e.loading=!1}catch(a){console.warn(a),r["a"].fail("上传图片失败,请检查网络"),e.loading=!1}},t)},updateInfo:function(t){var e=this,n=e.imgDo;null!=t&&(n.userSchoolCardPic=t,n.userSchoolCardPic=t,n.userReviewStatus=100,n.reviewerNote="等待审核",n.reviewerNoteToUser="等待审核",y["a"].get_data("smartIdentity/updateBatch",function(t){"10000"===t.ret?(r["a"].success("上传成功"),e.loading=!1,location.reload()):(r["a"].fail("上传失败,请检查网络"),e.loading=!1)},[n]))},onRead:function(t){this.photo=t}},created:function(){if(localStorage.getItem("frontend-userid")){var t=localStorage.getItem("frontend-userid"),e=this;y["a"].get_data("smartIdentity/list?userId="+t,function(t){if(void 0!==t&&void 0!==t.model&&void 0!==t.model.list||(Object(r["a"])("读取失败,请检查网络"),e.$router.push("verify")),"10000"===t.ret)try{var n=t.model.list;e.status=n[0].userReviewStatus,e.imgDo=n[0],e.note=n[0].reviewerNoteToUser,0===t.model.list.length||30===e.status?(e.statusColor="#c5c5c5",e.statusString="未上传校卡",e.$router.push("verify")):100===e.status||1e3===e.status?(e.schoolpic=e.IMGPREFIX+n[0].userSchoolCardPic,100===e.status&&(e.statusColor="#c5c530",e.statusString="审核中"),1e3===e.status&&(e.statusColor="#00ff00",e.statusString="审核通过")):(e.statusColor="#ff0000",e.statusString="审核未通过")}catch(a){console.warn(a),r["a"].fail("获取用户信息失败")}},{})}else this.$router.push("login")}};function B(t,e,n){var a=new FileReader;a.readAsDataURL(t),a.onload=function(){var t=this.result;N(t,e,n)}}function N(t,e,n){var a=new Image;a.src=t,a.onload=function(){var t=this,a=t.width,o=t.height,i=a/o;a=e.width||a,o=e.height||a/i;var r=.7,s=document.createElement("canvas"),l=s.getContext("2d"),c=document.createAttribute("width");c.nodeValue=a;var d=document.createAttribute("height");d.nodeValue=o,s.setAttributeNode(c),s.setAttributeNode(d),l.drawImage(t,0,0,a,o),e.quality&&e.quality<=1&&e.quality>0&&(r=e.quality);var u=s.toDataURL("image/jpeg",r);n(u)}}function $(t){var e=t.split(","),n=e[0].match(/:(.*?);/)[1],a=atob(e[1]),o=a.length,i=new Uint8Array(o);while(o--)i[o]=a.charCodeAt(o);return new Blob([i],{type:n})}var D=j,E=(n("9072"),Object(x["a"])(D,O,R,!1,null,"31feaae1",null));E.options.__file="schoolCard.vue";var P=E.exports,A={name:"me",components:Object(l["a"])({SchoolCard:P,SchoolidCard:I,AddPresentButton:d["a"]},c["a"].name,c["a"]),data:function(){return{button_active:!1,photoURL:""}},methods:{logout:function(){var t=this;s["a"].confirm({title:"退出登录吗",message:"退出登录后,请在公众号回复“1”重新获取链接登录哦"}).then(function(){r["a"].loading({mask:!0,message:"加载中...",duration:1e3}),localStorage.removeItem("frontend-userid"),t.$router.push("warning")}).catch()}},created:function(){if(localStorage.getItem("frontend-userid")){var t=!0,e=localStorage.getItem("frontend-userid"),n=this;y["a"].get_data("smartGoods/list?isDel=0&ownerId="+e,function(e){try{var a=e.model.list;"10000"===e.ret&&void 0!==e.model&&void 0!==e.model.list?(a.forEach(function(e){4!==e.sort&&(t=!1)}),n.button_active=t):n.button_active=!0}catch(o){console.warn(o),n.button_active=!0}},{})}else this.$router.push("login")},mounted:function(){document.getElementsByName("me_icon")[0].click()}},T=A,U=(n("4478"),Object(x["a"])(T,o,i,!1,null,"1d652d40",null));U.options.__file="me.vue";e["default"]=U.exports},fbd4:function(t,e,n){}}]);
- //# sourceMappingURL=chunk-1fb320c3.10928cdb.js.map
|