Files
t/unpackage/dist/build/mp-weixin/pages2/setting/setting.js
T
2025-03-28 16:27:26 +08:00

1 line
4.8 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages2/setting/setting"],{"098c":function(t,e,n){},"100b":function(t,e,n){"use strict";n.r(e);var o=n("d204"),i=n("3417");for(var u in i)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(u);n("a5ce");var a=n("828b"),r=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"9c4ce5c4",null,!1,o["a"],void 0);e["default"]=r.exports},3417:function(t,e,n){"use strict";n.r(e);var o=n("6fcc"),i=n.n(o);for(var u in o)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(u);e["default"]=i.a},"6fcc":function(t,e,n){"use strict";(function(t,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("6b19"),u=(t.importObject("uni-id-co"),t.database()),a=u.collection("uni-id-users"),r={components:{tuiButton:function(){n.e("components/thorui/tui-button/tui-button").then(function(){return resolve(n("49e9"))}.bind(null,n)).catch(n.oe)},tuiListCell:function(){n.e("components/thorui/tui-list-cell/tui-list-cell").then(function(){return resolve(n("d30d"))}.bind(null,n)).catch(n.oe)},tuiListView:function(){n.e("components/thorui/tui-list-view/tui-list-view").then(function(){return resolve(n("7411"))}.bind(null,n)).catch(n.oe)},tuiModal:function(){n.e("components/thorui/tui-modal/tui-modal").then(function(){return resolve(n("9062"))}.bind(null,n)).catch(n.oe)}},computed:{userInfo:function(){return i.store.userInfo},realNameStatus:function(){return this.userInfo.realNameAuth?this.userInfo.realNameAuth.authStatus:0}},data:function(){return{statusBarHeight:o.getSystemInfoSync()["statusBarHeight"],windowHeight:o.getSystemInfoSync().windowHeight,modal1:!1,currentEdit:0,updateForm:{nickname:"",gender:"",comment:""}}},mounted:function(){},methods:{checkUrlProtocol:function(t){try{var e=t.indexOf("://");if(-1===e)return"invalid";var n=t.substring(0,e).toLowerCase();return"http"===n||"https"===n?"http/https":"cloud"===n?"cloud":"other"}catch(o){return"invalid"}},getMessage:function(t){return 0===t?"请输入你的昵称":1===t?"请填写你的个人简介":2===t?"请选择你的性别":void 0},handleToRepassword:function(){o.navigateTo({url:"../../pages3/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd"})},handleShowModal:function(t){this.currentEdit=t,this.modal1=!0},updateUserInfo:function(){var t={};this.updateForm.nickname&&(t.nickname=this.updateForm.nickname),(this.updateForm.gender||0===this.updateForm.gender)&&(t.gender=this.updateForm.gender),this.updateForm.comment&&(t.comment=this.updateForm.comment),a.where({_id:this.userInfo._id}).update(t).then((function(e){e.result.updated?(o.showToast({title:"更新成功",icon:"none"}),i.mutations.setUserInfo(t)):o.showToast({title:"没有变化",icon:"none"})})),this.modal1=!1},handleLogout:function(){o.showModal({title:"提示",content:"确定退出登录吗?",success:function(t){t.confirm&&(i.mutations.logout(),o.switchTab({url:"/pages/my/my"}))}})},renderGener:function(){return console.log(this.userInfo),this.userInfo?0===this.userInfo.gender?"保密":1===this.userInfo.gender?"男":2===this.userInfo.gender?"女":"保密":"保密"},handleBindMobile:function(){o.navigateTo({url:"../../pages3/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile"})},setAvatar:function(){var t=this;o.chooseImage({count:1,success:function(e){o.navigateTo({url:"/pages/mine/setting/cutImage?path="+e.tempFilePaths[0]+"&options=".concat(JSON.stringify({width:600,height:600})),animationType:"fade-in",events:{uploadAvatarAfter:function(e){var n=e.url;console.log(n),a.where("_id==$env.uid").update({avatar:n}).then((function(e){console.log(e),o.showToast({icon:"none",title:"修改成功"}),t.setUserInfo({avatar:n})})).catch((function(t){o.showModal({content:t.message||"请求服务失败",showCancel:!1})})).finally((function(){o.hideLoading()}))}}})}})}}};e.default=r}).call(this,n("861b")["uniCloud"],n("df3c")["default"])},"7040f":function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("7bfe"),n("861b");o(n("3240"));var i=o(n("100b"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},a5ce:function(t,e,n){"use strict";var o=n("098c"),i=n.n(o);i.a},d204:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.userInfo.avatar_file&&"cloud"===t.checkUrlProtocol(t.userInfo.avatar_file.url)),o=n?null:t.userInfo.avatar_file&&"http/https"===t.checkUrlProtocol(t.userInfo.avatar_file.url),i=t.renderGener(),u=t.getMessage(t.currentEdit);t._isMounted||(t.e0=function(e){t.modal1=!t.modal1},t.e1=function(e){t.updateForm.gender=1},t.e2=function(e){t.updateForm.gender=2},t.e3=function(e){t.updateForm.gender=0}),t.$mp.data=Object.assign({},{$root:{m0:n,m1:o,m2:i,m3:u}})},i=[]}},[["7040f","common/runtime","common/vendor"]]]);