index.js 3.3 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/areaWindow/index"],{"1b9e":function(e,t,s){"use strict";s.r(t);var i=s("e063"),d=s("8b1a");for(var n in d)["default"].indexOf(n)<0&&function(e){s.d(t,e,(function(){return d[e]}))}(n);s("543b");var r=s("f0c5"),l=Object(r["a"])(d["default"],i["b"],i["c"],!1,null,"64ef78b0",null,!1,i["a"],void 0);t["default"]=l.exports},"543b":function(e,t,s){"use strict";var i=s("dd7e"),d=s.n(i);d.a},"8b1a":function(e,t,s){"use strict";s.r(t);var i=s("d8c5"),d=s.n(i);for(var n in i)["default"].indexOf(n)<0&&function(e){s.d(t,e,(function(){return i[e]}))}(n);t["default"]=d.a},d8c5:function(e,t,s){"use strict";var i=s("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var d=i(s("448a")),n=s("3c98"),r={},l={props:{display:{type:Boolean,default:!0},cityShow:{type:Number,default:3},address:{type:Array|Object,default:[]}},data:function(){return{active:0,addressList:[],selectedArr:[],selectedIndex:-1,is_loading:!1,old:{scrollTop:0},scrollTop:0}},computed:{activeId:function(){return-1==this.selectedIndex?0:this.selectedArr[this.selectedIndex].id},showMore:function(){return!this.selectedArr.length||this.selectedArr[this.selectedArr.length-1].hasOwnProperty("children")&&(1==this.cityShow&&this.addressList.level<2||2==this.cityShow&&this.addressList.level<3||3==this.cityShow&&this.addressList.level<4)}},watch:{address:function(e){this.selectedArr=e?(0,d.default)(e):[]},display:function(e){e?this.loadAddress(0):(this.addressList=[],this.selectedArr=this.address?(0,d.default)(this.address):[],this.selectedIndex=-1,this.is_loading=!1)}},mounted:function(){this.loadAddress(0)},methods:{change:function(e,t){this.selectedIndex!=t&&(-1===e&&(e=this.selectedArr.length?this.selectedArr[this.selectedArr.length-1].id:0),this.selectedIndex=t,this.loadAddress(e))},loadAddress:function(e){var t=this;r[e]?this.addressList=r[e]:(this.is_loading=!0,(0,n.getCityData)(e).then((function(s){t.is_loading=!1,r[e]=s.data,t.addressList=s.data})),this.goTop())},selected:function(e){this.is_loading||(this.selectedIndex>-1?(this.selectedArr.splice(this.selectedIndex+1,999),this.selectedArr[this.selectedIndex]=e,this.selectedIndex=-1):e.pid?this.selectedArr.push(e):this.selectedArr=[e],e.hasOwnProperty("children")&&(1==this.cityShow&&this.addressList[0].level<2||2==this.cityShow&&this.addressList[0].level<3||3==this.cityShow&&this.addressList[0].level<4)?this.loadAddress(e.id):(this.$emit("submit",(0,d.default)(this.selectedArr)),this.$emit("changeClose")),this.goTop())},close:function(){this.$emit("changeClose")},scroll:function(e){this.old.scrollTop=e.detail.scrollTop},goTop:function(e){var t=this;this.scrollTop=this.old.scrollTop,this.$nextTick((function(){t.scrollTop=0}))}}};t.default=l},dd7e:function(e,t,s){},e063:function(e,t,s){"use strict";s.d(t,"b",(function(){return i})),s.d(t,"c",(function(){return d})),s.d(t,"a",(function(){}));var i=function(){var e=this.$createElement;this._self._c},d=[]}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/areaWindow/index-create-component',
  4. {
  5. 'components/areaWindow/index-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("1b9e"))
  7. })
  8. },
  9. [['components/areaWindow/index-create-component']]
  10. ]);