pages-my-address.028c2e3c.js 9.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-my-address"],{"0c73":function(t,e,i){"use strict";i("7a82");var a=i("ee27").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(i("713c")),s=a(i("b27f")),r={components:{barTitle:n.default},data:function(){return{addressList:[],fromOrder:!1}},onLoad:function(t){this.fromOrder="cart"===t.from},onShow:function(){this.getList()},onReady:function(){s.default.setBarColor(!0),uni.pageScrollTo({scrollTop:0,duration:0})},methods:{editAddressTap:function(t){uni.navigateTo({url:"/pages/my/add-address?id="+t.id})},AddAddressTap:function(){uni.navigateTo({url:"/pages/my/add-address"})},selectAddressTap:function(t){if(this.fromOrder){var e=getCurrentPages();e[e.length-2]&&e[e.length-2].$vm.setAddress&&(e[e.length-2].$vm.setAddress(t.currentTarget.dataset.item),uni.navigateBack({delta:1}))}},getList:function(){var t=this;this.reqByuser({url:"?l=address.list",data:{},success:function(e){1==e.data.status?t.addressList=e.data.data:uni.showToast({icon:"error",title:"加载失败"})}})},setDefaultAddress:function(t){var e=this,i=t.currentTarget.dataset.item,a=i.id,n=i.province_id,s=i.city_id,r=i.county_id,o=i.address,d=i.name,c=i.phone,u={id:a,province:n,city:s,county:r,address:o,name:d,phone:c,type:1};this.reqByuser({url:"?l=address.up",data:u,success:function(t){1==t.data.status&&(uni.showToast({icon:"success",title:"更新成功"}),e.getList())}})},deleteAddress:function(t){var e=this;uni.showModal({title:"提醒",content:"确定要删除吗?",success:function(i){i.confirm&&e.reqByuser({url:"?l=address.delete",data:{id:t.id},success:function(t){1==t.data.status&&(uni.showToast({icon:"success",title:"删除成功"}),e.getList())}})}})}}};e.default=r},"0d511":function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("c975");var a={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(t){uni.setNavigationBarTitle({title:t})}}};e.default=a},"11e4":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 i("v-uni-view",[i("bar-title",{attrs:{bgColor:"bg-white",isBack:!0}},[i("template",{attrs:{slot:"content"},slot:"content"},[t._v("我的地址")])],2),t._l(t.addressList,(function(e){return i("v-uni-view",{key:e.id,staticClass:"bg-white zaiui-address-card-view"},[i("v-uni-view",{staticClass:"flex text-black text-lg",attrs:{"data-item":e},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.selectAddressTap.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"flex-sub text-left"},[t._v(t._s(e.name))]),i("v-uni-view",{staticClass:"flex-sub text-right"},[t._v(t._s(e.phone))])],1),i("v-uni-view",{staticClass:"margin-tb-sm text-gray",attrs:{"data-item":e},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.selectAddressTap.apply(void 0,arguments)}}},[t._v(t._s(e.area_string)+" "+t._s(e.address))]),i("v-uni-view",{staticClass:"zaiui-line-view"}),i("v-uni-view",{staticClass:"zaiui-right-view"},[i("v-uni-text",[i("v-uni-checkbox",{staticClass:"round red sm zaiui-checked",class:1==e.type?"checked":"",staticStyle:{transform:"scale(0.7)"},attrs:{checked:1==e.type,"data-item":e},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.setDefaultAddress.apply(void 0,arguments)}}}),i("v-uni-text",[t._v("设为默认")])],1),i("v-uni-text",{staticClass:"cuIcon-write",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.editAddressTap(e)}}},[t._v("编辑")]),i("v-uni-text",{staticClass:"cuIcon-delete",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.deleteAddress(e)}}},[t._v("删除")])],1)],1)})),i("v-uni-view",{staticClass:"bg-white wecanui-footer-fixed foot-pb"},[i("v-uni-view",{staticClass:"flex flex-direction"},[i("v-uni-button",{staticClass:"cu-btn bg-red",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.AddAddressTap.apply(void 0,arguments)}}},[t._v("添加新地址")])],1)],1)],2)},n=[]},1814:function(t,e,i){"use strict";i.r(e);var a=i("11e4"),n=i("ac98");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("595e");var r=i("f0c5"),o=Object(r["a"])(n["default"],a["b"],a["c"],!1,null,"4fde8791",null,!1,a["a"],void 0);e["default"]=o.exports},"595e":function(t,e,i){"use strict";var a=i("e474"),n=i.n(a);n.a},"5a30":function(t,e,i){var a=i("7ed5");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("4f06").default;n("e9abf2d4",a,!0,{sourceMap:!1,shadowMode:!1})},6675:function(t,e,i){"use strict";var a=i("5a30"),n=i.n(a);n.a},"713c":function(t,e,i){"use strict";i.r(e);var a=i("e88e"),n=i("df75a");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("6675");var r=i("f0c5"),o=Object(r["a"])(n["default"],a["b"],a["c"],!1,null,"1b7fdbfe",null,!1,a["a"],void 0);e["default"]=o.exports},"7ed5":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.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?%)}",""]),t.exports=e},ac98:function(t,e,i){"use strict";i.r(e);var a=i("0c73"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);e["default"]=n.a},b27f:function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("a9e3"),i("d401"),i("d3b7"),i("25f0"),i("e25e"),i("c975"),i("ac1f"),i("5319");var a={strLeng:function(t){if(t){for(var e=t.length,i=0,a=0;a<e;a++)t.charCodeAt(a)>128?i+=2:i+=1;return i}return 0},getPageNum:function(t,e){var i=Number(t)/Number(e);if(i%1!==0){var a=i.toString(),n=parseInt(a.substring(0,a.indexOf("."))),s=a.replace(/\d+\.(\d*)/,"$1");s>0&&(i=n+1)}return i},setBarColor:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t?uni.setNavigationBarColor({frontColor:"#000000",backgroundColor:"#FAFAFA"}):uni.setNavigationBarColor({frontColor:"#ffffff",backgroundColor:"#FAFAFA"})},zaiui_log:function(t){}},n=a;e.default=n},b6c8:function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,".zaiui-address-card-view[data-v-4fde8791]{position:relative;margin:%?36.36?% %?27.27?%;border-radius:%?10.9?%;padding:%?18.18?%}.zaiui-address-card-view .zaiui-line-view[data-v-4fde8791]{position:relative;background:#f9f9f9;margin-bottom:%?20?%;height:%?2?%}.zaiui-address-card-view .zaiui-right-view[data-v-4fde8791]{position:relative;text-align:right}.zaiui-address-card-view .zaiui-right-view uni-text[data-v-4fde8791]:before{margin-right:5px}.zaiui-address-card-view .zaiui-right-view uni-text + uni-text[data-v-4fde8791]{margin-left:20px}.wecanui-footer-fixed .flex-direction[data-v-4fde8791]{padding:%?18.18?%}",""]),t.exports=e},df75a:function(t,e,i){"use strict";i.r(e);var a=i("0d511"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);e["default"]=n.a},e474:function(t,e,i){var a=i("b6c8");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("4f06").default;n("34fe09ae",a,!0,{sourceMap:!1,shadowMode:!1})},e88e: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 i("v-uni-view",{staticClass:"zaiui-bar-title-box",style:t.isWechatBrowser?"display: none;":""},[i("v-uni-view",{staticClass:"cu-bar",class:[t.fixed?"fixed":"",t.shadow?"":"no-shadow",t.bgColor]},[t.isBack?i("v-uni-view",{staticClass:"action",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.BackPage.apply(void 0,arguments)}}},[i("v-uni-text",{staticClass:"cuIcon-back"}),i("v-uni-text",[t._v(t._s(t.backText))])],1):t._e(),t.isBack?t._e():i("v-uni-view",{staticClass:"action",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.leftTap.apply(void 0,arguments)}}},[t._t("left")],2),i("v-uni-view",{staticClass:"content",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.contentTap.apply(void 0,arguments)}}},[t._t("content")],2),i("v-uni-view",{staticClass:"action",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.rightTap.apply(void 0,arguments)}}},[t._t("right")],2)],1),t.fixed?i("v-uni-view",{staticClass:"zaiui-seat-height"}):t._e()],1)},n=[]}}]);