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

2 lines
5.4 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages2/setting/setting"],{373:function(t,e,n){"use strict";(function(t,e){var o=n(4);n(26),n(27);o(n(25));var i=o(n(374));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n(1)["default"],n(2)["createPage"])},374:function(t,e,n){"use strict";n.r(e);var o=n(375),i=n(377);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n(379);var u,a=n(46),s=Object(a["default"])(i["default"],o["render"],o["staticRenderFns"],!1,null,"405ddd04",null,!1,o["components"],u);s.options.__file="pages2/setting/setting.vue",e["default"]=s.exports},375:function(t,e,n){"use strict";n.r(e);var o=n(376);n.d(e,"render",(function(){return o["render"]})),n.d(e,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(e,"components",(function(){return o["components"]}))},376:function(t,e,n){"use strict";var o;n.r(e),n.d(e,"render",(function(){return i})),n.d(e,"staticRenderFns",(function(){return u})),n.d(e,"recyclableRender",(function(){return r})),n.d(e,"components",(function(){return o}));var i=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(),r=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:r}})},r=!1,u=[];i._withStripped=!0},377:function(t,e,n){"use strict";n.r(e);var o=n(378),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},378:function(t,e,n){"use strict";(function(t,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(200),r=(t.importObject("uni-id-co"),function(){n.e("components/thorui/tui-list-view/tui-list-view").then(function(){return resolve(n(821))}.bind(null,n)).catch(n.oe)}),u=function(){n.e("components/thorui/tui-list-cell/tui-list-cell").then(function(){return resolve(n(828))}.bind(null,n)).catch(n.oe)},a=function(){n.e("components/thorui/tui-button/tui-button").then(function(){return resolve(n(835))}.bind(null,n)).catch(n.oe)},s=function(){n.e("components/thorui/tui-modal/tui-modal").then(function(){return resolve(n(842))}.bind(null,n)).catch(n.oe)},c=t.database(),d=c.collection("uni-id-users"),l={components:{tuiButton:a,tuiListCell:u,tuiListView:r,tuiModal:s},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),d.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){var n={width:600,height:600};o.navigateTo({url:"/pages/mine/setting/cutImage?path="+e.tempFilePaths[0]+"&options=".concat(JSON.stringify(n)),animationType:"fade-in",events:{uploadAvatarAfter:function(e){var n=e.url;console.log(n),d.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=l}).call(this,n(27)["uniCloud"],n(2)["default"])},379:function(t,e,n){"use strict";n.r(e);var o=n(380),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},380:function(t,e,n){}},[[373,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages2/setting/setting.js.map