You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.7 KiB
1 lines
7.7 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-address-edit"],{"51c7":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.isLoad?i("v-uni-view",{staticClass:"apply-pages"},[i("v-uni-view",{staticClass:"apply-form pl-lg pr-lg"},[i("v-uni-view",{staticClass:"fill-base mt-md radius-16"},[i("v-uni-view",{staticClass:"flex-between ml-lg mr-lg b-1px-b"},[i("v-uni-view",{staticClass:"item-text"},[t._v("联系人")]),i("v-uni-input",{staticClass:"item-input flex-1",attrs:{type:"text",maxlength:"20",placeholder:t.rule[0].errorMsg},model:{value:t.form.user_name,callback:function(e){t.$set(t.form,"user_name",e)},expression:"form.user_name"}})],1),i("v-uni-view",{staticClass:"flex-between ml-lg mr-lg"},[i("v-uni-view",{staticClass:"item-text"},[t._v("手机号")]),i("v-uni-input",{staticClass:"item-input flex-1",attrs:{type:"text",placeholder:t.rule[1].errorMsg},model:{value:t.form.mobile,callback:function(e){t.$set(t.form,"mobile",e)},expression:"form.mobile"}})],1)],1),i("v-uni-view",{staticClass:"fill-base mt-md radius-16"},[i("v-uni-view",{staticClass:"flex-between ml-lg mr-lg b-1px-b"},[i("v-uni-view",{staticClass:"item-text"},[t._v("选择地区")]),i("v-uni-view",{staticClass:"item-input text flex-1",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.toChooseLocation.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"flex-y-center text-right"},[i("v-uni-view",{staticClass:"flex-1 text-right"},[t._v(t._s(t.form.address||"点击右边图标设置"))]),i("i",{staticClass:"iconfont iconjuli ml-sm",style:{color:t.primaryColor}})],1)],1)],1),i("v-uni-view",{staticClass:"flex-between ml-lg mr-lg"},[i("v-uni-view",{staticClass:"item-text"},[t._v("详细地址")]),i("v-uni-input",{staticClass:"item-input flex-1",attrs:{type:"text",placeholder:t.rule[3].errorMsg},model:{value:t.form.address_info,callback:function(e){t.$set(t.form,"address_info",e)},expression:"form.address_info"}})],1)],1),i("v-uni-view",{staticClass:"fill-base mt-md radius-16"},[i("v-uni-view",{staticClass:"flex-between ml-lg mr-lg"},[i("v-uni-view",{staticClass:"item-text flex-1",staticStyle:{width:"300rpx"}},[t._v("设为默认地址")]),i("v-uni-view",{staticClass:"item-input",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.form.status=1==t.form.status?0:1}}},[i("i",{staticClass:"iconfont icon-switch",class:[{"icon-switch-on":1==t.form.status}],style:{color:1==t.form.status?t.primaryColor:"#f2f2f2"}})])],1)],1),i("v-uni-view",{staticClass:"f-icontext c-caption mt-md"},[t._v("设置后,下单时优先展示该地址")])],1),i("v-uni-view",{staticClass:"space-max-footer"}),i("fix-bottom-button",{attrs:{text:t.textArr,bgColor:"#fff"},on:{cancel:function(e){arguments[0]=e=t.$handleEvent(e),t.toDel.apply(void 0,arguments)},confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.submit.apply(void 0,arguments)}}})],1):t._e()},n=[]},5744:function(t,e,i){"use strict";i.r(e);var a=i("51c7"),n=i("5fa0");for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);var s=i("f0c5"),o=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"30fd2495",null,!1,a["a"],void 0);e["default"]=o.exports},"5ea7":function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("a434"),i("d81d");var n=a(i("3835")),r=a(i("c7eb")),s=a(i("1da1")),o=a(i("5530")),l=i("26cb"),u={components:{},data:function(){return{isLoad:!1,options:{},textArr:[{text:"删除",type:"cancel"},{text:"保存",type:"confirm"}],form:{id:0,user_name:"",mobile:"",address:"",address_info:"",lng:"",lat:"",status:0},rule:[{name:"user_name",checkType:"isNotNull",errorMsg:"输入联系人姓名",regType:2},{name:"mobile",checkType:"isMobile",errorMsg:"输入手机号"},{name:"address",checkType:"isNotNull",errorMsg:"设置地区"},{name:"address_info",checkType:"isNotNull",errorMsg:"输入街道、楼牌号等",regType:2}],lockTap:!1}},computed:(0,l.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor}}),onLoad:function(t){this.options=t,this.initIndex()},methods:(0,o.default)((0,o.default)({},(0,l.mapMutations)(["updateUserItem","updateOrderItem"])),{},{initIndex:function(){var t=this;return(0,s.default)((0,r.default)().mark((function e(){var i,a,n,s;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.$jweixin.isWechat()){e.next=4;break}return e.next=3,t.$jweixin.initJssdk();case 3:t.$jweixin.wxReady((function(){t.$jweixin.hideOptionMenu()}));case 4:if(i=t.options.id,a=void 0===i?0:i,uni.setNavigationBarTitle({title:a?"编辑地址":"添加新地址"}),a){e.next=11;break}return t.textArr.splice(0,1),t.isLoad=!0,t.$util.setNavigationBarColor({bg:t.primaryColor}),e.abrupt("return");case 11:return e.next=13,t.$api.mine.addressInfo({id:a});case 13:for(s in n=e.sent,t.form)t.form[s]=n[s];t.$util.setNavigationBarColor({bg:t.primaryColor}),t.isLoad=!0;case 17:case"end":return e.stop()}}),e)})))()},toChooseLocation:function(t){var e=this;return(0,s.default)((0,r.default)().mark((function t(){var i,a,s,o,l,u,c;return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$util.checkAuth({type:"userLocation"});case 2:return t.next=4,uni.chooseLocation();case 4:if(i=t.sent,a=(0,n.default)(i,2),s=a[1],o=s.address,l=void 0===o?"":o,u=s.longitude,c=s.latitude,l){t.next=13;break}return t.abrupt("return");case 13:e.form.address=l,e.form.lng=u,e.form.lat=c;case 16:case"end":return t.stop()}}),t)})))()},toDel:function(){var t=this;return(0,s.default)((0,r.default)().mark((function e(){var i,a,s,o,l,u;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,uni.showModal({title:"提示",content:"请确认是否要删除此数据?"});case 2:if(i=e.sent,a=(0,n.default)(i,2),a[0],s=a[1].confirm,s){e.next=8;break}return e.abrupt("return");case 8:if(o=t.form.id,l=t.$util.getPage(-1),u=l.check_id,!t.lockTap){e.next=12;break}return e.abrupt("return");case 12:return t.lockTap=!0,t.$util.showLoading(),e.prev=14,e.next=17,t.$api.mine.addressDel({id:o});case 17:t.$util.hideAll(),t.$util.showToast({title:"删除成功"}),t.lockTap=!1,o==u&&t.updateOrderItem({key:"haveOperItem",val:!0}),setTimeout((function(){t.$util.back(),t.$util.goUrl({url:1,openType:"navigateBack"})}),1e3),e.next=27;break;case 24:e.prev=24,e.t0=e["catch"](14),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 27:case"end":return e.stop()}}),e,null,[[14,24]])})))()},validate:function(t){var e=new this.$util.Validate;this.rule.map((function(i){var a=i.name;e.add(t[a],i)}));var i=e.start();return i},submit:function(){var t=this;return(0,s.default)((0,r.default)().mark((function e(){var i,a,n;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.$util.deepCopy(t.form),a=t.validate(i),!a){e.next=5;break}return t.$util.showToast({title:a}),e.abrupt("return");case 5:if(!t.lockTap){e.next=7;break}return e.abrupt("return");case 7:return t.lockTap=!0,t.$util.showLoading(),e.prev=9,n=i.id?"addressUpdate":"addressAdd",e.next=13,t.$api.mine[n](i);case 13:t.$util.hideAll(),t.$util.showToast({title:"保存成功"}),setTimeout((function(){t.$util.back(),t.$util.goUrl({url:1,openType:"navigateBack"})}),1e3),e.next=21;break;case 18:e.prev=18,e.t0=e["catch"](9),setTimeout((function(){t.lockTap=!1,t.$util.hideAll()}),2e3);case 21:case"end":return e.stop()}}),e,null,[[9,18]])})))()}})};e.default=u},"5fa0":function(t,e,i){"use strict";i.r(e);var a=i("5ea7"),n=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(r);e["default"]=n.a}}]); |