"use strict";var e=require("../common/vendor.js"),l=require("../api/userAddress.js");require("../common/request.js");const u={data(){return{address:[]}},onLoad(){var s=this;e.index.$on("refreshAddress",()=>{s.getAddressList()})},onShow(){this.getAddressList()},methods:{selectAddress(s){e.index.$emit("updateAddress",s),e.index.navigateBack({delta:1})},editAddress(s){e.index.navigateTo({url:"./addEditAddress?type=edit&addressId="+s.addressId})},delAddress(s){e.index.showModal({title:"\u63D0\u793A",content:"\u786E\u8BA4\u5220\u9664\u6B64\u5730\u5740\u5417?",showCancel:!0,cancelText:"\u53D6\u6D88",confirmText:"\u786E\u5B9A",success:n=>{if(n.confirm){var i={addressId:s.addressId};l.delAddress(i).then(t=>{t.code==200?(e.index.showToast({icon:"success",title:"\u64CD\u4F5C\u6210\u529F"}),this.getAddressList()):e.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"})},t=>{})}}})},getAddressList(){l.getAddressList().then(s=>{s.code==200?this.address=s.data:e.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"})},s=>{})},addAddress(){e.index.navigateTo({url:"./addEditAddress?type=add"})}}};function h(s,n,i,t,a,r){return e.e({a:e.f(a.address,(d,o,v)=>e.e({a:d.isDefault==1},d.isDefault==1?{}:{},{b:e.t(d.province),c:e.t(d.city),d:e.t(d.district),e:e.t(d.detail),f:e.t(d.realName),g:e.t(s.$parsePhone(d.phone)),h:e.o(c=>r.delAddress(d)),i:e.o(c=>r.editAddress(d)),j:o,k:e.o(c=>r.selectAddress(d),o)})),b:a.address.length==0},a.address.length==0?{c:e.o(d=>r.getAddressList())}:{},{d:e.o(d=>r.addAddress())})}var A=e._export_sfc(u,[["render",h],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/address.vue"]]);wx.createPage(A);
