RegionPicker.js 3.2 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/RegionPicker"],{"0474":function(e,t,i){"use strict";i.r(t);var n=i("a916"),u=i("5484");for(var a in u)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return u[e]}))}(a);i("0df0");var s=i("f0c5"),l=Object(s["a"])(u["default"],n["b"],n["c"],!1,null,"1e3bc04c",null,!1,n["a"],void 0);t["default"]=l.exports},"0df0":function(e,t,i){"use strict";var n=i("3804"),u=i.n(n);u.a},3804:function(e,t,i){},5484:function(e,t,i){"use strict";i.r(t);var n=i("c8d5"),u=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=u.a},a916:function(e,t,i){"use strict";i.d(t,"b",(function(){return u})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var n={uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"25a4"))}},u=function(){var e=this.$createElement;this._self._c},a=[]},c8d5:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i("2a19"),u={name:"RegionPicker",props:{modal:{default:!0},modalFade:{default:!1},lockScroll:{default:!1},closeOnClickModal:{default:!0}},data:function(){return{areaPicker:[],items:!1}},created:function(){var t=this;(0,n.getAreaTree)().then((function(e){t.items=e.result.area_list})).catch((function(t){e.showToast({icon:"none",title:t.message})}))},computed:{buildItems:function(){if(!this.items)return[];var e=new Array;return this.getDefaultItems(this.items,e),e}},methods:{showPopup:function(e){this.$refs[e].open()},hidePopup:function(e){this.$refs[e].close()},getDefaultItems:function(e,t){if(e[0].child&&e[0].child.length>0){t&&0==t.length?(t.push({flex:1,values:e,textAlign:"center"}),this.areaPicker.push(0),this.getDefaultItems(e,t)):t&&t.length>0&&(t.push({flex:1,values:e[0].child,textAlign:"center"}),this.areaPicker.push(0),this.getDefaultItems(e[0].child,t))}},onValuesChange:function(e){var t=e.detail.value,i=this.areaPicker;for(var n in t)i[n]=t[n],n=parseInt(n),n<t.length-1&&(this.buildItems[n]["values"].length&&this.buildItems[n]["values"][t[n]]["child"]&&this.buildItems[n]["values"][t[n]]["child"].length?this.buildItems[n+1]["values"].length&&this.buildItems[n]["values"][t[n]]["child"][0]["area_id"]==this.buildItems[n+1]["values"][0]["area_id"]||(this.buildItems[n+1]["values"]=this.buildItems[n]["values"][t[n]]["child"],i[n+1]=0):(this.buildItems[n+1]["values"]=[],i[n+1]=0));this.areaPicker=i,this.$forceUpdate()},show:function(){this.showPopup("currentValue")},cancel:function(){this.hidePopup("currentValue")},confirm:function(){this.cancel();var e=[];for(var t in this.areaPicker)e[t]=this.buildItems[t]["values"][this.areaPicker[t]],e[t]||(e[t]={area_id:0,area_name:""});this.$emit("onConfirm",e)}}};t.default=u}).call(this,i("543d")["default"])}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'pages/RegionPicker-create-component',
  4. {
  5. 'pages/RegionPicker-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("0474"))
  7. })
  8. },
  9. [['pages/RegionPicker-create-component']]
  10. ]);