1 |
- require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/user_info/index"],{"00ff":function(t,i,e){"use strict";e.d(i,"b",(function(){return n})),e.d(i,"c",(function(){return r})),e.d(i,"a",(function(){}));var n=function(){var t=this.$createElement;this._self._c},r=[]},"23d7":function(t,i,e){"use strict";(function(t){var n=e("4ea4");Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var r=e("4818"),s=e("3c98"),a=e("8e8a"),o=e("26cb"),u=(n(e("6fc6")),n(e("5c3b"))),c={components:{},mixins:[u.default],data:function(){return{userInfo:{},loginType:"h5",userIndex:0,switchUserInfo:[],isAuto:!1,isShowAuth:!1,canvasWidth:"",canvasHeight:"",canvasStatus:!1,district:[],multiArray:[],multiIndex:[0,0,0],valueRegion:[0,0,0],region:["省","市","区"],mp_is_new:this.$Cache.get("MP_VERSION_ISNEW")||!1}},computed:(0,o.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,i){t&&this.getUserInfo()},deep:!0}},onLoad:function(){this.isLogin?this.getUserInfo():this.getIsLogin()},onShow:function(){t.removeStorageSync("form_type_cart")},methods:{getIsLogin:function(){(0,a.toLogin)()},addressList:function(){this.getCityList()},getCityList:function(){var t=this,i=this;(0,s.getCity)().then((function(e){t.district=e.data,i.initialize()}))},initialize:function(){var t=[],i=[],e=[];if(this.district.length){var n=this.district[0].c||[],r=n.length&&n[0].c||[];this.district.forEach((function(i){t.push(i.n)})),n.forEach((function(t){i.push(t.n)})),r.forEach((function(t){e.push(t.n)})),this.multiArray=[t,i,e]}},bindRegionChange:function(t,i){var e=this.multiIndex,n=this.district[e[0]]||{c:[]},r=n.c[e[1]]||{v:0},s=this.multiArray,a=t.detail.value;this.region=[s[0][a[0]],s[1][a[1]],s[2][a[2]]],this.userInfo.register_extend_info[i].value=r.v,this.userInfo.register_extend_info[i].province=this.region[0],this.userInfo.register_extend_info[i].city=this.region[1],this.userInfo.register_extend_info[i].district=this.region[2],this.valueRegion=[0,0,0],this.initialize()},bindMultiPickerColumnChange:function(t){var i=t.detail.column,e=t.detail.value,n=this.district[e]||{c:[]},r=this.multiArray,s=this.multiIndex;switch(s[i]=e,i){case 0:var a=n.c[0]||{c:[]};r[1]=n.c.map((function(t){return t.n})),r[2]=a.c.map((function(t){return t.n}));break;case 1:var o=this.district[s[0]].c[s[1]].c||[];r[2]=o.map((function(t){return t.n}));break;case 2:break}this.$set(this.multiArray,0,r[0]),this.$set(this.multiArray,1,r[1]),this.$set(this.multiArray,2,r[2]),this.multiIndex=s},radioChange:function(t,i){this.userInfo.register_extend_info[i].value=t.detail.value},bindDateChange:function(t,i){this.userInfo.register_extend_info[i].value=t.target.value},onLoadFun:function(){this.getUserInfo(),this.isShowAuth=!1},authColse:function(t){this.isShowAuth=t},Setting:function(){t.openSetting({success:function(t){}})},switchAccounts:function(i){var e=this,n=this.switchUserInfo[i],r=this;return r.userIndex=i,r.switchUserInfo.length<=1||(void 0===n?r.$util.Tips({title:"切换的账号不存在"}):void("h5"===n.user_type?(t.showLoading({title:"正在切换中"}),(0,s.switchH5Login)().then((function(i){t.hideLoading(),r.$store.commit("LOGIN",{token:i.data.token,time:e.$Cache.strTotime(i.data.expires_time)-e.$Cache.time()}),r.getUserInfo()})).catch((function(i){return t.hideLoading(),r.$util.Tips({title:i})}))):(r.$store.commit("LOGOUT"),t.showLoading({title:"正在切换中"}),this.getIsLogin())))},outLogin:function(){var i=this;"h5"==i.loginType&&t.showModal({title:"提示",content:"确认退出登录?",success:function(e){e.confirm?(0,r.getLogout)().then((function(e){i.$store.commit("LOGOUT"),t.reLaunch({url:"/pages/index/index"})})).catch((function(t){})):e.cancel}})},getUserInfo:function(){var t=this;(0,r.getUserInfo)().then((function(i){i.data.register_extend_info.forEach((function(t){"radio"==t.format?t.value="0":(t.value="","address"==t.format&&(t.province="",t.city="",t.district=""))})),i.data.register_extend_info.forEach((function(e){i.data.extend_info.forEach((function(i){if(e.info===i.info&&(e.value=i.value,"address"==e.format)){var n=[i.province,i.city,i.district];t.$set(t,"region",n)}}))})),t.$set(t,"userInfo",i.data);for(var e=i.data.switchUserInfo||[],n=0;n<e.length;n++)e[n].uid==t.userInfo.uid&&(t.userIndex=n);t.$set(t,"switchUserInfo",e)}))},uploadpic:function(){var t=this,i=this;this.canvasStatus=!0,i.$util.uploadImageChange("upload/image",(function(e){var n=i.switchUserInfo[i.userIndex];i.userInfo.avatar=e.data.url,i.switchUserInfo[i.userIndex]=n,i.$set(i,"switchUserInfo",i.switchUserInfo),t.canvasStatus=!1}),(function(i){t.canvasStatus=!1}),(function(i){t.canvasWidth=i.w,t.canvasHeight=i.h}))},onChooseAvatar:function(t){var i=this,e=t.detail.avatarUrl;this.$util.uploadImgs("upload/image",e,(function(t){i.userInfo.avatar=t.data.url}),(function(t){}))},formSubmit:function(t){var i=this,e=t.detail.value;i.switchUserInfo[i.userIndex];if(!e.nickname)return i.$util.Tips({title:"用户姓名不能为空"});e.avatar=this.userInfo.avatar;for(var n=0;n<i.userInfo.register_extend_info.length;n++){var s=i.userInfo.register_extend_info[n];if(s.required||s.value){if(("date"===s.format||"address"===s.format)&&!s.value)return i.$util.Tips({title:"".concat(s.tip)});if("text"===s.format&&!s.value.trim())return i.$util.Tips({title:"".concat(s.tip)});if("num"===s.format&&s.value<=0)return i.$util.Tips({title:"".concat(s.tip)});if("mail"===s.format){if(s.required&&!s.value)return i.$util.Tips({title:"".concat(s.tip)});if(!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(s.value))return i.$util.Tips({title:"请填写正确的邮箱"})}if("phone"===s.format){if(s.required&&!s.value)return i.$util.Tips({title:"".concat(s.tip)});if(!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(s.value))return i.$util.Tips({title:"".concat(s.tip)})}if("id"===s.format){if(s.required&&!s.value)return i.$util.Tips({title:"".concat(s.tip)});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(s.value))return i.$util.Tips({title:"请填写正确的身份证号码"})}}}e.extend_info=i.userInfo.register_extend_info,(0,r.userEdit)(e).then((function(t){return i.$util.Tips({title:t.msg,icon:"success"})})).catch((function(t){return i.$util.Tips({title:t||"保存失败,您并没有修改"})}))}}};i.default=c}).call(this,e("543d")["default"])},4271:function(t,i,e){"use strict";(function(t,i){var n=e("4ea4");e("59a4");n(e("66fd"));var r=n(e("b7f2"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(r.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},"6b8b":function(t,i,e){"use strict";e.r(i);var n=e("23d7"),r=e.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(s);i["default"]=r.a},"8ed0":function(t,i,e){"use strict";var n=e("ba4b"),r=e.n(n);r.a},b7f2:function(t,i,e){"use strict";e.r(i);var n=e("00ff"),r=e("6b8b");for(var s in r)["default"].indexOf(s)<0&&function(t){e.d(i,t,(function(){return r[t]}))}(s);e("8ed0");var a=e("f0c5"),o=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"3bf2d330",null,!1,n["a"],void 0);i["default"]=o.exports},ba4b:function(t,i,e){}},[["4271","common/runtime","common/vendor"]]]);
|