pages-my-add-address.81aad2e0.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-my-add-address"],{"02e2":function(e,t,a){"use strict";a.r(t);var i=a("8adb"),n=a.n(i);for(var r in i)["default"].indexOf(r)<0&&function(e){a.d(t,e,(function(){return i[e]}))}(r);t["default"]=n.a},"0d511":function(e,t,a){"use strict";a("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("c975");var i={name:"bar-title",props:{bgColor:{type:String,default:""},isBack:{type:Boolean,default:!0},backText:{type:String,default:""},fixed:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},title:{type:String,default:""}},data:function(){return{isWechatBrowser:!1}},methods:{BackPage:function(){uni.navigateBack()},leftTap:function(){this.$emit("leftTap")},contentTap:function(){this.$emit("contentTap")},rightTap:function(){this.$emit("rightTap")}},created:function(){uni.setNavigationBarTitle({title:this.title}),this.isWechatBrowser=navigator.userAgent.toLocaleLowerCase().indexOf("micromessenger")>0},watch:{title:function(e){uni.setNavigationBarTitle({title:e})}}};t.default=i},"10eb":function(e,t,a){"use strict";a("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},a("d9e2"),a("d401")},4053:function(e,t,a){"use strict";a("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(Array.isArray(e))return(0,i.default)(e)};var i=function(e){return e&&e.__esModule?e:{default:e}}(a("b680"))},"5a30":function(e,t,a){var i=a("7ed5");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var n=a("4f06").default;n("e9abf2d4",i,!0,{sourceMap:!1,shadowMode:!1})},6675:function(e,t,a){"use strict";var i=a("5a30"),n=a.n(i);n.a},"713c":function(e,t,a){"use strict";a.r(t);var i=a("e88e"),n=a("df75a");for(var r in n)["default"].indexOf(r)<0&&function(e){a.d(t,e,(function(){return n[e]}))}(r);a("6675");var o=a("f0c5"),s=Object(o["a"])(n["default"],i["b"],i["c"],!1,null,"1b7fdbfe",null,!1,i["a"],void 0);t["default"]=s.exports},"7d86":function(e,t,a){var i=a("f954");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var n=a("4f06").default;n("10302c61",i,!0,{sourceMap:!1,shadowMode:!1})},"7ed5":function(e,t,a){var i=a("24fb");t=i(!1),t.push([e.i,".zaiui-bar-title-box .cu-bar[data-v-1b7fdbfe]{padding-top:0;min-height:calc(0px + %?101?%)}.zaiui-bar-title-box .cu-bar .content[data-v-1b7fdbfe]{top:0}.zaiui-bar-title-box .cu-bar .content .cu-tag[data-v-1b7fdbfe]{position:relative;top:%?-2.72?%;padding:0 %?5.45?%}.zaiui-bar-title-box .cu-bar .content .cu-tag uni-text[data-v-1b7fdbfe]{position:relative;top:%?2?%}.zaiui-bar-title-box .cu-bar.fixed.no-shadow[data-v-1b7fdbfe]{box-shadow:inherit}.zaiui-bar-title-box .cu-bar.bg-white[data-v-1b7fdbfe]{color:#333}.zaiui-bar-title-box .zaiui-seat-height[data-v-1b7fdbfe]{width:100%;height:calc(0px + %?101?%)}",""]),e.exports=t},"8adb":function(e,t,a){"use strict";a("7a82");var i=a("ee27").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a("d0ff"));a("99af"),a("c740"),a("a434"),a("d81d"),a("c975"),a("ac1f"),a("00b4");var r=i(a("713c")),o=i(a("b27f")),s={components:{barTitle:r.default},data:function(){return{name:"",phone:"",id:"",address:"",addressShow:!1,areas:[[{name:"省份选择",value:"-1"}],[{name:"城市选择",value:"-1"}],[{name:"县区选择",value:"-1"}]],areasIndex:[0,0,0],roleDeep:4,type:2}},onLoad:function(e){var t=this;this.id=e.id||"",this.id?this.reqByuser({url:"?l=address.getInfo",data:{id:this.id},success:function(e){if(1==e.data.status){var a=e.data.data;t.phone=a.phone,t.address=a.address,t.city=a.city,t.type=a.type,t.name=a.name,t.initAreasIndex([a.province_id,a.city_id,a.county_id])}}}):this.loadAreas(0,1)},onReady:function(){o.default.setBarColor(!0),uni.pageScrollTo({scrollTop:0,duration:0})},methods:{initAreasIndex:function(e){var t=this,a=[].concat(e);(function i(n,r){t.loadAreas(n,r,0,(function(n){var o=n.findIndex((function(t){return e[r-1]==t.id}));1==r&&o++,t.areasIndex[r-1]=Math.max(0,o);var s=a.shift();s&&r<3&&i(s,r+1)}),1)})(0,1)},loadAreas:function(e,t,a,i){var r=this;t>4||this.req({url:"http://center.yuandaibao.com/package/area/?l=data.get",data:{level:t,parent:e},success:function(o){if(1==o.data.status){var s=o.data.data;if(t-1<3){var u=s.list;0==e&&(u=[{name:"省份选择",value:"-1"}].concat((0,n.default)(u))),r.areas.splice(t-1,1,u)}if("function"==typeof i&&i(s.list),a&&t<r.roleDeep-1){var c=s.list[0];-1!==c.id&&r.loadAreas(c.id,t+1)}}}})},multChange:function(e){var t=this.areas.map((function(t,a){return t[e.detail.value[a]]&&t[e.detail.value[a]].value})).join(",");if(t+=","+this.streetAreas[this.streetIndex].value,this.areas.length==this.roleDeep&&-1==t.indexOf("-1"))this.roles[this.roleIndex]},bindMultiPickerColumnChange:function(e){var t=this.areasIndex.map((function(t,a){return a==e.detail.column?e.detail.value:a<e.detail.column?t:0}));if(this.$set(this,"areasIndex",t),e.detail.column<this.roleDeep-1){var a=this.areas[e.detail.column][e.detail.value].id;if(0==e.detail.column&&this.areas.splice(2,1,[{name:"县区选择",value:"-1"}]),this.streetAreas=[{name:"街道选择",value:"-1"}],this.streetIndex=0,-1==a){var i=[].concat(this.areas);return i.splice(e.detail.column+1,5),void(this.areas=i)}this.loadAreas(this.areas[e.detail.column][e.detail.value].id,e.detail.column+2,1)}},selectAddress:function(){this.$refs.addressEl.show()},confirmChange:function(e){console.log(e),this.address=e.province+"/"+e.city+"/"+e.area},submit:function(){var e=this,t=this.name,a=this.phone,i=this.type,n=this.id,r=this.address,o=this.areas.map((function(t,a){return t[e.areasIndex[a]].id})).join(",");if(t)if(a)if(/1\d{10}/.test(a))if(!o||o.indexOf("-1")>-1)uni.showToast({icon:"error",title:"请填写地址"});else if(r){var s={name:t,province:this.areas[0][this.areasIndex[0]].id,city:this.areas[1][this.areasIndex[1]].id,county:this.areas[2][this.areasIndex[2]].id,address:r,phone:a,type:i,id:n};this.reqByuser({url:"?l=address.up",data:s,success:function(e){1==e.data.status&&(uni.showToast({icon:"success",title:"提交成功"}),uni.navigateBack({}))}})}else uni.showToast({icon:"error",title:"请填写详细地址"});else uni.showToast({icon:"error",title:"手机号格式错误"});else uni.showToast({icon:"error",title:"请填写手机号"});else uni.showToast({icon:"error",title:"请填写昵称"})}}};t.default=s},a9e0:function(e,t,a){"use strict";a("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},a("a4d3"),a("e01a"),a("d3b7"),a("d28b"),a("3ca3"),a("ddb0"),a("a630")},b27f:function(e,t,a){"use strict";a("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("a9e3"),a("d401"),a("d3b7"),a("25f0"),a("e25e"),a("c975"),a("ac1f"),a("5319");var i={strLeng:function(e){if(e){for(var t=e.length,a=0,i=0;i<t;i++)e.charCodeAt(i)>128?a+=2:a+=1;return a}return 0},getPageNum:function(e,t){var a=Number(e)/Number(t);if(a%1!==0){var i=a.toString(),n=parseInt(i.substring(0,i.indexOf("."))),r=i.replace(/\d+\.(\d*)/,"$1");r>0&&(a=n+1)}return a},setBarColor:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?uni.setNavigationBarColor({frontColor:"#000000",backgroundColor:"#FAFAFA"}):uni.setNavigationBarColor({frontColor:"#ffffff",backgroundColor:"#FAFAFA"})},zaiui_log:function(e){}},n=i;t.default=n},b902:function(e,t,a){"use strict";var i=a("7d86"),n=a.n(i);n.a},ce08:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){}));var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",[a("bar-title",{attrs:{bgColor:"bg-white",isBack:!0,title:e.id?"编辑地址":"新增地址"}},[a("template",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e.id?"编辑地址":"新增地址"))])],2),a("v-uni-view",{staticClass:"cu-form-group margin-top"},[a("v-uni-view",{staticClass:"title"},[e._v("收货人名")]),a("v-uni-input",{attrs:{placeholder:"您的姓名"},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})],1),a("v-uni-view",{staticClass:"cu-form-group"},[a("v-uni-view",{staticClass:"title"},[e._v("手机号码")]),a("v-uni-input",{attrs:{placeholder:"卖家和快递员联系您的方式"},model:{value:e.phone,callback:function(t){e.phone=t},expression:"phone"}})],1),a("v-uni-view",{staticClass:"cu-form-group"},[a("v-uni-view",{staticClass:"title"},[e._v("所在地区")]),a("v-uni-picker",{attrs:{mode:"multiSelector",value:e.areasIndex,"range-key":"name",range:e.areas},on:{columnchange:function(t){arguments[0]=t=e.$handleEvent(t),e.bindMultiPickerColumnChange.apply(void 0,arguments)},change:function(t){arguments[0]=t=e.$handleEvent(t),e.multChange.apply(void 0,arguments)}}},[a("v-uni-view",{staticClass:"picker"},[e._l(e.areas,(function(t,a){return a<3?[e._v(e._s(e.areas[a]&&e.areas[a][e.areasIndex[a]]&&e.areas[a][e.areasIndex[a]].name)),a<e.areas.length-1?[e._v(",")]:e._e()]:e._e()}))],2)],1)],1),a("v-uni-view",{staticClass:"cu-form-group"},[a("v-uni-view",{staticClass:"title"},[e._v("详细地址")]),a("v-uni-input",{attrs:{placeholder:"请输入详细的地址信息"},model:{value:e.address,callback:function(t){e.address=t},expression:"address"}})],1),a("v-uni-view",{staticClass:"bg-white wecanui-footer-fixed foot-pb"},[a("v-uni-view",{staticClass:"flex flex-direction"},[a("v-uni-button",{staticClass:"cu-btn bg-red",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.submit.apply(void 0,arguments)}}},[e._v("提交保存")])],1)],1)],1)},n=[]},d0ff:function(e,t,a){"use strict";a("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e)||(0,n.default)(e)||(0,r.default)(e)||(0,o.default)()};var i=s(a("4053")),n=s(a("a9e0")),r=s(a("dde1")),o=s(a("10eb"));function s(e){return e&&e.__esModule?e:{default:e}}},df75a:function(e,t,a){"use strict";a.r(t);var i=a("0d511"),n=a.n(i);for(var r in i)["default"].indexOf(r)<0&&function(e){a.d(t,e,(function(){return i[e]}))}(r);t["default"]=n.a},e88e:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){}));var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",{staticClass:"zaiui-bar-title-box",style:e.isWechatBrowser?"display: none;":""},[a("v-uni-view",{staticClass:"cu-bar",class:[e.fixed?"fixed":"",e.shadow?"":"no-shadow",e.bgColor]},[e.isBack?a("v-uni-view",{staticClass:"action",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.BackPage.apply(void 0,arguments)}}},[a("v-uni-text",{staticClass:"cuIcon-back"}),a("v-uni-text",[e._v(e._s(e.backText))])],1):e._e(),e.isBack?e._e():a("v-uni-view",{staticClass:"action",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.leftTap.apply(void 0,arguments)}}},[e._t("left")],2),a("v-uni-view",{staticClass:"content",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.contentTap.apply(void 0,arguments)}}},[e._t("content")],2),a("v-uni-view",{staticClass:"action",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.rightTap.apply(void 0,arguments)}}},[e._t("right")],2)],1),e.fixed?a("v-uni-view",{staticClass:"zaiui-seat-height"}):e._e()],1)},n=[]},ec24:function(e,t,a){"use strict";a.r(t);var i=a("ce08"),n=a("02e2");for(var r in n)["default"].indexOf(r)<0&&function(e){a.d(t,e,(function(){return n[e]}))}(r);a("b902");var o=a("f0c5"),s=Object(o["a"])(n["default"],i["b"],i["c"],!1,null,"5c8c6f1e",null,!1,i["a"],void 0);t["default"]=s.exports},f954:function(e,t,a){var i=a("24fb");t=i(!1),t.push([e.i,".wecanui-footer-fixed .flex-direction[data-v-5c8c6f1e]{padding:%?18.18?%}",""]),e.exports=t}}]);