177 lines
5.2 KiB
JavaScript
177 lines
5.2 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_booking_match_index = require("../../api/booking/match/index.js");
|
|
const api_booking_matchOrder_index = require("../../api/booking/matchOrder/index.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
list: [],
|
|
// 骨架屏
|
|
hideTools: true,
|
|
// 项目列表
|
|
itemList: []
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.reload();
|
|
},
|
|
methods: {
|
|
reload() {
|
|
const app = this;
|
|
Promise.all([app.getMatchList(), app.getMatchOrderList()]).then((res) => {
|
|
console.log("res: ", res);
|
|
app.list = res[0];
|
|
app.itemList = res[1];
|
|
});
|
|
},
|
|
getMatchList() {
|
|
return new Promise((resolve, reject) => {
|
|
api_booking_match_index.pageMatch({}).then((result) => {
|
|
resolve(result.list);
|
|
}).catch(reject);
|
|
});
|
|
},
|
|
getMatchOrderList() {
|
|
return new Promise((resolve, reject) => {
|
|
api_booking_matchOrder_index.pageMatchOrder({}).then((result) => {
|
|
resolve(result);
|
|
}).catch(reject);
|
|
});
|
|
},
|
|
onItem(e) {
|
|
const { index } = e.detail;
|
|
this.openUrl(`/package/match/list?categoryId=` + this.itemList[index].id);
|
|
},
|
|
openUrl(url) {
|
|
common_vendor.index.navigateTo({
|
|
url
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_uv_image2 = common_vendor.resolveComponent("uv-image");
|
|
const _easycom_uv_text2 = common_vendor.resolveComponent("uv-text");
|
|
const _easycom_uv_tags2 = common_vendor.resolveComponent("uv-tags");
|
|
const _easycom_uv_skeleton2 = common_vendor.resolveComponent("uv-skeleton");
|
|
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
|
|
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
|
|
(_easycom_uv_image2 + _easycom_uv_text2 + _easycom_uv_tags2 + _easycom_uv_skeleton2 + _easycom_uv_gap2 + _easycom_uni_card2)();
|
|
}
|
|
const _easycom_uv_image = () => "../../uni_modules/uv-image/components/uv-image/uv-image.js";
|
|
const _easycom_uv_text = () => "../../uni_modules/uv-text/components/uv-text/uv-text.js";
|
|
const _easycom_uv_tags = () => "../../uni_modules/uv-tags/components/uv-tags/uv-tags.js";
|
|
const _easycom_uv_skeleton = () => "../../uni_modules/uv-skeleton/components/uv-skeleton/uv-skeleton.js";
|
|
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
|
|
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
|
|
if (!Math) {
|
|
(_easycom_uv_image + _easycom_uv_text + _easycom_uv_tags + _easycom_uv_skeleton + _easycom_uv_gap + _easycom_uni_card)();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: $data.list.length > 0
|
|
}, $data.list.length > 0 ? {
|
|
b: common_vendor.f($data.list, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: "95122846-0-" + i0,
|
|
b: common_vendor.p({
|
|
src: item.image,
|
|
width: "120",
|
|
height: "120"
|
|
}),
|
|
c: "95122846-1-" + i0,
|
|
d: common_vendor.p({
|
|
size: "15",
|
|
lineHeight: "24",
|
|
lines: 2,
|
|
text: item.title
|
|
}),
|
|
e: "95122846-2-" + i0,
|
|
f: item.status == 0
|
|
}, item.status == 0 ? {
|
|
g: "95122846-3-" + i0,
|
|
h: common_vendor.p({
|
|
text: "未开始",
|
|
plain: true,
|
|
size: "mini",
|
|
type: "primary"
|
|
})
|
|
} : {}, {
|
|
i: item.status == 1
|
|
}, item.status == 1 ? {
|
|
j: "95122846-4-" + i0,
|
|
k: common_vendor.p({
|
|
text: "进行中",
|
|
plain: true,
|
|
size: "mini",
|
|
type: "error"
|
|
})
|
|
} : {}, {
|
|
l: item.status == 2
|
|
}, item.status == 2 ? {
|
|
m: "95122846-5-" + i0,
|
|
n: common_vendor.p({
|
|
text: "已结束",
|
|
plain: true,
|
|
size: "mini",
|
|
type: "info"
|
|
})
|
|
} : {}, {
|
|
o: common_vendor.t(item.users),
|
|
p: common_vendor.t(item.maxUsers),
|
|
q: common_vendor.o(($event) => $options.openUrl(`/package/match/detail?id=` + item.matchId), index),
|
|
r: index
|
|
});
|
|
}),
|
|
c: common_vendor.p({
|
|
lineHeight: "24",
|
|
size: "13",
|
|
text: `时间:2024-07-12 至 2024-08-12`
|
|
})
|
|
} : {
|
|
d: common_vendor.p({
|
|
rows: "2",
|
|
avatar: true,
|
|
loading: $data.hideTools,
|
|
title: false
|
|
}),
|
|
e: common_vendor.p({
|
|
height: "16"
|
|
}),
|
|
f: common_vendor.p({
|
|
rows: "2",
|
|
avatar: true,
|
|
loading: $data.hideTools,
|
|
title: false
|
|
}),
|
|
g: common_vendor.p({
|
|
height: "16"
|
|
}),
|
|
h: common_vendor.p({
|
|
rows: "2",
|
|
avatar: true,
|
|
loading: $data.hideTools,
|
|
title: false
|
|
}),
|
|
i: common_vendor.p({
|
|
height: "16"
|
|
}),
|
|
j: common_vendor.p({
|
|
rows: "2",
|
|
avatar: true,
|
|
loading: $data.hideTools,
|
|
title: false
|
|
}),
|
|
k: common_vendor.p({
|
|
height: "16"
|
|
}),
|
|
l: common_vendor.p({
|
|
border: false,
|
|
["is-shadow"]: false,
|
|
padding: "12px 4px"
|
|
})
|
|
});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-95122846"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/match/index.vue"]]);
|
|
wx.createPage(MiniProgramPage);
|