123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- exports.ids = [1];
- exports.modules = {
- /***/ 166:
- /***/ (function(module, exports) {
- // Exports
- module.exports = {
- };
- /***/ }),
- /***/ 182:
- /***/ (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/addAddressDialog.vue?vue&type=template&id=443741dd&scoped=true
- var render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', [_c('el-dialog', {
- attrs: {
- "lock-scroll": false,
- "title": "Add address",
- "visible": _vm.dialogFormVisible,
- "width": "700px"
- },
- on: {
- "update:visible": function ($event) {
- _vm.dialogFormVisible = $event;
- }
- }
- }, [_c('el-form', {
- ref: "ruleForm",
- attrs: {
- "model": _vm.data,
- "rules": _vm.rules
- }
- }, [_c('el-form-item', {
- attrs: {
- "prop": "country"
- }
- }, [_c('label', [_vm._v("Country/Region")]), _vm._v(" "), _c('el-input', {
- model: {
- value: _vm.data.country,
- callback: function ($$v) {
- _vm.$set(_vm.data, "country", $$v);
- },
- expression: "data.country"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "name"
- }
- }, [_c('label', [_vm._v("Full name")]), _vm._v(" "), _c('el-input', {
- model: {
- value: _vm.data.name,
- callback: function ($$v) {
- _vm.$set(_vm.data, "name", $$v);
- },
- expression: "data.name"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "phone"
- }
- }, [_c('label', [_vm._v("Phone number")]), _vm._v(" "), _c('el-input', {
- model: {
- value: _vm.data.phone,
- callback: function ($$v) {
- _vm.$set(_vm.data, "phone", $$v);
- },
- expression: "data.phone"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "address"
- }
- }, [_c('label', [_vm._v("Address")]), _vm._v(" "), _c('el-input', {
- attrs: {
- "placeholder": "Street address,P.O.box,company name,c/o"
- },
- model: {
- value: _vm.data.address,
- callback: function ($$v) {
- _vm.$set(_vm.data, "address", $$v);
- },
- expression: "data.address"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "post_code"
- }
- }, [_c('label', [_vm._v("Postcode")]), _vm._v(" "), _c('el-input', {
- model: {
- value: _vm.data.post_code,
- callback: function ($$v) {
- _vm.$set(_vm.data, "post_code", $$v);
- },
- expression: "data.post_code"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "city"
- }
- }, [_c('label', [_vm._v("City/Suburb")]), _vm._v(" "), _c('el-input', {
- attrs: {
- "placeholder": "Choose city by suburb"
- },
- model: {
- value: _vm.data.city,
- callback: function ($$v) {
- _vm.$set(_vm.data, "city", $$v);
- },
- expression: "data.city"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "state"
- }
- }, [_c('label', [_vm._v("State/Territory")]), _vm._v(" "), _c('el-input', {
- attrs: {
- "placeholder": "Choose state by territory"
- },
- model: {
- value: _vm.data.state,
- callback: function ($$v) {
- _vm.$set(_vm.data, "state", $$v);
- },
- expression: "data.state"
- }
- })], 1), _vm._v(" "), _c('el-form-item', {
- attrs: {
- "prop": "is_default"
- }
- }, [_c('el-checkbox', {
- model: {
- value: _vm.data.is_default,
- callback: function ($$v) {
- _vm.$set(_vm.data, "is_default", $$v);
- },
- expression: "data.is_default"
- }
- }, [_vm._v("\n Make this my default address\n ")])], 1), _vm._v(" "), _c('el-form-item', [_c('label', [_vm._v("Delivery instruction(optional)")]), _vm._v(" "), _c('div', {
- staticStyle: {
- "color": "#86d4e9",
- "line-height": "14px"
- }
- }, [_c('i', {
- staticClass: "el-icon-arrow-down",
- staticStyle: {
- "color": "#a2a2a2"
- }
- }), _vm._v("\n And preferences,notes,access codes and more\n ")])])], 1), _vm._v(" "), _c('div', {
- staticClass: "dialog-footer",
- attrs: {
- "slot": "footer"
- },
- slot: "footer"
- }, [_c('el-button', {
- on: {
- "click": function ($event) {
- return _vm.submit('ruleForm');
- }
- }
- }, [_vm._v("Add address")])], 1)], 1)], 1);
- };
- var staticRenderFns = [];
- // CONCATENATED MODULE: ./components/addAddressDialog.vue?vue&type=template&id=443741dd&scoped=true
- // 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/addAddressDialog.vue?vue&type=script&lang=js
- /* harmony default export */ var addAddressDialogvue_type_script_lang_js = ({
- props: {
- dialogVisible: {
- type: Boolean,
- default: false
- },
- componentVisible: {
- type: Number,
- default: 2
- },
- data: {
- type: Object,
- default: () => {
- return {
- country: "Australia",
- name: "",
- phone: "",
- address: "",
- post_code: "",
- city: "",
- state: "",
- is_default: null
- };
- }
- }
- },
- data() {
- return {
- value: [],
- options: [],
- rules: {
- country: [{
- required: true,
- message: "Please enter your country",
- trigger: "blur"
- }],
- name: [{
- required: true,
- message: "Please enter your name",
- trigger: "blur"
- }],
- phone: [{
- required: true,
- message: "Please enter your phone number",
- trigger: "blur"
- }],
- address: [{
- required: true,
- message: "Please enter your address",
- trigger: "blur"
- }],
- post_code: [{
- required: true,
- message: "Please enter post_code",
- trigger: "blur"
- }],
- city: [{
- required: true,
- message: "Please enter city",
- trigger: "blur"
- }],
- state: [{
- required: true,
- message: "Please enter state",
- trigger: "blur"
- }]
- },
- cityList: [{
- id: 1,
- name: "Sydney"
- }, {
- id: 2,
- name: "Adelaide Mail Centre"
- }, {
- id: 3,
- name: "Melbourne"
- }, {
- id: 4,
- name: "Eastern Suburbs Mc"
- }, {
- id: 5,
- name: "Hobart"
- }, {
- id: 6,
- name: "Perth"
- }, {
- id: 7,
- name: "Launceston"
- }, {
- id: 8,
- name: "Brisbane"
- }, {
- id: 9,
- name: "Northern Suburbs Mc"
- }, {
- id: 10,
- name: "Strawberry Hills"
- }, {
- id: 11,
- name: "Springfield"
- }, {
- id: 12,
- name: "Waterloo"
- }, {
- id: 13,
- name: "Richmond"
- }, {
- id: 14,
- name: "Haymarket"
- }, {
- id: 15,
- name: "Red Hill"
- }, {
- id: 16,
- name: "Brisbane GPO Boxes"
- }, {
- id: 17,
- name: "Mayfield"
- }, {
- id: 18,
- name: "Australia Square"
- }, {
- id: 19,
- name: "Woodstock"
- }, {
- id: 20,
- name: "Sydney South"
- }, {
- id: 21,
- name: "The Gap"
- }, {
- id: 22,
- name: "Kingston"
- }, {
- id: 23,
- name: "Kensington"
- }, {
- id: 24,
- name: "Darlington"
- }],
- stateList: [{
- id: 1,
- name: "Australian Capital Territory"
- }, {
- id: 2,
- name: "New South Wales"
- }, {
- id: 3,
- name: "Northern Territory"
- }, {
- id: 4,
- name: "Queensland"
- }, {
- id: 5,
- name: "South Australia"
- }, {
- id: 6,
- name: "Tasmania"
- }, {
- id: 7,
- name: "Victoria"
- }, {
- id: 8,
- name: "Western Australia"
- }]
- };
- },
- computed: {
- dialogFormVisible: {
- get: function () {
- return this.dialogVisible;
- },
- set: function (val) {
- this.$emit("update:dialogVisible", val);
- }
- }
- },
- methods: {
- submit(ruleForm) {
- this.$refs[ruleForm].validate(valid => {
- if (valid) {
- if (this.componentVisible == 2) {
- this.addAddress();
- if (this.$route.fullPath.includes('product-builder')) return;
- this.$router.push({
- path: '/home/myDetail',
- query: {
- type: "third"
- }
- });
- } else if (this.componentVisible == 3) {
- this.editAddress();
- this.$router.push({
- path: '/home/myDetail',
- query: {
- type: "third"
- }
- });
- }
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- addAddress() {
- this.$axios.post("/address/add", this.data).then(res => {
- if (res.code === 1) {
- this.$notify({
- title: "success",
- message: "Submitted successfully",
- type: "success",
- duration: 3000
- });
- this.dialogFormVisible = false;
- this.update();
- }
- }).catch(error => {
- this.$message.error(error.response.data.msg);
- });
- },
- editAddress() {
- this.$axios.post("/address/edit", this.data).then(res => {
- if (res.code === 1) {
- this.$notify({
- title: "success",
- message: "Submitted successfully",
- type: "success",
- duration: 3000
- });
- this.dialogFormVisible = false;
- this.update();
- }
- }).catch(error => {
- this.$message.error(error.response.data.msg);
- });
- },
- update() {
- this.$emit("update", true);
- }
- }
- });
- // CONCATENATED MODULE: ./components/addAddressDialog.vue?vue&type=script&lang=js
- /* harmony default export */ var components_addAddressDialogvue_type_script_lang_js = (addAddressDialogvue_type_script_lang_js);
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
- var componentNormalizer = __webpack_require__(2);
- // CONCATENATED MODULE: ./components/addAddressDialog.vue
- function injectStyles (context) {
-
- var style0 = __webpack_require__(194)
- if (style0.__inject__) style0.__inject__(context)
- }
- /* normalize component */
- var component = Object(componentNormalizer["a" /* default */])(
- components_addAddressDialogvue_type_script_lang_js,
- render,
- staticRenderFns,
- false,
- injectStyles,
- "443741dd",
- "72c5b0ae"
-
- )
- /* harmony default export */ var addAddressDialog = __webpack_exports__["default"] = (component.exports);
- /***/ }),
- /***/ 194:
- /***/ (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_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166);
- /* 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_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_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_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_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_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_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_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /***/ })
- };;
- //# sourceMappingURL=add-address-dialog.js.map
|