"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
if (!Array) {
|
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
_easycom_uni_popup2();
|
}
|
const _easycom_uni_popup = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.js";
|
if (!Math) {
|
_easycom_uni_popup();
|
}
|
const _sfc_main = {
|
__name: "invoice",
|
setup(__props) {
|
const invoice = common_vendor.ref({
|
code: "044031900111",
|
number: "37164339",
|
date: "2024-03-25",
|
amount: 360,
|
title: "个人",
|
taxNumber: "-",
|
issuer: "青岛镜湖医院",
|
hospitalName: "青岛镜湖医院",
|
patientName: "张三",
|
departmentName: "心内科",
|
orderNo: "P202403250001",
|
qrCode: "/static/payment/invoice-qr.png",
|
previewImage: "/static/payment/invoice-preview.png"
|
});
|
const copyText = (text) => {
|
common_vendor.index.setClipboardData({
|
data: text,
|
success: () => {
|
common_vendor.index.showToast({
|
title: "复制成功",
|
icon: "success"
|
});
|
}
|
});
|
};
|
const shareInvoice = () => {
|
common_vendor.index.share({
|
provider: "weixin",
|
scene: "WXSceneSession",
|
type: 2,
|
imageUrl: invoice.value.qrCode,
|
success: (res) => {
|
common_vendor.index.__f__("log", "at pages/payment/invoice.vue:204", "分享成功:", res);
|
},
|
fail: (err) => {
|
common_vendor.index.__f__("error", "at pages/payment/invoice.vue:207", "分享失败:", err);
|
}
|
});
|
};
|
const previewPopup = common_vendor.ref(null);
|
const showPreview = () => {
|
var _a;
|
(_a = previewPopup.value) == null ? void 0 : _a.open();
|
};
|
const closePreview = () => {
|
var _a;
|
(_a = previewPopup.value) == null ? void 0 : _a.close();
|
};
|
const previewFullImage = () => {
|
common_vendor.index.previewImage({
|
urls: [invoice.value.previewImage]
|
});
|
};
|
const printPopup = common_vendor.ref(null);
|
const printCount = common_vendor.ref(1);
|
const colorOptions = [
|
{ label: "彩色", value: "color" },
|
{ label: "黑白", value: "bw" }
|
];
|
const printColor = common_vendor.ref("color");
|
const showPrint = () => {
|
var _a;
|
(_a = printPopup.value) == null ? void 0 : _a.open();
|
};
|
const closePrint = () => {
|
var _a;
|
(_a = printPopup.value) == null ? void 0 : _a.close();
|
};
|
const confirmPrint = () => {
|
common_vendor.index.showLoading({
|
title: "打印中..."
|
});
|
const params = {
|
invoiceId: invoice.value.id,
|
count: printCount.value,
|
color: printColor.value
|
};
|
common_vendor.index.__f__("log", "at pages/payment/invoice.vue:252", "打印参数:", params);
|
setTimeout(() => {
|
common_vendor.index.hideLoading();
|
common_vendor.index.showToast({
|
title: "打印成功",
|
icon: "success"
|
});
|
closePrint();
|
}, 2e3);
|
};
|
common_vendor.onMounted(() => {
|
var _a, _b;
|
const pages = getCurrentPages();
|
const page = pages[pages.length - 1];
|
const id = (_b = (_a = page.$page) == null ? void 0 : _a.options) == null ? void 0 : _b.id;
|
loadInvoice(id);
|
});
|
const loadInvoice = (id) => {
|
common_vendor.index.__f__("log", "at pages/payment/invoice.vue:276", "加载发票:", id);
|
};
|
return (_ctx, _cache) => {
|
return {
|
a: invoice.value.qrCode,
|
b: common_vendor.t(invoice.value.code),
|
c: common_vendor.o(($event) => copyText(invoice.value.code)),
|
d: common_vendor.t(invoice.value.number),
|
e: common_vendor.o(($event) => copyText(invoice.value.number)),
|
f: common_vendor.t(invoice.value.date),
|
g: common_vendor.t(invoice.value.amount),
|
h: common_vendor.t(invoice.value.title),
|
i: common_vendor.t(invoice.value.taxNumber),
|
j: common_vendor.t(invoice.value.issuer),
|
k: common_vendor.t(invoice.value.hospitalName),
|
l: common_vendor.t(invoice.value.patientName),
|
m: common_vendor.t(invoice.value.departmentName),
|
n: common_vendor.t(invoice.value.orderNo),
|
o: common_vendor.o(closePreview),
|
p: invoice.value.previewImage,
|
q: common_vendor.o(previewFullImage),
|
r: common_vendor.sr(previewPopup, "7d4b6442-0", {
|
"k": "previewPopup"
|
}),
|
s: common_vendor.p({
|
type: "center"
|
}),
|
t: common_vendor.o(closePrint),
|
v: printCount.value <= 1 ? 1 : "",
|
w: common_vendor.o(($event) => printCount.value > 1 && printCount.value--),
|
x: common_vendor.t(printCount.value),
|
y: printCount.value >= 5 ? 1 : "",
|
z: common_vendor.o(($event) => printCount.value < 5 && printCount.value++),
|
A: common_vendor.f(colorOptions, (option, k0, i0) => {
|
return {
|
a: common_vendor.t(option.label),
|
b: option.value,
|
c: printColor.value === option.value ? 1 : "",
|
d: common_vendor.o(($event) => printColor.value = option.value, option.value)
|
};
|
}),
|
B: common_vendor.o(confirmPrint),
|
C: common_vendor.sr(printPopup, "7d4b6442-1", {
|
"k": "printPopup"
|
}),
|
D: common_vendor.p({
|
type: "bottom"
|
}),
|
E: common_vendor.o(showPreview),
|
F: common_vendor.o(showPrint),
|
G: common_vendor.o(shareInvoice),
|
H: common_vendor.gei(_ctx, "")
|
};
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/payment/invoice.js.map
|