2024-04-26 18:04:56 +08:00
|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../../common/vendor.js");
|
2024-04-27 18:02:43 +08:00
|
|
|
const common_assets = require("../../common/assets.js");
|
|
|
|
const dict_cancelDict = require("../../dict/cancelDict.js");
|
2024-05-06 10:11:25 +08:00
|
|
|
const api_order = require("../../api/order.js");
|
2024-04-30 16:24:55 +08:00
|
|
|
require("../../utils/request.js");
|
|
|
|
require("../../config/app.js");
|
|
|
|
require("../../store/user.js");
|
2024-04-26 18:04:56 +08:00
|
|
|
if (!Array) {
|
|
|
|
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
|
|
|
const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
|
2024-05-06 10:11:25 +08:00
|
|
|
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
|
2024-04-27 18:02:43 +08:00
|
|
|
const _easycom_up_copy2 = common_vendor.resolveComponent("up-copy");
|
2024-04-26 18:04:56 +08:00
|
|
|
const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
|
2024-05-06 10:11:25 +08:00
|
|
|
(_easycom_up_icon2 + _easycom_up_button2 + _easycom_up_image2 + _easycom_up_copy2 + _easycom_up_popup2)();
|
2024-04-26 18:04:56 +08:00
|
|
|
}
|
|
|
|
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";
|
2024-05-06 10:11:25 +08:00
|
|
|
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
|
2024-04-27 18:02:43 +08:00
|
|
|
const _easycom_up_copy = () => "../../uni_modules/uview-plus/components/u-copy/u-copy.js";
|
2024-04-26 18:04:56 +08:00
|
|
|
const _easycom_up_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
|
|
|
if (!Math) {
|
2024-05-06 10:11:25 +08:00
|
|
|
(_easycom_up_icon + _easycom_up_button + _easycom_up_image + _easycom_up_copy + _easycom_up_popup + addressPopup + modal)();
|
2024-04-26 18:04:56 +08:00
|
|
|
}
|
2024-04-27 18:02:43 +08:00
|
|
|
const addressPopup = () => "../../components/addressPopup.js";
|
|
|
|
const modal = () => "../../components/modal.js";
|
2024-04-26 18:04:56 +08:00
|
|
|
const _sfc_main = {
|
|
|
|
__name: "detail",
|
|
|
|
setup(__props) {
|
|
|
|
const showCancel = common_vendor.ref(false);
|
2024-04-27 18:02:43 +08:00
|
|
|
const showAddress = common_vendor.ref(false);
|
|
|
|
const cancelType = common_vendor.ref(-1);
|
|
|
|
const submitCancel = () => {
|
|
|
|
showCancel.value = false;
|
|
|
|
console.log(cancelType.value);
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "取消成功",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
};
|
|
|
|
const changeAddress = (e) => {
|
|
|
|
showAddress.value = false;
|
|
|
|
console.log(e);
|
|
|
|
};
|
2024-05-06 10:11:25 +08:00
|
|
|
const datas = common_vendor.ref({});
|
|
|
|
const getDetails = () => {
|
|
|
|
api_order.orderDetailApi({
|
|
|
|
order_id: datas.value.id
|
|
|
|
}).then((res) => {
|
|
|
|
datas.value = res.data;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
const c_price = (price, index = 0) => {
|
|
|
|
price = price + "";
|
|
|
|
return price.split(".")[index] || (index ? "00" : "0");
|
|
|
|
};
|
2024-04-26 18:04:56 +08:00
|
|
|
common_vendor.onLoad((option) => {
|
|
|
|
common_vendor.index.setNavigationBarTitle({
|
|
|
|
title: option.type == 1 ? "等待付款" : "订单详情"
|
|
|
|
});
|
2024-05-06 10:11:25 +08:00
|
|
|
if (option.id) {
|
|
|
|
datas.value.id = option.id;
|
|
|
|
getDetails();
|
|
|
|
}
|
2024-04-26 18:04:56 +08:00
|
|
|
});
|
|
|
|
return (_ctx, _cache) => {
|
2024-05-06 10:11:25 +08:00
|
|
|
return common_vendor.e({
|
2024-04-26 18:04:56 +08:00
|
|
|
a: common_vendor.p({
|
|
|
|
name: "map"
|
|
|
|
}),
|
2024-04-27 18:02:43 +08:00
|
|
|
b: common_vendor.o(($event) => showAddress.value = true),
|
|
|
|
c: common_vendor.p({
|
2024-04-26 18:04:56 +08:00
|
|
|
size: "small",
|
|
|
|
shape: "circle",
|
|
|
|
color: "#f6f6f6",
|
|
|
|
customStyle: {
|
|
|
|
color: "#666666"
|
|
|
|
}
|
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
d: common_vendor.f(datas.value.goods_list, (item, index, i0) => {
|
|
|
|
return {
|
|
|
|
a: "666b5ad0-2-" + i0,
|
|
|
|
b: common_vendor.p({
|
|
|
|
src: item.imgs,
|
|
|
|
width: "160rpx",
|
|
|
|
height: "160rpx"
|
|
|
|
}),
|
|
|
|
c: common_vendor.t(item.class_name),
|
|
|
|
d: common_vendor.t(item.sell),
|
|
|
|
e: common_vendor.t(item.nums)
|
|
|
|
};
|
2024-04-27 18:02:43 +08:00
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
e: datas.value.goods_list
|
|
|
|
}, datas.value.goods_list ? {
|
|
|
|
f: common_vendor.t(datas.value.goods_list.length),
|
|
|
|
g: common_vendor.t(c_price(datas.value.total, 0)),
|
|
|
|
h: common_vendor.t(c_price(datas.value.total, 1))
|
|
|
|
} : {}, {
|
|
|
|
i: common_vendor.t(c_price(datas.value.total, 0)),
|
|
|
|
j: common_vendor.t(c_price(datas.value.total, 1)),
|
|
|
|
k: common_vendor.t(datas.value.number),
|
|
|
|
l: common_vendor.p({
|
|
|
|
content: datas.value.number
|
|
|
|
}),
|
|
|
|
m: common_vendor.t(datas.value.create_time),
|
|
|
|
n: datas.value.paid
|
|
|
|
}, datas.value.paid ? {} : {}, {
|
|
|
|
o: common_vendor.o(($event) => showCancel.value = true),
|
|
|
|
p: common_vendor.t(datas.value.total),
|
|
|
|
q: common_vendor.p({
|
2024-04-26 18:04:56 +08:00
|
|
|
color: "#20B128",
|
|
|
|
shape: "circle"
|
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
r: common_vendor.f(common_vendor.unref(dict_cancelDict.list), (item, index, i0) => {
|
2024-04-27 18:02:43 +08:00
|
|
|
return common_vendor.e({
|
|
|
|
a: common_vendor.t(item.name),
|
|
|
|
b: cancelType.value == item.value
|
|
|
|
}, cancelType.value == item.value ? {
|
2024-04-30 18:08:36 +08:00
|
|
|
c: common_assets._imports_0
|
2024-04-27 18:02:43 +08:00
|
|
|
} : {
|
2024-04-30 18:08:36 +08:00
|
|
|
d: common_assets._imports_1
|
2024-04-27 18:02:43 +08:00
|
|
|
}, {
|
|
|
|
e: item.value,
|
|
|
|
f: common_vendor.o(($event) => cancelType.value = item.value, item.value)
|
|
|
|
});
|
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
s: common_vendor.o(submitCancel),
|
|
|
|
t: common_vendor.p({
|
2024-04-27 18:02:43 +08:00
|
|
|
color: "#20B128",
|
|
|
|
shape: "circle"
|
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
v: common_vendor.o(($event) => showCancel.value = false),
|
|
|
|
w: common_vendor.p({
|
2024-04-26 18:04:56 +08:00
|
|
|
show: showCancel.value,
|
|
|
|
closeable: true,
|
|
|
|
round: "10"
|
2024-04-27 18:02:43 +08:00
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
x: common_vendor.o(($event) => showAddress.value = false),
|
|
|
|
y: common_vendor.o(changeAddress),
|
|
|
|
z: common_vendor.p({
|
2024-04-27 18:02:43 +08:00
|
|
|
show: showAddress.value
|
|
|
|
}),
|
2024-05-06 10:11:25 +08:00
|
|
|
A: common_vendor.p({
|
2024-04-27 18:02:43 +08:00
|
|
|
show: false,
|
|
|
|
content: "您还没有添加收货地址,请点击添加"
|
2024-04-26 18:04:56 +08:00
|
|
|
})
|
2024-05-06 10:11:25 +08:00
|
|
|
});
|
2024-04-26 18:04:56 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/里海数字乡村/purchase-let/pagesOrder/detail/detail.vue"]]);
|
|
|
|
wx.createPage(MiniProgramPage);
|