purchase-let/unpackage/dist/dev/mp-weixin/pagesOrder/addressList/addressList.js

86 lines
2.9 KiB
JavaScript
Raw Normal View History

2024-04-27 18:02:43 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
2024-04-28 18:08:57 +08:00
const api_user = require("../../api/user.js");
require("../../utils/request.js");
require("../../config/app.js");
require("../../store/user.js");
2024-04-27 18:02:43 +08:00
if (!Array) {
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
(_easycom_up_icon2 + _easycom_up_button2)();
}
const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
const _easycom_up_button = () => "../../uni_modules/uview-plus/components/u-button/u-button.js";
if (!Math) {
(_easycom_up_icon + _easycom_up_button + modal)();
}
const modal = () => "../../components/modal.js";
const _sfc_main = {
__name: "addressList",
setup(__props) {
const navTo = (url) => {
common_vendor.index.navigateTo({
url
});
};
const show = common_vendor.ref(false);
const deleteInfo = common_vendor.ref({});
const showDelete = (item) => {
deleteInfo.value = item;
show.value = true;
};
const deleteAddress = () => {
console.log(deleteInfo.value);
show.value = false;
};
2024-04-28 18:08:57 +08:00
const addressList = common_vendor.ref([]);
const getAddressLists = () => {
api_user.addressListsApi().then((res) => {
addressList.value = res.data.lists;
console.log(addressList);
});
};
getAddressLists();
2024-04-27 18:02:43 +08:00
return (_ctx, _cache) => {
return {
2024-04-28 18:08:57 +08:00
a: common_vendor.f(addressList.value, (item, index, i0) => {
2024-04-27 18:02:43 +08:00
return common_vendor.e({
2024-04-28 18:08:57 +08:00
a: common_vendor.t(item.real_name),
b: common_vendor.t(item.phone),
c: common_vendor.t(item.detail)
}, {
e: common_assets._imports_1
2024-04-27 18:02:43 +08:00
}, {
2024-04-28 18:08:57 +08:00
f: "5e66515e-0-" + i0,
g: common_vendor.o(($event) => showDelete(item), index),
h: "5e66515e-1-" + i0,
i: common_vendor.o(($event) => navTo("/pagesOrder/addressEdit/addressEdit?mode=edit"), index),
j: index
2024-04-27 18:02:43 +08:00
});
}),
b: common_vendor.p({
name: "trash"
}),
c: common_vendor.p({
name: "edit-pen"
}),
d: common_vendor.o(($event) => navTo("/pagesOrder/addressEdit/addressEdit")),
e: common_vendor.p({
color: "#20B128",
shape: "circle"
}),
f: common_vendor.o(($event) => show.value = false),
g: common_vendor.o(deleteAddress),
h: common_vendor.p({
show: show.value,
title: "确认删除吗",
content: "删除后不可恢复"
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/里海数字乡村/purchase-let/pagesOrder/addressList/addressList.vue"]]);
wx.createPage(MiniProgramPage);