1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-user-address-add-add"],{"0da6":function(e,t,a){"use strict";a.d(t,"b",(function(){return r})),a.d(t,"c",(function(){return i})),a.d(t,"a",(function(){}));var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",[a("v-uni-view",[a("v-uni-form",{attrs:{"report-submit":"true"},on:{submit:function(t){arguments[0]=t=e.$handleEvent(t),e.formSubmit.apply(void 0,arguments)}}},[a("v-uni-view",{attrs:{id:"box"}},[a("v-uni-view",{staticClass:"add-line"},[a("v-uni-view",{staticClass:"al-left"},[a("v-uni-text",[e._v("收货人")])],1),a("v-uni-view",{staticClass:"al-right"},[a("v-uni-input",{attrs:{placeholder:"收货人","placeholder-class":"p-size",name:"name"},model:{value:e.data.name,callback:function(t){e.$set(e.data,"name",t)},expression:"data.name"}})],1)],1),a("v-uni-view",{staticClass:"add-line"},[a("v-uni-view",{staticClass:"al-left"},[a("v-uni-text",[e._v("手机号码")])],1),a("v-uni-view",{staticClass:"al-right"},[a("v-uni-input",{attrs:{placeholder:"手机号码","placeholder-class":"p-size",name:"tel",type:"number"},model:{value:e.data.tel,callback:function(t){e.$set(e.data,"tel",t)},expression:"data.tel"}})],1)],1),a("v-uni-view",{staticClass:"add-line"},[a("v-uni-view",{staticClass:"al-left"},[a("v-uni-text",[e._v("所在地区")])],1),a("v-uni-view",{staticClass:"al-right",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.showMulLinkageThreePicker.apply(void 0,arguments)}}},[a("v-uni-view",{style:"color:"+(e.data.region?"#333":"#585858")},[e._v(e._s(e.data.region?e.data.region:"请选择"))]),a("v-uni-input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{type:"text",name:"region",value:e.data.region}}),a("v-uni-view",{staticClass:"alr-jiantou"},[a("v-uni-image",{attrs:{src:"/static/img/ic_next.png"}})],1)],1)],1),a("v-uni-view",{staticClass:"add-line"},[a("v-uni-view",{staticClass:"al-left"},[a("v-uni-text",[e._v("详细地址")])],1),a("v-uni-view",{staticClass:"al-right"},[a("v-uni-textarea",{attrs:{"placeholder-class":"p-size",name:"address",placeholder:"详细省份,城市,道路,门牌号,小区,楼栋号,单元室等(必填)"},model:{value:e.data.address,callback:function(t){e.$set(e.data,"address",t)},expression:"data.address"}})],1)],1),a("v-uni-button",{staticClass:"nt add-btn",attrs:{formType:"submit"}},[e._v("保存")])],1)],1)],1),a("mpvue-city-picker",{ref:"mpvueCityPicker",attrs:{themeColor:e.themeColor,pickerValueDefault:e.cityPickerValueDefault},on:{onCancel:function(t){arguments[0]=t=e.$handleEvent(t),e.onCancel.apply(void 0,arguments)},onConfirm:function(t){arguments[0]=t=e.$handleEvent(t),e.onConfirm.apply(void 0,arguments)}}})],1)},i=[]},7073:function(e,t,a){a("23f4"),a("7d2f"),a("5c47"),a("9c4e"),a("ab80"),a("0506"),a("64aa"),a("5ef2"),e.exports={error:"",check:function(e,t){for(var a=0;a<t.length;a++){if(!t[a].checkType)return!0;if(!t[a].name)return!0;if(!t[a].errorMsg)return!0;if(!e[t[a].name])return this.error=t[a].errorMsg,!1;switch(t[a].checkType){case"string":var r=new RegExp("^.{"+t[a].checkRule+"}$");if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"int":r=new RegExp("^(-[1-9]|[1-9])[0-9]{"+t[a].checkRule+"}$");if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"between":if(!this.isNumber(e[t[a].name]))return this.error=t[a].errorMsg,!1;var i=t[a].checkRule.split(",");if(i[0]=Number(i[0]),i[1]=Number(i[1]),e[t[a].name]>i[1]||e[t[a].name]<i[0])return this.error=t[a].errorMsg,!1;break;case"betweenD":r=/^-?[1-9][0-9]?$/;if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;i=t[a].checkRule.split(",");if(i[0]=Number(i[0]),i[1]=Number(i[1]),e[t[a].name]>i[1]||e[t[a].name]<i[0])return this.error=t[a].errorMsg,!1;break;case"betweenF":r=/^-?[0-9][0-9]?.+[0-9]+$/;if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;i=t[a].checkRule.split(",");if(i[0]=Number(i[0]),i[1]=Number(i[1]),e[t[a].name]>i[1]||e[t[a].name]<i[0])return this.error=t[a].errorMsg,!1;break;case"same":if(e[t[a].name]!=t[a].checkRule)return this.error=t[a].errorMsg,!1;break;case"notsame":if(e[t[a].name]==t[a].checkRule)return this.error=t[a].errorMsg,!1;break;case"email":r=/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"phoneno":r=/^1[0-9]{10,10}$/;if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"zipcode":r=/^[0-9]{6}$/;if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"reg":r=new RegExp(t[a].checkRule);if(!r.test(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"in":if(-1==t[a].checkRule.indexOf(e[t[a].name]))return this.error=t[a].errorMsg,!1;break;case"notnull":if(null==e[t[a].name]||e[t[a].name].length<1)return this.error=t[a].errorMsg,!1;break}}return!0},isNumber:function(e){return/^-?[1-9][0-9]?.?[0-9]*$/.test(e)}}},"9d70":function(e,t,a){"use strict";a.r(t);var r=a("0da6"),i=a("e865");for(var n in i)["default"].indexOf(n)<0&&function(e){a.d(t,e,(function(){return i[e]}))}(n);a("b2b4");var s=a("828b"),o=Object(s["a"])(i["default"],r["b"],r["c"],!1,null,"144885b1",null,!1,r["a"],void 0);t["default"]=o.exports},b2b4:function(e,t,a){"use strict";var r=a("fcd8"),i=a.n(r);i.a},be2b:function(e,t,a){var r=a("c86c");t=r(!1),t.push([e.i,"uni-page-body[data-v-144885b1]{background:#f5f5f5}body.?%PAGE?%[data-v-144885b1]{background:#f5f5f5}.add-name[data-v-144885b1]{position:absolute;right:15px;color:#4a4a4a;font-size:13px}.add-line[data-v-144885b1]{padding:15px;display:flex;align-items:center;background:#fff;border-bottom:1px #f5f5f5 solid}.al-left[data-v-144885b1]{color:#585858;font-size:14px}.al-right[data-v-144885b1]{margin-left:auto;width:75%;display:flex;align-items:center;justify-content:flex-end}.al-right uni-input[data-v-144885b1]{text-align:right;font-size:14px;width:100%;height:100%}.al-right uni-textarea[data-v-144885b1]{width:100%;height:40px;font-size:14px}.p-size[data-v-144885b1]{color:#9b9b9b}.alr-jiantou[data-v-144885b1]{width:20px;height:20px;margin-left:6px}.alr-jiantou uni-image[data-v-144885b1]{width:100%;height:100%;display:block}uni-picker[data-v-144885b1]{width:100%}uni-button.add-btn[data-v-144885b1]{width:90%;height:50px;background:#db292b;color:#fff;border-radius:100px;position:absolute;bottom:50px;text-align:center;line-height:50px;margin:0 5%}",""]),e.exports=t},e231:function(e,t,a){"use strict";a("6a54");var r=a("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(a("7905")),n=r(a("7073")),s={components:{"mpvue-city-picker":i.default},data:function(){return{cityPickerValueDefault:[0,0,0],themeColor:"#007AFF",data:{name:"",tel:"",address:"",region:"",City:0}}},onLoad:function(e){this.id=e.id||0,this.id>0&&(uni.setNavigationBarTitle({title:"修改地址"}),this.getData())},methods:{getData:function(){var e=this;this.request.post("userAddressInfo",{id:this.id}).then((function(t){200==t.code?e.data=t.data:e.utils.Tip(t.msg)})).catch((function(){e.utils.Tip("网络错误,请稍后尝试")}))},formSubmit:function(e){var t=this,a=e.detail.value,r=n.default.check(a,[{name:"name",checkType:"notnull",checkRule:"",errorMsg:"请输入收货人姓名"},{name:"tel",checkType:"phoneno",checkRule:"",errorMsg:"请输入正确的联系电话"},{name:"region",checkType:"notnull",checkRule:"",errorMsg:"请选择所在地区"},{name:"address",checkType:"notnull",checkRule:"",errorMsg:"请输入详细地址"}]);r?(a.id=this.id,a.cityId=this.data.City,this.utils.loadIng("提交中..."),this.request.post("userAddressSave",a).then((function(e){200==e.code?(t.utils.Tip(e.msg),uni.$emit("addressEvent",{}),uni.navigateBack()):t.utils.Tip(e.msg)})).catch((function(){t.utils.Tip("网络错误,请稍后尝试")}))):uni.showToast({title:n.default.error,icon:"none"})},showMulLinkageThreePicker:function(){this.$refs.mpvueCityPicker.show()},onCancel:function(e){this.data.region=""},onConfirm:function(e){this.data.region=e.label,this.data.City=e.cityCode}}};t.default=s},e865:function(e,t,a){"use strict";a.r(t);var r=a("e231"),i=a.n(r);for(var n in r)["default"].indexOf(n)<0&&function(e){a.d(t,e,(function(){return r[e]}))}(n);t["default"]=i.a},fcd8:function(e,t,a){var r=a("be2b");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=a("967d").default;i("7b72a103",r,!0,{sourceMap:!1,shadowMode:!1})}}]);
|