reset-password-dialog.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. exports.ids = [28,29];
  2. exports.modules = {
  3. /***/ 284:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 296:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. // ESM COMPAT FLAG
  13. __webpack_require__.r(__webpack_exports__);
  14. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ResetPasswordMail.vue?vue&type=template&id=5f1ed0ce&scoped=true
  15. var render = function render() {
  16. var _vm = this,
  17. _c = _vm._self._c;
  18. return _c('div', [_vm._ssrNode("<div style=\"width: 100%; background-color: #f7f7f7; color: #4a596c; position: relative;\" data-v-5f1ed0ce><div style=\"\\n width: 960px;\\n box-sizing: border-box;\\n padding: 20px 80px;\\n margin: 0 auto;\\n background-color: #fff;\\n \" data-v-5f1ed0ce><div style=\"background-color: #fff; margin: 0 auto\" data-v-5f1ed0ce><p style=\"text-align: center\" data-v-5f1ed0ce><img src=\"https://promocollection.s3.ap-southeast-2.amazonaws.com/uploads/goodsfolder/logo.png\" data-v-5f1ed0ce></p> <hr data-v-5f1ed0ce> <div style=\"\\n padding-top: 18px;\\n margin-bottom: 38px;\\n font-size: 18px;\\n \" data-v-5f1ed0ce><table data-v-5f1ed0ce><tr data-v-5f1ed0ce><td style=\"position: relative; width: 200px; color: #02bde3; font-weight: bold;\" data-v-5f1ed0ce><div style=\"width: 100%; text-align: left\" data-v-5f1ed0ce>\n Home&amp;lifestyle\n </div></td> <td style=\"position: relative; width: 200px; color: #02bde3; font-weight: bold;\" data-v-5f1ed0ce><div style=\"width: 100%; text-align: center\" data-v-5f1ed0ce>\n Antibacterial range\n </div></td> <td style=\"position: relative; width: 200px; color: #02bde3; font-weight: bold;\" data-v-5f1ed0ce><div style=\"width: 100%; text-align: center\" data-v-5f1ed0ce>\n Technology\n </div></td> <td style=\"position: relative; width: 200px; color: #02bde3; font-weight: bold;\" data-v-5f1ed0ce><div style=\"width: 100%; text-align: right\" data-v-5f1ed0ce>\n Outdoor &amp; leisure\n </div></td></tr></table></div> <p data-v-5f1ed0ce>" + _vm._ssrEscape("Hello! " + _vm._s(_vm.mailData.name)) + "</p> <p style=\"width: 620px; margin: 40px 0px 20px\" data-v-5f1ed0ce>\n Please click the link below or copy and paste it into your browser\n to create a new password on the PromoCollection website.\n </p> <p data-v-5f1ed0ce><a" + _vm._ssrAttr("href", _vm.mailData.Url + '?email=' + _vm.mailData.email) + " target=\"_blank\" style=\"color: #5c7dd4\" data-v-5f1ed0ce>" + _vm._ssrEscape("\n " + _vm._s(_vm.mailData.Url + "?email=" + _vm.mailData.email) + "\n ") + "</a></p> <p style=\"margin: 20px auto 30px\" data-v-5f1ed0ce>\n This link is valid for 3 hours after receiving this email.\n </p></div></div> <div style=\"height: 24px; width: 960px; background-color: #f7f7f7;\" data-v-5f1ed0ce></div> <div style=\"\\n width: 960px;\\n box-sizing: border-box;\\n padding: 20px 80px;\\n margin: 0 auto;\\n background-color: #fff;\\n \" data-v-5f1ed0ce><div style=\"height: 180px; background-color: #fff; margin: 0 auto\" data-v-5f1ed0ce><p style=\"color: #02bde3; font-size: 22px\" data-v-5f1ed0ce>\n Have more questions? contact us!\n </p> <p style=\"margin: 20px 0\" data-v-5f1ed0ce>Phone: 203 916 5098</p> <p data-v-5f1ed0ce>\n Email:\n <span style=\"color: #5c7dd4; text-decoration: underline\" data-v-5f1ed0ce>\n Info@promocollection.uk\n </span></p></div></div></div>")]);
  19. };
  20. var staticRenderFns = [];
  21. // CONCATENATED MODULE: ./components/ResetPasswordMail.vue?vue&type=template&id=5f1ed0ce&scoped=true
  22. // 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/ResetPasswordMail.vue?vue&type=script&lang=js
  23. /* harmony default export */ var ResetPasswordMailvue_type_script_lang_js = ({
  24. props: {
  25. mailData: {}
  26. }
  27. });
  28. // CONCATENATED MODULE: ./components/ResetPasswordMail.vue?vue&type=script&lang=js
  29. /* harmony default export */ var components_ResetPasswordMailvue_type_script_lang_js = (ResetPasswordMailvue_type_script_lang_js);
  30. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  31. var componentNormalizer = __webpack_require__(2);
  32. // CONCATENATED MODULE: ./components/ResetPasswordMail.vue
  33. function injectStyles (context) {
  34. }
  35. /* normalize component */
  36. var component = Object(componentNormalizer["a" /* default */])(
  37. components_ResetPasswordMailvue_type_script_lang_js,
  38. render,
  39. staticRenderFns,
  40. false,
  41. injectStyles,
  42. "5f1ed0ce",
  43. "ab9bffba"
  44. )
  45. /* harmony default export */ var ResetPasswordMail = __webpack_exports__["default"] = (component.exports);
  46. /***/ }),
  47. /***/ 345:
  48. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49. "use strict";
  50. __webpack_require__.r(__webpack_exports__);
  51. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_resetPasswordDialog_vue_vue_type_style_index_0_id_6548d9c2_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(284);
  52. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_resetPasswordDialog_vue_vue_type_style_index_0_id_6548d9c2_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_resetPasswordDialog_vue_vue_type_style_index_0_id_6548d9c2_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  53. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_resetPasswordDialog_vue_vue_type_style_index_0_id_6548d9c2_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_resetPasswordDialog_vue_vue_type_style_index_0_id_6548d9c2_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  54. /***/ }),
  55. /***/ 381:
  56. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57. "use strict";
  58. // ESM COMPAT FLAG
  59. __webpack_require__.r(__webpack_exports__);
  60. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/resetPasswordDialog.vue?vue&type=template&id=6548d9c2&scoped=true
  61. var render = function render() {
  62. var _vm = this,
  63. _c = _vm._self._c;
  64. return _c('el-dialog', {
  65. attrs: {
  66. "lock-scroll": false,
  67. "visible": _vm.resetDialogVisible,
  68. "width": "700px"
  69. },
  70. on: {
  71. "update:visible": function ($event) {
  72. _vm.resetDialogVisible = $event;
  73. }
  74. }
  75. }, [_c('el-page-header', {
  76. on: {
  77. "back": _vm.goBack
  78. }
  79. }), _vm._v(" "), _c('div', {
  80. staticClass: "dialog-content"
  81. }, [_c('p', [_vm._v("Reset Password")]), _vm._v(" "), _c('p', [_vm._v("\n Enter your email address and we'll send a link to reset your password.\n ")]), _vm._v(" "), _c('el-input', {
  82. attrs: {
  83. "placeholder": "Email"
  84. },
  85. model: {
  86. value: _vm.email,
  87. callback: function ($$v) {
  88. _vm.email = $$v;
  89. },
  90. expression: "email"
  91. }
  92. }), _vm._v(" "), _c('el-button', {
  93. staticClass: "reset-btn",
  94. attrs: {
  95. "plain": "",
  96. "disabled": _vm.disabledFlag
  97. },
  98. on: {
  99. "click": _vm.debounceSendEmail
  100. }
  101. }, [_vm._v("\n " + _vm._s(_vm.butonContent) + "\n ")])], 1), _vm._v(" "), _c('reset-password-mail', {
  102. directives: [{
  103. name: "show",
  104. rawName: "v-show",
  105. value: false,
  106. expression: "false"
  107. }],
  108. ref: "resetPasswordMail",
  109. attrs: {
  110. "mailData": _vm.mailData
  111. }
  112. })], 1);
  113. };
  114. var staticRenderFns = [];
  115. // CONCATENATED MODULE: ./components/resetPasswordDialog.vue?vue&type=template&id=6548d9c2&scoped=true
  116. // EXTERNAL MODULE: ./plugins/AES.js
  117. var AES = __webpack_require__(32);
  118. // EXTERNAL MODULE: external "lodash"
  119. var external_lodash_ = __webpack_require__(141);
  120. var external_lodash_default = /*#__PURE__*/__webpack_require__.n(external_lodash_);
  121. // 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/resetPasswordDialog.vue?vue&type=script&lang=js
  122. /* harmony default export */ var resetPasswordDialogvue_type_script_lang_js = ({
  123. name: 'resetPasswordDialog',
  124. data() {
  125. return {
  126. disabledFlag: false,
  127. resetDialogVisible: false,
  128. email: '',
  129. butonContent: 'SEND RESET EMAIL',
  130. time: 60,
  131. timer: null,
  132. mailData: {
  133. Url: '',
  134. name: '',
  135. email: ''
  136. }
  137. };
  138. },
  139. watch: {
  140. email: {
  141. handler(newValue, oldValue) {
  142. if (newValue) {
  143. let reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
  144. if (reg.test(this.email)) {
  145. this.disabledFlag = false;
  146. } else {
  147. this.disabledFlag = true;
  148. }
  149. this.getmailData();
  150. }
  151. },
  152. immediate: true
  153. }
  154. },
  155. mounted() {
  156. this.getmailData();
  157. },
  158. methods: {
  159. goBack() {
  160. this.resetDialogVisible = false;
  161. this.$emit('openLoginDialog');
  162. },
  163. getmailData() {
  164. this.mailData.Url = location.origin + '/setNewPassword';
  165. this.mailData.name = this.email;
  166. this.mailData.email = AES["a" /* default */].encrypt(this.email + '&t=' + Date.now());
  167. },
  168. debounceSendEmail: external_lodash_default.a.debounce(function () {
  169. this.sendEmail();
  170. }, 200),
  171. sendEmail() {
  172. if (this.email) {
  173. this.disabledFlag = true;
  174. this.getmailData();
  175. this.timer = setInterval(() => {
  176. if (this.time == 0) {
  177. this.resetData();
  178. } else {
  179. this.butonContent = 'Resend Passwords in ' + this.time + ' s';
  180. this.time--;
  181. }
  182. }, 1000);
  183. this.$axios.post('/uk-api/uk/resetemail', {
  184. email: this.email,
  185. content: this.$refs.resetPasswordMail.$el.innerHTML
  186. }).then(res => {
  187. if (res.code == 1) {
  188. this.resetData();
  189. this.time = 60;
  190. this.$notify({
  191. title: 'success',
  192. message: 'Sending an email successfully',
  193. type: 'success',
  194. duration: 3000
  195. });
  196. }
  197. }).catch(() => {
  198. this.resetData();
  199. this.time = 60;
  200. // this.$message.error(error.response.data.msg);
  201. });
  202. }
  203. },
  204. resetData(boolean = false) {
  205. clearInterval(this.timer);
  206. this.disabledFlag = boolean;
  207. this.butonContent = 'SEND RESET EMAIL';
  208. }
  209. },
  210. beforeDestroy() {
  211. clearInterval(this.timer);
  212. }
  213. });
  214. // CONCATENATED MODULE: ./components/resetPasswordDialog.vue?vue&type=script&lang=js
  215. /* harmony default export */ var components_resetPasswordDialogvue_type_script_lang_js = (resetPasswordDialogvue_type_script_lang_js);
  216. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  217. var componentNormalizer = __webpack_require__(2);
  218. // CONCATENATED MODULE: ./components/resetPasswordDialog.vue
  219. function injectStyles (context) {
  220. var style0 = __webpack_require__(345)
  221. if (style0.__inject__) style0.__inject__(context)
  222. }
  223. /* normalize component */
  224. var component = Object(componentNormalizer["a" /* default */])(
  225. components_resetPasswordDialogvue_type_script_lang_js,
  226. render,
  227. staticRenderFns,
  228. false,
  229. injectStyles,
  230. "6548d9c2",
  231. "66626a54"
  232. )
  233. /* harmony default export */ var resetPasswordDialog = __webpack_exports__["default"] = (component.exports);
  234. /* nuxt-component-imports */
  235. installComponents(component, {ResetPasswordMail: __webpack_require__(296).default})
  236. /***/ })
  237. };;
  238. //# sourceMappingURL=reset-password-dialog.js.map