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.
410 lines
22 KiB
410 lines
22 KiB
exports.ids = [21]; |
|
exports.modules = { |
|
|
|
/***/ 168: |
|
/***/ (function(module, exports, __webpack_require__) { |
|
|
|
// style-loader: Adds some css to the DOM by adding a <style> tag |
|
|
|
// load the styles |
|
var content = __webpack_require__(192); |
|
if(content.__esModule) content = content.default; |
|
if(typeof content === 'string') content = [[module.i, content, '']]; |
|
if(content.locals) module.exports = content.locals; |
|
// add CSS to SSR context |
|
var add = __webpack_require__(5).default |
|
module.exports.__inject__ = function (context) { |
|
add("5ec6400f", content, true, context) |
|
}; |
|
|
|
/***/ }), |
|
|
|
/***/ 191: |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_setting_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(168); |
|
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_setting_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_setting_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__); |
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_setting_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_setting_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ 192: |
|
/***/ (function(module, exports, __webpack_require__) { |
|
|
|
// Imports |
|
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(4); |
|
var ___CSS_LOADER_GET_URL_IMPORT___ = __webpack_require__(6); |
|
var ___CSS_LOADER_URL_IMPORT_0___ = __webpack_require__(8); |
|
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false); |
|
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); |
|
// Module |
|
___CSS_LOADER_EXPORT___.push([module.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(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") 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}", ""]); |
|
// Exports |
|
module.exports = ___CSS_LOADER_EXPORT___; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ 222: |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
// ESM COMPAT FLAG |
|
__webpack_require__.r(__webpack_exports__); |
|
|
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/user/setting.vue?vue&type=template&id=c036b416& |
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"user-setting-page"},[_vm._ssrNode("<div class=\"top-box\"></div> "),_vm._ssrNode("<div>","</div>",[_vm._ssrNode("<h6>账号设置</h6> "),_vm._ssrNode("<div>","</div>",[_vm._ssrNode("<div>","</div>",[_vm._ssrNode("<p>昵称</p> "),_c('el-input',{attrs:{"value":_vm.userName,"placeholder":"请输入昵称"},on:{"input":_vm.changeName}}),_vm._ssrNode(" <p><span>保存</span></p>")],2),_vm._ssrNode(" "),_vm._ssrNode("<div>","</div>",[_vm._ssrNode("<p>头像</p> "),_c('el-avatar',{staticStyle:{"margin-top":"20px"},attrs:{"size":48,"src":_vm.userImg}}),_vm._ssrNode(" "),_vm._ssrNode("<p>","</p>",[_c('el-upload',{staticClass:"upload-demo",attrs:{"action":"string","auto-upload":false,"show-file-list":false,"on-change":_vm.getFile,"before-upload":_vm.beforeAvatarUploadImg}},[_c('span',[_vm._v("编辑"),_c('i',{staticClass:"el-icon-caret-right"})])])],1)],2),_vm._ssrNode(" "),_vm._ssrNode("<div>","</div>",[_vm._ssrNode("<p>开启个性化推荐</p> "),_vm._ssrNode("<p>","</p>",[_c('el-switch',{attrs:{"width":60,"active-color":"#005AD2","disabled":_vm.inChangeRecommend,"inactive-color":"#939AA7"},on:{"change":_vm.changeRecommend},model:{value:(_vm.open_recommend),callback:function ($$v) {_vm.open_recommend=$$v},expression:"open_recommend"}})],1)],2),_vm._ssrNode(" <div><p>注销账号</p> <p><span>申请<i class=\"el-icon-caret-right\"></i></span></p></div>")],2)],2),_vm._ssrNode(" "),_c('BottomRightFixed'),_vm._ssrNode(" "),_c('el-dialog',{attrs:{"center":true,"show-close":false,"title":"注销账户","visible":_vm.withdrawDialogVisible,"width":_vm.deviceType === 'pc' ? '400px' : '280px'},on:{"update:visible":function($event){_vm.withdrawDialogVisible=$event}}},[_c('span',[_vm._v("如果你想注销账号,请点击下方按钮进行申请,我们将于收到信息后的30天内完成注销流程。")]),_vm._v(" "),_c('span',{staticClass:"dialog-footer",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"type":"danger"},on:{"click":function($event){_vm.withdrawDialogVisible = false; |
|
_vm.confirmDialogVisible = true;}}},[_vm._v("提交申请")])],1)]),_vm._ssrNode(" "),_c('el-dialog',{attrs:{"center":true,"show-close":false,"title":"确定要注销账户吗?","visible":_vm.confirmDialogVisible,"width":_vm.deviceType === 'pc' ? '400px' : '280px'},on:{"update:visible":function($event){_vm.confirmDialogVisible=$event}}},[_c('span',[_vm._v("注销操作申请后将无法撤销,您的账户信息将永久清除。")]),_vm._v(" "),_c('span',{staticClass:"dialog-footer",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"type":"danger"},on:{"click":_vm.withdrawAccount}},[_vm._v("确认")]),_vm._v(" "),_c('el-button',{attrs:{"type":"info"},on:{"click":function($event){_vm.confirmDialogVisible = false}}},[_vm._v("取消")])],1)])],2)} |
|
var staticRenderFns = [] |
|
|
|
|
|
// CONCATENATED MODULE: ./src/pages/user/setting.vue?vue&type=template&id=c036b416& |
|
|
|
// EXTERNAL MODULE: external "vuex" |
|
var external_vuex_ = __webpack_require__(3); |
|
|
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/user/setting.vue?vue&type=script&lang=js& |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
// |
|
|
|
const { |
|
mapState |
|
} = Object(external_vuex_["createNamespacedHelpers"])('user'); |
|
/* harmony default export */ var settingvue_type_script_lang_js_ = ({ |
|
name: 'UserIndexPage', |
|
layout: 'detail', |
|
middleware: 'authenticated', |
|
|
|
async asyncData({ |
|
$axios, |
|
req |
|
}) { |
|
if (false) {} |
|
const data = await $axios.$get('/user/recommend-state', $axios.genSSROptions(req)); |
|
return { ...data.detail |
|
}; |
|
}, |
|
|
|
data() { |
|
return { |
|
inSaveName: false, |
|
inSaveImg: false, |
|
inChangeRecommend: false, |
|
withdrawDialogVisible: false, |
|
confirmDialogVisible: false, |
|
inWithdraw: false |
|
}; |
|
}, |
|
|
|
head: { |
|
title: '糖尿病网-个人设置', |
|
meta: [{ |
|
hid: 'description', |
|
name: 'description', |
|
content: '' |
|
}] |
|
}, |
|
computed: { ...mapState({ |
|
userInfo: state => state.info |
|
}), |
|
|
|
userName() { |
|
if (this.userInfo !== null && this.userInfo.name !== null && this.userInfo.name !== '') { |
|
return this.userInfo.name; |
|
} |
|
|
|
return ''; |
|
}, |
|
|
|
userImg() { |
|
if (this.userInfo !== null && this.userInfo.headimg !== null && this.userInfo.headimg !== '') { |
|
return this.userInfo.headimg; |
|
} |
|
|
|
return 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'; |
|
}, |
|
|
|
deviceType() { |
|
return this.$store.state.device.deviceType; |
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
this.baiduStat('账户设置页', 'show', '账户设置页-访问'); |
|
}, |
|
|
|
methods: { |
|
changeName(val) { |
|
this.$store.commit('user/setUserInfo', { |
|
name: val |
|
}); |
|
}, |
|
|
|
async saveName() { |
|
console.log(this.userName); |
|
|
|
if (this.userName !== '') { |
|
if (this.inSaveName) { |
|
this.$message({ |
|
message: '您的操作太快了', |
|
type: 'warning' |
|
}); |
|
} else { |
|
this.baiduStat('账户设置页', 'click', '账户设置-修改昵称'); |
|
this.inSaveName = true; |
|
const data = await this.$axios.$post('/user/modify-name', { |
|
username: this.userName |
|
}); |
|
|
|
if (data && data.success) { |
|
this.$message({ |
|
message: '修改成功', |
|
type: 'success' |
|
}); |
|
} else { |
|
this.$message.error(data.msg ? data.msg : '修改失败'); |
|
} |
|
|
|
this.inSaveName = false; |
|
} |
|
} else { |
|
this.$message({ |
|
message: '请输入昵称', |
|
type: 'warning' |
|
}); |
|
} |
|
}, |
|
|
|
async getFile(file, fileList) { |
|
this.baiduStat('账户设置页', 'click', '账户设置-修改头像'); |
|
const param = new FormData(); // 创建form对象 |
|
|
|
param.append('fileid', file.raw); |
|
this.inSaveImg = true; |
|
const data = await this.$axios.$post('/user/modify-headimg', param, { |
|
headers: { |
|
'Content-Type': 'multipart/form-data' |
|
} |
|
}); |
|
|
|
if (data && data.success) { |
|
this.$message({ |
|
message: '修改成功', |
|
type: 'success' |
|
}); |
|
this.$store.commit('user/setUserInfo', { |
|
headimg: data.detail.headImgUrl |
|
}); |
|
} else { |
|
this.$message.error(data.msg ? data.msg : '修改失败'); |
|
} |
|
|
|
this.inSaveImg = false; |
|
}, |
|
|
|
beforeAvatarUploadImg(file) { |
|
const isJPG = file.type === 'image/jpeg'; |
|
const isPNG = file.type === 'image/png'; |
|
const isLt2M = file.size / 1024 / 1024 < 6; |
|
|
|
if (!isJPG && !isPNG) { |
|
this.$message.warning('上传图片只能是 JPG或PNG 格式!'); |
|
} |
|
|
|
if (!isLt2M) { |
|
this.$message.warning('上传图片大小不能超过 6MB!'); |
|
} |
|
|
|
return (isJPG || isPNG) && isLt2M; |
|
}, |
|
|
|
async changeRecommend() { |
|
console.log(this.open_recommend); |
|
this.inChangeRecommend = true; |
|
const data = await this.$axios.$post('/user/recommend-state'); |
|
|
|
if (data && data.success) { |
|
this.$message({ |
|
message: '修改成功', |
|
type: 'success' |
|
}); |
|
this.open_recommend = data.detail.user_recommend === 1; |
|
this.baiduStat('账户设置页', 'click', '账户设置-开启个性化推荐-' + (data.detail.user_recommend === 1 ? '打开' : '关闭')); |
|
} else { |
|
this.open_recommend = !this.open_recommend; |
|
this.$message.error(data.msg ? data.msg : '修改失败'); |
|
} |
|
|
|
this.inChangeRecommend = false; |
|
}, |
|
|
|
async withdrawAccount() { |
|
if (this.inWithdraw) { |
|
this.$message({ |
|
message: '您的操作太快了', |
|
type: 'warning' |
|
}); |
|
} else { |
|
this.baiduStat('注销账户弹窗', 'click', '注销账户弹窗-提交注销申请'); |
|
this.inWithdraw = true; |
|
const data = await this.$axios.$post('/user/unRegister'); |
|
|
|
if (data && data.success) { |
|
this.$message({ |
|
message: '注销申请提交成功', |
|
type: 'success' |
|
}); |
|
} else { |
|
this.$message.error(data.msg ? data.msg : '注销申请提交失败'); |
|
} |
|
|
|
this.inWithdraw = false; |
|
this.confirmDialogVisible = false; |
|
} |
|
} |
|
|
|
} |
|
}); |
|
// CONCATENATED MODULE: ./src/pages/user/setting.vue?vue&type=script&lang=js& |
|
/* harmony default export */ var user_settingvue_type_script_lang_js_ = (settingvue_type_script_lang_js_); |
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js |
|
var componentNormalizer = __webpack_require__(1); |
|
|
|
// CONCATENATED MODULE: ./src/pages/user/setting.vue |
|
|
|
|
|
|
|
function injectStyles (context) { |
|
|
|
var style0 = __webpack_require__(191) |
|
if (style0.__inject__) style0.__inject__(context) |
|
|
|
} |
|
|
|
/* normalize component */ |
|
|
|
var component = Object(componentNormalizer["a" /* default */])( |
|
user_settingvue_type_script_lang_js_, |
|
render, |
|
staticRenderFns, |
|
false, |
|
injectStyles, |
|
null, |
|
"269819ef" |
|
|
|
) |
|
|
|
/* harmony default export */ var setting = __webpack_exports__["default"] = (component.exports); |
|
|
|
/* nuxt-component-imports */ |
|
installComponents(component, {BottomRightFixed: __webpack_require__(66).default}) |
|
|
|
|
|
/***/ }) |
|
|
|
};; |
|
//# sourceMappingURL=setting.js.map
|