billDetail.js
4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_hotel = require("../../common/hotel.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
if (!Array) {
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
(_easycom_uni_forms_item2 + _easycom_uni_forms2)();
}
const _easycom_uni_forms_item = () => "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js";
const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-forms/uni-forms.js";
if (!Math) {
(_easycom_uni_forms_item + _easycom_uni_forms)();
}
const _sfc_main = {
__name: "billDetail",
setup(__props) {
const data = common_vendor.reactive({
form: {
extJsonObj: {},
messageObj: {
foodsList: []
}
},
detail: {}
});
const {
form,
detail,
extJsonObj
} = common_vendor.toRefs(data);
let orderId = "";
common_vendor.onLoad((options) => {
if ("detail" in options) {
detail.value = JSON.parse(decodeURIComponent(options.detail));
}
console.log(detail.value);
orderId = options.orderId;
init();
});
function init() {
getData();
}
function getData() {
common_hotel.getFoodBilldetailbyId(orderId).then((res) => {
form.value = res.data;
form.value.messageObj = JSON.parse(form.value.message);
form.value.extJsonObj = JSON.parse(form.value.extJson);
});
}
function cancel() {
common_vendor.index.showModal({
title: "提示",
content: " 确定退订吗?",
showCancel: true,
success: function(res) {
if (res.confirm) {
common_vendor.index.showLoading({
title: "退订中..."
});
common_hotel.cancelOrder(orderId).then((respon) => {
common_vendor.index.hideLoading();
if (respon.data) {
common_vendor.index.showToast({
title: "已退订",
icon: "none",
duration: 2e3
});
init();
} else {
common_vendor.index.showToast({
title: "退订失败,请稍候重试",
icon: "none",
duration: 2e3
});
}
});
}
}
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(common_vendor.unref(form).name),
b: common_vendor.t(common_vendor.unref(form).address),
c: common_vendor.f(common_vendor.unref(form).messageObj.foodsList, (m, index, i0) => {
return {
a: common_vendor.t(m.name),
b: common_vendor.t(m.categoryName),
c: m.num > 0,
d: common_vendor.t(m.num),
e: common_vendor.t(m.price),
f: m.num > 0,
g: index
};
}),
d: common_vendor.t(common_vendor.unref(common_vendor.dayjs)(common_vendor.unref(form).extJsonObj.dcStart).format("YYYY-MM-DD")),
e: common_vendor.t(common_vendor.unref(common_vendor.dayjs)(common_vendor.unref(form).extJsonObj.dcEnd).format("YYYY-MM-DD")),
f: common_vendor.p({
label: "订餐周期"
}),
g: common_vendor.t(common_vendor.unref(form).contacts),
h: common_vendor.p({
label: "联系人"
}),
i: common_vendor.t(common_vendor.unref(form).phone),
j: common_vendor.p({
label: "联系电话"
}),
k: common_vendor.t(common_vendor.unref(form).remarks),
l: common_vendor.p({
label: "备注"
}),
m: common_vendor.p({
["label-width"]: "80"
}),
n: common_vendor.t(common_vendor.unref(detail).total),
o: common_vendor.unref(form).viewStatus == "5"
}, common_vendor.unref(form).viewStatus == "5" ? {
p: common_vendor.o(cancel)
} : common_vendor.unref(form).viewStatus == "4" ? {} : common_vendor.unref(form).viewStatus == "2" ? {} : {}, {
q: common_vendor.unref(form).viewStatus == "4",
r: common_vendor.unref(form).viewStatus == "2"
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-54e33de0"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/eat/billDetail.vue"]]);
wx.createPage(MiniProgramPage);