index.js
2.57 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
"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: "index",
setup(__props) {
const app = getApp();
const data = common_vendor.reactive({
list: [],
queryParam: {},
autoplay: true
});
const { list, queryParam, autoplay } = common_vendor.toRefs(data);
common_vendor.onShow((option) => {
if (app.globalData.isLogin) {
getList();
} else {
app.firstLoadCallback = () => {
getList();
};
}
});
common_vendor.onPullDownRefresh(() => {
getList();
});
function getList() {
const venueId = app.globalData.venue.id;
common_hotel.getActivityList(venueId).then((res) => {
list.value = res.rows;
});
}
function goDetail(item) {
let path = `/pages_hotel/hotel/detail?id=${item.id}`;
common_vendor.index.navigateTo({
url: path
});
}
function goMycenter() {
let path = `/pages_hotel/hotel/mycenter`;
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(common_vendor.unref(list), (item, index, i0) => {
var _a;
return {
a: common_vendor.f((_a = item.photos) == null ? void 0 : _a.split(","), (pic, index2, i1) => {
return {
a: pic,
b: index2
};
}),
b: common_vendor.t(item.name),
c: common_vendor.t(item.hdStart.substring(0, 10)),
d: common_vendor.t(item.hdEnd.substring(0, 10)),
e: common_vendor.t(item.address),
f: index,
g: common_vendor.o(($event) => goDetail(item), index)
};
}),
b: common_vendor.unref(autoplay),
c: common_assets._imports_1$1,
d: common_assets._imports_0$2,
e: common_vendor.unref(list).length == 0
}, common_vendor.unref(list).length == 0 ? {} : {}, {
f: common_assets._imports_9,
g: common_vendor.o(goMycenter)
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0a8a2b4c"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/index.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);