pages-add-address-add-address.28bbda8d.js 7.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-add-address-add-address"],{"032e":function(a,e,t){"use strict";var n=t("53ac"),i=t.n(n);i.a},"53ac":function(a,e,t){var n=t("9ad6");"string"===typeof n&&(n=[[a.i,n,""]]),n.locals&&(a.exports=n.locals);var i=t("4f06").default;i("6ba5523c",n,!0,{sourceMap:!1,shadowMode:!1})},6770:function(a,e,t){"use strict";t.d(e,"b",(function(){return i})),t.d(e,"c",(function(){return r})),t.d(e,"a",(function(){return n}));var n={wPicker:t("7401").default},i=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("v-uni-view",{staticClass:"ra"},[t("v-uni-view",[t("v-uni-view",{staticClass:"ra_label"},[a._v("收货人")]),t("v-uni-input",{staticClass:"ra_input",attrs:{type:"text",placeholder:"请填写收货人姓名"},model:{value:a.params.name,callback:function(e){a.$set(a.params,"name",e)},expression:"params.name"}})],1),t("v-uni-view",[t("v-uni-view",{staticClass:"ra_label"},[a._v("手机号")]),t("v-uni-input",{staticClass:"ra_input",attrs:{type:"number",placeholder:"请填写收货人手机号",maxlength:"11"},model:{value:a.params.phone,callback:function(e){a.$set(a.params,"phone",e)},expression:"params.phone"}})],1),t("v-uni-view",{on:{click:function(e){arguments[0]=e=a.$handleEvent(e),a.choosePicker.apply(void 0,arguments)}}},[t("v-uni-view",{staticClass:"ra_label"},[a._v("省市县区")]),t("v-uni-view",{staticClass:"ads_box flexB"},[t("v-uni-input",{attrs:{type:"text",placeholder:"请选择所在地区",disabled:!0},model:{value:a.params.local,callback:function(e){a.$set(a.params,"local",e)},expression:"params.local"}}),t("v-uni-text",{staticClass:"iconfont iconiconfontjiantou2"})],1)],1),t("v-uni-view",[t("v-uni-view",{staticClass:"ra_label"},[a._v("详细地址")]),t("v-uni-input",{staticClass:"ra_input",attrs:{type:"text",placeholder:"请输入详细地址"},model:{value:a.params.address,callback:function(e){a.$set(a.params,"address",e)},expression:"params.address"}})],1),t("v-uni-view",{staticClass:"ra_default",on:{click:function(e){arguments[0]=e=a.$handleEvent(e),a.setDefault.apply(void 0,arguments)}}},[1==a.params.is_default?t("v-uni-text",{staticClass:"iconfont iconxuanzhong"}):t("v-uni-text",{staticClass:"iconfont iconweixuanzhong"}),t("v-uni-text",{class:a.params.is_default?"default":""},[a._v("设置为默认地址")])],1),t("v-uni-view",{staticClass:"ra_add_btn",on:{click:function(e){arguments[0]=e=a.$handleEvent(e),a.save.apply(void 0,arguments)}}},[a._v(a._s(a.address_id?"确认修改":"保存"))]),t("w-picker",{ref:"Selector",attrs:{mode:"region",defaultVal:a.pickerDefaultVal,themeColor:"#F76454"},on:{confirm:function(e){arguments[0]=e=a.$handleEvent(e),a.onConfirm.apply(void 0,arguments)}}})],1)},r=[]},9723:function(a,e,t){"use strict";t.r(e);var n=t("6770"),i=t("ee89");for(var r in i)"default"!==r&&function(a){t.d(e,a,(function(){return i[a]}))}(r);t("032e");var s,c=t("f0c5"),o=Object(c["a"])(i["default"],n["b"],n["c"],!1,null,"8c31d846",null,!1,n["a"],s);e["default"]=o.exports},"9ad6":function(a,e,t){var n=t("24fb");e=n(!1),e.push([a.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */\r\n/*主题色及按钮渐变背景*/\r\n/*字体大小*/.ra[data-v-8c31d846]{padding:%?30?%;width:100%;box-sizing:border-box}.ra .ra_add_btn[data-v-8c31d846]{margin:%?150?% %?110?% 0 %?110?%;height:%?88?%;border-radius:%?88?%;color:#fff;font-size:%?32?%;background:linear-gradient(93deg,#ff232c,#ff571b);line-height:%?88?%;text-align:center}.ra .ra_label[data-v-8c31d846]{color:#999;font-size:%?28?%}.ra .ra_input[data-v-8c31d846]{color:#333;font-size:%?32?%;height:%?48?%;box-sizing:initial}.ra .ads_box[data-v-8c31d846],\r\n.ra .ra_input[data-v-8c31d846]{border-bottom:%?2?% solid #e9e9e9;padding:%?14?% 0;margin-bottom:%?30?%}.ra .ads_box uni-input[data-v-8c31d846]{width:95%;height:%?58?%}.ra .ra_default[data-v-8c31d846]{display:flex;align-items:center;justify-content:flex-start}.ra .ra_default .iconfont[data-v-8c31d846]{margin-right:%?10?%;vertical-align:%?-2?%}.ra .ra_default .default[data-v-8c31d846]{color:#fb231f}',""]),a.exports=e},b8e3:function(a,e,t){"use strict";var n=t("4ea4");t("99af"),t("ac1f"),t("466d"),t("498a"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(t("7401")),r=(n(t("7f95")),n(t("d201")),n(t("0766"))),s=(n(t("2f85")),t("6436")),c={data:function(){return{address_id:"",params:{name:"",phone:"",local:"",province:"",city:"",area:"",address:"",is_default:0,remark:""},pickerDefaultVal:["河南省","郑州市","金水区"]}},components:{WPicker:i.default,cityPicker:r.default},onLoad:function(a){if(a.item){var e=JSON.parse(a.item);this.params=e,this.address_id=e.id,this.params.local="".concat(e.province,"-").concat(e.city,"-").concat(e.area),this.pickerDefaultVal=[e.province,e.city,e.area]}},methods:{choosePicker:function(){this.$refs.Selector.show()},onConfirm:function(a){console.log("".concat(a.checkArr[0],"-").concat(a.checkArr[1],"-").concat(a.checkArr[2])),this.pickerDefaultVal=[a.checkArr[0],a.checkArr[1],a.checkArr[2]],this.params.province=a.checkArr[0],this.params.city=a.checkArr[1],this.params.area=a.checkArr[2]},setDefault:function(){0==this.params.is_default?this.params.is_default=1:this.params.is_default=0},save:function(){if(this.params.name.match(/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/))if(this.params.phone.match(/^1\d{10}$/))if(this.params.local.trim().length)if(this.params.address){var a=this.params,e=a.name,t=a.phone,n=a.province,i=a.city,r=a.area,c=a.address,o=a.is_default,d=a.remark,l="",u="",f="";this.address_id?(l={address_id:this.address_id,name:e,phone:t,province:n,city:i,area:r,address:c,is_default:o,remark:d},u=s.updateAdress,f="修改地址成功!"):(l={name:e,phone:t,province:n,city:i,area:r,address:c,is_default:o,remark:d},u=s.addAdress,f="添加地址成功!"),u(l).then((function(a){200==a.code?uni.showModal({content:f,showCancel:!1,success:function(a){a.confirm&&uni.reLaunch({url:"../address-list/address-list"})}}):uni.showModal({content:a.msg,showCancel:!1})}))}else uni.showToast({title:"详细地址不能为空",icon:"none",mask:!0});else uni.showToast({title:"请选择所在地区",icon:"none",mask:!0});else uni.showToast({title:"手机号码不符合要求",icon:"none",mask:!0});else uni.showToast({title:"姓名不符合要求",icon:"none",mask:!0})}}};e.default=c},ee89:function(a,e,t){"use strict";t.r(e);var n=t("b8e3"),i=t.n(n);for(var r in n)"default"!==r&&function(a){t.d(e,a,(function(){return n[a]}))}(r);e["default"]=i.a}}]);