处理开台
This commit is contained in:
233
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
233
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
@@ -1,50 +1,112 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_index = require("../../api/index.js");
|
||||
const utils_helper = require("../../utils/helper.js");
|
||||
if (!Array) {
|
||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
||||
const _easycom_nut_grid_item2 = common_vendor.resolveComponent("nut-grid-item");
|
||||
const _easycom_nut_grid2 = common_vendor.resolveComponent("nut-grid");
|
||||
(_easycom_nut_button2 + _easycom_nut_grid_item2 + _easycom_nut_grid2)();
|
||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
||||
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
||||
const _easycom_nut_textarea2 = common_vendor.resolveComponent("nut-textarea");
|
||||
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
||||
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
||||
(_easycom_nut_button2 + _easycom_nut_input2 + _easycom_nut_form_item2 + _easycom_nut_textarea2 + _easycom_nut_form2 + _easycom_nut_popup2)();
|
||||
}
|
||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
||||
const _easycom_nut_grid_item = () => "../../uni_modules/nutui-uni/components/griditem/griditem.js";
|
||||
const _easycom_nut_grid = () => "../../uni_modules/nutui-uni/components/grid/grid.js";
|
||||
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
|
||||
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
||||
const _easycom_nut_textarea = () => "../../uni_modules/nutui-uni/components/textarea/textarea.js";
|
||||
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
|
||||
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_nut_button + _easycom_nut_grid_item + _easycom_nut_grid)();
|
||||
(_easycom_nut_button + _easycom_nut_input + _easycom_nut_form_item + _easycom_nut_textarea + _easycom_nut_form + _easycom_nut_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const rooms = [
|
||||
{
|
||||
name: "房间名称 1"
|
||||
},
|
||||
{
|
||||
name: "房间名称 2"
|
||||
},
|
||||
{
|
||||
name: "房间名称 3"
|
||||
},
|
||||
{
|
||||
name: "房间名称 4"
|
||||
},
|
||||
{
|
||||
name: "房间名称 5"
|
||||
},
|
||||
{
|
||||
name: "房间名称 6"
|
||||
},
|
||||
{
|
||||
name: "房间名称 7"
|
||||
},
|
||||
{
|
||||
name: "房间名称 8"
|
||||
},
|
||||
{
|
||||
name: "房间名称 9"
|
||||
const form = common_vendor.reactive({
|
||||
room_id: 0,
|
||||
tel: "",
|
||||
remarks: ""
|
||||
});
|
||||
const rooms = common_vendor.ref([]);
|
||||
const getRoomStyle = (status) => {
|
||||
let backgroundColor = "";
|
||||
switch (status) {
|
||||
case 1:
|
||||
backgroundColor = "#d9d9d9";
|
||||
break;
|
||||
case 2:
|
||||
backgroundColor = "#ffa39e";
|
||||
break;
|
||||
case 3:
|
||||
backgroundColor = "#b7eb8f";
|
||||
break;
|
||||
default:
|
||||
backgroundColor = "#d9d9d9";
|
||||
}
|
||||
];
|
||||
return {
|
||||
"background-color": backgroundColor
|
||||
};
|
||||
};
|
||||
const visiblePopup = common_vendor.ref(false);
|
||||
const tempRoom = common_vendor.reactive({});
|
||||
const onBooking = (room) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:123", "----", room);
|
||||
Object.assign(tempRoom, room);
|
||||
form.room_id = room.id;
|
||||
visiblePopup.value = true;
|
||||
};
|
||||
const onClosePopup = () => {
|
||||
Object.assign(tempRoom, {});
|
||||
Object.assign(form, {
|
||||
room_id: 0,
|
||||
tel: "",
|
||||
remarks: ""
|
||||
});
|
||||
visiblePopup.value = false;
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:136", "关闭");
|
||||
};
|
||||
const getRooms = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:140", "房间");
|
||||
api_index.fetchRooms().then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:142", res);
|
||||
rooms.value = res;
|
||||
});
|
||||
};
|
||||
const onSubmit = () => {
|
||||
api_index.fetchBooking(form).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:150", res);
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "预约成功"
|
||||
});
|
||||
onClosePopup();
|
||||
getRooms();
|
||||
});
|
||||
};
|
||||
const onUnBooking = (room) => {
|
||||
api_index.fetchUnBooking({
|
||||
id: room.id
|
||||
}).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:164", res);
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "取消预约成功"
|
||||
});
|
||||
getRooms();
|
||||
});
|
||||
};
|
||||
const init = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:174", "init");
|
||||
getRooms();
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:179", "onshow---");
|
||||
getRooms();
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
init();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/index/orderAdd")),
|
||||
@@ -53,24 +115,95 @@ const _sfc_main = {
|
||||
block: true
|
||||
}),
|
||||
c: common_vendor.s("top:0px"),
|
||||
d: common_vendor.f(rooms, (room, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(room.name),
|
||||
b: "1cf27b2a-3-" + i0 + "," + ("1cf27b2a-2-" + i0),
|
||||
c: "1cf27b2a-4-" + i0 + "," + ("1cf27b2a-2-" + i0),
|
||||
d: index,
|
||||
e: "1cf27b2a-2-" + i0 + ",1cf27b2a-1"
|
||||
};
|
||||
}),
|
||||
e: common_vendor.p({
|
||||
type: "primary"
|
||||
}),
|
||||
f: common_vendor.p({
|
||||
type: "success"
|
||||
d: common_vendor.f(rooms.value, (room, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(room.room_name),
|
||||
b: room.tel
|
||||
}, room.tel ? {
|
||||
c: common_vendor.t(room.tel)
|
||||
} : {}, {
|
||||
d: room.remarks
|
||||
}, room.remarks ? {
|
||||
e: common_vendor.t(room.remarks)
|
||||
} : {}, {
|
||||
f: room.status === 1
|
||||
}, room.status === 1 ? {
|
||||
g: common_vendor.o(($event) => onBooking(room), index),
|
||||
h: "1cf27b2a-1-" + i0,
|
||||
i: common_vendor.p({
|
||||
size: "small",
|
||||
type: "primary",
|
||||
shape: "square"
|
||||
})
|
||||
} : room.status === 2 ? {
|
||||
k: common_vendor.o(($event) => onUnBooking(room), index),
|
||||
l: "1cf27b2a-2-" + i0,
|
||||
m: common_vendor.p({
|
||||
size: "small",
|
||||
type: "warning",
|
||||
plain: true,
|
||||
shape: "square"
|
||||
})
|
||||
} : {}, {
|
||||
j: room.status === 2,
|
||||
n: room.status === 3
|
||||
}, room.status === 3 ? {
|
||||
o: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)(`/pages/index/orderEdit?roomId=${room.id}`), index),
|
||||
p: "1cf27b2a-3-" + i0,
|
||||
q: common_vendor.p({
|
||||
size: "small",
|
||||
type: "info",
|
||||
plain: true,
|
||||
shape: "square"
|
||||
})
|
||||
} : {
|
||||
r: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)(`/pages/index/orderAdd?roomId=${room.id}`), index),
|
||||
s: "1cf27b2a-4-" + i0,
|
||||
t: common_vendor.p({
|
||||
size: "small",
|
||||
type: "success",
|
||||
plain: true,
|
||||
shape: "square"
|
||||
})
|
||||
}, {
|
||||
v: index,
|
||||
w: common_vendor.s(getRoomStyle(room.status))
|
||||
});
|
||||
}),
|
||||
e: common_vendor.t(tempRoom == null ? void 0 : tempRoom.room_name),
|
||||
f: common_vendor.o(($event) => form.tel = $event),
|
||||
g: common_vendor.p({
|
||||
["column-num"]: 2,
|
||||
square: true
|
||||
placeholder: "请输入尾号",
|
||||
modelValue: form.tel
|
||||
}),
|
||||
h: common_vendor.p({
|
||||
label: "尾号"
|
||||
}),
|
||||
i: common_vendor.o(($event) => form.remarks = $event),
|
||||
j: common_vendor.p({
|
||||
rows: 3,
|
||||
["adjust-keyboard-to"]: _ctx.bottom,
|
||||
placeholder: "请输入备注",
|
||||
modelValue: form.remarks
|
||||
}),
|
||||
k: common_vendor.p({
|
||||
label: "备注"
|
||||
}),
|
||||
l: common_vendor.o(onSubmit),
|
||||
m: common_vendor.p({
|
||||
type: "primary",
|
||||
block: true
|
||||
}),
|
||||
n: common_vendor.o(onClosePopup),
|
||||
o: common_vendor.o(($event) => visiblePopup.value = $event),
|
||||
p: common_vendor.p({
|
||||
["custom-style"]: {
|
||||
height: "60%"
|
||||
},
|
||||
position: "bottom",
|
||||
["safe-area-inset-bottom"]: true,
|
||||
["close-on-click-overlay"]: true,
|
||||
visible: visiblePopup.value
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user