You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.2 KiB
1 lines
7.2 KiB
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/user_info/index"],{"4d6a":function(t,i,e){"use strict";(function(t){var n=e("47a9");Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var a=e("77d7"),r=e("a230"),s=e("7ba4"),o=e("8f59"),u=(n(e("bc59")),n(e("cef6"))),c={components:{tuiModal:function(){e.e("components/tui-modal/index").then(function(){return resolve(e("ac66"))}.bind(null,e)).catch(e.oe)},NavBar:function(){e.e("components/NavBar").then(function(){return resolve(e("5962"))}.bind(null,e)).catch(e.oe)}},mixins:[u.default],data:function(){return{isCancellation:!1,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){},deep:!0}},onLoad:function(){this.isLogin?this.getUserInfo():this.getIsLogin()},onShow:function(){t.removeStorageSync("form_type_cart")},methods:{getIsLogin:function(){(0,s.toLogin)()},addressList:function(){this.getCityList()},getCityList:function(){var t=this,i=this;(0,r.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||[],a=n.length&&n[0].c||[];this.district.forEach((function(i){t.push(i.n)})),n.forEach((function(t){i.push(t.n)})),a.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:[]},a=n.c[e[1]]||{v:0},r=this.multiArray,s=t.detail.value;this.region=[r[0][s[0]],r[1][s[1]],r[2][s[2]]],this.userInfo.register_extend_info[i].value=a.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:[]},a=this.multiArray,r=this.multiIndex;switch(r[i]=e,i){case 0:var s=n.c[0]||{c:[]};a[1]=n.c.map((function(t){return t.n})),a[2]=s.c.map((function(t){return t.n}));break;case 1:var o=this.district[r[0]].c[r[1]].c||[];a[2]=o.map((function(t){return t.n}));break;case 2:break}this.$set(this.multiArray,0,a[0]),this.$set(this.multiArray,1,a[1]),this.$set(this.multiArray,2,a[2]),this.multiIndex=r},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],a=this;return a.userIndex=i,a.switchUserInfo.length<=1||(void 0===n?a.$util.Tips({title:"切换的账号不存在"}):void("h5"===n.user_type?(t.showLoading({title:"正在切换中"}),(0,r.switchH5Login)().then((function(i){t.hideLoading(),a.$store.commit("LOGIN",{token:i.data.token,time:e.$Cache.strTotime(i.data.expires_time)-e.$Cache.time()}),a.getUserInfo()})).catch((function(i){return t.hideLoading(),a.$util.Tips({title:i})}))):(a.$store.commit("LOGOUT"),t.showLoading({title:"正在切换中"}),this.getIsLogin())))},getUserInfo:function(){var t=this;(0,a.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){}))},bindPhone:function(){t.navigateTo({url:"/pages/users/user_phone/index"})},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 r=i.userInfo.register_extend_info[n];if(r.required||r.value){if(("date"===r.format||"address"===r.format)&&!r.value)return i.$util.Tips({title:"".concat(r.tip)});if("text"===r.format&&!r.value.trim())return i.$util.Tips({title:"".concat(r.tip)});if("num"===r.format&&r.value<=0)return i.$util.Tips({title:"".concat(r.tip)});if("mail"===r.format){if(r.required&&!r.value)return i.$util.Tips({title:"".concat(r.tip)});if(r.value&&!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(r.value))return i.$util.Tips({title:"请填写正确的邮箱"})}if("phone"===r.format&&!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(r.value))return i.$util.Tips({title:"".concat(r.tip)});if("id"===r.format){if(r.required&&!r.value)return i.$util.Tips({title:"".concat(r.tip)});if(r.value&&!/^[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 i.$util.Tips({title:"请填写正确的身份证号码"})}}}e.extend_info=i.userInfo.register_extend_info,(0,a.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("df3c")["default"])},"54ce":function(t,i,e){},5585:function(t,i,e){"use strict";(function(t,i){var n=e("47a9");e("7561");n(e("3240"));var a=n(e("815c"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(a.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},"7d11":function(t,i,e){"use strict";var n=e("54ce"),a=e.n(n);a.a},"815c":function(t,i,e){"use strict";e.r(i);var n=e("f7fd"),a=e("9bd1");for(var r in a)["default"].indexOf(r)<0&&function(t){e.d(i,t,(function(){return a[t]}))}(r);e("7d11");var s=e("828b"),o=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"43653b84",null,!1,n["a"],void 0);i["default"]=o.exports},"9bd1":function(t,i,e){"use strict";e.r(i);var n=e("4d6a"),a=e.n(n);for(var r in n)["default"].indexOf(r)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(r);i["default"]=a.a},f7fd:function(t,i,e){"use strict";e.d(i,"b",(function(){return n})),e.d(i,"c",(function(){return a})),e.d(i,"a",(function(){}));var n=function(){var t=this,i=t.$createElement;t._self._c;t._isMounted||(t.e0=function(i){t.isCancellation=!0},t.e1=function(i){t.isCancellation=!1},t.e2=function(i){t.isCancellation=!1})},a=[]}},[["5585","common/runtime","common/vendor"]]]); |