@pisell/private-materials 3.3.55 → 3.3.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/appointmentBooking/assets/resource.svg +1 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Resource/index.js +44 -5
- package/es/components/appointmentBooking/hooks.js +218 -177
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -0
- package/es/components/booking/components/TabProduct/productItem/index.js +14 -2
- package/es/components/booking/components/drawer/index.js +4 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.js +25 -17
- package/es/components/booking/info/client/index.js +2 -1
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/pet/index.js +3 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.js +27 -27
- package/es/components/booking/info2/index.js +3 -3
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +5 -2
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +23 -4
- package/es/components/eventBooking/components/progressBar/index.js +16 -0
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentList/index.js +10 -4
- package/es/components/pay/toC/PaymentList/serve.d.ts +1 -1
- package/es/components/pay/toC/PaymentList/serve.js +7 -1
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +30 -13
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +30 -13
- package/es/components/pay/toC/PaymentMethods/index.js +29 -2
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/index.less +4 -0
- package/es/components/pay/toC/index.js +38 -30
- package/es/components/pay/toC/utils.d.ts +6 -0
- package/es/components/pay/toC/utils.js +21 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +18 -6
- package/es/components/productSelect/components/TabProduct/index.js +28 -10
- package/es/components/productSelect/components/TabProduct/tabs/index.d.ts +21 -0
- package/es/components/productSelect/components/TabProduct/tabs/index.js +243 -0
- package/es/components/productSelect/components/TabProduct/tabs/index.less +126 -0
- package/es/components/productSelect/components/pisellPriceText/index.d.ts +11 -0
- package/es/components/productSelect/components/pisellPriceText/index.js +43 -0
- package/es/components/productSelect/components/productGroup/index.js +20 -7
- package/es/components/productSelect/components/productGroup/index.less +14 -1
- package/es/components/productSelect/index.less +1 -2
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +16 -10
- package/es/components/ticketBooking/components/addServiceVariant/index.less +10 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +3 -1
- package/es/components/ticketBooking/index.js +2 -1
- package/es/components/ticketBooking/locales.d.ts +3 -0
- package/es/components/ticketBooking/locales.js +12 -3
- package/es/components/ticketBooking/utils/index.d.ts +5 -1
- package/es/components/ticketBooking/utils/index.js +35 -3
- package/es/components/wallet/index.js +51 -5
- package/lib/components/appointmentBooking/assets/resource.svg +1 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +44 -5
- package/lib/components/appointmentBooking/hooks.js +12 -3
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +3 -0
- package/lib/components/booking/components/TabProduct/productItem/index.js +8 -1
- package/lib/components/booking/components/drawer/index.js +2 -2
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.js +31 -27
- package/lib/components/booking/info/client/index.js +2 -1
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/pet/index.js +3 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/index.js +7 -4
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +18 -8
- package/lib/components/eventBooking/components/progressBar/index.js +15 -0
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentList/index.js +11 -6
- package/lib/components/pay/toC/PaymentList/serve.d.ts +1 -1
- package/lib/components/pay/toC/PaymentList/serve.js +5 -2
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +10 -1
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +10 -1
- package/lib/components/pay/toC/PaymentMethods/index.js +28 -4
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/index.less +4 -0
- package/lib/components/pay/toC/index.js +20 -13
- package/lib/components/pay/toC/utils.d.ts +6 -0
- package/lib/components/pay/toC/utils.js +15 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +8 -1
- package/lib/components/productSelect/components/TabProduct/index.js +19 -6
- package/lib/components/productSelect/components/TabProduct/tabs/index.d.ts +21 -0
- package/lib/components/productSelect/components/TabProduct/tabs/index.js +202 -0
- package/lib/components/productSelect/components/TabProduct/tabs/index.less +126 -0
- package/lib/components/productSelect/components/pisellPriceText/index.d.ts +11 -0
- package/lib/components/productSelect/components/pisellPriceText/index.js +72 -0
- package/lib/components/productSelect/components/productGroup/index.js +24 -4
- package/lib/components/productSelect/components/productGroup/index.less +14 -1
- package/lib/components/productSelect/index.less +1 -2
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +25 -14
- package/lib/components/ticketBooking/components/addServiceVariant/index.less +10 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -1
- package/lib/components/ticketBooking/index.js +2 -1
- package/lib/components/ticketBooking/locales.d.ts +3 -0
- package/lib/components/ticketBooking/locales.js +6 -3
- package/lib/components/ticketBooking/utils/index.d.ts +5 -1
- package/lib/components/ticketBooking/utils/index.js +35 -3
- package/lib/components/wallet/index.js +26 -1
- package/package.json +2 -2
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
|
@@ -46,7 +46,10 @@ export default {
|
|
|
46
46
|
"pisell2.ticket-booking.create-new": "Create new",
|
|
47
47
|
"pisell2.ticket-booking.add-to-cart": "Added to Cart",
|
|
48
48
|
"pisell2.ticket-booking.not-available-title": "Sorry, Not available at current time.",
|
|
49
|
-
"pisell2.ticket-booking.not-available-ok": "OK"
|
|
49
|
+
"pisell2.ticket-booking.not-available-ok": "OK",
|
|
50
|
+
"pisell2.ticket-booking.in-cart": function pisell2TicketBookingInCart(number) {
|
|
51
|
+
return "".concat(number, " in cart");
|
|
52
|
+
}
|
|
50
53
|
},
|
|
51
54
|
"zh-CN": {
|
|
52
55
|
"pisell2.ticket-booking.info": "信息",
|
|
@@ -95,7 +98,10 @@ export default {
|
|
|
95
98
|
"pisell2.ticket-booking.create-new": "新建",
|
|
96
99
|
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
97
100
|
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售时间。",
|
|
98
|
-
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
101
|
+
"pisell2.ticket-booking.not-available-ok": "好的",
|
|
102
|
+
"pisell2.ticket-booking.in-cart": function pisell2TicketBookingInCart(number) {
|
|
103
|
+
return "\u5DF2\u6709".concat(number, "\u4EF6");
|
|
104
|
+
}
|
|
99
105
|
},
|
|
100
106
|
"zh-HK": {
|
|
101
107
|
"pisell2.ticket-booking.info": "資訊",
|
|
@@ -144,6 +150,9 @@ export default {
|
|
|
144
150
|
"pisell2.ticket-booking.create-new": "新建",
|
|
145
151
|
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
146
152
|
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售時間。",
|
|
147
|
-
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
153
|
+
"pisell2.ticket-booking.not-available-ok": "好的",
|
|
154
|
+
"pisell2.ticket-booking.in-cart": function pisell2TicketBookingInCart(number) {
|
|
155
|
+
return "\u5DF2\u6709".concat(number, "\u4EF6");
|
|
156
|
+
}
|
|
148
157
|
}
|
|
149
158
|
};
|
|
@@ -12,4 +12,8 @@ export declare const restoreProductOtherData: (data: any) => {
|
|
|
12
12
|
product_variant_id: number;
|
|
13
13
|
quantity: number;
|
|
14
14
|
} | undefined;
|
|
15
|
-
export declare const addService: (list: any[], addItem: any) =>
|
|
15
|
+
export declare const addService: (list: any[], addItem: any) => {
|
|
16
|
+
list: any[];
|
|
17
|
+
quantity: any;
|
|
18
|
+
};
|
|
19
|
+
export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
|
|
@@ -109,19 +109,26 @@ var isSameProduct = function isSameProduct(a, b) {
|
|
|
109
109
|
};
|
|
110
110
|
export var addService = function addService(list, addItem) {
|
|
111
111
|
var value = list;
|
|
112
|
+
var count;
|
|
112
113
|
// 预约商品直接添加
|
|
113
114
|
if (!isNormalProductByDurationSchedule(addItem)) {
|
|
114
115
|
value.push(addItem);
|
|
116
|
+
count = addItem._extend.quantity;
|
|
115
117
|
} else {
|
|
116
118
|
// 非预约商品判断是否相同,相同合并
|
|
117
119
|
var isNotSame = true;
|
|
118
120
|
value = list.map(function (item) {
|
|
119
121
|
if (isSameProduct(item, addItem)) {
|
|
120
|
-
var _item$_extend, _addItem$_extend;
|
|
122
|
+
var _item$_extend, _addItem$_extend, _item$_extend2;
|
|
121
123
|
isNotSame = false;
|
|
124
|
+
var quantity = ((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.quantity) || 1) + ((addItem === null || addItem === void 0 || (_addItem$_extend = addItem._extend) === null || _addItem$_extend === void 0 ? void 0 : _addItem$_extend.quantity) || 1);
|
|
125
|
+
count = quantity;
|
|
122
126
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
123
127
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
124
|
-
quantity:
|
|
128
|
+
quantity: quantity,
|
|
129
|
+
other: _objectSpread(_objectSpread({}, ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.other) || {}), {}, {
|
|
130
|
+
quantity: quantity
|
|
131
|
+
})
|
|
125
132
|
})
|
|
126
133
|
});
|
|
127
134
|
}
|
|
@@ -129,7 +136,32 @@ export var addService = function addService(list, addItem) {
|
|
|
129
136
|
});
|
|
130
137
|
if (isNotSame) {
|
|
131
138
|
value.push(addItem);
|
|
139
|
+
count = addItem._extend.quantity;
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
|
-
return
|
|
142
|
+
return {
|
|
143
|
+
list: value,
|
|
144
|
+
quantity: count
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export var addServiceScroll = function addServiceScroll(rowKey, cacheItem) {
|
|
148
|
+
var list = document.querySelectorAll("#rowKey-".concat(rowKey));
|
|
149
|
+
setTimeout(function () {
|
|
150
|
+
if (list.length && isNormalProductByDurationSchedule(cacheItem)) {
|
|
151
|
+
list[list.length - 1].scrollIntoView({
|
|
152
|
+
behavior: 'smooth',
|
|
153
|
+
block: 'center'
|
|
154
|
+
});
|
|
155
|
+
} else {
|
|
156
|
+
setTimeout(function () {
|
|
157
|
+
var bookingWrap = document.querySelectorAll(".booking-info-warp");
|
|
158
|
+
if (bookingWrap.length) {
|
|
159
|
+
bookingWrap[0].scrollTo({
|
|
160
|
+
top: 99999,
|
|
161
|
+
behavior: 'smooth'
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}, 100);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
135
167
|
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
2
8
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -297,6 +303,16 @@ var Wallet = Provider(function () {
|
|
|
297
303
|
count: count
|
|
298
304
|
})), /*#__PURE__*/React.createElement(RightOutlined, null));
|
|
299
305
|
};
|
|
306
|
+
var mergeSearch = function mergeSearch(currentSearch, params) {
|
|
307
|
+
var searchParams = new URLSearchParams(currentSearch);
|
|
308
|
+
Object.entries(params).forEach(function (_ref4) {
|
|
309
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
310
|
+
key = _ref5[0],
|
|
311
|
+
value = _ref5[1];
|
|
312
|
+
searchParams.set(key, value);
|
|
313
|
+
});
|
|
314
|
+
return searchParams.toString();
|
|
315
|
+
};
|
|
300
316
|
|
|
301
317
|
/**
|
|
302
318
|
* 创建Menu组件的配置
|
|
@@ -304,6 +320,13 @@ var Wallet = Provider(function () {
|
|
|
304
320
|
var MenuProps = {
|
|
305
321
|
className: 'pisell-lowcode-wallet-menu',
|
|
306
322
|
onClick: function onClick(e) {
|
|
323
|
+
var _context$appHelper$ut;
|
|
324
|
+
(_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.history) === null || _context$appHelper$ut === void 0 || _context$appHelper$ut.push({
|
|
325
|
+
hash: location.hash,
|
|
326
|
+
search: mergeSearch(location.search, {
|
|
327
|
+
type: 'list'
|
|
328
|
+
})
|
|
329
|
+
});
|
|
307
330
|
dispatch({
|
|
308
331
|
type: 'setState',
|
|
309
332
|
payload: {
|
|
@@ -341,6 +364,27 @@ var Wallet = Provider(function () {
|
|
|
341
364
|
}]
|
|
342
365
|
};
|
|
343
366
|
|
|
367
|
+
// 监听路由 type变化 dispatch更新setup
|
|
368
|
+
useEffect(function () {
|
|
369
|
+
var searchParams = new URLSearchParams(location.search);
|
|
370
|
+
var type = searchParams.get('type');
|
|
371
|
+
if (type) {
|
|
372
|
+
dispatch({
|
|
373
|
+
type: 'setState',
|
|
374
|
+
payload: {
|
|
375
|
+
setup: type
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
} else {
|
|
379
|
+
dispatch({
|
|
380
|
+
type: 'setState',
|
|
381
|
+
payload: {
|
|
382
|
+
setup: 'menu'
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}, [location.search]);
|
|
387
|
+
|
|
344
388
|
/**
|
|
345
389
|
* 处理返回按钮点击
|
|
346
390
|
*/
|
|
@@ -356,6 +400,7 @@ var Wallet = Provider(function () {
|
|
|
356
400
|
setup: prevSetup
|
|
357
401
|
}
|
|
358
402
|
});
|
|
403
|
+
history.back(); // 后退到上一步
|
|
359
404
|
}
|
|
360
405
|
};
|
|
361
406
|
|
|
@@ -390,7 +435,7 @@ var Wallet = Provider(function () {
|
|
|
390
435
|
* @param code 钱包代码
|
|
391
436
|
*/
|
|
392
437
|
var addWallet = /*#__PURE__*/function () {
|
|
393
|
-
var
|
|
438
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(code) {
|
|
394
439
|
var onError, data, tagMap, cardType, successMessage;
|
|
395
440
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
396
441
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -452,7 +497,7 @@ var Wallet = Provider(function () {
|
|
|
452
497
|
}, _callee2);
|
|
453
498
|
}));
|
|
454
499
|
return function addWallet(_x3) {
|
|
455
|
-
return
|
|
500
|
+
return _ref6.apply(this, arguments);
|
|
456
501
|
};
|
|
457
502
|
}();
|
|
458
503
|
|
|
@@ -460,7 +505,7 @@ var Wallet = Provider(function () {
|
|
|
460
505
|
* 搜索钱包
|
|
461
506
|
*/
|
|
462
507
|
var handleSearch = /*#__PURE__*/function () {
|
|
463
|
-
var
|
|
508
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
464
509
|
var code,
|
|
465
510
|
resetSearchState,
|
|
466
511
|
onSearchFail,
|
|
@@ -528,7 +573,7 @@ var Wallet = Provider(function () {
|
|
|
528
573
|
}, _callee3, null, [[6, 13]]);
|
|
529
574
|
}));
|
|
530
575
|
return function handleSearch() {
|
|
531
|
-
return
|
|
576
|
+
return _ref7.apply(this, arguments);
|
|
532
577
|
};
|
|
533
578
|
}();
|
|
534
579
|
|
|
@@ -607,9 +652,10 @@ var Wallet = Provider(function () {
|
|
|
607
652
|
* 渲染移动端布局
|
|
608
653
|
*/
|
|
609
654
|
var renderMobileLayout = function renderMobileLayout() {
|
|
655
|
+
var _utils$interaction, _utils$interaction$is;
|
|
610
656
|
return /*#__PURE__*/React.createElement("div", {
|
|
611
657
|
className: "pisell-lowcode-wallet-mobile"
|
|
612
|
-
}, /*#__PURE__*/React.createElement(WalletBar, {
|
|
658
|
+
}, !(utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && (_utils$interaction$is = _utils$interaction.isAppEnv) !== null && _utils$interaction$is !== void 0 && _utils$interaction$is.call(_utils$interaction)) && /*#__PURE__*/React.createElement(WalletBar, {
|
|
613
659
|
setup: setup,
|
|
614
660
|
onBack: onBack
|
|
615
661
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1275.59 1275.59"><defs><style>.cls-1{fill:#a6a6a6;}</style></defs><g id="DxmwFQ.tif"><path class="cls-1" d="M636.87,977.58c-114.72,1.47-224.68-20.79-329.21-68-15.86-7.16-27.21-5.9-41.28,3.48C213.52,948.26,160,982.43,106.5,1016.73c-9.48,6.08-19.25,13.77-31.41,4.9-13-9.52-8.84-21.72-5.11-33.57,17.49-55.52,34-111.4,53.34-166.26,7.84-22.23,4.17-36.79-11.17-54.36C36.65,680.94,2.43,581,23.2,466.21c18-99.46,74-176.57,151-238.71C273.46,147.32,388.47,104,514.45,86.05c118.93-16.93,236.23-12.26,351.34,21.89,145.61,43.18,271,116.11,348.42,253.1,49,86.79,56.45,179,26.18,273.75-4.88,15.27-7.87,40.71-32.33,33.2-26.2-8-10.69-29.31-5.9-44.58,43.67-139.14-3.45-251.65-104.6-345.78C991.83,179.25,861.31,135,720.56,120c-146.14-15.54-287.38,5.21-419.35,72.83C199.54,244.92,115.73,315.67,75.28,426.91c-38.67,106.33-15.56,203,49.22,292.24,4.14,5.7,8,12.14,13.45,16.28,38,28.73,40.16,63.43,21.87,104.72C148.1,866.6,141.39,895.27,132.55,923c-2.35,7.39-7.94,16.28-1.15,22.29,7.8,6.92,14.27-2.48,20.45-6.38,37.3-23.55,74.68-47,111.42-71.41,15-10,28.85-10.45,44.66-2.72,148,72.35,303.66,87.56,464.76,62.18,2.62-.41,5.25-.7,7.86-1.16,14.24-2.49,28.51-1.69,31.3,15.32s-10.53,22.14-24.72,24.41c-41,6.55-82.07,12.48-123.76,12.07C654.53,977.5,645.7,977.58,636.87,977.58Z"/><path class="cls-1" d="M1033.47,1198.82c-10.6,0-21.19.18-31.78,0-39.56-.77-60.71-20.83-61.28-60.26-.27-19.06-1.81-36.46-15.66-51.38-4.39-4.72-7.17-13-7-19.55,1-39.88-20.87-70.15-41.08-101.14C821.4,881.7,821.09,797.61,876,725.15c62.22-82.07,179.6-102.34,265.78-45.9,89.35,58.51,116.38,169.16,63.78,262.88-12.06,21.5-25.44,42.29-38.6,63.17a108.78,108.78,0,0,0-16.33,49.79c-1.41,17.07-4.09,33.17-17.53,45.64-8.07,7.48-6.06,17.91-6.27,27.49-1.12,53.27-18.56,70.41-72.19,70.82-7.07,0-14.13,0-21.19,0Zm158.82-356.91c-3.34-65.92-35.67-113.78-95.24-140.62-60.42-27.23-118.46-17.53-167.61,26.49-47.76,42.77-66.7,96.58-47.38,160.23,7.78,25.6,22.78,47.57,37,69.91,18,28.32,36.23,56.7,37.17,92,.29,10.66,3.07,20.93,16,19.1,12.71-1.79,9.38-13,7.91-21.35q-9.6-54.74-19.93-109.33c-2-10.22-1.75-19.22,6.61-26.62,9.23-8.17,18.11-4.49,26.63,1,7.15,4.58,14.3,7.73,21.9,1.9,12.06-9.25,23.72-10.48,36-.34,6.3,5.21,12.84,3,19.81.11,29.47-12.11,39.23-5,34.33,26.56-5.53,35.71-13,71.11-19.52,106.68-1.56,8.62-4.23,19,7.81,21.78,11.43,2.62,16.2-6.24,16.73-15.66,2.4-42.66,25.38-76.24,47.2-110.54C1177.31,912.39,1194.61,880.63,1192.29,841.91Zm-159.57,316.58v-.28c12.32,0,24.71.84,36.94-.2,17-1.43,17.21-14.74,17.48-27.46.27-12.54-4.83-20.42-18.34-20.45q-34.33-.07-68.69.21c-13.61.13-21.4,6-20.94,20.9.43,13.63,4,25.14,19.26,27C1009.7,1159.59,1021.28,1158.49,1032.72,1158.49Zm1.72-202.58c-14,3-28.37,5.21-25.36,24,4,25.21,8.92,50.28,14,75.31,1.19,5.91,4.1,12.5,11.94,11.66,6.39-.68,7.5-7,8.54-12,4.85-23.27,8.23-46.91,14.29-69.85C1063.81,962.48,1048.2,960.53,1034.44,955.91Z"/><path class="cls-1" d="M639.31,407.39q-177.43-.06-354.85-.09c-8.8,0-17.7,0-26.37-1.3-9.74-1.42-16.3-7.62-16.29-17.81,0-9.93,5.86-16.66,15.75-18.41a122.26,122.26,0,0,1,21.06-1.36q356.16-.14,712.33-.08c8.81,0,17.7,0,26.42,1.09,10.46,1.33,19,6.48,19,18.27,0,13.21-9.32,18.08-21.07,18.91-8.79.63-17.63.79-26.45.79Q814.09,407.48,639.31,407.39Z"/><path class="cls-1" d="M639.72,508.17q178.74,0,357.48.06c8.77,0,17.76.22,26.24,2.13s13.39,8.66,13.14,17.6c-.21,7.72-4.61,13.91-12,15.69a113,113,0,0,1-26,3.06q-360.13.25-720.27.1a106,106,0,0,1-21-1.71c-9.79-2-15.52-8.75-15.41-18.73.12-10.32,6.62-16.18,16.63-17.19,8.75-.89,17.61-.95,26.43-1Q462.3,508.15,639.72,508.17Z"/><path class="cls-1" d="M448.43,687.14q-82,0-164,0c-7.05,0-14.1-.2-21.14-.51-12.23-.54-20.81-6.52-21-19.05-.27-14,8.57-20,22.32-20q183.78.17,367.57.13c13.67,0,26.26,4.07,25.34,20-1,16.95-15.35,19.67-29.28,19.71-59.93.18-119.87.08-179.81.08Z"/></g></svg>
|
|
@@ -40,6 +40,7 @@ var import_hooks = require("../../hooks");
|
|
|
40
40
|
var import_context = require("../../context");
|
|
41
41
|
var import_utils = require("../../utils");
|
|
42
42
|
var import_guests = __toESM(require("../../assets/guests.svg"));
|
|
43
|
+
var import_resource = __toESM(require("../../assets/resource.svg"));
|
|
43
44
|
var import_utils2 = require("@pisell/utils");
|
|
44
45
|
var import_index = require("./index.less");
|
|
45
46
|
var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
@@ -50,11 +51,14 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
50
51
|
resourceOtherParams,
|
|
51
52
|
currentStep,
|
|
52
53
|
setResourceOtherParams,
|
|
53
|
-
currentStepParams
|
|
54
|
+
currentStepParams,
|
|
55
|
+
currentSelectedResources
|
|
54
56
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
55
57
|
const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
56
58
|
const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
|
|
57
59
|
const { updateStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
60
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
61
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
58
62
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
59
63
|
next: async () => {
|
|
60
64
|
setResourceOtherParams({
|
|
@@ -68,6 +72,9 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
68
72
|
const { resources: resources2 } = getResourceList();
|
|
69
73
|
return resources2 || [];
|
|
70
74
|
}, []);
|
|
75
|
+
(0, import_react.useEffect)(() => {
|
|
76
|
+
setLoading(true);
|
|
77
|
+
}, []);
|
|
71
78
|
(0, import_react.useEffect)(() => {
|
|
72
79
|
const checkAndSkipResourceStep = async () => {
|
|
73
80
|
var _a;
|
|
@@ -104,7 +111,9 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
104
111
|
);
|
|
105
112
|
}, [currentStepParams.key, resources]);
|
|
106
113
|
const renderLists = (0, import_react.useMemo)(() => {
|
|
107
|
-
const appointmentCarts = carts.filter(
|
|
114
|
+
const appointmentCarts = carts.filter(
|
|
115
|
+
(n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id))
|
|
116
|
+
);
|
|
108
117
|
if (appointmentCarts.length > 1 || !(appointmentCarts == null ? void 0 : appointmentCarts.length)) {
|
|
109
118
|
return [];
|
|
110
119
|
}
|
|
@@ -142,7 +151,9 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
142
151
|
var _a;
|
|
143
152
|
setSelectedResource(e.id);
|
|
144
153
|
if (e.id) {
|
|
145
|
-
const index = carts.findIndex(
|
|
154
|
+
const index = carts.findIndex(
|
|
155
|
+
(n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id))
|
|
156
|
+
);
|
|
146
157
|
return appointmentBooking.updateCart({
|
|
147
158
|
_id: (_a = carts == null ? void 0 : carts[index]) == null ? void 0 : _a._id,
|
|
148
159
|
resources: (0, import_utils.updateCartResources)(carts == null ? void 0 : carts[index], e)
|
|
@@ -151,13 +162,41 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
151
162
|
};
|
|
152
163
|
(0, import_react.useEffect)(() => {
|
|
153
164
|
var _a, _b, _c;
|
|
154
|
-
const index = carts.findIndex(
|
|
165
|
+
const index = carts.findIndex(
|
|
166
|
+
(n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id))
|
|
167
|
+
);
|
|
155
168
|
const selectedResource2 = (_c = (_b = (_a = carts == null ? void 0 : carts[index]) == null ? void 0 : _a._origin) == null ? void 0 : _b.resources) == null ? void 0 : _c.find(
|
|
156
169
|
(item) => (item == null ? void 0 : item.form_id) === (appointmentBoard == null ? void 0 : appointmentBoard.form_id)
|
|
157
170
|
);
|
|
158
171
|
setSelectedResource((selectedResource2 == null ? void 0 : selectedResource2.id) || 0);
|
|
159
172
|
}, [carts, appointmentBoard == null ? void 0 : appointmentBoard.form_id]);
|
|
160
|
-
|
|
173
|
+
(0, import_react.useEffect)(() => {
|
|
174
|
+
if (resourcesResult) {
|
|
175
|
+
setLoading(false);
|
|
176
|
+
}
|
|
177
|
+
}, [resourcesResult]);
|
|
178
|
+
const currentResourceName = (0, import_react.useMemo)(() => {
|
|
179
|
+
var _a;
|
|
180
|
+
const currentResource = (_a = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _a.currentSelectedResource;
|
|
181
|
+
const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
|
|
182
|
+
const name = (0, import_utils.getResourceTitle)(
|
|
183
|
+
appointmentBooking,
|
|
184
|
+
resourceItem == null ? void 0 : resourceItem.code,
|
|
185
|
+
utils,
|
|
186
|
+
resourceItem
|
|
187
|
+
);
|
|
188
|
+
return name;
|
|
189
|
+
}, [currentSelectedResources]);
|
|
190
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-resource-wrap" }, loading ? /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true }) : !(resourcesResult == null ? void 0 : resourcesResult.length) ? /* @__PURE__ */ import_react.default.createElement(
|
|
191
|
+
import_materials.PisellEmpty,
|
|
192
|
+
{
|
|
193
|
+
description: import_utils2.locales.getText("pisell2.appointment.resource.tip")(
|
|
194
|
+
currentResourceName
|
|
195
|
+
),
|
|
196
|
+
maxWidth: 400,
|
|
197
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Image, { src: import_resource.default, preview: false, width: 44 })
|
|
198
|
+
}
|
|
199
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
161
200
|
import_materials.PisellCustomCheckboxGroup,
|
|
162
201
|
{
|
|
163
202
|
dataSource: resourcesResult,
|
|
@@ -197,6 +197,7 @@ var useAppointmentBookingStep = () => {
|
|
|
197
197
|
(0, import_utils3.scrollToFirstErrorCard)();
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
+
let preKey = "";
|
|
200
201
|
currentSelectedResources == null ? void 0 : currentSelectedResources.forEach((cart) => {
|
|
201
202
|
var _a3, _b3;
|
|
202
203
|
const selectedResource2 = cart == null ? void 0 : cart.currentSelectedResource;
|
|
@@ -207,7 +208,8 @@ var useAppointmentBookingStep = () => {
|
|
|
207
208
|
if (formId) {
|
|
208
209
|
const description = import_utils.locales.getText("pisell2.appointment.fill-form");
|
|
209
210
|
const beforeKey = (0, import_utils2.getFormInsertBeforeKey)(currentKey, stepList2);
|
|
210
|
-
appointmentBooking.addStep({ key: formKey, description }, beforeKey);
|
|
211
|
+
appointmentBooking.addStep({ key: formKey, description }, preKey || beforeKey);
|
|
212
|
+
preKey = formKey;
|
|
211
213
|
} else {
|
|
212
214
|
appointmentBooking.removeStep(formKey);
|
|
213
215
|
}
|
|
@@ -235,12 +237,19 @@ var useAppointmentBookingStep = () => {
|
|
|
235
237
|
if (((_f = nextStep2 == null ? void 0 : nextStep2.key) == null ? void 0 : _f.startsWith("select-resource_")) || (nextStep2 == null ? void 0 : nextStep2.key) === "confirm-information") {
|
|
236
238
|
const selectedResource = ((_g = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _g.currentSelectedResource) || {};
|
|
237
239
|
const renderItem = (selectedResource == null ? void 0 : selectedResource.renderItem) || {};
|
|
238
|
-
const checkHolder = () => {
|
|
240
|
+
const checkHolder = async () => {
|
|
239
241
|
setLoading(false);
|
|
240
242
|
if (isRetailTemplate || (appointmentBooking == null ? void 0 : appointmentBooking.isCartAllNormalProducts())) {
|
|
241
243
|
return appointmentBooking.next();
|
|
242
244
|
}
|
|
243
|
-
|
|
245
|
+
let cartLists = carts || [];
|
|
246
|
+
if (!(carts == null ? void 0 : carts.length)) {
|
|
247
|
+
const newCarts = await appointmentBooking.getCart();
|
|
248
|
+
cartLists = newCarts || [];
|
|
249
|
+
} else {
|
|
250
|
+
cartLists = carts || [];
|
|
251
|
+
}
|
|
252
|
+
const appoimentCarts = cartLists.filter((n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id)));
|
|
244
253
|
const { hasError } = (0, import_utils2.checkAndGoNext)(isFormSubject, checkAccount, appoimentCarts);
|
|
245
254
|
setIsErrorHolder(hasError);
|
|
246
255
|
if (hasError) {
|
|
@@ -106,6 +106,7 @@ declare const _default: {
|
|
|
106
106
|
'pisell2.appointment.add-guests': string;
|
|
107
107
|
'pisell2.appointment.policy': string;
|
|
108
108
|
'pisell2.appointment.policy.confirm': string;
|
|
109
|
+
'pisell2.appointment.resource.tip': (val: string) => string;
|
|
109
110
|
'pisell2.text.apply': string;
|
|
110
111
|
'pisell2.text.goodpass': string;
|
|
111
112
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -223,6 +224,7 @@ declare const _default: {
|
|
|
223
224
|
'pisell2.appointment.add-guests': string;
|
|
224
225
|
'pisell2.appointment.policy': string;
|
|
225
226
|
'pisell2.appointment.policy.confirm': string;
|
|
227
|
+
'pisell2.appointment.resource.tip': (val: string) => string;
|
|
226
228
|
'pisell2.text.apply': string;
|
|
227
229
|
'pisell2.text.goodpass': string;
|
|
228
230
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -340,6 +342,7 @@ declare const _default: {
|
|
|
340
342
|
'pisell2.appointment.add-guests': string;
|
|
341
343
|
'pisell2.appointment.policy': string;
|
|
342
344
|
'pisell2.appointment.policy.confirm': string;
|
|
345
|
+
'pisell2.appointment.resource.tip': (val: string) => string;
|
|
343
346
|
'pisell2.text.apply': string;
|
|
344
347
|
'pisell2.text.goodpass': string;
|
|
345
348
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -130,6 +130,7 @@ var locales_default = {
|
|
|
130
130
|
"pisell2.appointment.add-guests": "Add guests",
|
|
131
131
|
"pisell2.appointment.policy": "You have read and agreed to this policy",
|
|
132
132
|
"pisell2.appointment.policy.confirm": "Confirm",
|
|
133
|
+
"pisell2.appointment.resource.tip": (val) => `Tip: Change ${val || "resource"} using the dropdown in the cart.`,
|
|
133
134
|
"pisell2.text.apply": "Apply",
|
|
134
135
|
"pisell2.text.goodpass": "GoodPass",
|
|
135
136
|
"pisell2.text.goodpass.product-vouchers": "Product Vouchers",
|
|
@@ -247,6 +248,7 @@ var locales_default = {
|
|
|
247
248
|
"pisell2.appointment.add-guests": "添加预约人",
|
|
248
249
|
"pisell2.appointment.policy": "您已仔细阅读并同意此协议",
|
|
249
250
|
"pisell2.appointment.policy.confirm": "确定",
|
|
251
|
+
"pisell2.appointment.resource.tip": (val) => `提示:在右侧购物车中,通过下拉框修改“${val || "资源"}”`,
|
|
250
252
|
"pisell2.text.apply": "应用",
|
|
251
253
|
"pisell2.text.goodpass": "商品券",
|
|
252
254
|
"pisell2.text.goodpass.product-vouchers": "商品兑换券",
|
|
@@ -364,6 +366,7 @@ var locales_default = {
|
|
|
364
366
|
"pisell2.appointment.add-guests": "添加預約人",
|
|
365
367
|
"pisell2.appointment.policy": "您已仔細閱讀並同意此協議",
|
|
366
368
|
"pisell2.appointment.policy.confirm": "確定",
|
|
369
|
+
"pisell2.appointment.resource.tip": (val) => `提示:在右側購物車中,透過下拉框修改“${val || "資源"}”`,
|
|
367
370
|
"pisell2.text.apply": "應用",
|
|
368
371
|
"pisell2.text.goodpass": "商品券",
|
|
369
372
|
"pisell2.text.goodpass.product-vouchers": "商品兌換券",
|
|
@@ -36,6 +36,8 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_utils = require("@pisell/utils");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_utils2 = require("../../../utils");
|
|
39
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
40
|
+
var import_pisellPriceText = __toESM(require("../../../../productSelect/components/pisellPriceText"));
|
|
39
41
|
var import_index = require("./index.less");
|
|
40
42
|
var ProductItem = ({
|
|
41
43
|
item,
|
|
@@ -44,6 +46,11 @@ var ProductItem = ({
|
|
|
44
46
|
style,
|
|
45
47
|
className
|
|
46
48
|
}) => {
|
|
49
|
+
const { price, is_bundle, minimum_markup_price } = item;
|
|
50
|
+
let _price = price;
|
|
51
|
+
if (is_bundle) {
|
|
52
|
+
_price = new import_decimal.default(price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
|
|
53
|
+
}
|
|
47
54
|
const stockText = (0, import_react.useMemo)(() => {
|
|
48
55
|
if (item.is_track === 0) {
|
|
49
56
|
return false;
|
|
@@ -73,7 +80,7 @@ var ProductItem = ({
|
|
|
73
80
|
className: "server-product-title"
|
|
74
81
|
},
|
|
75
82
|
item.title
|
|
76
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), stockText && /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, stockText), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" },
|
|
83
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), stockText && /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, stockText), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" }, /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: _price, isMini: is_bundle })))
|
|
77
84
|
);
|
|
78
85
|
};
|
|
79
86
|
var productItem_default = ProductItem;
|
|
@@ -38,7 +38,7 @@ var import_ArrowLeft = __toESM(require("@pisell/icon/es/ArrowLeft"));
|
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
40
|
var Drawer = (props) => {
|
|
41
|
-
const { hideScrollBar = true, showGoBack = true } = props;
|
|
41
|
+
const { hideScrollBar = true, showGoBack = true, mask = false } = props;
|
|
42
42
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
43
43
|
import_antd.Drawer,
|
|
44
44
|
{
|
|
@@ -52,7 +52,7 @@ var Drawer = (props) => {
|
|
|
52
52
|
title: false,
|
|
53
53
|
bodyStyle: { padding: 0 },
|
|
54
54
|
push: false,
|
|
55
|
-
mask
|
|
55
|
+
mask
|
|
56
56
|
},
|
|
57
57
|
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__booking-drawer-title-wrap") }, /* @__PURE__ */ import_react.default.createElement(
|
|
58
58
|
"div",
|
|
@@ -101,24 +101,28 @@ var VoucherCard = (props) => {
|
|
|
101
101
|
});
|
|
102
102
|
return val;
|
|
103
103
|
}, [state.service.value]);
|
|
104
|
+
const { run } = (0, import_ahooks.useDebounceFn)(
|
|
105
|
+
() => {
|
|
106
|
+
var _a2, _b2;
|
|
107
|
+
if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (isBooking4Shop) {
|
|
111
|
+
const val = shopDiscount.calcDiscount(state.service.value);
|
|
112
|
+
productRef.current = val.productList;
|
|
113
|
+
dispatch({
|
|
114
|
+
type: "setService",
|
|
115
|
+
payload: {
|
|
116
|
+
...services,
|
|
117
|
+
value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{ wait: 500 }
|
|
123
|
+
);
|
|
104
124
|
(0, import_react.useEffect)(() => {
|
|
105
|
-
|
|
106
|
-
if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
if (isBooking4Shop) {
|
|
110
|
-
const val = shopDiscount.calcDiscount(state.service.value);
|
|
111
|
-
console.log("input: ", state.service.value);
|
|
112
|
-
console.log("output: ", val);
|
|
113
|
-
productRef.current = val.productList;
|
|
114
|
-
dispatch({
|
|
115
|
-
type: "setService",
|
|
116
|
-
payload: {
|
|
117
|
-
...services,
|
|
118
|
-
value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
125
|
+
run();
|
|
122
126
|
}, [JSON.stringify(serviceMemo), isBooking4Shop]);
|
|
123
127
|
const fn = (0, import_ahooks.useMemoizedFn)((result) => {
|
|
124
128
|
var _a2;
|
|
@@ -135,18 +139,18 @@ var VoucherCard = (props) => {
|
|
|
135
139
|
});
|
|
136
140
|
(0, import_react.useEffect)(() => {
|
|
137
141
|
if (!isBooking4Shop) return;
|
|
138
|
-
pisellos.effects.on(ShopDiscountHooks.onScanCustomerChange, (customer) => {
|
|
139
|
-
dispatch({
|
|
140
|
-
type: "setClient",
|
|
141
|
-
payload: {
|
|
142
|
-
value: customer
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
142
|
pisellos.effects.on(
|
|
147
|
-
ShopDiscountHooks.
|
|
148
|
-
|
|
143
|
+
ShopDiscountHooks.onScanCustomerChange,
|
|
144
|
+
(customer) => {
|
|
145
|
+
dispatch({
|
|
146
|
+
type: "setClient",
|
|
147
|
+
payload: {
|
|
148
|
+
value: customer
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
149
152
|
);
|
|
153
|
+
pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, fn);
|
|
150
154
|
pisellos.effects.on(
|
|
151
155
|
ShopDiscountHooks.onDiscountListChange,
|
|
152
156
|
(discount) => {
|
|
@@ -306,7 +306,8 @@ var Client = () => {
|
|
|
306
306
|
isPreview: false,
|
|
307
307
|
drawerProps: {
|
|
308
308
|
title: import_utils.locales.getText("pisell2.text.select-customer"),
|
|
309
|
-
destroyOnClose: true
|
|
309
|
+
destroyOnClose: true,
|
|
310
|
+
mask: state.drawerMask
|
|
310
311
|
},
|
|
311
312
|
mode: "single",
|
|
312
313
|
createItemText: import_utils.locales.getText("pisell2.text.create-new-customer"),
|
|
@@ -463,6 +463,9 @@ var Pet = (props) => {
|
|
|
463
463
|
...((_c3 = (_b3 = (_a3 = state.pet) == null ? void 0 : _a3.formData) == null ? void 0 : _b3[0]) == null ? void 0 : _c3.options) || []
|
|
464
464
|
]);
|
|
465
465
|
},
|
|
466
|
+
drawerProps: {
|
|
467
|
+
mask: state.drawerMask
|
|
468
|
+
},
|
|
466
469
|
getHolders,
|
|
467
470
|
addCallbackService: addCallback,
|
|
468
471
|
loading: valueLoading,
|