1 |
- {"version":3,"sources":["webpack:///./src/assets/images/noAddress.png","webpack:///./src/assets/images/line.jpg","webpack:///./src/views/user/address/AddressManagement.vue?1aad","webpack:///src/views/user/address/AddressManagement.vue","webpack:///./src/views/user/address/AddressManagement.vue?b0a6","webpack:///./src/views/user/address/AddressManagement.vue","webpack:///./src/views/user/address/AddressManagement.vue?e291"],"names":["module","exports","render","_vm","this","_h","$createElement","_c","_self","ref","staticClass","class","addressList","length","page","attrs","_e","_l","item","index","key","_v","_s","real_name","phone","province","city","district","detail","domProps","is_default","on","$event","radioChange","editAddress","delAddress","loadend","loading","_m","staticStyle","addAddress","getAddress","staticRenderFns","components","Loading","data","limit","loadTitle","isWechat","mounted","AddressList","$scroll","$refs","container","methods","that","push","apply","res","$router","path","id","$dialog","toast","mes","callback","splice","$set","i","len","userInfo","userName","telNumber","address","provinceName","cityName","countryName","detailInfo","post_code","postalCode","type","wx_export","component"],"mappings":"qGAAAA,EAAOC,QAAU,IAA0B,iC,qBCA3CD,EAAOC,QAAU,IAA0B,4B,yCCA3C,IAAIC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,IAAI,YAAYC,YAAY,qBAAqBC,MAAMR,EAAIS,YAAYC,OAAS,GAAKV,EAAIW,KAAO,EAAI,KAAO,IAAI,CAAEX,EAAIS,YAAYC,OAAS,EAAGN,EAAG,MAAM,CAACG,YAAY,QAAQ,CAACH,EAAG,MAAM,CAACQ,MAAM,CAAC,IAAM,EAAQ,aAAgCZ,EAAIa,KAAKb,EAAIc,GAAId,EAAe,aAAE,SAASe,EAAKC,GAAO,OAAOZ,EAAG,MAAM,CAACa,IAAID,EAAMT,YAAY,QAAQ,CAACH,EAAG,MAAM,CAACG,YAAY,WAAW,CAACH,EAAG,MAAM,CAACG,YAAY,aAAa,CAACP,EAAIkB,GAAG,iBAAiBlB,EAAImB,GAAGJ,EAA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c3.js","sourcesContent":["module.exports = __webpack_public_path__ + \"h5/img/noAddress.d76a1cef.png\";","module.exports = __webpack_public_path__ + \"h5/img/line.05bf1c84.jpg\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:\"container\",staticClass:\"address-management\",class:_vm.addressList.length < 1 && _vm.page > 1 ? 'on' : ''},[(_vm.addressList.length > 0)?_c('div',{staticClass:\"line\"},[_c('img',{attrs:{\"src\":require(\"@assets/images/line.jpg\")}})]):_vm._e(),_vm._l((_vm.addressList),function(item,index){return _c('div',{key:index,staticClass:\"item\"},[_c('div',{staticClass:\"address\"},[_c('div',{staticClass:\"consignee\"},[_vm._v(\"\\n 收货人:\"+_vm._s(item.real_name)),_c('span',{staticClass:\"phone\"},[_vm._v(_vm._s(item.phone))])]),_c('div',[_vm._v(\"\\n 收货地址:\"+_vm._s(item.province)+_vm._s(item.city)+_vm._s(item.district)+_vm._s(item.detail)+\"\\n \")])]),_c('div',{staticClass:\"operation acea-row row-between-wrapper\"},[_c('div',{staticClass:\"select-btn\"},[_c('div',{staticClass:\"checkbox-wrapper\"},[_c('label',{staticClass:\"well-check\"},[_c('input',{attrs:{\"type\":\"radio\",\"name\":\"default\",\"value\":\"\"},domProps:{\"checked\":item.is_default ? true : false},on:{\"click\":function($event){return _vm.radioChange(index)}}}),_c('i',{staticClass:\"icon\"}),_c('span',{staticClass:\"default\"},[_vm._v(\"设为默认\")])])])]),_c('div',{staticClass:\"acea-row row-middle\"},[_c('div',{on:{\"click\":function($event){return _vm.editAddress(index)}}},[_c('span',{staticClass:\"iconfont icon-bianji\"}),_vm._v(\"编辑\\n \")]),_c('div',{on:{\"click\":function($event){return _vm.delAddress(index)}}},[_c('span',{staticClass:\"iconfont icon-shanchu\"}),_vm._v(\"删除\\n \")])])])])}),_c('Loading',{attrs:{\"loaded\":_vm.loadend,\"loading\":_vm.loading}}),(_vm.addressList.length < 1 && _vm.page > 1)?_c('div',{staticClass:\"noCommodity\"},[_vm._m(0)]):_vm._e(),_c('div',{staticStyle:{\"height\":\"1.2rem\"}}),_c('div',{staticClass:\"footer acea-row row-between-wrapper\"},[(_vm.isWechat)?_c('div',{staticClass:\"addressBnt bg-color-red\",on:{\"click\":_vm.addAddress}},[_c('span',{staticClass:\"iconfont icon-tianjiadizhi\"}),_vm._v(\"添加新地址\\n \")]):_c('div',{staticClass:\"addressBnt on bg-color-red\",on:{\"click\":_vm.addAddress}},[_c('span',{staticClass:\"iconfont icon-tianjiadizhi\"}),_vm._v(\"添加新地址\\n \")]),(_vm.isWechat)?_c('div',{staticClass:\"addressBnt wxbnt\",on:{\"click\":_vm.getAddress}},[_c('span',{staticClass:\"iconfont icon-weixin2\"}),_vm._v(\"导入微信地址\\n \")]):_vm._e()])],2)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"noPictrue\"},[_c('img',{staticClass:\"image\",attrs:{\"src\":require(\"@assets/images/noAddress.png\")}})])}]\n\nexport { render, staticRenderFns }","<template>\r\n <div\r\n class=\"address-management\"\r\n :class=\"addressList.length < 1 && page > 1 ? 'on' : ''\"\r\n ref=\"container\"\r\n >\r\n <div class=\"line\" v-if=\"addressList.length > 0\">\r\n <img src=\"@assets/images/line.jpg\" />\r\n </div>\r\n <div class=\"item\" v-for=\"(item, index) in addressList\" :key=\"index\">\r\n <div class=\"address\">\r\n <div class=\"consignee\">\r\n 收货人:{{ item.real_name\r\n }}<span class=\"phone\">{{ item.phone }}</span>\r\n </div>\r\n <div>\r\n 收货地址:{{ item.province }}{{ item.city }}{{ item.district\r\n }}{{ item.detail }}\r\n </div>\r\n </div>\r\n <div class=\"operation acea-row row-between-wrapper\">\r\n <div class=\"select-btn\">\r\n <div class=\"checkbox-wrapper\">\r\n <label class=\"well-check\"\r\n ><input\r\n type=\"radio\"\r\n name=\"default\"\r\n value=\"\"\r\n :checked=\"item.is_default ? true : false\"\r\n @click=\"radioChange(index)\"\r\n /><i class=\"icon\"></i><span class=\"default\">设为默认</span></label\r\n >\r\n </div>\r\n </div>\r\n <div class=\"acea-row row-middle\">\r\n <div @click=\"editAddress(index)\">\r\n <span class=\"iconfont icon-bianji\"></span>编辑\r\n </div>\r\n <div @click=\"delAddress(index)\">\r\n <span class=\"iconfont icon-shanchu\"></span>删除\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <Loading :loaded=\"loadend\" :loading=\"loading\"></Loading>\r\n <div class=\"noCommodity\" v-if=\"addressList.length < 1 && page > 1\">\r\n <div class=\"noPictrue\">\r\n <img src=\"@assets/images/noAddress.png\" class=\"image\" />\r\n </div>\r\n </div>\r\n <div style=\"height:1.2rem;\"></div>\r\n <div class=\"footer acea-row row-between-wrapper\">\r\n <div class=\"addressBnt bg-color-red\" v-if=\"isWechat\" @click=\"addAddress\">\r\n <span class=\"iconfont icon-tianjiadizhi\"></span>添加新地址\r\n </div>\r\n <div class=\"addressBnt on bg-color-red\" v-else @click=\"addAddress\">\r\n <span class=\"iconfont icon-tianjiadizhi\"></span>添加新地址\r\n </div>\r\n <div class=\"addressBnt wxbnt\" v-if=\"isWechat\" @click=\"getAddress\">\r\n <span class=\"iconfont icon-weixin2\"></span>导入微信地址\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n<style scoped>\r\n.address-management.on {\r\n background-color: #fff;\r\n height: 100vh;\r\n}\r\n</style>\r\n<script type=\"text/babel\">\r\nimport {\r\n getAddressList,\r\n getAddressRemove,\r\n getAddressDefaultSet,\r\n postAddress\r\n} from \"@api/user\";\r\nimport Loading from \"@components/Loading\";\r\nimport { isWeixin } from \"@utils\";\r\nimport { openAddress } from \"@libs/wechat\";\r\n\r\nexport default {\r\n components: {\r\n Loading\r\n },\r\n data() {\r\n return {\r\n page: 1,\r\n limit: 20,\r\n addressList: [],\r\n loadTitle: \"\",\r\n loading: false,\r\n loadend: false,\r\n isWechat: isWeixin()\r\n };\r\n },\r\n mounted: function() {\r\n this.AddressList();\r\n this.$scroll(this.$refs.container, () => {\r\n !this.loading && this.AddressList();\r\n });\r\n },\r\n methods: {\r\n /**\r\n * 获取地址列表\r\n *\r\n */\r\n AddressList: function() {\r\n let that = this;\r\n if (that.loading) return; //阻止下次请求(false可以进行请求);\r\n if (that.loadend) return; //阻止结束当前请求(false可以进行请求);\r\n that.loading = true;\r\n getAddressList({ page: that.page, limit: that.limit }).then(res => {\r\n that.loading = false;\r\n //apply();js将一个数组插入另一个数组;\r\n that.addressList.push.apply(that.addressList, res.data);\r\n that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;\r\n that.page = that.page + 1;\r\n });\r\n },\r\n /**\r\n * 编辑地址\r\n */\r\n editAddress: function(index) {\r\n this.$router.push({\r\n path: \"/user/add_address/\" + this.addressList[index].id\r\n });\r\n },\r\n /**\r\n * 删除地址\r\n */\r\n delAddress: function(index) {\r\n let that = this;\r\n let address = this.addressList[index];\r\n let id = address.id;\r\n getAddressRemove(id).then(function() {\r\n that.$dialog.toast({\r\n mes: \"删除成功!\",\r\n callback: () => {\r\n that.addressList.splice(index, 1);\r\n that.$set(that, \"addressList\", that.addressList);\r\n }\r\n });\r\n });\r\n },\r\n /**\r\n * 设置默认地址\r\n */\r\n radioChange: function(index) {\r\n let that = this,\r\n address = this.addressList[index],\r\n id = address.id;\r\n getAddressDefaultSet(id).then(function() {\r\n for (var i = 0, len = that.addressList.length; i < len; i++) {\r\n if (i === index) that.addressList[i].is_default = 1;\r\n else that.addressList[i].is_default = 0;\r\n }\r\n that.$set(that, \"addressList\", that.addressList);\r\n });\r\n },\r\n /**\r\n * 新增地址\r\n */\r\n addAddress: function() {\r\n this.$router.push({\r\n path: \"/user/add_address\"\r\n });\r\n },\r\n getAddress() {\r\n openAddress().then(userInfo => {\r\n this.$dialog.loading.open();\r\n postAddress({\r\n real_name: userInfo.userName,\r\n phone: userInfo.telNumber,\r\n address: {\r\n province: userInfo.provinceName,\r\n city: userInfo.cityName,\r\n district: userInfo.countryName\r\n },\r\n detail: userInfo.detailInfo,\r\n post_code: userInfo.postalCode,\r\n type: 1,\r\n wx_export: 1\r\n })\r\n .then(() => {\r\n this.page = 1;\r\n this.loading = false;\r\n this.loadend = false;\r\n this.addressList = [];\r\n this.AddressList();\r\n\r\n this.$dialog.loading.close();\r\n this.$dialog.toast({ mes: \"添加成功\" });\r\n })\r\n .catch(err => {\r\n this.$dialog.loading.close();\r\n this.$dialog.error(err.msg || \"添加失败\");\r\n });\r\n });\r\n }\r\n }\r\n};\r\n</script>\r\n","import mod from \"-!../../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./AddressManagement.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./AddressManagement.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AddressManagement.vue?vue&type=template&id=5f9f2230&scoped=true&\"\nimport script from \"./AddressManagement.vue?vue&type=script&lang=js&\"\nexport * from \"./AddressManagement.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AddressManagement.vue?vue&type=style&index=0&id=5f9f2230&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5f9f2230\",\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../node_modules/_mini-css-extract-plugin@0.8.2@mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/_css-loader@1.0.1@css-loader/index.js??ref--6-oneOf-1-1!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/_postcss-loader@3.0.0@postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./AddressManagement.vue?vue&type=style&index=0&id=5f9f2230&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../../node_modules/_mini-css-extract-plugin@0.8.2@mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/_css-loader@1.0.1@css-loader/index.js??ref--6-oneOf-1-1!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/_postcss-loader@3.0.0@postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./AddressManagement.vue?vue&type=style&index=0&id=5f9f2230&scoped=true&lang=css&\""],"sourceRoot":""}
|