bztang-admin/addons/yun_shop/static/app/js/chunk-4f5c1100.02766bc0.js

1 line
8.3 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4f5c1100"],{"0a7e":function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"appendAddress"}},[s("c-title",{attrs:{hide:!1,text:"添加收货地址"}}),s("div",{staticStyle:{"margin-top":"0.625rem"}}),e.country_code?s("van-field",{attrs:{type:"number",required:"",placeholder:"请输入区号",label:"区号"},model:{value:e.form.country_code,callback:function(t){e.$set(e.form,"country_code",t)},expression:"form.country_code"}}):e._e(),s("van-field",{attrs:{placeholder:"请输入收件人",label:"收件人"},model:{value:e.form.username,callback:function(t){e.$set(e.form,"username",t)},expression:"form.username"}}),s("van-field",{attrs:{placeholder:"请输入联系电话",type:"tel",label:"联系电话:"},model:{value:e.form.mobile,callback:function(t){e.$set(e.form,"mobile",t)},expression:"form.mobile"}}),s("van-field",{staticClass:"default-address",attrs:{name:"switch",label:"设置默认地址","label-width":"7.5rem"},scopedSlots:e._u([{key:"input",fn:function(){return[s("van-switch",{attrs:{size:"25px","active-color":"#f15353","inactive-color":"#ffffff"},model:{value:e.form.isDefault,callback:function(t){e.$set(e.form,"isDefault",t)},expression:"form.isDefault"}})]},proxy:!0}])}),s("div",[s("van-field",{attrs:{label:"所在地区","is-link":"",value:e.addressName,readonly:""},on:{click:function(t){t.stopPropagation(),e.addressShow=!0}}}),e.strShow?s("van-field",{attrs:{label:"街道:","is-link":"",value:e.form.street,readonly:""},on:{click:function(t){return t.stopPropagation(),e.streetChoose.apply(null,arguments)}}}):e._e(),s("yd-cityselect",{attrs:{callback:e.addressCallback,items:e.district},model:{value:e.addressShow,callback:function(t){e.addressShow=t},expression:"addressShow"}})],1),s("van-field",{attrs:{rows:"3",autosize:"",type:"textarea",placeholder:"请输入详细地址"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}}),e.address_parse_open?s("div",{staticClass:"txt",on:{click:e.tapToParse}},[e._v("自动填写地址")]):e._e(),s("div",{staticStyle:{height:"3.75rem"}}),s("div",{staticClass:"address_addnav set-pc-style",on:{click:e.appendAddress}},[s("i",{staticClass:"fa fa-plus-circle"}),s("span",[e._v("保存")])]),s("van-popup",{attrs:{position:"bottom",overlay:!0},model:{value:e.streetShow,callback:function(t){e.streetShow=t},expression:"streetShow"}},[s("van-picker",{attrs:{title:"选择街道","show-toolbar":"","value-key":"areaname",columns:e.districtVal},on:{confirm:e.streetConfirm,cancel:e.onCancel}})],1),s("addressParse",{attrs:{show:e.address_parse_show},on:{toPostMethod:e.toPostMethod,address_parseClose:e.address_parseClose}})],1)},a=[],r=(s("b0c0"),s("99af"),s("ac1f"),s("00b4"),s("b64b"),s("5fbb")),o={data:function(){return{form:{username:"",mobile:"",province:"",city:"",district:"",address:"",isDefault:!1,street:"",country_code:"86"},is_region:0,addressShow:!1,addressName:"",district:district,districtVal:[],streetShow:!1,strShow:!1,isResize:!1,address_parse_open:0,address_parse_show:!1}},methods:{toPostMethod:function(e){this.form.address=e.address,this.form.provice=e.province,this.form.city=e.city,this.form.district=e.region,this.form.username=e.name,this.form.mobile=e.mobile,this.getStreet(e.region_id,e.street),this.addressName="".concat(e.province).concat(e.city).concat(e.region),this.address_parseClose()},tapToParse:function(){this.address_parse_show=!0},address_parseClose:function(){this.address_parse_show=!1},isFocus:function(){this.isResize=!0},isBlur:function(){this.isResize=!1},appendAddress:function(){var e=this;this.country_code&&this.fun.isTextEmpty(this.form.country_code)?this.$dialog.alert({message:"请输入区号"}):this.fun.isTextEmpty(this.form.username)?this.$dialog.alert({message:"请输入收件人"}):this.fun.isTextEmpty(this.form.mobile)?this.$dialog.alert({message:"请输入联系电话"}):/^[0-9]{1,}$/.test(this.form.mobile)?1==this.is_region&&this.fun.isTextEmpty(this.addressName)?this.$dialog.alert({message:"请输入所在地区"}):this.fun.isTextEmpty(this.form.address)?this.$dialog.alert({message:"请输入详细地址"}):$http.get("member.member-address.store",{username:this.form.username,mobile:this.form.mobile,city:this.form.city,address:this.form.address,province:void 0==this.form.provice?"":this.form.provice,isdefault:this.form.isDefault?1:0,district:this.form.district,street:this.form.street,country_code:this.form.country_code}).then((function(t){1==t.result?e.$dialog.alert({message:t.msg}).then((function(){e.$router.go(-1)})):e.$dialog.alert({message:t.msg})}),(function(e){})):this.$dialog.alert({message:"请输入正确的联系电话"})},addressCallback:function(e){this.form.street="",this.districtVal="",this.form.street="",this.districtVal=[],this.addressName=e.itemName1+" "+e.itemName2+" "+e.itemName3,this.form.provice=e.itemName1,this.form.city=e.itemName2,this.form.district=e.itemName3,this.getStreet(e.itemValue3)},streetChoose:function(){1==this.is_region&&this.fun.isTextEmpty(this.addressName)?this.$dialog.alert({message:"请先选择所在地区"}):this.streetShow=!0},streetConfirm:function(e){this.form.street=e.areaname,this.streetShow=!1},onCancel:function(){this.streetShow=!1},getStreet:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";$http.get("member.memberAddress.street",{district_id:e},".").then((function(e){1==e.result&&!t.fun.isTextEmpty(e.data)&&e.data.length>0?(t.districtVal=e.data,t.strShow=!0,s&&(t.form.street=s)):t.strShow=!1})).catch((function(e){}))},getIsOpenAddress:function(){var e=this;$http.get("member.member-address.is-region").then((function(t){1==t.result&&(e.is_region=t.data.is_region)})).catch((function(e){}))}},activated:function(){this.form.username="",this.form.mobile="",this.form.province="",this.form.city="",this.form.district="",this.form.street="",this.form.address="",this.form.isDefault=!1,this.addressName="",this.isResize=!1,this.$route.params.isdefault&&(this.form.isDefault=!0);var e=JSON.parse(window.localStorage.getItem("yz_basic_info"));this.address_parse_open=e.plugin_setting.address_parse_open,this.country_code=e.home.system.country_code,this.strShow=!1,this.getIsOpenAddress()},mounted:function(){},components:{addressParse:r["a"]}},d=o,n=d,l=(s("30be"),s("2877")),c=Object(l["a"])(n,i,a,!1,null,"1247a414",null);t["default"]=c.exports},22416:function(e,t,s){var i=s("24fb");t=i(!1),t.push([e.i,".txt[data-v-1247a414]{color:#ef5452;padding:1rem .5938rem;text-align:left}.address_addnav[data-v-1247a414]{width:100%;padding:0 3% 0 6%!important;position:fixed;bottom:0;left:0;background:#f15353!important;color:#fff!important;text-align:center;height:2.8125rem!important;line-height:2.8125rem!important}.popup-con[data-v-1247a414]{width:100%}#appendAddress .mint-field .mint-cell-title[data-v-1247a414]{text-align:left}.address_addnav i[data-v-1247a414]{color:#fff;font-size:22px;position:absolute;top:50%;height:1.125rem;line-height:1.125rem;margin-left:-2.125rem;margin-top:-.5625rem}.maleall[data-v-1247a414]{background:#fff;text-align:left}#appendAddress .males[data-v-1247a414]{line-height:3.125rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;border-top:.0625rem solid #d9d9d9;margin-left:.625rem;padding-right:.625rem}#appendAddress .males .address[data-v-1247a414]{display:inline-block;position:relative;width:100%;float:right;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:0}.maleall span[data-v-1247a414]{font-size:16px;vertical-align:middle;width:6.5625rem;-webkit-box-flex:0;-ms-flex:none;-webkit-flex:none;flex:none;line-height:3.125rem}#address[data-v-1247a414]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;line-height:3.125rem}#address .mint-button--default[data-v-1247a414]{line-height:3.125rem;text-align:left;font-size:16px}.default-address[data-v-1247a414] .van-field__body{float:right}[data-v-1247a414] .van-cell--clickable:active{background-color:#fff}",""]),e.exports=t},"30be":function(e,t,s){"use strict";s("d016")},d016:function(e,t,s){var i=s("22416");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=s("499e").default;a("0fd23f63",i,!0,{sourceMap:!1,shadowMode:!1})}}]);