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

211 lines
7.4 KiB
JavaScript
Raw Normal View History

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-05-06 14:54:47 +08:00
const rePay = () => {
api_order.rePaymentApi({
order_id: datas.value.id,
pay_type: 1
}).then((res) => {
console.log(res);
});
};
2024-05-06 14:26:18 +08:00
let timer = null;
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
});
2024-05-06 14:26:18 +08:00
common_vendor.onBackPress(() => {
clearInterval(timer);
console.log("清除");
});
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-05-06 14:26:18 +08:00
b: datas.value.paid == 0
}, datas.value.paid == 0 ? {
c: common_vendor.o(($event) => showAddress.value = true),
d: common_vendor.p({
2024-04-26 18:04:56 +08:00
size: "small",
shape: "circle",
color: "#f6f6f6",
customStyle: {
color: "#666666"
}
2024-05-06 14:26:18 +08:00
})
} : {}, {
e: common_vendor.f(datas.value.goods_list, (item, index, i0) => {
2024-05-06 10:11:25 +08:00
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),
2024-05-06 14:54:47 +08:00
e: common_vendor.t(item.goods_unit),
f: common_vendor.t(item.nums),
g: common_vendor.t(item.msg)
2024-05-06 10:11:25 +08:00
};
2024-04-27 18:02:43 +08:00
}),
2024-05-06 14:26:18 +08:00
f: datas.value.paid == 0
}, datas.value.paid == 0 ? common_vendor.e({
g: datas.value.goods_list
2024-05-06 10:11:25 +08:00
}, datas.value.goods_list ? {
2024-05-06 14:26:18 +08:00
h: common_vendor.t(datas.value.goods_list.length),
2024-05-06 10:11:25 +08:00
i: common_vendor.t(c_price(datas.value.total, 0)),
2024-05-06 14:26:18 +08:00
j: common_vendor.t(c_price(datas.value.total, 1))
} : {}, {
k: common_vendor.t(c_price(datas.value.total, 0)),
l: common_vendor.t(c_price(datas.value.total, 1))
}) : {}, {
m: datas.value.paid == 0
}, datas.value.paid == 0 ? common_vendor.e({
n: common_vendor.t(datas.value.number),
o: common_vendor.p({
2024-05-06 10:11:25 +08:00
content: datas.value.number
}),
2024-05-06 14:26:18 +08:00
p: common_vendor.t(datas.value.create_time),
q: datas.value.paid
}, datas.value.paid ? {} : {}) : common_vendor.e({
r: datas.value.goods_list
}, datas.value.goods_list ? {
s: common_vendor.t(c_price(datas.value.total, 0)),
t: common_vendor.t(c_price(datas.value.total, 1))
} : {}, {
v: common_vendor.t(datas.value.number),
w: common_vendor.p({
content: datas.value.number
}),
x: common_vendor.t(datas.value.pay_type == 3 ? "余额支付" : "微信支付"),
y: common_vendor.t(datas.value.create_time),
z: datas.value.paid
}, datas.value.paid ? {} : {}), {
2024-05-06 14:54:47 +08:00
A: datas.value.number
}, datas.value.number ? common_vendor.e({
B: !datas.value.paid
}, !datas.value.paid ? {
C: common_vendor.o(($event) => showCancel.value = true),
D: common_vendor.t(datas.value.total),
E: common_vendor.o(rePay),
F: common_vendor.p({
2024-04-26 18:04:56 +08:00
color: "#20B128",
shape: "circle"
2024-05-06 14:54:47 +08:00
})
} : common_vendor.e({
G: datas.value.status == 0 || datas.value.status == 1
}, datas.value.status == 0 || datas.value.status == 1 ? {
H: common_vendor.o(() => {
2024-04-26 18:04:56 +08:00
}),
2024-05-06 14:54:47 +08:00
I: common_vendor.p({
color: "#20B128",
shape: "circle"
})
} : {
J: common_vendor.o(() => {
}),
K: common_vendor.p({
color: "#20B128",
shape: "circle"
})
})) : {}, {
L: 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 14:54:47 +08:00
M: common_vendor.o(submitCancel),
N: common_vendor.p({
2024-04-27 18:02:43 +08:00
color: "#20B128",
shape: "circle"
}),
2024-05-06 14:54:47 +08:00
O: common_vendor.o(($event) => showCancel.value = false),
P: 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 14:54:47 +08:00
Q: common_vendor.o(($event) => showAddress.value = false),
R: common_vendor.o(changeAddress),
S: common_vendor.p({
2024-04-27 18:02:43 +08:00
show: showAddress.value
}),
2024-05-06 14:54:47 +08:00
T: 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);