1 line
26 KiB
JavaScript
1 line
26 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_info_form-index"],{"06e9":function(t,e,i){"use strict";i("6a54");var a=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("0c26"),i("5c47"),i("0506");var n=i("672a"),r=i("e44d"),s=i("8f59"),o=(a(i("ea2b")),{data:function(){return{userInfo:{},loginType:"h5",userIndex:0,canvasWidth:"",canvasHeight:"",canvasStatus:!1,mp_is_new:this.$Cache.get("MP_VERSION_ISNEW")||!1}},components:{},computed:(0,s.mapGetters)(["isLogin","viewColor","keyColor"]),watch:{},onLoad:function(){this.isLogin?this.getUserSetting():(0,r.toLogin)()},onShow:function(){},methods:{radioChange:function(t,e){e.value=t.detail.value},bindDateChange:function(t,e){this.userInfo["extend_info"][e].value=t.detail.value},getUserSetting:function(){var t=this;(0,n.getUserSetting)().then((function(e){t.$set(t,"userInfo",e.data)}))},uploadpic:function(){var t=this;t.canvasStatus=!0,t.$util.uploadImageChange("upload/image",(function(e){t.userInfo.avatar=e.data.url,t.canvasStatus=!1}),(function(e){t.canvasStatus=!1}),(function(e){t.canvasWidth=e.w,t.canvasHeight=e.h}))},onChooseAvatar:function(t){var e=this,i=t.detail.avatarUrl;this.$util.uploadImgs("upload/image",i,(function(t){e.userInfo.avatar=t.data.url}),(function(t){}))},formSubmit:function(t){var e=this,i=t.detail.value;if(!i.nickname)return e.$util.Tips({title:"用户姓名不能为空"});i.avatar=this.userInfo.avatar;for(var a=0;a<e.userInfo.extend_info.length;a++){var r=e.userInfo.extend_info[a];if(r.is_require||r.value){if(("date"===r.type||"address"===r.type)&&!r.value)return e.$util.Tips({title:"".concat(r.msg)});if("input"===r.type&&!r.value.trim())return e.$util.Tips({title:"".concat(r.msg)});if("int"===r.type&&r.value<=0)return e.$util.Tips({title:"".concat(r.msg)});if("email"===r.type){if(r.is_require&&!r.value)return e.$util.Tips({title:"".concat(r.msg)});if(!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(r.value))return e.$util.Tips({title:"请填写正确的邮箱"})}if("phone"===r.type){if(r.is_require&&!r.value)return e.$util.Tips({title:"".concat(r.msg)});if(!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(r.value))return e.$util.Tips({title:"".concat(r.msg)})}if("id_card"===r.type){if(r.is_require&&!r.value)return e.$util.Tips({title:"".concat(r.msg)});if(!/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/i.test(r.value))return e.$util.Tips({title:"请填写正确的身份证号码"})}}}i.extend_info=e.userInfo.extend_info,(0,n.userSettingEdit)(i).then((function(t){e.$util.Tips({title:t.message,icon:"success"}),setTimeout((function(){uni.switchTab({url:"/pages/user/index"})}),500)})).catch((function(t){return e.$util.Tips({title:t||"保存失败,您并没有修改"})}))}}});e.default=o},"2d6f":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",[i("v-uni-form",{on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.formSubmit.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"personal-data",style:t.viewColor},[i("v-uni-view",{staticClass:"list"},[i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",[t._v("头像")]),i("v-uni-view",{staticClass:"avatar-box"},[i("v-uni-image",{attrs:{src:t.userInfo.avatar||"/static/images/f.png"}})],1)],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",[t._v("昵称")]),i("v-uni-view",{staticClass:"input acea-row row-between-wrapper"},[i("v-uni-input",{staticClass:"id",attrs:{type:"nickname",name:"nickname",value:t.userInfo.nickname,maxlength:"16",disabled:!0}}),i("v-uni-text",{staticClass:"iconfont icon-suozi"})],1)],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",[t._v("手机号码")]),t.userInfo.phone?i("v-uni-view",{staticClass:"input acea-row row-between-wrapper"},[i("v-uni-input",{staticClass:"id",attrs:{type:"text",disabl
|