require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugin/agent/queryArea"],{"354c":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=(t._self._c,2==t.level?t.__map(t.regions[t.province].children,(function(e,i){var n=t.__get_orig(e),r=t.setAbb(e.name);return{$orig:n,m0:r}})):null),n=3==t.level?t.__map(t.regions[t.province].children[t.city].children,(function(e,i){var n=t.__get_orig(e),r=t.setAbb(e.name);return{$orig:n,m1:r}})):null;t.$mp.data=Object.assign({},{$root:{l0:i,l1:n}})},r=[]},"5c85":function(t,e,i){"use strict";i.r(e);var n=i("354c"),r=i("74a0");for(var s in r)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(s);i("cffc");var c=i("828b"),a=Object(c["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=a.exports},"74a0":function(t,e,i){"use strict";i.r(e);var n=i("a70c"),r=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=r.a},a70c:function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(i("7ca3")),s=i("8f59");function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var a={data:function(){return{type:0,agent_areas:{},regions:[],level:1,province:-1,city:-1,district:-1}},computed:function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){(0,r.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},(0,s.mapGetters)(["agent","user"])),onLoad:function(t){t.type&&(this.type=t.type),this.init()},methods:{init:function(){var t=this;1==this.type||this.type,this.getRegions(),2!=this.type&&this.$util.get("agent/agent/getAgentUserCheck").then((function(e){1==e.code&&(t.agent_areas=e.data)}))},sel:function(t){var e=parseInt(t.currentTarget.dataset.level),i=this.province,n=this.city,r=this.district;e>=2&&(this.province=-1==i?0:i),e>=3&&(this.city=-1==n?0:n),4==e&&(this.district=-1==r?0:r),this.level=e},selAddress:function(e,i){var n=this,r=this.regions,s=i,c=3;1==this.type?c=parseInt(this.user.agent_level):2==this.type&&(c=3);var a=[];this.province,this.city,this.district;if(1==i?(c>=1&&(i=2),{province:e,city:-1,district:-1},this.province=e,this.city=-1,this.district=-1):2==i?(c>=2&&(i=3),this.city=e,this.district=-1):i>=3&&(c>=3&&(i=4),this.district=e),s!=c||1!=this.type&&2!=this.type)this.level=i;else{c>=1&&a.push(r[this.province].name),c>=2&&a.push(r[this.province].children[this.city].name),c>=3&&a.push(r[this.province].children[this.city].children[this.district].name);var o=a.join("-"),u="";if(1==this.type){if(this.user.agent_province||this.user.agent_city||this.user.agent_area)return!1;if(this.agent_areas[o])return this.toast("该区域已被申请");u="确定选择【"+o+"】作为代理区域吗？"}else u="确定选择【"+o+"】作为所属区域吗？";t.showModal({title:"提示",content:u,success:function(e){if(e.confirm){var i={agent_province:a[0]},r=n.user.agent_level,s="agent/agent/setRegion";2==n.type&&(s="agent/agent/setUserRegion",r=4),r>=2&&(i.agent_city=a[1]),r>=3&&(i.agent_area=a[2]),n.$util.post(s,i).then((function(e){1==e.code?n.toast(e.message,1500,(function(){t.navigateBack({delta:1})})):n.toast(e.message)}))}}})}},setAbb:function(t){return t.split("")[0]},getRegions:function(){var e=this,i=t.getStorageSync("regions");i?this.initRegions(i):this.$util.get("common/getRegions").then((function(i){1==i.code&&(e.initRegions(i.data),t.setStorageSync("regions",i.data))}))},initRegions:function(t){for(var e={"河南省":"豫","广东省":"粤","内蒙古自治区":"蒙","黑龙江省":"黑","新疆维吾尔自治区":"新","湖北省":"鄂","辽宁省":"辽","山东省":"鲁","陕西省":"陕","上海市":"沪","贵州省":"黔","重庆市":"渝","西藏自治区":"藏","安徽省":"皖","福建省":"闽","湖南省":"湘","海南省":"琼","江苏省":"苏","青海省":"青","广西壮族自治区":"桂","宁夏回族自治区":"宁","浙江省":"浙","河北省":"冀","香港特别行政区":"港","台湾省":"台","澳门特别行政区":"澳","甘肃省":"甘","四川省":"川","天津市":"津","云南省":"滇","吉林省":"吉","江西省":"赣","北京市":"京","山西省":"晋"},i=0;i<t.length;i++)e[t[i].name]?t[i].abb=e[t[i].name]:t[i].abb=t[i].name.split("")[0];this.regions=t}}};e.default=a}).call(this,i("df3c")["default"])},bac5:function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("4c1a");n(i("3240"));var r=n(i("5c85"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(r.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},cffc:function(t,e,i){"use strict";var n=i("d8be"),r=i.n(n);r.a},d8be:function(t,e,i){}},[["bac5","common/runtime","common/vendor"]]]);