处理开台
This commit is contained in:
441
unpackage/dist/dev/mp-weixin/pages/index/orderEdit.js
vendored
Normal file
441
unpackage/dist/dev/mp-weixin/pages/index/orderEdit.js
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_index = require("../../api/index.js");
|
||||
if (!Array) {
|
||||
const _easycom_nut_form_item2 = common_vendor.resolveComponent("nut-form-item");
|
||||
const _easycom_nut_input2 = common_vendor.resolveComponent("nut-input");
|
||||
const _easycom_nut_form2 = common_vendor.resolveComponent("nut-form");
|
||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
||||
const _easycom_nut_cascader2 = common_vendor.resolveComponent("nut-cascader");
|
||||
const _easycom_nut_picker2 = common_vendor.resolveComponent("nut-picker");
|
||||
const _easycom_nut_popup2 = common_vendor.resolveComponent("nut-popup");
|
||||
(_easycom_nut_form_item2 + _easycom_nut_input2 + _easycom_nut_form2 + _easycom_nut_button2 + _easycom_nut_cascader2 + _easycom_nut_picker2 + _easycom_nut_popup2)();
|
||||
}
|
||||
const _easycom_nut_form_item = () => "../../uni_modules/nutui-uni/components/formitem/formitem.js";
|
||||
const _easycom_nut_input = () => "../../uni_modules/nutui-uni/components/input/input.js";
|
||||
const _easycom_nut_form = () => "../../uni_modules/nutui-uni/components/form/form.js";
|
||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
||||
const _easycom_nut_cascader = () => "../../uni_modules/nutui-uni/components/cascader/cascader.js";
|
||||
const _easycom_nut_picker = () => "../../uni_modules/nutui-uni/components/picker/picker.js";
|
||||
const _easycom_nut_popup = () => "../../uni_modules/nutui-uni/components/popup/popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_nut_form_item + _easycom_nut_input + _easycom_nut_form + _easycom_nut_button + _easycom_nut_cascader + _easycom_nut_picker + _easycom_nut_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "orderEdit",
|
||||
setup(__props) {
|
||||
common_vendor.onLoad((options) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:225", "onLoad");
|
||||
form.room_id = options.roomId;
|
||||
getRoomOrder();
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:232", form);
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:233", options);
|
||||
});
|
||||
const getRoomOrder = () => {
|
||||
api_index.fetchRoomOrder(form.room_id).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:239", res);
|
||||
form.room_id = res.room_id;
|
||||
form.order_type = res.order_type;
|
||||
form.fee_type = res.fee_type.value;
|
||||
form.fee_type_name = res.fee_type.text;
|
||||
form.fee_combo_id = res.fee_combo_id;
|
||||
form.fee_combo_name = res.fee_combo_name;
|
||||
form.fee_amount = res.fee_amount;
|
||||
form.fee_pay_status = res.fee_pay_status.value;
|
||||
form.fee_pay_status_txt = res.fee_pay_status.text;
|
||||
form.over_often = res.over_often;
|
||||
form.over_amount = res.over_amount;
|
||||
form.over_pay_status = res.over_pay_status.value;
|
||||
form.over_pay_status_txt = res.over_pay_status.text;
|
||||
});
|
||||
};
|
||||
const visibleFeeTypePopup = common_vendor.ref(false);
|
||||
const feeTypes = [
|
||||
{
|
||||
value: 1,
|
||||
label: "美团"
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "抖音"
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: "线下"
|
||||
}
|
||||
];
|
||||
const onConfirmFeeType = (selectedValue) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:343", selectedValue);
|
||||
form.fee_type_name = selectedValue.selectedOptions[0].label;
|
||||
form.fee_type = selectedValue.selectedOptions[0].value;
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:346", form);
|
||||
if (form.fee_type !== 3) {
|
||||
getCombos();
|
||||
}
|
||||
visibleFeeTypePopup.value = false;
|
||||
};
|
||||
const getCombos = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:355", "获取套餐");
|
||||
api_index.fetchCombos({
|
||||
type: form.fee_type
|
||||
}).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:359", res);
|
||||
combos.value = res;
|
||||
});
|
||||
};
|
||||
const visibleCombosPopup = common_vendor.ref(false);
|
||||
const popupCombosVal = common_vendor.ref([]);
|
||||
const combos = common_vendor.ref([]);
|
||||
const onConfirmCombos = (selectedValue) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:374", selectedValue);
|
||||
form.fee_combo_name = selectedValue.selectedOptions[0].label;
|
||||
form.fee_combo_id = selectedValue.selectedOptions[0].value;
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:377", form);
|
||||
visibleCombosPopup.value = false;
|
||||
};
|
||||
const visiblePaymentStatusPopup = common_vendor.ref(false);
|
||||
common_vendor.ref([]);
|
||||
const popupPaymentTypeVal = common_vendor.ref("");
|
||||
const paymentStatuses = [
|
||||
{
|
||||
value: 1,
|
||||
label: "已付"
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "未付"
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: "赠送"
|
||||
}
|
||||
];
|
||||
const openPayStatusPopup = (type, index = -1) => {
|
||||
popupPaymentTypeVal.value = type;
|
||||
goodsPayIndex.value = index;
|
||||
visiblePaymentStatusPopup.value = true;
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:405", type);
|
||||
};
|
||||
const onConfirmPaymentStatus = (selectedValue) => {
|
||||
if (popupPaymentTypeVal.value == "fee") {
|
||||
form.fee_pay_status_txt = selectedValue.selectedOptions[0].label;
|
||||
form.fee_pay_status = selectedValue.selectedOptions[0].value;
|
||||
}
|
||||
if (popupPaymentTypeVal.value == "over") {
|
||||
form.over_pay_status_txt = selectedValue.selectedOptions[0].label;
|
||||
form.over_pay_status = selectedValue.selectedOptions[0].value;
|
||||
}
|
||||
if (popupPaymentTypeVal.value == "goods" && goodsPayIndex.value >= 0) {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:419", "处理商品支付状态", goodsPayIndex.value);
|
||||
orderGoods.value[goodsPayIndex.value].goods_pay_status_txt = selectedValue.selectedOptions[0].label;
|
||||
orderGoods.value[goodsPayIndex.value].goods_pay_status = selectedValue.selectedOptions[0].value;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:423", form);
|
||||
visiblePaymentStatusPopup.value = false;
|
||||
popupPaymentTypeVal.value = "";
|
||||
goodsPayIndex.value = -1;
|
||||
};
|
||||
const orderGoods = common_vendor.ref([
|
||||
// {
|
||||
// goods_type_name: null,
|
||||
// goods_type_id: null,
|
||||
// goods_name: null,
|
||||
// goods_id: null,
|
||||
// goods_price: null,
|
||||
// goods_pay_status: 0,
|
||||
// goods_pay_status_txt: "请选择",
|
||||
// cascader_val: []
|
||||
// },
|
||||
]);
|
||||
const goodsPayIndex = common_vendor.ref(0);
|
||||
const goodsIndex = common_vendor.ref(0);
|
||||
const addGoods = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:450", orderGoods.value);
|
||||
orderGoods.value.push({
|
||||
goods_type_name: null,
|
||||
goods_type_id: null,
|
||||
goods_name: null,
|
||||
goods_id: null,
|
||||
goods_price: null,
|
||||
goods_pay_status: 0,
|
||||
goods_pay_status_txt: "请选择",
|
||||
cascader_val: []
|
||||
});
|
||||
};
|
||||
const removeGoods = (index) => {
|
||||
orderGoods.value.splice(index, 1);
|
||||
};
|
||||
const visibleGoodsCascader = common_vendor.ref(false);
|
||||
const cascaderGoodsValue = common_vendor.computed(() => {
|
||||
var _a;
|
||||
let cascader_val = [];
|
||||
if (goodsIndex.value >= 0) {
|
||||
return ((_a = orderGoods.value[goodsIndex.value]) == null ? void 0 : _a.cascader_val) ?? [];
|
||||
} else {
|
||||
return cascader_val;
|
||||
}
|
||||
});
|
||||
const onGoodsChange = (...args) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:478", "onGoodsChange", args);
|
||||
};
|
||||
const onGoodsPathChange = (args) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:482", "onGoodsPathChange", args);
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:483", "goodsIndex", goodsIndex.value);
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:484", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
|
||||
orderGoods.value[goodsIndex.value].goods_type_name = null;
|
||||
orderGoods.value[goodsIndex.value].goods_type_id = null;
|
||||
orderGoods.value[goodsIndex.value].goods_name = null;
|
||||
orderGoods.value[goodsIndex.value].goods_id = null;
|
||||
orderGoods.value[goodsIndex.value].goods_price = null;
|
||||
if (args.length >= 1 && args[0] !== null) {
|
||||
orderGoods.value[goodsIndex.value].goods_type_name = args[0].text;
|
||||
orderGoods.value[goodsIndex.value].goods_type_id = args[0].value;
|
||||
}
|
||||
if (args.length >= 2 && args[1] !== null) {
|
||||
orderGoods.value[goodsIndex.value].goods_name = args[1].text;
|
||||
orderGoods.value[goodsIndex.value].goods_id = args[1].value;
|
||||
orderGoods.value[goodsIndex.value].goods_price = args[1].goods_price;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:500", "orderGoods.value[goodsIndex.value]", orderGoods.value[goodsIndex.value]);
|
||||
};
|
||||
const onCloseGoodsCascader = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:503", "onCloseGoodsCascader");
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:504", "goodsIndex.value", goodsIndex.value);
|
||||
if (orderGoods.value[goodsIndex.value].goods_type_id && orderGoods.value[goodsIndex.value].goods_id) {
|
||||
orderGoods.value[goodsIndex.value].cascader_val = [
|
||||
orderGoods.value[goodsIndex.value].goods_type_id,
|
||||
orderGoods.value[goodsIndex.value].goods_id
|
||||
];
|
||||
}
|
||||
goodsIndex.value = 0;
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:512", "goodsIndex.value", goodsIndex.value);
|
||||
};
|
||||
const onOpenGoodsCascader = () => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:515", "onOpenGoodsCascader");
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:516", "goodsIndex.value", goodsIndex.value);
|
||||
};
|
||||
const form = common_vendor.reactive({
|
||||
order_type: 1,
|
||||
// 开台订单
|
||||
room_id: 0,
|
||||
fee_type: 0,
|
||||
fee_type_name: "请选择",
|
||||
fee_combo_id: 0,
|
||||
// 套餐费用ID
|
||||
fee_combo_name: "请选择",
|
||||
// 套餐费用名称
|
||||
fee_amount: null,
|
||||
// 线下支付费用
|
||||
fee_pay_status: 0,
|
||||
// 费用支付状态
|
||||
fee_pay_status_txt: "请选择",
|
||||
// 费用支付状态
|
||||
over_often: null,
|
||||
// 超时小时
|
||||
over_amount: null,
|
||||
// 超时金额
|
||||
over_pay_status: 0,
|
||||
// 超时支付状态
|
||||
over_pay_status_txt: "请选择",
|
||||
// 超时支付状态
|
||||
discount_amount: null
|
||||
// 优惠金额
|
||||
});
|
||||
const selectGoods = common_vendor.ref([]);
|
||||
common_vendor.onMounted(() => {
|
||||
api_index.fetchGoods().then((res) => {
|
||||
selectGoods.value = res;
|
||||
});
|
||||
});
|
||||
const submitForm = () => {
|
||||
let data = {
|
||||
order_goods: orderGoods.value,
|
||||
order: form
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:567", "提交的订单数据:", data);
|
||||
api_index.fetchAddOrder(data).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/index/orderEdit.vue:570", res);
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(form.fee_type_name),
|
||||
b: common_vendor.o(($event) => visibleFeeTypePopup.value = true),
|
||||
c: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
d: form.fee_type === 1 || form.fee_type === 2
|
||||
}, form.fee_type === 1 || form.fee_type === 2 ? {
|
||||
e: common_vendor.t(form.fee_combo_name),
|
||||
f: common_vendor.o(($event) => visibleCombosPopup.value = true),
|
||||
g: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
})
|
||||
} : {
|
||||
h: common_vendor.o(($event) => form.fee_amount = $event),
|
||||
i: common_vendor.p({
|
||||
placeholder: "请输入金额",
|
||||
type: "number",
|
||||
modelValue: form.fee_amount
|
||||
}),
|
||||
j: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
})
|
||||
}, {
|
||||
k: common_vendor.t(form.fee_pay_status_txt),
|
||||
l: common_vendor.o(($event) => openPayStatusPopup("fee")),
|
||||
m: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
n: common_vendor.o(($event) => form.over_often = $event),
|
||||
o: common_vendor.p({
|
||||
placeholder: "请输入小时",
|
||||
type: "number",
|
||||
modelValue: form.over_often
|
||||
}),
|
||||
p: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
q: common_vendor.o(($event) => form.over_amount = $event),
|
||||
r: common_vendor.p({
|
||||
placeholder: "请输入金额",
|
||||
type: "number",
|
||||
modelValue: form.over_amount
|
||||
}),
|
||||
s: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
t: common_vendor.t(form.over_pay_status_txt),
|
||||
v: common_vendor.o(($event) => openPayStatusPopup("over")),
|
||||
w: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
x: common_vendor.o(addGoods),
|
||||
y: common_vendor.p({
|
||||
type: "primary",
|
||||
plain: true,
|
||||
size: "small"
|
||||
}),
|
||||
z: common_vendor.f(orderGoods.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.goods_type_name && item.goods_name
|
||||
}, item.goods_type_name && item.goods_name ? {
|
||||
b: common_vendor.t(item.goods_type_name),
|
||||
c: common_vendor.t(item.goods_name)
|
||||
} : {}, {
|
||||
d: common_vendor.o(($event) => {
|
||||
visibleGoodsCascader.value = true;
|
||||
goodsIndex.value = index;
|
||||
}, index),
|
||||
e: "7c6285d6-14-" + i0 + ",7c6285d6-13",
|
||||
f: common_vendor.t(item.goods_price),
|
||||
g: "7c6285d6-15-" + i0 + ",7c6285d6-13",
|
||||
h: common_vendor.t(item.goods_pay_status_txt),
|
||||
i: common_vendor.o(($event) => openPayStatusPopup("goods", index), index),
|
||||
j: "7c6285d6-16-" + i0 + ",7c6285d6-13",
|
||||
k: common_vendor.o(($event) => removeGoods(index), index),
|
||||
l: "7c6285d6-18-" + i0 + "," + ("7c6285d6-17-" + i0),
|
||||
m: "7c6285d6-17-" + i0 + ",7c6285d6-13",
|
||||
n: index
|
||||
});
|
||||
}),
|
||||
A: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
B: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
C: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
D: common_vendor.p({
|
||||
type: "danger",
|
||||
size: "mini"
|
||||
}),
|
||||
E: common_vendor.p({
|
||||
["label-position"]: "top"
|
||||
}),
|
||||
F: common_vendor.o(($event) => form.discount_amount = $event),
|
||||
G: common_vendor.p({
|
||||
placeholder: "请输入金额",
|
||||
type: "number",
|
||||
modelValue: form.discount_amount
|
||||
}),
|
||||
H: common_vendor.o(submitForm),
|
||||
I: common_vendor.p({
|
||||
type: "primary",
|
||||
block: true
|
||||
}),
|
||||
J: common_vendor.o(onGoodsChange),
|
||||
K: common_vendor.o(onGoodsPathChange),
|
||||
L: common_vendor.o(onOpenGoodsCascader),
|
||||
M: common_vendor.o(onCloseGoodsCascader),
|
||||
N: common_vendor.o(($event) => visibleGoodsCascader.value = $event),
|
||||
O: common_vendor.o(($event) => cascaderGoodsValue.value = $event),
|
||||
P: common_vendor.p({
|
||||
title: "商品选择",
|
||||
["text-key"]: "label",
|
||||
["value-key"]: "value",
|
||||
["children-key"]: "children",
|
||||
options: selectGoods.value,
|
||||
["title-ellipsis"]: false,
|
||||
visible: visibleGoodsCascader.value,
|
||||
modelValue: cascaderGoodsValue.value
|
||||
}),
|
||||
Q: common_vendor.o(onConfirmPaymentStatus),
|
||||
R: common_vendor.o(($event) => visiblePaymentStatusPopup.value = false),
|
||||
S: common_vendor.p({
|
||||
columns: paymentStatuses,
|
||||
["field-names"]: {
|
||||
text: "label",
|
||||
value: "value"
|
||||
},
|
||||
title: "选择支付状态"
|
||||
}),
|
||||
T: common_vendor.o(($event) => visiblePaymentStatusPopup.value = $event),
|
||||
U: common_vendor.p({
|
||||
position: "bottom",
|
||||
["safe-area-inset-bottom"]: true,
|
||||
visible: visiblePaymentStatusPopup.value
|
||||
}),
|
||||
V: common_vendor.o(onConfirmCombos),
|
||||
W: common_vendor.o(($event) => visibleCombosPopup.value = false),
|
||||
X: common_vendor.o(($event) => popupCombosVal.value = $event),
|
||||
Y: common_vendor.p({
|
||||
columns: combos.value,
|
||||
["field-names"]: {
|
||||
text: "label",
|
||||
value: "value"
|
||||
},
|
||||
title: "选择团购套餐",
|
||||
modelValue: popupCombosVal.value
|
||||
}),
|
||||
Z: common_vendor.o(($event) => visibleCombosPopup.value = $event),
|
||||
aa: common_vendor.p({
|
||||
position: "bottom",
|
||||
["safe-area-inset-bottom"]: true,
|
||||
visible: visibleCombosPopup.value
|
||||
}),
|
||||
ab: common_vendor.o(onConfirmFeeType),
|
||||
ac: common_vendor.o(($event) => visibleFeeTypePopup.value = false),
|
||||
ad: common_vendor.p({
|
||||
columns: feeTypes,
|
||||
["field-names"]: {
|
||||
text: "label",
|
||||
value: "value"
|
||||
},
|
||||
title: "选择结算方式"
|
||||
}),
|
||||
ae: common_vendor.o(($event) => visibleFeeTypePopup.value = $event),
|
||||
af: common_vendor.p({
|
||||
position: "bottom",
|
||||
["safe-area-inset-bottom"]: true,
|
||||
visible: visibleFeeTypePopup.value
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7c6285d6"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/orderEdit.js.map
|
||||
Reference in New Issue
Block a user