You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
17 KiB
1 lines
17 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{640:function(e,t,n){var content=n(669);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,n(23).default)("5ec6400f",content,!0,{sourceMap:!1})},668:function(e,t,n){"use strict";n(640)},669:function(e,t,n){var o=n(22),r=n(36),c=n(44),d=o(!1),l=r(c);d.push([e.i,"*{margin:0;border:none;padding:0}html{height:100%}body{position:relative;min-width:320px;min-height:100%;background:#fff;font-family:MicrosoftYaHei;font-size:0}body .outer-container{min-width:1258px}body .outer-container.isMobile{min-width:auto}body .outer-container.isMobile .content-container{padding:60px 0 62px;width:100%}body .outer-container.isMobile .content-container .left-content{display:block!important;margin-right:0!important;width:100%!important}body .outer-container.isMobile .content-container .footer-outer{position:absolute!important;min-width:auto!important}body .outer-container.isMobile .content-container .load-more{width:100%!important}body .outer-container.isMobile .content-container .common-flex{display:block!important}body .outer-container.isMobile .content-container .common-other-content{margin:0!important}body .outer-container.isMobile .content-container .common-other-content h6{margin-bottom:10px!important;font-size:20px!important;line-height:28px!important}body .outer-container.isMobile .content-container .common-other-content .font-content b,body .outer-container.isMobile .content-container .common-other-content .font-content h5,body .outer-container.isMobile .content-container .common-other-content .font-content h6,body .outer-container.isMobile .content-container .common-other-content .font-content p{margin-bottom:8px!important;font-size:16px!important;line-height:24px!important;word-break:break-all}body .outer-container.isMobile .content-container .common-other-content .font-content h5{font-size:18px!important}body .outer-container.isMobile.hasLoginBottom{padding-bottom:calc(env(safe-area-inset-bottom) + 55px)}body .outer-container.isMobile.hasLoginBottom .bottom-outer,body .outer-container.isMobile.hasLoginBottom .footer-outer{bottom:calc(constant(safe-area-inset-bottom) + 55px);bottom:calc(env(safe-area-inset-bottom) + 55px)}body .outer-container.isMobile.hasLoginBottom .fixed-box{bottom:calc(constant(safe-area-inset-bottom) + 65px)!important;bottom:calc(env(safe-area-inset-bottom) + 65px)!important}body .content-container{margin:0 auto;width:1080px}body img{vertical-align:top;-o-object-fit:cover;object-fit:cover}body a{text-decoration:none}body .text-ellipsis{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}body .left-content{display:inline-block;margin-right:32px;width:723px}body .right-content{float:right;display:inline-block;width:325px}body .common-flex{display:grid;grid-template-columns:repeat(4,25%)}body .load-more{margin:0 auto;width:357px;height:50px;background:#f5f5f8;border-radius:4px;font-size:18px;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#939aa7;line-height:50px;text-align:center}body .footer-outer{position:fixed;bottom:0;left:0;width:100%;min-width:1258px;background:#f5f5f8;z-index:9}body .common-title{padding:20px 0 10px;text-align:left;font-size:24px;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:#001965;line-height:33px}body .common-title a{float:right;font-size:16px;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#5d6269}body .common-title a i{color:#001965}body p.go-follow{margin-bottom:23px;height:50px;background:#e6553f;border-radius:4px;text-align:center;cursor:pointer;font-size:18px;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:#fff;line-height:50px}body .common-other-content{margin:44px 0;padding:30px;box-sizing:border-box}body .common-other-content h6{margin-bottom:20px;font-size:24px;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:#001965;line-height:33px}body .common-other-content .font-content b,body .common-other-content .font-content h5,body .common-other-content .font-content h6,body .common-other-content .font-content p{margin-bottom:12px;font-size:18px;color:#5d6269;line-height:30px}body .common-other-content .font-content h5{font-size:20px}body .el-message{top:50%!important}body .el-message i{font-size:16px}@media screen and (max-width:500px){body .el-message{min-width:200px;max-width:80%}}body .video-player-box .vjs-big-play-button{top:50%;left:50%;border:none;outline:none;width:68px;height:67px;transform:translate(-50%,-50%);background:url("+l+") 50% no-repeat;background-color:transparent!important;background-size:68px 67px}body .video-player-box .vjs-big-play-button .vjs-icon-placeholder:before{display:none}body .video-player-box .vjs-control-bar button{outline:none}body .el-avatar>img{width:100%}.user-setting-page{padding:36px 0 48px}.user-setting-page .top-box{position:absolute;top:86px;left:0;width:100%;height:259px;background:#f5f5f8}.user-setting-page>div:nth-child(2){position:relative;border:1px solid #ededed;padding:36px 32px;background:#fff;box-sizing:border-box}.user-setting-page>div:nth-child(2)>h6{margin-bottom:32px;font-size:24px;color:#001965;line-height:31px;font-weight:400}.user-setting-page>div:nth-child(2)>div{border-top:1px solid #ededed}.user-setting-page>div:nth-child(2)>div>div{position:relative;border-bottom:1px solid #ededed;padding-left:171px;height:88px}.user-setting-page>div:nth-child(2)>div>div>p:first-child{position:absolute;left:0;font-size:18px;color:#5d6269;line-height:88px}.user-setting-page>div:nth-child(2)>div>div>p:last-child{position:absolute;right:0;cursor:pointer}.user-setting-page>div:nth-child(2)>div>div:first-child .el-input{margin-top:20px;width:361px;height:48px}.user-setting-page>div:nth-child(2)>div>div:first-child .el-input .el-input__inner{border:none;padding:0 18px;height:48px;background:#f5f5f8;font-size:18px;color:#292b2c;line-height:24px}.user-setting-page>div:nth-child(2)>div>div:first-child>p:last-child{top:21px;width:90px;height:40px;background:#005ad2;border-radius:4px;text-align:center;font-size:16px;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#fff;line-height:40px}.user-setting-page>div:nth-child(2)>div>div:nth-child(2)>p:last-child,.user-setting-page>div:nth-child(2)>div>div:nth-child(4)>p:last-child{top:37px}.user-setting-page>div:nth-child(2)>div>div:nth-child(2)>p:last-child span,.user-setting-page>div:nth-child(2)>div>div:nth-child(4)>p:last-child span{font-size:16px;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#5d6269;line-height:22px}.user-setting-page>div:nth-child(2)>div>div:nth-child(2)>p:last-child span i,.user-setting-page>div:nth-child(2)>div>div:nth-child(4)>p:last-child span i{color:#005ad2}.user-setting-page>div:nth-child(2)>div>div:nth-child(3)>p:last-child{top:21px}.user-setting-page>div:nth-child(2)>div>div:nth-child(3)>p:last-child .el-switch{height:30px}.user-setting-page>div:nth-child(2)>div>div:nth-child(3)>p:last-child .el-switch .el-switch__core{border:none;height:30px;border-radius:15px}.user-setting-page>div:nth-child(2)>div>div:nth-child(3)>p:last-child .el-switch .el-switch__core:after{top:3px;left:3px;width:24px;height:24px;border-radius:12px}.user-setting-page>div:nth-child(2)>div>div:nth-child(3)>p:last-child .el-switch.is-checked .el-switch__core:after{left:100%;margin-left:-27px}.isMobile .user-setting-page{padding:0}.isMobile .user-setting-page .top-box{display:none}.isMobile .user-setting-page>div:nth-child(2){border:none;padding:0}.isMobile .user-setting-page>div:nth-child(2)>h6{display:none}.isMobile .user-setting-page>div:nth-child(2)>div>div{display:flex;padding:0 15px;height:60px}.isMobile .user-setting-page>div:nth-child(2)>div>div>p:first-child{position:relative;margin-right:10px;font-size:16px;line-height:60px}.isMobile .user-setting-page>div:nth-child(2)>div>div>p:last-child{right:15px}.isMobile .user-setting-page>div:nth-child(2)>div>div:first-child .el-input{margin-top:10px;width:calc(100% - 130px);height:40px}.isMobile .user-setting-page>div:nth-child(2)>div>div:first-child .el-input .el-input__inner{padding:0 10px;height:40px}.isMobile .user-setting-page>div:nth-child(2)>div>div:first-child>p:last-child{top:10px;width:70px;height:40px;font-size:15px}.isMobile .user-setting-page>div:nth-child(2)>div>div:nth-child(2)>span{margin-top:10px!important;width:40px!important;height:40px!important;border-radius:20px}.isMobile .user-setting-page>div:nth-child(2)>div>div:nth-child(2)>p:last-child,.isMobile .user-setting-page>div:nth-child(2)>div>div:nth-child(4)>p:last-child{top:17px}.isMobile .user-setting-page>div:nth-child(2)>div>div:nth-child(3)>p:last-child{top:15px}.isMobile .user-setting-page~.bottom-outer{display:none}",""]),e.exports=d},699:function(e,t,n){"use strict";n.r(t);n(25),n(19),n(24),n(10),n(37),n(20),n(38);var o=n(12),r=n(7),c=(n(30),n(52),n(28));function d(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?d(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):d(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var h={name:"UserIndexPage",layout:"detail",middleware:"authenticated",asyncData:function(e){return Object(r.a)(regeneratorRuntime.mark((function t(){var n,o,data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.$axios,o=e.req,t.abrupt("return");case 3:return t.next=5,n.$get("/user/recommend-state",n.genSSROptions(o));case 5:return data=t.sent,t.abrupt("return",l({},data.detail));case 7:case"end":return t.stop()}}),t)})))()},data:function(){return{inSaveName:!1,inSaveImg:!1,inChangeRecommend:!1,withdrawDialogVisible:!1,confirmDialogVisible:!1,inWithdraw:!1}},head:{title:"糖尿病网-个人设置",meta:[{hid:"description",name:"description",content:""}]},computed:l(l({},(0,Object(c.a)("user").mapState)({userInfo:function(e){return e.info}})),{},{userName:function(){return null!==this.userInfo&&null!==this.userInfo.name&&""!==this.userInfo.name?this.userInfo.name:""},userImg:function(){return null!==this.userInfo&&null!==this.userInfo.headimg&&""!==this.userInfo.headimg?this.userInfo.headimg:"https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"},deviceType:function(){return this.$store.state.device.deviceType}}),mounted:function(){this.baiduStat("账户设置页","show","账户设置页-访问")},methods:{changeName:function(e){this.$store.commit("user/setUserInfo",{name:e})},saveName:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log(e.userName),""===e.userName){t.next=15;break}if(!e.inSaveName){t.next=6;break}e.$message({message:"您的操作太快了",type:"warning"}),t.next=13;break;case 6:return e.baiduStat("账户设置页","click","账户设置-修改昵称"),e.inSaveName=!0,t.next=10,e.$axios.$post("/user/modify-name",{username:e.userName});case 10:(data=t.sent)&&data.success?e.$message({message:"修改成功",type:"success"}):e.$message.error(data.msg?data.msg:"修改失败"),e.inSaveName=!1;case 13:t.next=16;break;case 15:e.$message({message:"请输入昵称",type:"warning"});case 16:case"end":return t.stop()}}),t)})))()},getFile:function(e,t){var n=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var param,data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.baiduStat("账户设置页","click","账户设置-修改头像"),(param=new FormData).append("fileid",e.raw),n.inSaveImg=!0,t.next=6,n.$axios.$post("/user/modify-headimg",param,{headers:{"Content-Type":"multipart/form-data"}});case 6:(data=t.sent)&&data.success?(n.$message({message:"修改成功",type:"success"}),n.$store.commit("user/setUserInfo",{headimg:data.detail.headImgUrl})):n.$message.error(data.msg?data.msg:"修改失败"),n.inSaveImg=!1;case 9:case"end":return t.stop()}}),t)})))()},beforeAvatarUploadImg:function(e){var t="image/jpeg"===e.type,n="image/png"===e.type,o=e.size/1024/1024<6;return t||n||this.$message.warning("上传图片只能是 JPG或PNG 格式!"),o||this.$message.warning("上传图片大小不能超过 6MB!"),(t||n)&&o},changeRecommend:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log(e.open_recommend),e.inChangeRecommend=!0,t.next=4,e.$axios.$post("/user/recommend-state");case 4:(data=t.sent)&&data.success?(e.$message({message:"修改成功",type:"success"}),e.open_recommend=1===data.detail.user_recommend,e.baiduStat("账户设置页","click","账户设置-开启个性化推荐-"+(1===data.detail.user_recommend?"打开":"关闭"))):(e.open_recommend=!e.open_recommend,e.$message.error(data.msg?data.msg:"修改失败")),e.inChangeRecommend=!1;case 7:case"end":return t.stop()}}),t)})))()},withdrawAccount:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.inWithdraw){t.next=4;break}e.$message({message:"您的操作太快了",type:"warning"}),t.next=12;break;case 4:return e.baiduStat("注销账户弹窗","click","注销账户弹窗-提交注销申请"),e.inWithdraw=!0,t.next=8,e.$axios.$post("/user/unRegister");case 8:(data=t.sent)&&data.success?e.$message({message:"注销申请提交成功",type:"success"}):e.$message.error(data.msg?data.msg:"注销申请提交失败"),e.inWithdraw=!1,e.confirmDialogVisible=!1;case 12:case"end":return t.stop()}}),t)})))()}}},m=(n(668),n(11)),component=Object(m.a)(h,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"user-setting-page"},[n("div",{staticClass:"top-box"}),e._v(" "),n("div",[n("h6",[e._v("账号设置")]),e._v(" "),n("div",[n("div",[n("p",[e._v("昵称")]),e._v(" "),n("el-input",{attrs:{value:e.userName,placeholder:"请输入昵称"},on:{input:e.changeName}}),e._v(" "),n("p",{on:{click:e.saveName}},[n("span",[e._v("保存")])])],1),e._v(" "),n("div",[n("p",[e._v("头像")]),e._v(" "),n("el-avatar",{staticStyle:{"margin-top":"20px"},attrs:{size:48,src:e.userImg}}),e._v(" "),n("p",[n("el-upload",{staticClass:"upload-demo",attrs:{action:"string","auto-upload":!1,"show-file-list":!1,"on-change":e.getFile,"before-upload":e.beforeAvatarUploadImg}},[n("span",[e._v("编辑"),n("i",{staticClass:"el-icon-caret-right"})])])],1)],1),e._v(" "),n("div",[n("p",[e._v("开启个性化推荐")]),e._v(" "),n("p",[n("el-switch",{attrs:{width:60,"active-color":"#005AD2",disabled:e.inChangeRecommend,"inactive-color":"#939AA7"},on:{change:e.changeRecommend},model:{value:e.open_recommend,callback:function(t){e.open_recommend=t},expression:"open_recommend"}})],1)]),e._v(" "),n("div",[n("p",[e._v("注销账号")]),e._v(" "),n("p",{on:{click:function(t){e.baiduStat("账户设置页","click","账户设置-注销账号"),e.withdrawDialogVisible=!0}}},[e._m(0)])])])]),e._v(" "),n("BottomRightFixed"),e._v(" "),n("el-dialog",{attrs:{center:!0,"show-close":!1,title:"注销账户",visible:e.withdrawDialogVisible,width:"pc"===e.deviceType?"400px":"280px"},on:{"update:visible":function(t){e.withdrawDialogVisible=t}}},[n("span",[e._v("如果你想注销账号,请点击下方按钮进行申请,我们将于收到信息后的30天内完成注销流程。")]),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"danger"},on:{click:function(t){e.withdrawDialogVisible=!1,e.confirmDialogVisible=!0}}},[e._v("提交申请")])],1)]),e._v(" "),n("el-dialog",{attrs:{center:!0,"show-close":!1,title:"确定要注销账户吗?",visible:e.confirmDialogVisible,width:"pc"===e.deviceType?"400px":"280px"},on:{"update:visible":function(t){e.confirmDialogVisible=t}}},[n("span",[e._v("注销操作申请后将无法撤销,您的账户信息将永久清除。")]),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"danger"},on:{click:e.withdrawAccount}},[e._v("确认")]),e._v(" "),n("el-button",{attrs:{type:"info"},on:{click:function(t){e.confirmDialogVisible=!1}}},[e._v("取消")])],1)])],1)}),[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[e._v("申请"),n("i",{staticClass:"el-icon-caret-right"})])}],!1,null,null,null);t.default=component.exports;installComponents(component,{BottomRightFixed:n(418).default})}}]); |