12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0e53fb90"],{"0cd8":function(t,e,s){"use strict";var a=s("5ca1"),i=s("7b23");a(a.P+a.F*!s("2f21")([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},"0ecb":function(t,e,s){},"1c01":function(t,e,s){var a=s("5ca1");a(a.S+a.F*!s("9e1e"),"Object",{defineProperty:s("86cc").f})},"2aac":function(t,e,s){"use strict";s("7f7f");var a=function(){var t=this,e=t._self._c;return e("ul",{staticClass:"address-list"},[t._l(t.list,(function(s,a){return e("li",{key:a,class:{active:t.isSelect?a===t.selectIndex:1===s.is_default},on:{click:function(e){return t.clickAddress(a,s)}}},[e("span",{staticClass:"user-name"},[t._v(t._s(s.name))]),e("span",{staticClass:"user-msg"},[t._v(t._s(s.full_address))]),e("span",{staticClass:"user-num"},[t._v(t._s(s.mobile_show))]),e("div",{staticClass:"address-btn-box"},[e("button",{attrs:{type:"button"},on:{click:function(e){t.address=s,t.showEdit=!0}}},[t._v("修改")]),e("button",{attrs:{type:"button"},on:{click:function(e){return t.deleteAddress(s.id)}}},[t._v("删除")])])])})),e("normal-box",{attrs:{show:0===t.list.length}}),e("address-save-dialog",{attrs:{"address-data":t.address},on:{submitSuccess:function(e){return t.getList()}},model:{value:t.showEdit,callback:function(e){t.showEdit=e},expression:"showEdit"}})],2)},i=[],r=(s("1c01"),s("58b2"),s("8e6e"),s("f3e2"),s("d25f"),s("ac6a"),s("456d"),s("28a5"),s("bd86")),n=(s("6d67"),s("f523")),c=s("cc9d"),o=s("5c96"),l=s("3d56");function d(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,a)}return s}function u(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?d(Object(s),!0).forEach((function(e){Object(r["a"])(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):d(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}var f={name:"address-list",components:{AddressSaveDialog:l["a"],NormalBox:c["a"]},props:{isSelect:{default:!1}},data:function(){return{selectIndex:-1,showEdit:!1,address:null,list:[]}},mounted:function(){this.getList()},methods:{clickAddress:function(t,e){this.isSelect&&(this.selectIndex=t,this.$emit("select",e))},editAddress:function(t){},deleteAddress:function(t){var e=this;Object(o["MessageBox"])({type:"warning",title:"提示",message:"确定删除地址吗?",showCancelButton:!0}).then((function(){n["l"].delete({id:t}).then((function(){o["Message"].success("删除成功!"),e.getList()}))}))},getList:function(){var t=this;n["l"].page().then((function(e){var s=e.data;t.list=s.list.map((function(t){return u(u({},t),{},{mobile_show:t.mobile.split("").map((function(t,e){return e>2&&e<7?"*":t})).join("")})}))}))}}},p=f,m=(s("771a"),s("2877")),b=Object(m["a"])(p,a,i,!1,null,"01e3b522",null);e["a"]=b.exports},"39d7":function(t,e,s){},"3d56":function(t,e,s){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",[e("el-dialog",{attrs:{title:"收货地址",visible:t.value},on:{"update:visible":function(e){t.value=e}}},[e("address-save",{attrs:{addressData:t.addressData},on:{submitSuccess:function(e){return t.submit("submitSuccess",e)},submitError:function(e){return t.submit("submitError",e)}}})],1)],1)},i=[],r=s("6489"),n={components:{AddressSave:r["a"]},model:{prop:"show",event:"show"},props:{show:{default:!0},addressData:{default:null}},computed:{value:{get:function(){return this.show},set:function(t){this.$emit("show",t)}}},name:"address-save-dialog",data:function(){return{}},mounted:function(){},methods:{submit:function(t,e){this.$emit(t,e),"submitSuccess"===t&&(this.value=!1)}}},c=n,o=s("2877"),l=Object(o["a"])(c,a,i,!1,null,"103d1cfb",null);e["a"]=l.exports},"43f3":function(t,e,s){"use strict";s("d368")},"456d":function(t,e,s){var a=s("4bf8"),i=s("0d58");s("5eda")("keys",(function(){return function(t){return i(a(t))}}))},5740:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAaCAYAAACgoey0AAAAAXNSR0IArs4c6QAAAmVJREFUSEvNlktoU1EQhv9JYmMEqVSweVna6kqiLuIDpIKCoIi4Eq2o4Ca3SVyIYlFwUbKwIFpE8JHEhRSL4BtR0HYj6LJmUwSpqIg2Ib6wXUjSmtxfEnuT29iYh4n2LufMme/8c+Y/XHG73cQ/+CKRiOgx8t/BhSeqVRM0YUUV1xv8fH1iIVLjpyBwgTyda3U9wQ5zGvdXfnwBwjXdyc91B/s3u9jb9g2NJjV/eyLP6gpml+NoWlX7jDPneQgLGvbUBcye1vmIT14Bsb9gSM9hS0e37L6VrjmYfvtSpHgPgFuDTlHQIHJQwtF+LfYbmEecFnxXt8KIl3I5NlqJreizbYSK2yCWaPu+/DDi2Jsm9D8dmf0B0aaaXbYnIDZBkAJEkVDsajlwKg4fwPMA5+nyh7eNNK/NwEv6mIr9K8Cm6c0EDN0SjvYVg7NnRQPi4xdAembkCAZgNXvWPFycyMRLg732TpDXQJhyhQyGXglGTxbC6W+1IjV1B+CG3JpABeS4hGJnM7GKXi56HTtA3gRp0RUMwqockkAga0h6netA9S5Ih+5AExBjp4TGHmuxisDZwoqtA5AHABfl4XIDtB2AIb4PZBCkWbc2CpPslIvRV/rOVAzOwn3OVVDTgyCsumfnNcDlBW1/BFj2SvjtROF1VAX+BW9pRzo1BHDZrAMmcgZWzwntCmoGzsIPtzUjOTkIcrVOeRJi8EhobOBPdqtasVaUSnsjJHEdxHZA3sNk3CWXPgyX8vhfg/MHsLXAZv4kgXfJUtCK7VROwXJzaqa4XGDVPq4UUCx/7iqulcJidebMf/VPA+RfN4ekXxQAAAAASUVORK5CYII="},"58b2":function(t,e,s){var a=s("5ca1");a(a.S+a.F*!s("9e1e"),"Object",{defineProperties:s("1495")})},"5eda":function(t,e,s){var a=s("5ca1"),i=s("8378"),r=s("79e5");t.exports=function(t,e){var s=(i.Object||{})[t]||Object[t],n={};n[t]=e(s),a(a.S+a.F*r((function(){s(1)})),"Object",n)}},6489:function(t,e,s){"use strict";s("7f7f");var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"add-wrap"},[e("div",{staticClass:"form-row"},[e("span",{staticClass:"form-label"},[t._v("收货人")]),e("div",{staticClass:"form-input-box"},[e("el-input",{attrs:{placeholder:"请输入姓名"},model:{value:t.params.name,callback:function(e){t.$set(t.params,"name",e)},expression:"params.name"}})],1)]),e("div",{staticClass:"form-row"},[e("span",{staticClass:"form-label"},[t._v("手机号")]),e("div",{staticClass:"form-input-box"},[e("el-input",{attrs:{placeholder:"请输入手机号"},model:{value:t.params.mobile,callback:function(e){t.$set(t.params,"mobile",e)},expression:"params.mobile"}})],1)]),e("div",{staticClass:"form-row"},[e("span",{staticClass:"form-label"},[t._v("收货地址")]),e("div",{staticClass:"form-select-box"},[e("div",{staticClass:"select-box"},[e("el-select",{attrs:{placeholder:"请选择省份"},on:{change:function(e){return t.selectAddress(0)}},model:{value:t.params.province_id,callback:function(e){t.$set(t.params,"province_id",e)},expression:"params.province_id"}},t._l(t.provinceList,(function(t,s){return e("el-option",{key:s,attrs:{label:t.name,value:t.id}})})),1)],1),e("div",{staticClass:"select-box"},[e("el-select",{attrs:{placeholder:"请选择县区"},on:{change:function(e){return t.selectAddress(1)}},model:{value:t.params.city_id,callback:function(e){t.$set(t.params,"city_id",e)},expression:"params.city_id"}},t._l(t.cityList,(function(t,s){return e("el-option",{key:s,attrs:{label:t.name,value:t.id}})})),1)],1),e("div",{staticClass:"select-box"},[e("el-select",{attrs:{placeholder:"请选择街/道"},on:{change:function(e){return t.selectAddress(2)}},model:{value:t.params.district_id,callback:function(e){t.$set(t.params,"district_id",e)},expression:"params.district_id"}},t._l(t.areaList,(function(t,s){return e("el-option",{key:s,attrs:{label:t.name,value:t.id}})})),1)],1)])]),e("div",{staticClass:"form-row-column"},[e("span",{staticClass:"form-label"},[t._v("详细位置")]),e("div",{staticClass:"form-textarea-box"},[e("el-input",{attrs:{type:"textarea",placeholder:"请输入详细位置",maxlength:"80","show-word-limit":""},model:{value:t.params.address,callback:function(e){t.$set(t.params,"address",e)},expression:"params.address"}})],1)]),e("div",{staticClass:"default-row",on:{click:function(e){t.params.is_default=1===t.params.is_default?0:1}}},[1===t.params.is_default?e("img",{attrs:{src:s("5740")}}):e("img",{attrs:{src:s("87aa")}}),t._v("\n 设为默认地址\n ")]),e("div",{staticClass:"btn-box"},[e("button",{attrs:{type:"button"},on:{click:function(e){return t.submit()}}},[t._v("保存")])])])},i=[],r=(s("1c01"),s("58b2"),s("8e6e"),s("f3e2"),s("d25f"),s("ac6a"),s("456d"),s("0cd8"),s("bd86")),n=s("f523"),c=s("325c"),o=s("5c96");function l(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,a)}return s}function d(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?l(Object(s),!0).forEach((function(e){Object(r["a"])(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):l(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}var u={name:"address-save",props:{show:{default:!0},addressData:{default:null}},data:function(){var t={id:0,name:"",mobile:"",province_id:"",city_id:"",district_id:"",address:"",full_address:"",is_default:0},e=[["name",["notNull","请输入姓名"]],["mobile",["notNull","请输入手机号"]],["province_id",["notNull","请选择省份"]],["city_id",["notNull","请选择城市"]],["district_id",["notNull","请选择区县"]],["address",["notNull","请输入详细地址"]]],s=Object(c["d"])(t,e);return{params:t,validatorNullList:e,validatorNullResult:s,provinceList:[],provinceMap:{},cityList:[],cityMap:{},areaList:[],areaMap:{}}},mounted:function(){this.params=JSON.parse(JSON.stringify(this.addressData||d({province_id:"",city_id:"",district_id:""},this.params))),this.getAddressTree()},watch:{addressData:function(t){this.params=d({id:0,name:"",mobile:"",province_id:"",city_id:"",district_id:"",address:"",full_address:"",is_default:0},JSON.parse(JSON.stringify(t||{}))),this.params.id>0&&this.getAddressTree(0)},params:{deep:!0,handler:function(t){this.validatorNullResult=Object(c["d"])(t,this.validatorNullList)}}},methods:{submit:function(){var t=this,e=this.params;if(this.validatorNullResult.length>0)return o["Message"].warning(this.validatorNullResult[0].errMsg);e.full_address=this.provinceMap[e.province_id].name+this.cityMap[e.city_id].name+this.areaMap[e.district_id].name+e.address;var s=e.id>0?n["l"].edit:n["l"].add;s(e).then((function(){o["Message"].success(e.id>0?"更新成功":"新增成功"),t.$emit("submitSuccess",e)})).catch((function(){t.$emit("submitError",e)}))},selectAddress:function(t){t<2&&(0===t&&(this.cityList=[],this.areaList=[],this.params.city_id="",this.params.district_id=""),1===t&&(this.areaList=[],this.params.district_id=""),this.getAddressTree(t+1))},getAddressTree:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s={0:"province",1:"city",2:"area"},a={0:0,1:this.params.province_id,2:this.params.city_id},i=s[e],c=a[e];return n["a"].tree({id:c}).then((function(e){var s=e.data;t.$set(t,"".concat(i,"List"),s),t.$set(t,"".concat(i,"Map"),s.reduce((function(t,e){return d(d({},t),{},Object(r["a"])({},e.id,e))}),{}))}))}}},f=u,p=(s("43f3"),s("2877")),m=Object(p["a"])(f,a,i,!1,null,"43ec30f1",null);e["a"]=m.exports},"6d67":function(t,e,s){"use strict";var a=s("5ca1"),i=s("0a49")(1);a(a.P+a.F*!s("2f21")([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},"771a":function(t,e,s){"use strict";s("0ecb")},"7b23":function(t,e,s){var a=s("d8e8"),i=s("4bf8"),r=s("626a"),n=s("9def");t.exports=function(t,e,s,c,o){a(e);var l=i(t),d=r(l),u=n(l.length),f=o?u-1:0,p=o?-1:1;if(s<2)for(;;){if(f in d){c=d[f],f+=p;break}if(f+=p,o?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;o?f>=0:u>f;f+=p)f in d&&(c=e(c,d[f],f,l));return c}},"7f7f":function(t,e,s){var a=s("86cc").f,i=Function.prototype,r=/^\s*function ([^ (]*)/,n="name";n in i||s("9e1e")&&a(i,n,{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},"87aa":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAaCAYAAACgoey0AAAAAXNSR0IArs4c6QAAAFdJREFUSEtjNDY2/s9AB3D27FlGZGsYB9xidBdRKxBgHsPp41GLR4Oa3BAYTVywkIMXIKPZidzEhK5vNHGNJi6G0ew0mp3IDYHRAgSjACE3KInVN2ja1QD/gsAbf14pDQAAAABJRU5ErkJggg=="},"8e6e":function(t,e,s){var a=s("5ca1"),i=s("990b"),r=s("6821"),n=s("11e9"),c=s("f1ae");a(a.S,"Object",{getOwnPropertyDescriptors:function(t){var e,s,a=r(t),o=n.f,l=i(a),d={},u=0;while(l.length>u)s=o(a,e=l[u++]),void 0!==s&&c(d,e,s);return d}})},"990b":function(t,e,s){var a=s("9093"),i=s("2621"),r=s("cb7c"),n=s("7726").Reflect;t.exports=n&&n.ownKeys||function(t){var e=a.f(r(t)),s=i.f;return s?e.concat(s(t)):e}},afec:function(t,e,s){"use strict";s("39d7")},cc9d:function(t,e,s){"use strict";var a=function(){var t=this,e=t._self._c;return t.show?e("div",{staticClass:"normal-box"},[e("img",{attrs:{src:s("e18b"),alt:""}}),t._v("\n 暂无数据\n")]):t._e()},i=[],r={props:{show:{default:!1}},name:"normal-box",data:function(){return{}}},n=r,c=(s("afec"),s("2877")),o=Object(c["a"])(n,a,i,!1,null,"9c6dfd84",null);e["a"]=o.exports},d25f:function(t,e,s){"use strict";var a=s("5ca1"),i=s("0a49")(2);a(a.P+a.F*!s("2f21")([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},d368:function(t,e,s){},e18b:function(t,e,s){t.exports=s.p+"img/normal.540f7eb9.png"},f1ae:function(t,e,s){"use strict";var a=s("86cc"),i=s("4630");t.exports=function(t,e,s){e in t?a.f(t,e,i(0,s)):t[e]=s}}}]);
- //# sourceMappingURL=chunk-0e53fb90.93bfdc13.js.map
|