exports.ids = [16,20]; exports.modules = { /***/ 221: /***/ (function(module, exports) { // Exports module.exports = { }; /***/ }), /***/ 244: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* 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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221); /* 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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_true__WEBPACK_IMPORTED_MODULE_0__); /* 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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_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_PcGlobalForm_vue_vue_type_style_index_0_id_4b4d0fec_prod_lang_scss_scope_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ 282: /***/ (function(module, exports) { // Exports module.exports = { }; /***/ }), /***/ 294: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // 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/PcGlobalForm.vue?vue&type=template&id=4b4d0fec var render = function render() { var _vm = this, _c = _vm._self._c; return _c('div', { staticClass: "form global-form" }, [_c('el-form', { ref: "ruleForm", staticClass: "form-list", attrs: { "model": _vm.formData, "rules": _vm.rules } }, _vm._l(_vm.formConfig, function (item) { return _c('el-form-item', { key: item.label, attrs: { "prop": item.prop } }, [item.type === 'input' ? _c('el-input', { style: { width: item.width }, attrs: { "disabled": item.disabled, "placeholder": item.placeholder, "clearable": "" }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }) : _vm._e(), _vm._v(" "), item.type === 'password' ? _c('el-input', { style: { width: item.width }, attrs: { "type": _vm.flag ? 'text' : 'password', "autocomplete": "off", "placeholder": item.placeholder, "clearable": "" }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }, [!_vm.flag ? _c('i', { staticClass: "el-input__icon iconfont", staticStyle: { "font-size": "22px" }, attrs: { "slot": "suffix" }, on: { "click": _vm.showPassword }, slot: "suffix" }, [_vm._v("")]) : _c('i', { staticClass: "el-input__icon iconfont", staticStyle: { "font-size": "22px" }, attrs: { "slot": "suffix" }, on: { "click": _vm.showPassword }, slot: "suffix" }, [_vm._v("")])]) : _vm._e(), _vm._v(" "), item.type === 'textarea' ? _c('el-input', { style: { width: item.width }, attrs: { "type": "textarea", "disabled": item.disabled, "maxlength": item.maxlength, "rows": item.rows, "show-word-limit": item.showWordLimit }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }) : _vm._e(), _vm._v(" "), item.type === 'select' ? _c('el-select', { style: { width: item.width }, attrs: { "disabled": item.disabled, "clearable": "", "multiple": _vm.multiple, "placeholder": item.placeholder }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }, _vm._l(item.selectList, function (option) { return _c('el-option', { key: option.id, attrs: { "label": option.name, "value": option.id } }); }), 1) : _vm._e(), _vm._v(" "), item.type === 'selectObj' ? _c('el-select', { style: { width: item.width }, attrs: { "disabled": item.disabled, "filterable": "", "clearable": "", "placeholder": item.placeholder }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }, _vm._l(item.selectList, function (item, key) { return _c('el-option', { key: parseInt(key), attrs: { "label": item, "value": parseInt(key) } }); }), 1) : _vm._e(), _vm._v(" "), item.type === 'radio' ? _c('el-radio-group', { attrs: { "disabled": item.disabled }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }, _vm._l(item.radios, function (radio) { return _c('el-radio', { key: radio.label, attrs: { "label": radio.label } }); }), 1) : _vm._e(), _vm._v(" "), item.type === 'checkbox' ? _c('el-checkbox-group', { attrs: { "disabled": item.disabled }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }, _vm._l(item.checkboxs, function (item) { return _c('el-checkbox', { key: item.label, attrs: { "label": item.label } }, [_vm._v(_vm._s(item.label))]); }), 1) : _vm._e(), _vm._v(" "), item.type === 'switch' ? _c('el-switch', { attrs: { "disabled": item.disabled }, on: { "change": function ($event) { item.change && item.change(_vm.formData[item.prop]); } }, model: { value: _vm.formData[item.prop], callback: function ($$v) { _vm.$set(_vm.formData, item.prop, $$v); }, expression: "formData[item.prop]" } }) : _vm._e(), _vm._v(" "), item.type === 'slot' ? [_vm._t(item.slotName)] : _vm._e()], 2); }), 1), _vm._ssrNode(" "), _vm._ssrNode("
", "
", [_vm.showLoginBtn ? _c('el-button', { attrs: { "loading": _vm.submitLoading }, nativeOn: { "click": function ($event) { return _vm.submit.apply(null, arguments); } } }, [_vm._v("\n LOGIN\n ")]) : _vm._e(), _vm._ssrNode(" "), _vm.showRegisterBtn ? _c('el-button', { attrs: { "loading": _vm.submitLoading }, nativeOn: { "click": function ($event) { return _vm.submit.apply(null, arguments); } } }, [_vm._v("\n REGISTER\n ")]) : _vm._e(), _vm._ssrNode(" "), _vm.showDeleteBtn ? _c('el-button', { nativeOn: { "click": function ($event) { return _vm.close.apply(null, arguments); } } }, [_vm._v("取 消")]) : _vm._e()], 2)], 2); }; var staticRenderFns = []; // CONCATENATED MODULE: ./components/PcGlobalForm.vue?vue&type=template&id=4b4d0fec // 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/PcGlobalForm.vue?vue&type=script&lang=js /* harmony default export */ var PcGlobalFormvue_type_script_lang_js = ({ name: "GlobalForm", props: { showDeleteBtn: { type: Boolean, default: true }, showLoginBtn: { type: Boolean, default: true }, showRegisterBtn: { type: Boolean, default: true }, // 表单配置 formConfig: { type: Array, required: true }, // 表单数据 formData: { type: Object, required: true }, // 表单规则 rules: { type: Object }, submitLoading: { type: Boolean } }, data() { return { flag: false }; }, methods: { submit() { this.$refs.ruleForm.validate(valid => { if (valid) { this.$emit("handleSubmit"); } else { console.log("error submit!!"); return false; } }); }, close() { this.$emit("handleClose"); }, showPassword() { this.flag = !this.flag; } } }); // CONCATENATED MODULE: ./components/PcGlobalForm.vue?vue&type=script&lang=js /* harmony default export */ var components_PcGlobalFormvue_type_script_lang_js = (PcGlobalFormvue_type_script_lang_js); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(2); // CONCATENATED MODULE: ./components/PcGlobalForm.vue function injectStyles (context) { var style0 = __webpack_require__(244) if (style0.__inject__) style0.__inject__(context) } /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( components_PcGlobalFormvue_type_script_lang_js, render, staticRenderFns, false, injectStyles, null, "905cdef0" ) /* harmony default export */ var PcGlobalForm = __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 338: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* 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_loginDialog_vue_vue_type_style_index_0_id_0b8b973d_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(282); /* 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_loginDialog_vue_vue_type_style_index_0_id_0b8b973d_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_loginDialog_vue_vue_type_style_index_0_id_0b8b973d_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__); /* 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_loginDialog_vue_vue_type_style_index_0_id_0b8b973d_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_loginDialog_vue_vue_type_style_index_0_id_0b8b973d_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ 373: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // 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/loginDialog.vue?vue&type=template&id=0b8b973d&scoped=true var render = function render() { var _vm$config$configInfo, _vm$config$configInfo2; var _vm = this, _c = _vm._self._c; return _c('div', [_c('el-dialog', { attrs: { "custom-class": _vm.activeName === 'first' ? 'custom-login-form' : 'custom-register-form', "lock-scroll": false, "visible": _vm.dialogVisible, "width": _vm.dialogWidth, "before-close": _vm.close }, on: { "update:visible": function ($event) { _vm.dialogVisible = $event; } } }, [_c('el-tabs', { model: { value: _vm.activeName, callback: function ($$v) { _vm.activeName = $$v; }, expression: "activeName" } }, [_c('el-tab-pane', { attrs: { "label": "LOGIN", "name": "first" } }, [_c('GlobalForm', { ref: "loginForm", attrs: { "formData": _vm.loginData, "formConfig": _vm.loginFormConfig, "rules": _vm.loginRules, "submitLoading": _vm.submitLoading, "showDeleteBtn": _vm.showDeleteBtn, "showRegisterBtn": false }, on: { "handleSubmit": _vm.submit }, scopedSlots: _vm._u([{ key: "checkbox", fn: function () { return [_c('div', { staticClass: "rememberMe" }, [_c('el-checkbox', { model: { value: _vm.isRemember, callback: function ($$v) { _vm.isRemember = $$v; }, expression: "isRemember" } }, [_vm._v("Remember me")]), _vm._v(" "), _c('div', { staticClass: "btn-forgot-pw", on: { "click": _vm.resetPassword } }, [_vm._v("\n Forgot Password\n ")])], 1)]; }, proxy: true }]) }), _vm._v(" "), _c('div', { staticStyle: { "font-size": "14px", "color": "#666", "margin-top": "18px", "text-align": "right" } }, [_vm._v("\n Strictly distributors only. Proof of status will be required\n ")])], 1), _vm._v(" "), _c('el-tab-pane', { attrs: { "label": "REGISTER AS A NEW USER", "name": "second" } }, [_c('div', { staticClass: "flex start" }, [_c('div', { staticStyle: { "width": "50%", "min-width": "50%", "padding-top": "48px" } }, [_c('div', { staticClass: "flex center", staticStyle: { "margin-bottom": "55px" } }, [_c('img', { attrs: { "src": __webpack_require__(33), "alt": "PromoCollection Logo" } })]), _vm._v(" "), _c('div', { staticClass: "desc-content main-desc" }, [_vm._v("\n PromoCollection is Australia's fastest growing\n "), _c('br'), _vm._v("\n promotional products supplier, 5 years in a row!\n ")]), _vm._v(" "), _c('p', { staticClass: "desc-content" }, [_vm._v("\n We work exclusively with distributors to offer over 2000\n catalogue products, as well as a world of sourcing options, with\n our 60 person offshore sourcing team,to source anything you\n need!\n ")]), _vm._v(" "), _c('div', { staticClass: "desc-content" }, [_vm._v("\n To apply for a login, please input the below information\n ")]), _vm._v(" "), (_vm$config$configInfo = _vm.config.configInfo) !== null && _vm$config$configInfo !== void 0 && _vm$config$configInfo.image ? _c('div', { staticClass: "signature-image flex center" }, [_c('img', { class: { pointer: (_vm$config$configInfo2 = _vm.config.configInfo) === null || _vm$config$configInfo2 === void 0 ? void 0 : _vm$config$configInfo2.link }, attrs: { "src": _vm.config.configInfo.image, "alt": "" }, on: { "click": _vm.toSignatureLink } })]) : _vm._e()]), _vm._v(" "), _c('div', { staticClass: "flex-auto register-form" }, [_c('el-form', { ref: "registForm", attrs: { "inline": true, "model": _vm.registData, "rules": _vm.registRules, "label-position": "top" } }, _vm._l(_vm.registFormConfig, function (item) { return _c('el-form-item', { key: item.label, class: { 'long-form-item': item.long, 'short-form-item': !item.long }, attrs: { "prop": item.prop, "label": item.placeholder } }, [item.type === 'password' ? _c('el-input', { attrs: { "type": _vm.showPassword ? 'text' : 'password' }, model: { value: _vm.registData[item.prop], callback: function ($$v) { _vm.$set(_vm.registData, item.prop, $$v); }, expression: "registData[item.prop]" } }, [!_vm.showPassword ? _c('i', { staticClass: "el-input__icon iconfont", staticStyle: { "font-size": "22px", "cursor": "pointer", "color": "#666" }, attrs: { "slot": "suffix" }, on: { "click": function ($event) { _vm.showPassword = true; } }, slot: "suffix" }, [_vm._v("")]) : _c('i', { staticClass: "el-input__icon iconfont", staticStyle: { "font-size": "22px", "cursor": "pointer", "color": "#666" }, attrs: { "slot": "suffix" }, on: { "click": function ($event) { _vm.showPassword = false; } }, slot: "suffix" }, [_vm._v("")])]) : _c('el-input', { attrs: { "id": item.prop + '_input' }, on: { "change": $e => _vm.onInputChange($e, item.prop) }, model: { value: _vm.registData[item.prop], callback: function ($$v) { _vm.$set(_vm.registData, item.prop, $$v); }, expression: "registData[item.prop]" } })], 1); }), 1), _vm._v(" "), _c('div', { staticClass: "flex center" }, [_c('el-button', { attrs: { "loading": _vm.submitLoading }, on: { "click": _vm.checkRegisterForm } }, [_vm._v("REGISTER")])], 1), _vm._v(" "), _c('p', { staticClass: "desc-content" }, [_vm._v("* required")])], 1)])])], 1)], 1), _vm._ssrNode(" "), _c('resetPasswordDialog', { ref: "resetPasswordDialog", on: { "openLoginDialog": _vm.openLoginDialog } }), _vm._ssrNode(" "), _c('dialog-XX-success', { attrs: { "visible": _vm.xxContentVisible, "content": _vm.xxContent }, on: { "update:visible": function ($event) { _vm.xxContentVisible = $event; } } })], 2); }; var staticRenderFns = []; // CONCATENATED MODULE: ./components/loginDialog.vue?vue&type=template&id=0b8b973d&scoped=true // EXTERNAL MODULE: external "vuex" var external_vuex_ = __webpack_require__(6); // EXTERNAL MODULE: ./components/PcGlobalForm.vue + 4 modules var PcGlobalForm = __webpack_require__(294); // EXTERNAL MODULE: ./components/DIalogXXSuccess.vue + 4 modules var DIalogXXSuccess = __webpack_require__(30); // 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/loginDialog.vue?vue&type=script&lang=js const Base64 = __webpack_require__(146).Base64; /* harmony default export */ var loginDialogvue_type_script_lang_js = ({ name: 'LoginDialog', components: { GlobalForm: PcGlobalForm["default"], 'dialog-XX-success': DIalogXXSuccess["default"] }, data() { return { showPassword: false, xxContentVisible: false, xxContent: 'success', isRemember: false, showDeleteBtn: false, activeName: 'first', submitLoading: false, loginData: { email: '', password: '' }, registData: {}, // 表单配置 loginFormConfig: [{ autoInput: true, prop: 'email', type: 'input', placeholder: 'User Name' }, { prop: 'password', type: 'password', placeholder: 'Password' }, { type: 'slot', slotName: 'checkbox' }], registFormConfig: [{ long: true, prop: 'email', type: 'input', placeholder: 'Email' }, { long: true, prop: 'password', type: 'password', placeholder: 'Password' }, { long: true, prop: 'confirm_password', type: 'password', placeholder: 'Comfirm Password' }, { prop: 'contacts', type: 'input', placeholder: 'First Name' }, { prop: 'last_name', type: 'input', placeholder: 'Last Name' }, { long: true, prop: 'company', type: 'input', placeholder: 'Company Name' }, { prop: 'phone', type: 'input', placeholder: 'Phone No' }, { prop: 'url', type: 'input', placeholder: 'Website' }, { long: true, prop: 'address', type: 'input', placeholder: 'Address' }, { prop: 'state', type: 'input', placeholder: 'State' }, { prop: 'postcode', type: 'input', placeholder: 'Post Code' }], // 表单规则 loginRules: { email: [{ required: true, message: 'Please enter the correct email', trigger: 'blur' }], password: [{ required: true, message: 'The password length only allows 6-16 bits', trigger: 'blur', min: 6, max: 16 }] }, registRules: { email: [{ required: true, message: 'Please enter your email address', trigger: 'blur' }], password: [{ required: true, message: 'The password length only allows 6-16 bits', trigger: 'blur', min: 6, max: 16 }], confirm_password: [{ required: true, message: 'The password length only allows 6-16 bits', trigger: 'blur', min: 6, max: 16 }], company: [{ required: true, message: 'Please enter your company name', trigger: 'blur' }], contacts: [{ required: true, message: 'Please enter your contact person', trigger: 'blur' }], last_name: [{ required: true, message: 'Please enter your contact person', trigger: 'blur' }], phone: [{ required: true, message: 'Please enter your phone number', trigger: 'blur' }] }, autoComplete: null, // 记录谷歌地图API选择地点后拿到的地址名. 这个不能直接更新到registeData上, 不然输入框内容会再次变化. selectAddress: '' }; }, computed: { ...Object(external_vuex_["mapState"])(['dialogVisible', 'config']), dialogWidth() { return this.activeName === 'first' ? '506px' : '1108px'; } }, watch: { dialogVisible(value) { if (value) { document.addEventListener('keydown', this.onEnterClick); } else { document.removeEventListener('keydown', this.onEnterClick); } }, activeName() { if (this.activeName === 'second' && this.autoComplete === null) { if (window.google) { this.initGoogleMapAutoComplete(); this.getAddrByLocation(); } else { setTimeout(() => { this.initGoogleMapAutoComplete(); this.getAddrByLocation(); }, 1500); } } } }, mounted() { this.getCookie(); }, methods: { ...Object(external_vuex_["mapMutations"])(['closeDialog', 'openDialog']), onEnterClick(e) { if (e.keyCode === 13) { console.log('enter'); let target = this.$refs.loginForm; if (this.activeName === 'first') { // do nothing. login form } if (this.activeName === 'second') { target = this.$refs.registForm; } if (typeof target.submit === 'function') { target.submit(); } } }, checkRegisterForm() { this.$refs.registForm.validate(valid => { if (valid) { this.submit(); } }); }, submit() { if (this.activeName === 'first') { if (this.isRemember) { const password = Base64.encode(this.loginData.password); this.setCookie(this.loginData.email, password, 7); } else { this.setCookie('', '', -1); } this.login(); } else if (this.activeName === 'second') { this.regist(); } }, login() { this.$store.dispatch('login', this.loginData).then(res => { if (res.code == 1) { setTimeout(() => { this.closeDialog(); }, 200); this.xxContentVisible = true; this.xxContent = 'Login Successful'; this.submitLoading = false; // this.$confirm("Login Successful", { // confirmButtonText: "OK", // confirmButtonClass: 'confirmBtn', // showCancelButton: false, // showClose: false, // type: "success", // center: true, // lockScroll: false, // }).then(() => { // }); } else if (res.code == 10100) { this.$confirm(res.msg, { confirmButtonText: 'OK', showCancelButton: false, type: 'error', center: true }); } }).catch(() => { this.closeDialog(); }); }, regist() { this.submitLoading = true; const formData = Object.assign({}, this.registData); if (this.selectAddress && this.selectAddress.length) { formData.address = this.selectAddress; } this.$axios({ url: '/uk-api/uk/register', method: 'post', data: formData }).then(res => { if (res.code == 1) { this.closeDialog(); this.submitLoading = false; this.xxContentVisible = true; this.xxContent = "We've received your login request. Someone will be in touch shortly to confirm."; this.registerEmail(); } }).catch(e => { const res = e.response.data; if (res.code === 10100) { this.$confirm(res.msg + ', please click OK to jump to login.', { confirmButtonText: 'OK', showCancelButton: false, type: 'error', center: true }).then(() => { this.submitLoading = false; this.activeName = 'first'; }); } }); }, registerEmail() { this.$axios.get('/uk-api/uk/register_email?email=' + this.registData.email).then(res => {}).catch(error => { this.$message.error(error.response.data.msg); }); }, close() { this.closeDialog(); this.registData = {}; }, resetPassword() { this.closeDialog(); this.$refs.resetPasswordDialog.resetDialogVisible = true; }, openLoginDialog() { this.openDialog(); }, // 设置cookie setCookie(email, password, days) { const date = new Date(); date.setTime(date.getTime() + 24 * 60 * 60 * 1000 * days); document.cookie = 'email' + '=' + email + ';path=/;expires=' + date.toGMTString(); document.cookie = 'password' + '=' + password + ';path=/;expires=' + date.toGMTString(); }, // 读取cookie 将用户名和密码回显到input框中 getCookie() { if (document.cookie.length > 0 && this.$cookies.get('can-use-cookie')) { const arr = document.cookie.split('; '); for (let i = 0; i < arr.length; i++) { const arr2 = arr[i].split('='); if (arr2[0] === 'email') { this.loginData.email = arr2[1]; } else if (arr2[0] === 'password') { this.loginData.password = Base64.decode(arr2[1]); this.isRemember = true; } } } }, toSignatureLink() { var _this$config$configIn; const link = ((_this$config$configIn = this.config.configInfo) === null || _this$config$configIn === void 0 ? void 0 : _this$config$configIn.link) || ''; if (link) { window.open(link, '_blank'); } }, initGoogleMapAutoComplete() { // console.log(window.google.maps, 'maps') // https://developers.google.com/maps/documentation/javascript/place-autocomplete this.autoComplete = new window.google.maps.places.Autocomplete(document.getElementById('address_input'), { types: ['address'], componentRestrictions: { country: ['UK'] }, // 如果不知道需要什么字段, 可以查文档, 或给'all'或不传fields参数, 然后从返回结果里面找出需要数据的字段名, 填到这里 fields: ['address_components', 'place_id', 'name', 'formatted_address'] }); this.autoComplete.addListener('place_changed', this.onPlaceChange); }, onPlaceChange() { const data = this.autoComplete.getPlace(); if (Array.isArray(data.address_components)) { data.address_components.forEach(i => { if (i.types.includes('postal_code')) { this.$set(this.registData, 'postcode', i.long_name || i.short_name); } if (i.types.includes('administrative_area_level_1')) { this.$set(this.registData, 'state', i.short_name || i.long_name); } }); } this.selectAddress = data.name || this.registData.address; }, onInputChange(value, attr) { if (attr === 'address') { // 地址输入变更时, 清空这个值, 避免手动输入地址又不选的时候, 这个变量保存了上一次选地址时留下的数据. this.selectAddress = ''; } }, getAddrByLocation() { if (navigator.geolocation) { let location = { lat: 0, lng: 0 }; navigator.geolocation.getCurrentPosition(position => { location = { lat: position.coords.latitude, lng: position.coords.longitude }; console.log(location, 'position'); const geocoder = new window.google.maps.Geocoder(); geocoder.geocode({ location }).then(response => { var _response$results; console.log(response, 'response'); if ((_response$results = response.results) !== null && _response$results !== void 0 && _response$results.length) { response.results[0].address_components.forEach(i => { if (i.types.includes('postal_code')) { this.$set(this.registData, 'postcode', i.long_name || i.short_name); } if (i.types.includes('administrative_area_level_1')) { this.$set(this.registData, 'state', i.short_name || i.long_name); } if (i.types.includes('route')) { this.$set(this.registData, 'address', i.short_name || i.long_name); } this.selectAddress = i.short_name || i.long_name; }); } }); }, error => { console.log(error, 'get location error'); }); } } } }); // CONCATENATED MODULE: ./components/loginDialog.vue?vue&type=script&lang=js /* harmony default export */ var components_loginDialogvue_type_script_lang_js = (loginDialogvue_type_script_lang_js); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(2); // CONCATENATED MODULE: ./components/loginDialog.vue function injectStyles (context) { var style0 = __webpack_require__(338) if (style0.__inject__) style0.__inject__(context) } /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( components_loginDialogvue_type_script_lang_js, render, staticRenderFns, false, injectStyles, "0b8b973d", "2a981bf3" ) /* harmony default export */ var loginDialog = __webpack_exports__["default"] = (component.exports); /***/ }) };; //# sourceMappingURL=login-dialog.js.map