| 1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["bundle/pages/user_profile/user_profile"],{"2c4f":function(e,t,n){"use strict";(function(e){var o=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n("7eb4")),r=o(n("ee10")),i=o(n("7ca3")),s=n("e585"),u=n("704d"),c=n("7398"),f=n("8f59"),p=n("bb87"),d=o(n("00b8")),l=o(n("d361"));function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g={NONE:"",SEX:"sex",NICKNAME:"nickname",AVATAR:"avatar",MOBILE:"mobile"},m={data:function(){return{userInfos:{},fieldType:g.NONE,smsType:u.SMSEnum["FINDPWD"],showNickName:!1,newNickname:"",mobile:"",showPicker:!1,sexList:["男","女"],payList:[{text:"设置密码"},{text:"忘记密码"}],has_pay_password:!1,showTipsPwd:!1,showTipsLogin:!1,has_password:!1,loginList:[{text:"设置密码"},{text:"忘记密码"}]}},computed:w({},(0,f.mapGetters)(["client"])),methods:w(w(w({},(0,f.mapActions)(["getUser"])),(0,f.mapMutations)(["logout"])),{},{getUserInfoFun:function(){var e=this;(0,s.apiGetUserInfo)().then((function(t){e.userInfos=t}))},setUserInfoFun:function(e){var t=this;return(0,r.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,s.apiSetUserInfo)({field:t.fieldType,value:e});case 2:t.getUserInfoFun();case 3:case"end":return n.stop()}}),n)})))()},onChooseAvatar:function(e){this.$Router.push({path:"/bundle/pages/user_set/user_set"})},changeNameConfirm:function(e){var t=this;return(0,r.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.fieldType=g.NICKNAME,t.newNickname=e.detail.value.nickname,t.newNickname){n.next=4;break}return n.abrupt("return",t.$toast({title:"请输入新的昵称"}));case 4:return n.next=6,t.setUserInfoFun(t.newNickname);case 6:t.showNickName=!1;case 7:case"end":return n.stop()}}),n)})))()},changeSex:function(){this.showPicker=!0,this.fieldType=g.SEX},changeSexConfirm:function(e){this.setUserInfoFun(e[0]+1),this.showPicker=!1},getPhoneNumber:function(e){var t=this;return(0,r.default)(a.default.mark((function n(){var o,r,i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=e.detail,r=o.code,i=o.errMsg,"getPhoneNumber:ok"===i){n.next=3;break}return n.abrupt("return",t.$toast({title:"绑定失败"}));case 3:(0,s.apiMnpBindMobile)({code:r}).then((function(e){t.getUserInfoFun()}));case 4:case"end":return n.stop()}}),n)})))()},getHasPayPassword:function(){var e=this;(0,s.hasPayPassword)().then((function(t){e.has_pay_password=t.has_pay_password,0==t.has_pay_password?e.payList=[{text:"设置密码"}]:e.payList=[{text:"修改密码"},{text:"忘记密码"}]}))},showPayPwd:function(){this.showTipsPwd=!0,console.log(this.showTipsPwd)},actionSheetPay:function(e){this.has_pay_password?0===e?this.goPage("/bundle/pages/pay_pwd/pay_pwd",2):1===e&&this.goPage("/bundle/pages/pay_pwd/pay_pwd",3):this.goPage("/bundle/pages/pay_pwd/pay_pwd",1)},getHasLoginPassword:function(){var e=this;(0,s.apiHasPassword)().then((function(t){e.has_password=t.has_password,0==t.has_password?e.loginList=[{text:"设置密码"}]:e.loginList=[{text:"修改密码"},{text:"忘记密码"}]}))},showLogin:function(){this.showTipsLogin=!0},actionSheetLogin:function(e){console.log(this.has_password),this.has_password?0===e?this.goPage("/bundle/pages/pay_pwd/pay_pwd",7):1===e&&this.goPage("/bundle/pages/pay_pwd/pay_pwd",8):this.goPage("/bundle/pages/pay_pwd/pay_pwd",6)},goPage:function(e,t){this.$Router.push({path:e,query:{type:t}})},logOut:function(){var t=this;e.showModal({content:"是否退出登录?",confirmColor:this.themeColor,success:function(n){var o=n.cancel;o||(0,s.apiLogout)().then((function(n){d.default.remove("TOKEN"),d.default.remove("USER_INFO"),t.logout(),e.redirectTo({url:"/pages/login/login"})}))}})},bindWechat:function(){switch(this.client){case u.ClientEnum["MP_WEIXIN"]:this.mnpAuth();break;case u.ClientEnum["OA_WEIXIN"]:this.oaAuth();break}},mnpAuth:function(){var e=this;return(0,r.default)(a.default.mark((function t(){var n,o;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,p.getCode)();case 2:return n=t.sent,t.next=5,(0,s.apiMnpAuthLogin)({code:n});case 5:return t.next=7,e.getUser();case 7:o=e.$Route.query.form,"payment"===o&&e.$Router.back();case 9:case"end":return t.stop()}}),t)})))()},oaAuth:function(){l.default.getWxUrl()},uploadImage:function(t){var n=this;e.showLoading({title:"正在上传中...",mask:!0}),(0,c.uploadFile)(t).then((function(t){e.hideLoading(),n.setUserInfoFun(t.uri)})).catch((function(){e.hideLoading(),n.$toast({title:"上传失败"})}))}}),onLoad:function(){var t=this;return(0,r.default)(a.default.mark((function n(){return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:e.$on("uAvatarCropper",(function(e){t.uploadImage(e)})),t.bindWechat=(0,c.trottle)(t.bindWechat);case 2:case"end":return n.stop()}}),n)})))()},onUnload:function(){e.$off("uAvatarCropper")},onShow:function(){this.getUserInfoFun(),this.getHasPayPassword(),this.getHasLoginPassword()}};t.default=m}).call(this,n("df3c")["default"])},"32ff":function(e,t,n){},3651:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));var o={uIcon:function(){return n.e("components/uview-ui/components/u-icon/u-icon").then(n.bind(null,"1340"))},uPopup:function(){return n.e("components/uview-ui/components/u-popup/u-popup").then(n.bind(null,"002f"))},uFormItem:function(){return Promise.all([n.e("common/vendor"),n.e("components/uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"3fe1"))},uPicker:function(){return Promise.all([n.e("common/vendor"),n.e("components/uview-ui/components/u-picker/u-picker")]).then(n.bind(null,"78c2"))},uActionSheet:function(){return n.e("components/uview-ui/components/u-action-sheet/u-action-sheet").then(n.bind(null,"0a8a"))}},a=function(){var e=this.$createElement;this._self._c},r=[]},4114:function(e,t,n){"use strict";var o=n("32ff"),a=n.n(o);a.a},6658:function(e,t,n){"use strict";n.r(t);var o=n("2c4f"),a=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=a.a},aaf1:function(e,t,n){"use strict";n.r(t);var o=n("3651"),a=n("6658");for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(r);n("4114");var i=n("828b"),s=Object(i["a"])(a["default"],o["b"],o["c"],!1,null,"6005fa36",null,!1,o["a"],void 0);t["default"]=s.exports},deab:function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("b46f");o(n("3240"));var a=o(n("aaf1"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])}},[["deab","common/runtime","common/vendor"]]]);
|