hotelDetail.js
3.64 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
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const common_hotel = require("../../common/hotel.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
const _sfc_main = {
__name: "hotelDetail",
setup(__props) {
const data = common_vendor.reactive({
form: {},
startlist: ["零星", " 一星", "二星", " 三星", "四星", "五星", "六星", "七星"],
roomList: []
});
const {
form,
startlist,
roomList
} = common_vendor.toRefs(data);
let hotelId = null;
let foundRoomId = null;
common_vendor.onLoad((option) => {
console.log(option);
hotelId = option.hotelId;
foundRoomId = option.id;
});
common_vendor.onShow(() => {
getData();
});
function getData() {
common_hotel.getHotelById(hotelId).then((res) => {
form.value = res.data;
});
common_hotel.getHotelRooms(foundRoomId).then((res) => {
roomList.value = res.rows;
});
}
function goOrder(r) {
const room = encodeURIComponent(JSON.stringify(r));
let path = `/pages_hotel/hotel/order?room=${room}&hotelName=${form.value.name}&checkInTime=${form.value.checkInTime}`;
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
var _a, _b;
return {
a: common_vendor.f((_a = common_vendor.unref(form).photos) == null ? void 0 : _a.split(","), (pic, index, i0) => {
return {
a: pic,
b: index
};
}),
b: _ctx.indicatorDots,
c: _ctx.autoplay,
d: _ctx.interval,
e: _ctx.duration,
f: common_assets._imports_0$3,
g: common_vendor.t(common_vendor.unref(startlist)[common_vendor.unref(form).starLevel]),
h: common_vendor.t(common_vendor.unref(form).name),
i: common_vendor.f((_b = common_vendor.unref(form).label) == null ? void 0 : _b.replace(/,/g, ",").split(","), (tag, k0, i0) => {
return {
a: common_vendor.t(tag),
b: tag
};
}),
j: common_assets._imports_1$1,
k: common_vendor.t(common_vendor.unref(form).checkInTime),
l: common_vendor.t(common_vendor.unref(form).checkOutTime),
m: common_assets._imports_0$2,
n: common_vendor.t(common_vendor.unref(form).addName),
o: common_assets._imports_1$2,
p: common_vendor.unref(form).introduction,
q: common_vendor.t(common_vendor.unref(form).remarks),
r: common_vendor.unref(form).remarks,
s: common_vendor.f(common_vendor.unref(roomList), (r, k0, i0) => {
return common_vendor.e({
a: r.photo,
b: common_vendor.t(r.roomType),
c: common_vendor.t(r.bedType),
d: common_vendor.t(r.area),
e: r.windowFlag == 1,
f: r.windowFlag == 0,
g: r.bathroomFlag == 1,
h: r.addBedFlag == 1,
i: r.breakfastNum && r.breakfastNum > "0"
}, r.breakfastNum && r.breakfastNum > "0" ? {
j: common_vendor.t(r.breakfastNum)
} : {}, {
k: common_vendor.t(r.roomPrice),
l: common_vendor.o(($event) => goOrder(r), r.id),
m: r.id
});
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-114df8e7"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/hotelDetail.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);