(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/set/addressManage"],{"5cd3":function(t,e,i){"use strict";i.r(e);var n=i("b3e8"),a=i.n(n);for(var s in n)"default"!==s&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=a.a},"5f70":function(t,e,i){},"6b90":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return n}));var n={uniList:function(){return i.e("components/uni-list/uni-list").then(i.bind(null,"bdc8"))},uniListItem:function(){return i.e("components/uni-list-item/uni-list-item").then(i.bind(null,"83de"))}},a=function(){var t=this,e=t.$createElement;t._self._c},s=[]},a1d8:function(t,e,i){"use strict";(function(t){i("5935");n(i("66fd"));var e=n(i("e3bf"));function n(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=i,t(e.default)}).call(this,i("543d")["createPage"])},b3e8:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2681"),a=function(){i.e("components/uni-list/uni-list").then(function(){return resolve(i("bdc8"))}.bind(null,i)).catch(i.oe)},s=function(){i.e("components/uni-list-item/uni-list-item").then(function(){return resolve(i("83de"))}.bind(null,i)).catch(i.oe)},d=function(){i.e("components/uni-popup/uni-popup").then(function(){return resolve(i("ebf3"))}.bind(null,i)).catch(i.oe)},o=function(){Promise.all([i.e("common/vendor"),i.e("components/wangding-pickerAddress/wangding-pickerAddress")]).then(function(){return resolve(i("9a3b"))}.bind(null,i)).catch(i.oe)},r={components:{uniList:a,uniListItem:s,pickerAddress:o,uniPopup:d},data:function(){return{detail_address:"",addressDetail:"",addressData:{name:"",mobile:"",address:{province:"",city:"",district:""},area:"",default:!1,latitude:"",longitude:""}}},computed:{latlng:function(){var t="";return""!==this.addressData.latitude&&""!==this.addressData.longitude&&(t=this.addressData.latitude+" , "+this.addressData.longitude),t}},onLoad:function(e){var i="新增收货地址";if("edit"===e.type){i="编辑收货地址";var n=JSON.parse(e.data);console.log(n),this.addressData={name:n.real_name,mobile:n.phone,address:{province:n.province,city:n.city,district:n.district},area:n.detail,default:1==n.is_default,id:n.id,latitude:"",longitude:""},this.addressDetail=n.province+n.city+n.district}this.manageType=e.type,t.setNavigationBarTitle({title:i})},methods:{onCityClick:function(t){var e=t.data,i=this.addressData.address;i.province=e[0],i.city=e[1],i.district=e[2],this.addressDetail=e.join("")},onLatlngClick:function(){var t=this;console.log("选择经纬度"),wx.chooseLocation({success:function(e){console.log(e,"地图选择"),""==e.address?t.$api.msg("请选择地址"):(t.$set(t.addressData,"latitude",e.latitude),t.$set(t.addressData,"longitude",e.longitude),t.$set(t,"detail_address",e.address))}})},chooseLocation:function(){var e=this;t.chooseLocation({success:function(t){console.log(t),e.addressData.addressName=t.name,e.addressData.address=t.name}})},switchChange:function(t){this.addressData.default=t.value},confirm:function(){var e=this,i=this.addressData;i.name?/(^1[3|4|5|7|8][0-9]{9}$)/.test(i.mobile)?i.address?i.area?i.latitude&&i.longitude?-1!=e.detail_address.indexOf(i.address.province)&&-1!=e.detail_address.indexOf(i.address.city)&&-1!=e.detail_address.indexOf(i.address.district)?(0,n.addressEdit)({real_name:i.name,phone:i.mobile,address:{province:i.address.province,city:i.address.city,district:i.address.district},detail:i.area,is_default:i.default,id:i.id||"",type:1,latitude:i.latitude,longitude:i.longitude}).then((function(i){e.$api.prePage().refreshList(),t.showToast({title:"提交成功",duration:2e3}),setTimeout((function(){t.navigateBack()}),800)})):this.$api.msg("地址和经纬度不一致"):this.$api.msg("请选择经纬度"):this.$api.msg("请填写门牌号信息"):this.$api.msg("请在地图选择所在位置"):this.$api.msg("请输入正确的手机号码"):this.$api.msg("请填写收货人姓名")}}};e.default=r}).call(this,i("543d")["default"])},e3bf:function(t,e,i){"use strict";i.r(e);var n=i("6b90"),a=i("5cd3");for(var s in a)"default"!==s&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("ed05");var d,o=i("f0c5"),r=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],d);e["default"]=r.exports},ed05:function(t,e,i){"use strict";var n=i("5f70"),a=i.n(n);a.a}},[["a1d8","common/runtime","common/vendor"]]]);