Files
t/unpackage/dist/dev/mp-weixin/pages2/setting/setting.js
T
2026-05-04 00:43:20 +08:00

2 lines
7.2 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages2/setting/setting"],{326:function(e,t,n){"use strict";(function(e,t){var o=n(4);n(26),n(27);o(n(25));var r=o(n(327));e.__webpack_require_UNI_MP_PLUGIN__=n,t(r.default)}).call(this,n(1)["default"],n(2)["createPage"])},327:function(e,t,n){"use strict";n.r(t);var o=n(328),r=n(330);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n(332);var u,a=n(46),c=Object(a["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,"405ddd04",null,!1,o["components"],u);c.options.__file="pages2/setting/setting.vue",t["default"]=c.exports},328:function(e,t,n){"use strict";n.r(t);var o=n(329);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},329:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return r})),n.d(t,"staticRenderFns",(function(){return u})),n.d(t,"recyclableRender",(function(){return i})),n.d(t,"components",(function(){return o}));var r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.renderGener()),o=e.getMessage(e.currentEdit);e._isMounted||(e.e0=function(t){e.modal1=!e.modal1},e.e1=function(t){e.updateForm.gender=1},e.e2=function(t){e.updateForm.gender=2},e.e3=function(t){e.updateForm.gender=0}),e.$mp.data=Object.assign({},{$root:{m0:n,m1:o}})},i=!1,u=[];r._withStripped=!0},330:function(e,t,n){"use strict";n.r(t);var o=n(331),r=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},331:function(e,t,n){"use strict";(function(e,o){var r=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(28)),u=r(n(11)),a=r(n(31)),c=r(n(75)),s=n(184);n(25);function l(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,u.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e.importObject("uni-id-co");var f=function(){n.e("components/thorui/tui-list-view/tui-list-view").then(function(){return resolve(n(859))}.bind(null,n)).catch(n.oe)},p=function(){n.e("components/thorui/tui-list-cell/tui-list-cell").then(function(){return resolve(n(866))}.bind(null,n)).catch(n.oe)},h=function(){n.e("components/thorui/tui-button/tui-button").then(function(){return resolve(n(873))}.bind(null,n)).catch(n.oe)},m=function(){n.e("components/thorui/tui-modal/tui-modal").then(function(){return resolve(n(880))}.bind(null,n)).catch(n.oe)},g=function(){n.e("components/cloud-image").then(function(){return resolve(n(597))}.bind(null,n)).catch(n.oe)},v=e.database(),b=v.collection("uni-id-users"),w={components:{tuiButton:h,tuiListCell:p,tuiListView:f,tuiModal:m,cloudImage:g},computed:{userInfo:function(){return s.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:{getFileInfo:function(e){var t=e.split("/").pop(),n=t.split("."),o=(0,c.default)(n),r=o[0],i=o.slice(1),u=i.length?i.pop():"";return{name:r,extname:u}},formatBytes:function(e){if(0===e)return"0 Bytes";var t=1024,n=["Bytes","KB","MB","GB","TB"],o=Math.floor(Math.log(e)/Math.log(t));return o>=n.length?"> 1 TB":parseFloat((e/Math.pow(t,o)).toFixed(2))+" "+n[o]},updateUserAvatat:function(){var t=this;return(0,a.default)(i.default.mark((function n(){var r;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:r=t,o.chooseImage({type:"image",count:1,success:function(t){var n=this;return(0,a.default)(i.default.mark((function u(){var a,c,l,f,p,h;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(console.log(t),!(t.tempFilePaths.length>0)){i.next=15;break}return a=t.tempFilePaths[0],c=r.getFileInfo(a),l=c.name,f=c.extname,p=e.importObject("ext-storage-co"),console.log("avatar/".concat(l)),i.next=8,p.getUploadFileOptions({cloudPath:"avatar/".concat(l)});case 8:return h=i.sent,console.log(d({},h)),console.log(h.uploadFileOptions),i.next=13,e.uploadFile(d(d({},h.uploadFileOptions),{},{filePath:a,cloudPath:h.cloudPath,success:function(){var e={cloudPath:h.cloudPath,fileID:h.fileID,fileURL:h.fileURL},t={avatar_file:{name:l,extname:f,url:e.fileID}};b.where({_id:r.userInfo._id}).update(t).then((function(e){e.result.updated?(o.showToast({title:"更新成功",icon:"none"}),s.mutations.setUserInfo(t)):o.showToast({title:"没有变化",icon:"none"})})),n.modal1=!1,console.log("上传成功",e)},fail:function(e){console.log("上传失败",e)}}));case 13:i.next=16;break;case 15:console.log("未选中文件");case 16:case"end":return i.stop()}}),u)})))()}});case 2:case"end":return n.stop()}}),n)})))()},checkUrlProtocol:function(e){try{var t=e.indexOf("://");if(-1===t)return"invalid";var n=e.substring(0,t).toLowerCase();return"http"===n||"https"===n?"http/https":"cloud"===n?"cloud":"other"}catch(o){return"invalid"}},getMessage:function(e){return 0===e?"请输入你的昵称":1===e?"请填写你的个人简介":2===e?"请选择你的性别":void 0},handleToRepassword:function(){this.userInfo.mobile?o.navigateTo({url:"../../pages3/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd"}):console.log("需要绑定手机号!")},handleShowModal:function(e){this.currentEdit=e,this.modal1=!0},updateUserInfo:function(){var e={};this.updateForm.nickname&&(e.nickname=this.updateForm.nickname),(this.updateForm.gender||0===this.updateForm.gender)&&(e.gender=this.updateForm.gender),this.updateForm.comment&&(e.comment=this.updateForm.comment),b.where({_id:this.userInfo._id}).update(e).then((function(t){t.result.updated?(o.showToast({title:"更新成功",icon:"none"}),s.mutations.setUserInfo(e)):o.showToast({title:"没有变化",icon:"none"})})),this.modal1=!1},handleLogout:function(){o.showModal({title:"提示",content:"确定退出登录吗?",success:function(e){e.confirm&&(s.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"})}}};t.default=w}).call(this,n(27)["uniCloud"],n(2)["default"])},332:function(e,t,n){"use strict";n.r(t);var o=n(333),r=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},333:function(e,t,n){}},[[326,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages2/setting/setting.js.map