billDetail.js
5.82 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
"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: {
messageObj: {}
},
detail: {}
});
const {
form,
detail
} = 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.getRoomBilldetailbyId(orderId).then((res) => {
form.value = res.data;
form.value.messageObj = JSON.parse(form.value.message);
});
}
function unsubscribe() {
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
});
}
});
}
}
});
}
function cancel() {
common_vendor.index.showModal({
title: "提示",
content: " 确定取消订单吗?",
showCancel: true,
success: function(res) {
if (res.confirm) {
common_vendor.index.showLoading({
title: "操作中..."
});
common_hotel.cancelOrder2(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) => {
var _a, _b, _c;
return common_vendor.e({
a: common_vendor.t(common_vendor.unref(detail).name),
b: common_vendor.t(common_vendor.unref(form).address),
c: common_vendor.t((_a = common_vendor.unref(detail).messageObj) == null ? void 0 : _a.roomName),
d: common_vendor.t(common_vendor.unref(detail).messageObj.roomInfo),
e: common_vendor.t((_b = common_vendor.unref(form).messageObj) == null ? void 0 : _b.roomStayDate),
f: common_vendor.p({
label: "入住时间"
}),
g: common_vendor.t(common_vendor.unref(form).roomNum),
h: common_vendor.p({
label: "房间数"
}),
i: common_vendor.f((_c = common_vendor.unref(form).rzUsers) == null ? void 0 : _c.split(","), (n, index, i0) => {
return {
a: common_vendor.t(n),
b: "f806955c-3-" + i0 + ",f806955c-0",
c: common_vendor.p({
label: `入住人${index + 1}`
}),
d: index
};
}),
j: common_vendor.t(common_vendor.unref(form).ddDate),
k: common_vendor.p({
label: "预计到店"
}),
l: common_vendor.t(common_vendor.unref(form).phone),
m: common_vendor.p({
label: "联系电话"
}),
n: common_vendor.unref(form).addNum > 0
}, common_vendor.unref(form).addNum > 0 ? {
o: common_vendor.t(common_vendor.unref(form).addNum),
p: common_vendor.p({
label: "加床张数"
})
} : {}, {
q: common_vendor.t(common_vendor.unref(detail).total),
r: common_vendor.unref(form).viewStatus == "5"
}, common_vendor.unref(form).viewStatus == "5" ? {
s: common_vendor.o(unsubscribe)
} : common_vendor.unref(form).viewStatus == "4" ? {} : common_vendor.unref(form).viewStatus == "2" ? {} : common_vendor.unref(form).viewStatus == "7" ? {} : common_vendor.unref(form).viewStatus == "0" ? {
y: common_vendor.o(cancel)
} : {}, {
t: common_vendor.unref(form).viewStatus == "4",
v: common_vendor.unref(form).viewStatus == "2",
w: common_vendor.unref(form).viewStatus == "7",
x: common_vendor.unref(form).viewStatus == "0"
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f806955c"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/billDetail.vue"]]);
wx.createPage(MiniProgramPage);