bundle-pages-user_profile-user_profile.b5b819f9.js 17 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["bundle-pages-user_profile-user_profile"],{"02ee":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}));var a={uIcon:n("adc7").default,uPopup:n("8d0a").default,uFormItem:n("7e30").default,uPicker:n("d0b7").default,uActionSheet:n("5bb5").default},i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{class:e.themeName},[n("v-uni-view",{staticClass:"header bg-white p-t-30",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.onChooseAvatar.apply(void 0,arguments)}}},[n("v-uni-button",{staticClass:"flex",attrs:{"hover-class":"none"}},[n("v-uni-image",{attrs:{src:""!=e.userInfos.avatar?e.userInfos.avatar:"../../static/images/icon_wechat.png"}})],1),n("v-uni-view",{staticClass:"m-l-40"},[n("v-uni-view",{staticClass:"nickname lg"},[e._v(e._s(e.userInfos.nickname))]),n("v-uni-view",{staticClass:"muted m-t-20"},[e._v("ID:"+e._s(e.userInfos.sn))])],1),n("v-uni-view",{staticStyle:{"margin-left":"auto"}},[n("u-icon",{attrs:{name:"arrow-right"}})],1)],1),n("v-uni-view",{staticClass:"item nr flex row-between",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.showPayPwd.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"label"},[e._v("转账密码")]),n("u-icon",{attrs:{name:"arrow-right"}})],1),n("v-uni-view",{staticClass:"item nr flex row-between",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.showLogin.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"label"},[e._v("登录密码")]),n("u-icon",{attrs:{name:"arrow-right"}})],1),0===e.userInfo.is_auth?n("v-uni-view",{staticClass:"item nr flex row-between"},[n("v-uni-view",{staticClass:"label"},[e._v("微信授权")]),n("v-uni-button",{staticClass:"br60 bind nr flex row-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.bindWechat.apply(void 0,arguments)}}},[e._v("授权")])],1):e._e(),n("v-uni-view",{staticClass:"item nr flex row-between",staticStyle:{"margin-top":"24rpx"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.goPage("/bundle/pages/server_explan/server_explan",1)}}},[n("v-uni-view",{staticClass:"label"},[e._v("服务协议")]),n("v-uni-view",{staticClass:"content"}),n("u-icon",{attrs:{name:"arrow-right"}})],1),n("v-uni-view",{staticClass:"item nr flex row-between",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.goPage("/bundle/pages/server_explan/server_explan",2)}}},[n("v-uni-view",{staticClass:"label"},[e._v("隐私政策")]),n("v-uni-view",{staticClass:"content"}),n("u-icon",{attrs:{name:"arrow-right"}})],1),n("v-uni-view",{staticClass:"item nr flex row-between"},[n("v-uni-view",{staticClass:"label"},[e._v("关于我们")]),n("v-uni-view",{staticClass:"content flex row-right m-r-24"},[e._v("v"+e._s(e.userInfos.version))])],1),n("v-uni-view",{staticClass:"p-b-50"},[n("v-uni-button",{staticClass:"btn m-t-30 md br60 flex row-center white",staticStyle:{height:"88rpx"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.logOut.apply(void 0,arguments)}}},[e._v("退出登录")])],1),n("u-popup",{attrs:{closeable:!0,maskCloseAble:!1,mode:"center","border-radius":"14"},model:{value:e.showNickName,callback:function(t){e.showNickName=t},expression:"showNickName"}},[n("v-uni-view",{staticClass:"p-24 bg-white",staticStyle:{width:"70vw"}},[n("v-uni-view",{staticClass:"m-b-30 xl text-center"},[e._v("修改用户名")]),n("v-uni-form",{on:{submit:function(t){arguments[0]=t=e.$handleEvent(t),e.changeNameConfirm.apply(void 0,arguments)}}},[n("u-form-item",{attrs:{label:"新昵称",labelWidth:120}},[n("v-uni-input",{staticClass:"nr",staticStyle:{height:"60rpx"},attrs:{value:e.userInfos.nickname,name:"nickname",type:"nickname",placeholder:"请输入新的昵称"}})],1),n("v-uni-button",{staticClass:"btn white flex br60 row-center",attrs:{"form-type":"submit"}},[e._v("确定")])],1)],1)],1),n("u-picker",{attrs:{mode:"selector","confirm-color":"#101010","default-selector":[0],range:e.sexList},on:{confirm:function(t){arguments[0]=t=e.$handleEvent(t),e.changeSexConfirm.apply(void 0,arguments)}},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}}),n("u-action-sheet",{attrs:{list:e.loginList},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.actionSheetLogin.apply(void 0,arguments)}},model:{value:e.showTipsLogin,callback:function(t){e.showTipsLogin=t},expression:"showTipsLogin"}}),n("u-action-sheet",{attrs:{list:e.payList},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.actionSheetPay.apply(void 0,arguments)}},model:{value:e.showTipsPwd,callback:function(t){e.showTipsPwd=t},expression:"showTipsPwd"}})],1)},o=[]},"2d34":function(e,t,n){var a=n("d4c6");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var i=n("967d").default;i("736e1282",a,!0,{sourceMap:!1,shadowMode:!1})},4546:function(e,t,n){"use strict";n("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("64aa");var a={name:"u-action-sheet",props:{maskCloseAble:{type:Boolean,default:!0},list:{type:Array,default:function(){return[]}},tips:{type:Object,default:function(){return{text:"",color:"",fontSize:"26"}}},cancelBtn:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!1},value:{type:Boolean,default:!1},borderRadius:{type:[String,Number],default:0},zIndex:{type:[String,Number],default:0},cancelText:{type:String,default:"取消"}},computed:{tipsStyle:function(){var e={};return this.tips.color&&(e.color=this.tips.color),this.tips.fontSize&&(e.fontSize=this.tips.fontSize+"rpx"),e},itemStyle:function(){var e=this;return function(t){var n={};return e.list[t].color&&(n.color=e.list[t].color),e.list[t].fontSize&&(n.fontSize=e.list[t].fontSize+"rpx"),e.list[t].disabled&&(n.color="#c0c4cc"),n}},uZIndex:function(){return this.zIndex?this.zIndex:this.$u.zIndex.popup}},methods:{close:function(){this.popupClose(),this.$emit("close")},popupClose:function(){this.$emit("input",!1)},itemClick:function(e){this.list[e].disabled||(this.$emit("click",e),this.$emit("input",!1))}}};t.default=a},"4b55":function(e,t,n){"use strict";var a=n("853d"),i=n.n(a);i.a},"5bb5":function(e,t,n){"use strict";n.r(t);var a=n("616b"),i=n("d435");for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("4b55");var s=n("828b"),r=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"3860b5bc",null,!1,a["a"],void 0);t["default"]=r.exports},"616b":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}));var a={uPopup:n("8d0a").default},i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("u-popup",{attrs:{mode:"bottom","border-radius":e.borderRadius,popup:!1,maskCloseAble:e.maskCloseAble,length:"auto",safeAreaInsetBottom:e.safeAreaInsetBottom,"z-index":e.uZIndex},on:{close:function(t){arguments[0]=t=e.$handleEvent(t),e.popupClose.apply(void 0,arguments)}},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[e.tips.text?n("v-uni-view",{staticClass:"u-tips u-border-bottom",style:[e.tipsStyle]},[e._v(e._s(e.tips.text))]):e._e(),e._l(e.list,(function(t,a){return[n("v-uni-view",{key:a+"_0",staticClass:"u-action-sheet-item u-line-1",class:[a<e.list.length-1?"u-border-bottom":""],style:[e.itemStyle(a)],attrs:{"hover-stay-time":150},on:{touchmove:function(t){t.stopPropagation(),t.preventDefault(),arguments[0]=t=e.$handleEvent(t)},click:function(t){arguments[0]=t=e.$handleEvent(t),e.itemClick(a)}}},[n("v-uni-text",[e._v(e._s(t.text))]),t.subText?n("v-uni-text",{staticClass:"u-action-sheet-item__subtext u-line-1"},[e._v(e._s(t.subText))]):e._e()],1)]})),e.cancelBtn?n("v-uni-view",{staticClass:"u-gab"}):e._e(),e.cancelBtn?n("v-uni-view",{staticClass:"u-actionsheet-cancel u-action-sheet-item",attrs:{"hover-class":"u-hover-class","hover-stay-time":150},on:{touchmove:function(t){t.stopPropagation(),t.preventDefault(),arguments[0]=t=e.$handleEvent(t)},click:function(t){arguments[0]=t=e.$handleEvent(t),e.close.apply(void 0,arguments)}}},[e._v(e._s(e.cancelText))]):e._e()],2)},o=[]},"7c2a":function(e,t,n){"use strict";var a=n("2d34"),i=n.n(a);i.a},"853d":function(e,t,n){var a=n("a4b0");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var i=n("967d").default;i("7c7e4b82",a,!0,{sourceMap:!1,shadowMode:!1})},a4b0:function(e,t,n){var a=n("c86c");t=a(!1),t.push([e.i,"@charset \"UTF-8\";\n/* 颜色变量 */\n/** S Font's size **/\n/** E Font's size **/[data-v-3860b5bc]:export{red_theme:#ff2c3c;orange_theme:#f7971e;pink_theme:#fa444d;gold_theme:#e0a356;blue_theme:#2f80ed;green_theme:#2ec840}.u-tips[data-v-3860b5bc]{font-size:%?26?%;text-align:center;padding:%?34?% 0;line-height:1;color:#909399}.u-action-sheet-item[data-v-3860b5bc]{display:flex;flex-direction:row;line-height:1;justify-content:center;align-items:center;font-size:%?32?%;padding:%?34?% 0;flex-direction:column}.u-action-sheet-item__subtext[data-v-3860b5bc]{font-size:%?24?%;color:#909399;margin-top:%?20?%}.u-gab[data-v-3860b5bc]{height:%?12?%;background-color:#eaeaec}.u-actionsheet-cancel[data-v-3860b5bc]{color:#303133}",""]),e.exports=t},aeea:function(e,t,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("aa9c"),n("5c47"),n("a1c1");var i=a(n("2634")),o=a(n("2fdc")),s=a(n("9b1b")),r=n("1f61"),u=n("d9e9"),c=n("2947"),l=n("8f59"),d=n("e2bb"),f=a(n("307a")),p=a(n("a10c")),h={NONE:"",SEX:"sex",NICKNAME:"nickname",AVATAR:"avatar",MOBILE:"mobile"},v={data:function(){return{userInfos:{},fieldType:h.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:(0,s.default)({},(0,l.mapGetters)(["client"])),methods:(0,s.default)((0,s.default)((0,s.default)({},(0,l.mapActions)(["getUser"])),(0,l.mapMutations)(["logout"])),{},{getUserInfoFun:function(){var e=this;(0,r.apiGetUserInfo)().then((function(t){e.userInfos=t}))},setUserInfoFun:function(e){var t=this;return(0,o.default)((0,i.default)().mark((function n(){return(0,i.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,r.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,o.default)((0,i.default)().mark((function n(){return(0,i.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.fieldType=h.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=h.SEX},changeSexConfirm:function(e){this.setUserInfoFun(e[0]+1),this.showPicker=!1},getPhoneNumber:function(e){var t=this;return(0,o.default)((0,i.default)().mark((function n(){var a,o,s;return(0,i.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=e.detail,o=a.code,s=a.errMsg,"getPhoneNumber:ok"===s){n.next=3;break}return n.abrupt("return",t.$toast({title:"绑定失败"}));case 3:(0,r.apiMnpBindMobile)({code:o}).then((function(e){t.getUserInfoFun()}));case 4:case"end":return n.stop()}}),n)})))()},getHasPayPassword:function(){var e=this;(0,r.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,r.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 e=this;uni.showModal({content:"是否退出登录?",confirmColor:this.themeColor,success:function(t){var n=t.cancel;n||(0,r.apiLogout)().then((function(t){f.default.remove("TOKEN"),f.default.remove("USER_INFO"),e.logout(),uni.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,o.default)((0,i.default)().mark((function t(){var n,a;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,d.getCode)();case 2:return n=t.sent,t.next=5,(0,r.apiMnpAuthLogin)({code:n});case 5:return t.next=7,e.getUser();case 7:a=e.$Route.query.form,"payment"===a&&e.$Router.back();case 9:case"end":return t.stop()}}),t)})))()},oaAuth:function(){p.default.getWxUrl()},uploadImage:function(e){var t=this;uni.showLoading({title:"正在上传中...",mask:!0}),(0,c.uploadFile)(e).then((function(e){uni.hideLoading(),t.setUserInfoFun(e.uri)})).catch((function(){uni.hideLoading(),t.$toast({title:"上传失败"})}))}}),onLoad:function(){var e=this;return(0,o.default)((0,i.default)().mark((function t(){var n,a,o;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.$Route.query,a=n.code,o=n.form,!a){t.next=8;break}return Array.isArray(a)&&(a=a.pop()),t.next=5,(0,r.apiOaAuthLogin)({code:a});case 5:return t.next=7,e.getUser();case 7:"payment"===o&&e.$Router.replace({path:"/bundle/pages/user_order/user_order",query:{mode:"pay"}});case 8:uni.$on("uAvatarCropper",(function(t){e.uploadImage(t)})),e.bindWechat=(0,c.trottle)(e.bindWechat);case 10:case"end":return t.stop()}}),t)})))()},onUnload:function(){uni.$off("uAvatarCropper")},onShow:function(){this.getUserInfoFun(),this.getHasPayPassword(),this.getHasLoginPassword()}};t.default=v},bbb9:function(e,t,n){"use strict";n.r(t);var a=n("aeea"),i=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);t["default"]=i.a},d435:function(e,t,n){"use strict";n.r(t);var a=n("4546"),i=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);t["default"]=i.a},d4c6:function(e,t,n){var a=n("c86c");t=a(!1),t.push([e.i,"@charset \"UTF-8\";\n/* 颜色变量 */\n/** S Font's size **/\n/** E Font's size **/[data-v-25df5768]:export{red_theme:#ff2c3c;orange_theme:#f7971e;pink_theme:#fa444d;gold_theme:#e0a356;blue_theme:#2f80ed;green_theme:#2ec840}.header[data-v-25df5768]{padding:%?30?% %?20?%;margin:%?20?% 0;width:100%;border-radius:%?14?%;display:flex;align-items:center}.header uni-image[data-v-25df5768]{width:%?120?%;height:%?120?%;border-radius:50%}.header uni-button[data-v-25df5768]{padding:0}.item[data-v-25df5768]{margin-top:%?2?%;padding:%?30?% %?20?%;border-radius:%?14?%;background-color:#fff}.item .label[data-v-25df5768]{width:%?150?%}.item .content[data-v-25df5768]{flex:1;width:80%}.item .bind[data-v-25df5768]{height:%?56?%;border-width:%?1?%;border-style:solid}.red_theme .item .bind[data-v-25df5768]{color:#ff2c3c}.orange_theme .item .bind[data-v-25df5768]{color:#f7971e}.pink_theme .item .bind[data-v-25df5768]{color:#fa444d}.gold_theme .item .bind[data-v-25df5768]{color:#e0a356}.blue_theme .item .bind[data-v-25df5768]{color:#2f80ed}.green_theme .item .bind[data-v-25df5768]{color:#2ec840}.red_theme .item .bind[data-v-25df5768]{border-color:#ff2c3c}.orange_theme .item .bind[data-v-25df5768]{border-color:#f7971e}.pink_theme .item .bind[data-v-25df5768]{border-color:#fa444d}.gold_theme .item .bind[data-v-25df5768]{border-color:#e0a356}.blue_theme .item .bind[data-v-25df5768]{border-color:#2f80ed}.green_theme .item .bind[data-v-25df5768]{border-color:#2ec840}.btn[data-v-25df5768]{height:%?70?%;margin:%?60?% %?50?% 0}.red_theme .btn[data-v-25df5768]{background-color:#ff2c3c}.orange_theme .btn[data-v-25df5768]{background-color:#f7971e}.pink_theme .btn[data-v-25df5768]{background-color:#fa444d}.gold_theme .btn[data-v-25df5768]{background-color:#e0a356}.blue_theme .btn[data-v-25df5768]{background-color:#2f80ed}.green_theme .btn[data-v-25df5768]{background-color:#2ec840}",""]),e.exports=t},e573:function(e,t,n){"use strict";n.r(t);var a=n("02ee"),i=n("bbb9");for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("7c2a");var s=n("828b"),r=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"25df5768",null,!1,a["a"],void 0);t["default"]=r.exports}}]);