index.js
4.92 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
"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_search_bar2 = common_vendor.resolveComponent("uni-search-bar");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uni_search_bar2 + _easycom_uni_icons2 + _easycom_uni_popup2)();
}
const _easycom_uni_search_bar = () => "../../uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uni_search_bar + _easycom_uni_icons + _easycom_uni_popup)();
}
const _sfc_main = {
__name: "index",
setup(__props) {
const data = common_vendor.reactive({
form: {},
restaurantList: [],
detailPopup: null,
restaurantInfo: {},
queryParam: {
name: ""
}
});
const {
form,
startlist,
restaurantList,
detailPopup,
restaurantInfo,
queryParam
} = common_vendor.toRefs(data);
let activeId = null;
common_vendor.onLoad((option) => {
console.log(option);
activeId = option.activeId;
});
common_vendor.onShow(() => {
getData();
});
function getData() {
common_vendor.index.showLoading({
title: "加载中"
});
common_hotel.getActivityRestaurantList({
activityId: activeId,
name: queryParam.value.name
}).then((res) => {
restaurantList.value = res.rows;
for (const r of restaurantList.value) {
r.photosArr = r.photos.split(",");
}
common_vendor.index.hideLoading();
});
}
function goOrder(r) {
var obj = encodeURIComponent(JSON.stringify(r));
let path = `/pages_hotel/eat/menu?id=${r.id}&detail=${obj}&activeId=${activeId}`;
common_vendor.index.navigateTo({
url: path
});
}
function onclear() {
queryParam.value.name = "";
getData();
}
function clickImg() {
common_vendor.index.previewImage({
urls: restaurantInfo.value.photosArr,
// current: 0,
success: function(res) {
console.log("success", res);
},
fail: function(res) {
console.log("fail", res);
},
complete: function(res) {
console.log("complete", res);
}
});
}
return (_ctx, _cache) => {
var _a;
return common_vendor.e({
a: common_vendor.o(($event) => onclear()),
b: common_vendor.o(($event) => getData()),
c: common_vendor.o(($event) => common_vendor.unref(queryParam).name = $event),
d: common_vendor.p({
clearButton: "auto",
cancelButton: "none",
modelValue: common_vendor.unref(queryParam).name
}),
e: common_vendor.f(common_vendor.unref(restaurantList), (h, k0, i0) => {
return {
a: common_vendor.f(h.photosArr, (pic, index, i1) => {
return {
a: pic,
b: index
};
}),
b: common_vendor.t(h.name),
c: common_vendor.t(h.price || 0),
d: "634f1e9c-1-" + i0,
e: common_vendor.t(h.addName),
f: h.id,
g: common_vendor.o(($event) => goOrder(h), h.id)
};
}),
f: _ctx.indicatorDots,
g: _ctx.autoplay,
h: _ctx.interval,
i: _ctx.duration,
j: common_vendor.p({
type: "location",
size: "16"
}),
k: common_vendor.unref(restaurantList).length == 0
}, common_vendor.unref(restaurantList).length == 0 ? {} : {}, {
l: common_vendor.t(common_vendor.unref(restaurantInfo).name),
m: common_vendor.f(common_vendor.unref(restaurantInfo).photosArr, (p, index, i0) => {
return {
a: index,
b: p
};
}),
n: common_vendor.t((_a = common_vendor.unref(restaurantInfo).photosArr) == null ? void 0 : _a.length),
o: common_vendor.o(clickImg),
p: common_vendor.unref(restaurantInfo).photosArr,
q: common_vendor.unref(restaurantInfo).introduction,
r: common_vendor.sr(detailPopup, "634f1e9c-2", {
"k": "detailPopup"
}),
s: common_vendor.p({
["background-color"]: "#fff",
type: "bottom"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-634f1e9c"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/eat/index.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);