profile.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. exports.ids = [53,7];
  2. exports.modules = {
  3. /***/ 144:
  4. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5. "use strict";
  6. // ESM COMPAT FLAG
  7. __webpack_require__.r(__webpack_exports__);
  8. // 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!./components/count-down.vue?vue&type=template&id=2fbaab86&
  9. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.time >= 0)?_c('div',[_c('client-only',[(_vm.isSlot)?_vm._t("default"):_c('span',[_vm._v(_vm._s(_vm.formateTime))])],2)],1):_vm._e()}
  10. var staticRenderFns = []
  11. // CONCATENATED MODULE: ./components/count-down.vue?vue&type=template&id=2fbaab86&
  12. // CONCATENATED MODULE: ./utils/parseTime.js
  13. const SECOND = 1000;
  14. const MINUTE = 60 * SECOND;
  15. const HOUR = 60 * MINUTE;
  16. const DAY = 24 * HOUR;
  17. function parseTimeData(time) {
  18. const days = Math.floor(time / DAY);
  19. const hours = sliceTwo(Math.floor(time % DAY / HOUR));
  20. const minutes = sliceTwo(Math.floor(time % HOUR / MINUTE));
  21. const seconds = sliceTwo(Math.floor(time % MINUTE / SECOND));
  22. return {
  23. days: days,
  24. hours: hours,
  25. minutes: minutes,
  26. seconds: seconds
  27. };
  28. }
  29. function sliceTwo(str) {
  30. return (0 + str.toString()).slice(-2);
  31. }
  32. function parseFormat(format, timeData) {
  33. let days = timeData.days;
  34. let hours = timeData.hours,
  35. minutes = timeData.minutes,
  36. seconds = timeData.seconds;
  37. if (format.indexOf('dd') !== -1) {
  38. format = format.replace('dd', days);
  39. }
  40. if (format.indexOf('hh') !== -1) {
  41. format = format.replace('hh', sliceTwo(hours));
  42. }
  43. if (format.indexOf('mm') !== -1) {
  44. format = format.replace('mm', sliceTwo(minutes));
  45. }
  46. if (format.indexOf('ss') !== -1) {
  47. format = format.replace('ss', sliceTwo(seconds));
  48. }
  49. return format;
  50. }
  51. // 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!./components/count-down.vue?vue&type=script&lang=js&
  52. //
  53. //
  54. //
  55. //
  56. //
  57. //
  58. //
  59. //
  60. //
  61. /* harmony default export */ var count_downvue_type_script_lang_js_ = ({
  62. components: {},
  63. props: {
  64. isSlot: {
  65. type: Boolean,
  66. default: false
  67. },
  68. time: {
  69. type: Number,
  70. default: 0
  71. },
  72. format: {
  73. type: String,
  74. default: 'hh:mm:ss'
  75. },
  76. autoStart: {
  77. type: Boolean,
  78. default: true
  79. }
  80. },
  81. watch: {
  82. time: {
  83. immediate: true,
  84. handler(value) {
  85. if (value) {
  86. this.reset();
  87. }
  88. }
  89. }
  90. },
  91. data() {
  92. return {
  93. timeObj: {},
  94. formateTime: 0
  95. };
  96. },
  97. created() {},
  98. computed: {},
  99. methods: {
  100. createTimer(fn) {
  101. return setTimeout(fn, 100);
  102. },
  103. isSameSecond(time1, time2) {
  104. return Math.floor(time1) === Math.floor(time2);
  105. },
  106. start() {
  107. if (this.counting) {
  108. return;
  109. }
  110. this.counting = true;
  111. this.endTime = Date.now() + this.remain * 1000;
  112. this.setTimer();
  113. },
  114. setTimer() {
  115. this.tid = this.createTimer(() => {
  116. let remain = this.getRemain();
  117. if (!this.isSameSecond(remain, this.remain) || remain === 0) {
  118. this.setRemain(remain);
  119. }
  120. if (this.remain !== 0) {
  121. this.setTimer();
  122. }
  123. });
  124. },
  125. getRemain() {
  126. return Math.max(this.endTime - Date.now(), 0);
  127. },
  128. pause() {
  129. this.counting = false;
  130. clearTimeout(this.tid);
  131. },
  132. reset() {
  133. this.pause();
  134. this.remain = this.time;
  135. this.setRemain(this.remain);
  136. if (this.autoStart) {
  137. this.start();
  138. }
  139. },
  140. setRemain(remain) {
  141. const {
  142. format
  143. } = this;
  144. this.remain = remain;
  145. const timeData = parseTimeData(remain);
  146. this.formateTime = parseFormat(format, timeData);
  147. this.$emit('change', timeData);
  148. if (remain === 0) {
  149. this.pause();
  150. this.$emit('finish');
  151. }
  152. }
  153. }
  154. });
  155. // CONCATENATED MODULE: ./components/count-down.vue?vue&type=script&lang=js&
  156. /* harmony default export */ var components_count_downvue_type_script_lang_js_ = (count_downvue_type_script_lang_js_);
  157. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  158. var componentNormalizer = __webpack_require__(1);
  159. // CONCATENATED MODULE: ./components/count-down.vue
  160. function injectStyles (context) {
  161. }
  162. /* normalize component */
  163. var component = Object(componentNormalizer["a" /* default */])(
  164. components_count_downvue_type_script_lang_js_,
  165. render,
  166. staticRenderFns,
  167. false,
  168. injectStyles,
  169. null,
  170. "4090b4e2"
  171. )
  172. /* harmony default export */ var count_down = __webpack_exports__["default"] = (component.exports);
  173. /***/ }),
  174. /***/ 149:
  175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  176. "use strict";
  177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return client; });
  178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return loginType; });
  179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return SMSType; });
  180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FieldType; });
  181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AfterSaleType; });
  182. const client = 5;
  183. const loginType = {
  184. SMS: 0,
  185. ACCOUNT: 1
  186. }; // 短信发送
  187. const SMSType = {
  188. // 注册
  189. REGISTER: 'ZCYZ',
  190. // 找回密码
  191. FINDPWD: 'ZHMM',
  192. // 登陆
  193. LOGIN: 'YZMDL',
  194. // 商家申请入驻
  195. SJSQYZ: 'SJSQYZ',
  196. // 更换手机号
  197. CHANGE_MOBILE: 'BGSJHM',
  198. // 绑定手机号
  199. BIND: 'BDSJHM'
  200. };
  201. const FieldType = {
  202. NONE: '',
  203. SEX: 'sex',
  204. NICKNAME: 'nickname',
  205. AVATAR: 'avatar',
  206. MOBILE: 'mobile'
  207. }; // 售后状态
  208. const AfterSaleType = {
  209. // 售后申请
  210. NORMAL: 'normal',
  211. // 处理中
  212. HANDLING: 'apply',
  213. // 已处理
  214. FINISH: 'finish'
  215. };
  216. /***/ }),
  217. /***/ 238:
  218. /***/ (function(module, exports, __webpack_require__) {
  219. // style-loader: Adds some css to the DOM by adding a <style> tag
  220. // load the styles
  221. var content = __webpack_require__(316);
  222. if(content.__esModule) content = content.default;
  223. if(typeof content === 'string') content = [[module.i, content, '']];
  224. if(content.locals) module.exports = content.locals;
  225. // add CSS to SSR context
  226. var add = __webpack_require__(4).default
  227. module.exports.__inject__ = function (context) {
  228. add("98ca9702", content, true, context)
  229. };
  230. /***/ }),
  231. /***/ 315:
  232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  233. "use strict";
  234. __webpack_require__.r(__webpack_exports__);
  235. /* 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_profile_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(238);
  236. /* 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_profile_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_profile_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
  237. /* 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_profile_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_profile_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  238. /***/ }),
  239. /***/ 316:
  240. /***/ (function(module, exports, __webpack_require__) {
  241. // Imports
  242. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(3);
  243. var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
  244. // Module
  245. ___CSS_LOADER_EXPORT___.push([module.i, ".user-profile{width:980px;padding:10px}.user-profile .user-header{padding:10px 5px;border-bottom:1px solid #e5e5e5}.user-profile .user-container{margin-top:35px}.user-profile .user-container .user-form-item{padding-left:13px;margin-top:24px}.user-profile .user-container .user-form-item .user-form-label{width:60px;text-align:left;margin-right:24px}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader:hover .avatar .mask{display:flex}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader:hover .avatar:after{opacity:1}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader .avatar{position:relative}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader .avatar .mask{display:none;position:absolute}.user-profile .user-container .user-form-item .user-avatar-upload .avatar-uploader .avatar:after{content:\"更换头像\";position:absolute;transition:opacity .3s ease;opacity:0;width:100%;height:64px;left:0;top:0;border-radius:60px;background-color:rgba(0,0,0,.3);color:#fff;display:flex;flex-direction:row;justify-content:center;align-items:center;font-size:12px}.user-profile .user-container .user-form-item .user-input{width:240px}.user-profile .user-container .user-form-item .el-radio__input.is-checked+.el-radio__label{color:#007aff}.user-profile .user-container .user-form-item .el-input__inner:focus{border-color:#007aff}.user-profile .user-container .user-form-item .el-radio__input.is-checked .el-radio__inner{border-color:#007aff;background:#007aff}.user-profile .user-container .user-form-item .el-radio__inner:hover{border-color:#007aff}.user-profile .user-container .primary-btn{height:32px;width:100px;margin-top:32px;border:none;border-radius:4px;cursor:pointer}.user-profile .user-container .primary-btn:focus{border:none;outline:none}", ""]);
  246. // Exports
  247. module.exports = ___CSS_LOADER_EXPORT___;
  248. /***/ }),
  249. /***/ 362:
  250. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  251. "use strict";
  252. // ESM COMPAT FLAG
  253. __webpack_require__.r(__webpack_exports__);
  254. // 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!./pages/user/profile.vue?vue&type=template&id=5917c3b2&
  255. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"user-profile"},[_vm._ssrNode("<div class=\"user-header lg\">\n 个人资料\n </div> "),_vm._ssrNode("<div class=\"user-container\">","</div>",[_vm._ssrNode("<div class=\"user-form-item flex\">","</div>",[_vm._ssrNode("<label class=\"user-form-label nr\">头像</label> "),_vm._ssrNode("<div class=\"user-avatar-upload\">","</div>",[_c('el-upload',{staticClass:"avatar-uploader",attrs:{"action":_vm.action,"show-file-list":false,"file-list":_vm.fileList,"on-success":_vm.uploadFileSuccess,"headers":{token: _vm.$store.state.token}}},[_c('div',{staticClass:"avatar"},[_c('el-image',{staticStyle:{"width":"64px","height":"64px","border-radius":"60px"},attrs:{"src":_vm.avatar}}),_vm._v(" "),_c('div',{staticClass:"mask white"})],1)])],1)],2),_vm._ssrNode(" <div class=\"user-form-item flex\"><label class=\"user-form-label nr\">用户ID</label> <div class=\"normal nr\">"+_vm._ssrEscape(_vm._s(_vm.sn))+"</div></div> "),_vm._ssrNode("<div class=\"user-form-item flex\">","</div>",[_vm._ssrNode("<label class=\"user-form-label nr\">昵称</label> "),_c('el-input',{staticClass:"user-input",attrs:{"suffix-icon":"el-icon-edit"},model:{value:(_vm.nickName),callback:function ($$v) {_vm.nickName=$$v},expression:"nickName"}})],2),_vm._ssrNode(" "),_vm._ssrNode("<div class=\"user-form-item flex\">","</div>",[_vm._ssrNode("<label class=\"user-form-label nr\">性别</label> "),_c('el-radio-group',{model:{value:(_vm.radio),callback:function ($$v) {_vm.radio=$$v},expression:"radio"}},[_c('el-radio',{attrs:{"label":'男'}},[_vm._v("男")]),_vm._v(" "),_c('el-radio',{attrs:{"label":'女'}},[_vm._v("女")])],1)],2),_vm._ssrNode(" <div class=\"user-form-item flex\"><label class=\"user-form-label nr\">手机号</label> <div class=\"normal nr\">"+_vm._ssrEscape(_vm._s(_vm.mobile))+"</div> <div style=\"color: #6699CC;margin-left: 13px;cursor: pointer;\">"+_vm._ssrEscape("\n "+_vm._s(_vm.mobile?'修改号码':'绑定手机号'))+"</div></div> <div class=\"user-form-item flex\"><label class=\"user-form-label nr\">注册时间</label> <div class=\"normal nr\">"+_vm._ssrEscape(_vm._s(_vm.createTime))+"</div></div> <div class=\"user-form-item flex\"><label class=\"user-form-label nr\">登录密码</label> <div class=\"nr\" style=\"color: #6699CC;cursor: pointer;\">修改密码</div></div> <button class=\"primary-btn bg-primary flex-center white\">\n 保存\n </button>")],2),_vm._ssrNode(" "),_c('el-dialog',{attrs:{"center":true,"title":_vm.mobile ? '更换手机号': '绑定手机',"visible":_vm.showChangeNumber,"width":"40%"},on:{"update:visible":function($event){_vm.showChangeNumber=$event}}},[_c('div',[_c('el-form',{staticStyle:{"width":"50%","margin":"0 auto"}},[_c('el-form-item',[_c('el-input',{attrs:{"placeholder":"请输入新的手机号码"},model:{value:(_vm.telephone),callback:function ($$v) {_vm.telephone=$$v},expression:"telephone"}})],1),_vm._v(" "),_c('el-form-item',[_c('div',{staticClass:"flex"},[_c('el-input',{attrs:{"placeholder":"短信验证码"},model:{value:(_vm.verifyCode),callback:function ($$v) {_vm.verifyCode=$$v},expression:"verifyCode"}}),_vm._v(" "),_c('el-button',{staticStyle:{"margin-left":"14px"},on:{"click":_vm.sndSmsToPhone}},[(_vm.canSendNumber)?_c('div',[_vm._v("获取验证码")]):_c('count-down',{attrs:{"time":60,"format":"ss秒","autoStart":""},on:{"finish":function($event){_vm.canSendNumber = true}}})],1)],1)])],1)],1),_vm._v(" "),_c('div',{attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{staticStyle:{"width":"134px"},attrs:{"type":"primary"},on:{"click":_vm.changeUserMobile}},[_vm._v("确认")]),_vm._v(" "),_c('el-button',{staticStyle:{"width":"134px"},on:{"click":_vm.closeChangeNumber}},[_vm._v("取消")])],1)]),_vm._ssrNode(" "),_c('el-dialog',{attrs:{"title":"设置登录密码","center":true,"visible":_vm.showPwdPop,"width":"40%"},on:{"update:visible":function($event){_vm.showPwdPop=$event}}},[_c('div',[_c('el-form',{staticStyle:{"width":"50%","margin":"0 auto"}},[_c('el-form-item',[_c('el-input',{attrs:{"placeholder":"请输入手机号码"},model:{value:(_vm.mobile),callback:function ($$v) {_vm.mobile=$$v},expression:"mobile"}})],1),_vm._v(" "),_c('el-form-item',[_c('div',{staticClass:"flex"},[_c('el-input',{attrs:{"placeholder":"短信验证码"},model:{value:(_vm.verifyCode),callback:function ($$v) {_vm.verifyCode=$$v},expression:"verifyCode"}}),_vm._v(" "),_c('el-button',{staticStyle:{"margin-left":"14px"},on:{"click":_vm.sndSmsToPhone}},[(_vm.canSendPwd)?_c('div',[_vm._v("获取验证码")]):_c('count-down',{attrs:{"time":60,"format":"ss秒","autoStart":""},on:{"finish":function($event){_vm.canSendPwd = true}}})],1)],1)]),_vm._v(" "),_c('el-form-item',[_c('el-input',{attrs:{"type":"password","placeholder":"请输入密码 (数字与字母自由组合)"},model:{value:(_vm.pwd),callback:function ($$v) {_vm.pwd=$$v},expression:"pwd"}})],1),_vm._v(" "),_c('el-form-item',[_c('el-input',{attrs:{"type":"password","placeholder":"再次输入密码"},model:{value:(_vm.againPwd),callback:function ($$v) {_vm.againPwd=$$v},expression:"againPwd"}})],1)],1)],1),_vm._v(" "),_c('div',{attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{staticStyle:{"width":"134px"},attrs:{"type":"primary"},on:{"click":_vm.setPassWord}},[_vm._v("确认")]),_vm._v(" "),_c('el-button',{staticStyle:{"width":"134px"},on:{"click":_vm.closePwdPop}},[_vm._v("取消")])],1)])],2)}
  256. var staticRenderFns = []
  257. // CONCATENATED MODULE: ./pages/user/profile.vue?vue&type=template&id=5917c3b2&
  258. // EXTERNAL MODULE: ./utils/type.js
  259. var type = __webpack_require__(149);
  260. // EXTERNAL MODULE: external "js-cookie"
  261. var external_js_cookie_ = __webpack_require__(10);
  262. var external_js_cookie_default = /*#__PURE__*/__webpack_require__.n(external_js_cookie_);
  263. // EXTERNAL MODULE: external "vuex"
  264. var external_vuex_ = __webpack_require__(2);
  265. // EXTERNAL MODULE: ./config/app.js
  266. var app = __webpack_require__(33);
  267. // 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!./pages/user/profile.vue?vue&type=script&lang=js&
  268. //
  269. //
  270. //
  271. //
  272. //
  273. //
  274. //
  275. //
  276. //
  277. //
  278. //
  279. //
  280. //
  281. //
  282. //
  283. //
  284. //
  285. //
  286. //
  287. //
  288. //
  289. //
  290. //
  291. //
  292. //
  293. //
  294. //
  295. //
  296. //
  297. //
  298. //
  299. //
  300. //
  301. //
  302. //
  303. //
  304. //
  305. //
  306. //
  307. //
  308. //
  309. //
  310. //
  311. //
  312. //
  313. //
  314. //
  315. //
  316. //
  317. //
  318. //
  319. //
  320. //
  321. //
  322. //
  323. //
  324. //
  325. //
  326. //
  327. //
  328. //
  329. //
  330. //
  331. //
  332. //
  333. //
  334. //
  335. //
  336. //
  337. //
  338. //
  339. //
  340. //
  341. //
  342. //
  343. //
  344. //
  345. //
  346. //
  347. //
  348. //
  349. //
  350. //
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. /* harmony default export */ var profilevue_type_script_lang_js_ = ({
  378. head() {
  379. return {
  380. title: this.$store.getters.headTitle,
  381. link: [{
  382. rel: "icon",
  383. type: "image/x-icon",
  384. href: this.$store.getters.favicon
  385. }]
  386. };
  387. },
  388. layout: "user",
  389. mounted() {
  390. this.getUserInfoFun();
  391. },
  392. data() {
  393. return {
  394. avatar: "",
  395. mobile: "",
  396. sex: 0,
  397. createTime: "",
  398. sn: "",
  399. action: app["a" /* default */].baseUrl + "/api/file/formimage",
  400. nickName: "",
  401. radio: 1,
  402. showChangeNumber: false,
  403. showPwdPop: false,
  404. telephone: "",
  405. verifyCode: "",
  406. pwd: "",
  407. againPwd: "",
  408. smsType: type["c" /* SMSType */].CHANGE_MOBILE,
  409. canSendNumber: true,
  410. canSendPwd: true,
  411. fileList: []
  412. };
  413. },
  414. methods: { ...Object(external_vuex_["mapActions"])(["getPublicData"]),
  415. async getUserInfoFun() {
  416. let res = await this.$get("user/info");
  417. if (res.code == 1) {
  418. this.avatar = res.data.avatar;
  419. this.nickName = res.data.nickname;
  420. this.mobile = res.data.mobile;
  421. this.sex = res.data.sex;
  422. this.radio = this.sex;
  423. this.createTime = res.data.create_time;
  424. this.sn = res.data.sn;
  425. }
  426. },
  427. async saveUserInfo() {
  428. let res = await this.$post("pc/changeUserInfo", {
  429. sex: this.radio == "男" ? 1 : 2,
  430. nickname: this.nickName
  431. });
  432. if (res.code == 1) {
  433. this.$message({
  434. message: res.msg,
  435. type: "success"
  436. });
  437. this.getPublicData();
  438. }
  439. },
  440. closeChangeNumber() {
  441. this.telephone = "";
  442. this.verifyCode = "";
  443. this.showChangeNumber = false;
  444. },
  445. closePwdPop() {
  446. this.telephone = "";
  447. this.verifyCode = "";
  448. this.showPwdPop = false;
  449. },
  450. // 打开修改手机号的弹窗
  451. openChangeNumber() {
  452. this.showChangeNumber = true;
  453. this.smsType = this.mobile ? type["c" /* SMSType */].CHANGE_MOBILE : type["c" /* SMSType */].BIND;
  454. },
  455. // 打开修改登录密码的弹窗
  456. openChangePwdPop() {
  457. if (this.mobile == "") return this.$message.error("请先绑定手机号");
  458. this.showPwdPop = true;
  459. this.smsType = type["c" /* SMSType */].FINDPWD;
  460. },
  461. // 发送验证码
  462. async sndSmsToPhone() {
  463. if ((this.smsType == type["c" /* SMSType */].CHANGE_MOBILE || this.smsType == type["c" /* SMSType */].BIND) && !this.canSendNumber) return;else if (this.smsType == type["c" /* SMSType */].FINDPWD && !this.canSendPwd) return;
  464. if (this.smsType == type["c" /* SMSType */].CHANGE_MOBILE && !this.telephone) return this.$message.error("请输入手机号");
  465. let res = await this.$post("sms/send", {
  466. mobile: this.smsType == type["c" /* SMSType */].FINDPWD ? this.mobile : this.telephone,
  467. key: this.smsType
  468. });
  469. if (res.code == 1) {
  470. this.smsType == type["c" /* SMSType */].FINDPWD ? this.canSendPwd = false : this.canSendNumber = false;
  471. this.$message.success("发送成功");
  472. }
  473. },
  474. // 修改手机号码
  475. async changeUserMobile() {
  476. if (!this.telephone) return this.$message.error("请输入新的手机号码");
  477. if (!this.verifyCode) return this.$message.error("请输入验证码");
  478. let res = await this.$post("user/changeMobile", {
  479. mobile: this.mobile,
  480. new_mobile: this.telephone,
  481. code: this.verifyCode,
  482. action: this.mobile ? "change" : "",
  483. client: type["d" /* client */]
  484. });
  485. if (res.code == 1) {
  486. this.showChangeNumber = false;
  487. this.$message.success(res.msg);
  488. this.getPublicData();
  489. this.getUserInfoFun();
  490. }
  491. },
  492. // 设置登录密码
  493. async setPassWord() {
  494. if (!this.verifyCode) return this.$message.error("请输入验证码");
  495. if (!this.pwd) return this.$message.error("请输入密码");
  496. if (!this.againPwd) return this.$message.error("请输入确认密码");
  497. if (this.pwd != this.againPwd) return this.$message.error("两次密码输入不一致");
  498. let res = await this.$post("login_password/forget", {
  499. mobile: this.mobile,
  500. code: this.verifyCode,
  501. password: this.pwd,
  502. repassword: this.againPwd,
  503. client: type["d" /* client */]
  504. });
  505. if (res.code == 1) {
  506. this.$message({
  507. message: res.msg,
  508. type: "success"
  509. });
  510. this.showPwdPop = false;
  511. const token = res.data.token;
  512. external_js_cookie_default.a.set("token", token, {
  513. expires: 60
  514. });
  515. }
  516. },
  517. async uploadFileSuccess(res, fileList) {
  518. let respond = await this.$post("user/setInfo", {
  519. field: type["b" /* FieldType */].AVATAR,
  520. value: res.data.uri
  521. });
  522. if (respond.code == 1) {
  523. this.$message({
  524. message: respond.msg,
  525. type: "success"
  526. });
  527. let userRes = await this.$get("user/info");
  528. if (userRes.code == 1) {
  529. this.avatar = userRes.data.avatar;
  530. this.nickName = userRes.data.nickname;
  531. this.mobile = userRes.data.mobile;
  532. this.sex = userRes.data.sex;
  533. this.radio = this.sex;
  534. this.createTime = userRes.data.create_time;
  535. }
  536. }
  537. }
  538. }
  539. });
  540. // CONCATENATED MODULE: ./pages/user/profile.vue?vue&type=script&lang=js&
  541. /* harmony default export */ var user_profilevue_type_script_lang_js_ = (profilevue_type_script_lang_js_);
  542. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  543. var componentNormalizer = __webpack_require__(1);
  544. // CONCATENATED MODULE: ./pages/user/profile.vue
  545. function injectStyles (context) {
  546. var style0 = __webpack_require__(315)
  547. if (style0.__inject__) style0.__inject__(context)
  548. }
  549. /* normalize component */
  550. var component = Object(componentNormalizer["a" /* default */])(
  551. user_profilevue_type_script_lang_js_,
  552. render,
  553. staticRenderFns,
  554. false,
  555. injectStyles,
  556. null,
  557. "6ecdb877"
  558. )
  559. /* harmony default export */ var profile = __webpack_exports__["default"] = (component.exports);
  560. /* nuxt-component-imports */
  561. installComponents(component, {CountDown: __webpack_require__(144).default})
  562. /***/ })
  563. };;
  564. //# sourceMappingURL=profile.js.map