@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
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import { useDebounceFn } from 'ahooks';
|
|
10
|
+
import ChevronLeft from '@pisell/icon/es/ChevronLeft';
|
|
11
|
+
import ChevronRight from '@pisell/icon/es/ChevronRight';
|
|
12
|
+
import "./index.less";
|
|
13
|
+
|
|
14
|
+
// tabs 子组件定义
|
|
15
|
+
|
|
16
|
+
// 定义主键类型
|
|
17
|
+
|
|
18
|
+
// Tabs 可传递的参数
|
|
19
|
+
|
|
20
|
+
var Tabs = function Tabs(_ref, ref) {
|
|
21
|
+
var renderTab = _ref.renderTab,
|
|
22
|
+
rowKey = _ref.rowKey,
|
|
23
|
+
_ref$name = _ref.name,
|
|
24
|
+
name = _ref$name === void 0 ? 'tabs-' : _ref$name,
|
|
25
|
+
onChange = _ref.onChange,
|
|
26
|
+
tab = _ref.tab,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
options = _ref.options;
|
|
29
|
+
var _useState = useState(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
isShowButton = _useState2[0],
|
|
32
|
+
setIsShowButton = _useState2[1];
|
|
33
|
+
useImperativeHandle(ref, function () {
|
|
34
|
+
return {
|
|
35
|
+
scroll: function scroll(tab) {
|
|
36
|
+
if (tab) {
|
|
37
|
+
var dom = document.querySelector("#".concat(name).concat(tab));
|
|
38
|
+
if (dom) {
|
|
39
|
+
setTabScroll(dom === null || dom === void 0 ? void 0 : dom.offsetLeft);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* @Title: 改变tab事件
|
|
47
|
+
* @Describe:
|
|
48
|
+
* @Author: Wzw
|
|
49
|
+
* @param {RowKey} _key
|
|
50
|
+
*/
|
|
51
|
+
var _onChange = function _onChange(_key, _item, e) {
|
|
52
|
+
// setScroll(_tab, _key);
|
|
53
|
+
// 如果传入了tab 并且有onChange, 则调用onChange, 否则设置组件内部tab
|
|
54
|
+
if (onChange) {
|
|
55
|
+
onChange(_key, _item);
|
|
56
|
+
}
|
|
57
|
+
setTabScroll(e.target.offsetLeft);
|
|
58
|
+
};
|
|
59
|
+
useEffect(function () {
|
|
60
|
+
if (options !== null && options !== void 0 && options.length) {
|
|
61
|
+
calculateWidth();
|
|
62
|
+
}
|
|
63
|
+
}, [options]);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @title: 判断是否展示箭头
|
|
67
|
+
* @description:
|
|
68
|
+
* @return {*}
|
|
69
|
+
* @Author: chensheng.gu
|
|
70
|
+
* @Date: 2023-08-01 15:59
|
|
71
|
+
*/
|
|
72
|
+
var calculateWidth = function calculateWidth() {
|
|
73
|
+
var tabsWrapper = document.querySelector('#pisell-tabs');
|
|
74
|
+
var tabsContent = document.querySelector('#pisell-tabs-content');
|
|
75
|
+
if ((tabsContent === null || tabsContent === void 0 ? void 0 : tabsContent.offsetWidth) + 60 > (tabsWrapper === null || tabsWrapper === void 0 ? void 0 : tabsWrapper.offsetWidth)) {
|
|
76
|
+
setIsShowButton(true);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @title: 选项
|
|
82
|
+
* @description:
|
|
83
|
+
* @param {*} useMemo
|
|
84
|
+
* @return {*}
|
|
85
|
+
* @Author: zhiwei.Wang
|
|
86
|
+
* @Date: 2023-06-03 10:44
|
|
87
|
+
*/
|
|
88
|
+
var _options = useMemo(function () {
|
|
89
|
+
return options || [];
|
|
90
|
+
}, [options]);
|
|
91
|
+
|
|
92
|
+
// 左侧按钮宽度
|
|
93
|
+
var _useState3 = useState(40),
|
|
94
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
95
|
+
leftWidth = _useState4[0],
|
|
96
|
+
setLeftWidth = _useState4[1];
|
|
97
|
+
var _useState5 = useState(false),
|
|
98
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
99
|
+
leftActive = _useState6[0],
|
|
100
|
+
setLeftActive = _useState6[1];
|
|
101
|
+
//右侧按钮宽度
|
|
102
|
+
var _useState7 = useState(40),
|
|
103
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
104
|
+
rightWidth = _useState8[0],
|
|
105
|
+
setRightWidth = _useState8[1];
|
|
106
|
+
var _useState9 = useState(true),
|
|
107
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
108
|
+
rightActive = _useState10[0],
|
|
109
|
+
setRightActive = _useState10[1];
|
|
110
|
+
|
|
111
|
+
// 防抖
|
|
112
|
+
var debounceChange = useDebounceFn(function (_ref2) {
|
|
113
|
+
var current = _ref2.current,
|
|
114
|
+
total = _ref2.total;
|
|
115
|
+
if (current === 0) {
|
|
116
|
+
// setLeftWidth(0);
|
|
117
|
+
setLeftActive(false);
|
|
118
|
+
} else {
|
|
119
|
+
// setLeftWidth(40);
|
|
120
|
+
setLeftActive(true);
|
|
121
|
+
}
|
|
122
|
+
if (current + 10 >= total) {
|
|
123
|
+
// setRightWidth(0);
|
|
124
|
+
setRightActive(false);
|
|
125
|
+
} else {
|
|
126
|
+
// setRightWidth(40);
|
|
127
|
+
setRightActive(true);
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
wait: 200
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// 滚动时触发
|
|
134
|
+
var onScroll = function onScroll(e) {
|
|
135
|
+
var total = e.target.scrollWidth - e.target.clientWidth;
|
|
136
|
+
var current = e.target.scrollLeft;
|
|
137
|
+
debounceChange.run({
|
|
138
|
+
current: current,
|
|
139
|
+
total: total
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// 设置滚动位置
|
|
144
|
+
var setTabScroll = function setTabScroll(val) {
|
|
145
|
+
var dom = document.querySelector('#pisell-tabs-content');
|
|
146
|
+
console.log('domdom', dom);
|
|
147
|
+
if (!dom) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
dom.scrollLeft = val;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @title: 手动触发滚动位置
|
|
155
|
+
* @description:
|
|
156
|
+
* @param {*} type
|
|
157
|
+
* @return {*}
|
|
158
|
+
* @Author: zhiwei.Wang
|
|
159
|
+
* @Date: 2023-06-03 10:45
|
|
160
|
+
*/
|
|
161
|
+
var onPageChange = function onPageChange(type) {
|
|
162
|
+
var dom = document.querySelector('#pisell-tabs-content');
|
|
163
|
+
if (!dom) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (type === 'left') {
|
|
167
|
+
setTabScroll((dom === null || dom === void 0 ? void 0 : dom.scrollLeft) - dom.clientWidth / 2);
|
|
168
|
+
} else {
|
|
169
|
+
setTabScroll((dom === null || dom === void 0 ? void 0 : dom.scrollLeft) + dom.clientWidth / 2);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// 左侧按钮
|
|
174
|
+
var leftBtn = useMemo(function () {
|
|
175
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: "booking-pisell-tabs-btn-left",
|
|
177
|
+
style: {
|
|
178
|
+
width: leftWidth,
|
|
179
|
+
// marginLeft: !leftWidth ? '20px' : 0,
|
|
180
|
+
opacity: leftActive ? 1 : 0.3
|
|
181
|
+
},
|
|
182
|
+
onClick: function onClick() {
|
|
183
|
+
onPageChange('left');
|
|
184
|
+
}
|
|
185
|
+
}, /*#__PURE__*/React.createElement(ChevronRight, {
|
|
186
|
+
className: "booking-pisell-tabs-btn-icon"
|
|
187
|
+
}));
|
|
188
|
+
}, [leftWidth, leftActive]);
|
|
189
|
+
|
|
190
|
+
// 右侧按钮
|
|
191
|
+
var rightBtn = useMemo(function () {
|
|
192
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
className: "booking-pisell-tabs-btn-right",
|
|
194
|
+
style: {
|
|
195
|
+
width: rightWidth,
|
|
196
|
+
// marginRight: !rightWidth ? '20px' : 0,
|
|
197
|
+
opacity: rightActive ? 1 : 0.3
|
|
198
|
+
},
|
|
199
|
+
onClick: function onClick() {
|
|
200
|
+
onPageChange('right');
|
|
201
|
+
}
|
|
202
|
+
}, /*#__PURE__*/React.createElement(ChevronLeft, {
|
|
203
|
+
type: "icona-iconArrowsLine",
|
|
204
|
+
className: "booking-pisell-tabs-btn-icon"
|
|
205
|
+
}));
|
|
206
|
+
}, [rightWidth, rightActive]);
|
|
207
|
+
|
|
208
|
+
// 中间内容
|
|
209
|
+
var content = useMemo(function () {
|
|
210
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: "booking-pisell-tabs-content",
|
|
212
|
+
id: "pisell-tabs-content",
|
|
213
|
+
onScroll: onScroll,
|
|
214
|
+
style: {
|
|
215
|
+
width: 'unset'
|
|
216
|
+
}
|
|
217
|
+
}, !isShowButton ? /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
style: {
|
|
219
|
+
width: 4
|
|
220
|
+
}
|
|
221
|
+
}) : null, _options.map(function (d, i) {
|
|
222
|
+
var _key = rowKey ? d[rowKey] : i;
|
|
223
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
224
|
+
className: classNames('booking-pisell-tabs-tab', {
|
|
225
|
+
'booking-pisell-tabs-tab-active': tab === _key
|
|
226
|
+
}),
|
|
227
|
+
key: _key,
|
|
228
|
+
id: name + '' + _key,
|
|
229
|
+
onClick: function onClick(e) {
|
|
230
|
+
_onChange(_key, d, e);
|
|
231
|
+
}
|
|
232
|
+
}, renderTab ? renderTab(d) : /*#__PURE__*/React.createElement("div", {
|
|
233
|
+
className: "booking-pisell-tabs-tab-content"
|
|
234
|
+
}, d.name));
|
|
235
|
+
}));
|
|
236
|
+
}, [_options, rowKey, name, tab, isShowButton]);
|
|
237
|
+
console.log('isShow', isShowButton);
|
|
238
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: classNames('booking-pisell-tabs', className),
|
|
240
|
+
id: "pisell-tabs"
|
|
241
|
+
}, isShowButton && leftBtn, content, isShowButton && rightBtn);
|
|
242
|
+
};
|
|
243
|
+
export default /*#__PURE__*/forwardRef(Tabs);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
.booking-pisell-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
-webkit-box-align: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
font-size: 17px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
color: #0d1619;
|
|
10
|
+
cursor: default;
|
|
11
|
+
|
|
12
|
+
.booking-pisell-tabs-btn-left,
|
|
13
|
+
.booking-pisell-tabs-btn-right {
|
|
14
|
+
-webkit-box-flex: 0;
|
|
15
|
+
flex-grow: 0;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
transition: width 300ms ease 0s;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
overflow: visible;
|
|
20
|
+
background: #fff;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
width: 40px;
|
|
23
|
+
height: 40px;
|
|
24
|
+
display: flex;
|
|
25
|
+
-webkit-box-align: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
-webkit-box-pack: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
user-select: none;
|
|
31
|
+
|
|
32
|
+
.booking-pisell-tabs-btn-icon {
|
|
33
|
+
width: 24px;
|
|
34
|
+
height: 24px;
|
|
35
|
+
background: #f1f1f1;
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
color: #262626;
|
|
41
|
+
font-size: 20px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.booking-pisell-tabs-btn-left {
|
|
46
|
+
.booking-pisell-tabs-btn-icon {
|
|
47
|
+
transform: rotate(180deg);
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.booking-pisell-tabs-btn-right {
|
|
53
|
+
/* White */
|
|
54
|
+
|
|
55
|
+
background: #ffffff;
|
|
56
|
+
/* shadow-lg */
|
|
57
|
+
|
|
58
|
+
// box-shadow: 0px 6px 15px -3px rgba(0, 0, 0, 0.15);
|
|
59
|
+
|
|
60
|
+
.booking-pisell-tabs-btn-icon {
|
|
61
|
+
transform: rotate(180deg);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.booking-pisell-tabs-content {
|
|
66
|
+
width: 100%;
|
|
67
|
+
max-width: none;
|
|
68
|
+
overflow: scroll hidden;
|
|
69
|
+
scroll-snap-type: x mandatory;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
display: flex;
|
|
72
|
+
position: relative;
|
|
73
|
+
scroll-behavior: smooth;
|
|
74
|
+
|
|
75
|
+
/*滚动条样式*/
|
|
76
|
+
&::-webkit-scrollbar {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&::-webkit-scrollbar-thumb {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&::-webkit-scrollbar-track {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.booking-pisell-tabs-tab {
|
|
89
|
+
scroll-snap-align: start;
|
|
90
|
+
white-space: initial;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
|
|
94
|
+
.booking-pisell-tabs-tab-content {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
height: 40px;
|
|
97
|
+
padding: 0px 16px;
|
|
98
|
+
border-radius: 88px;
|
|
99
|
+
-webkit-box-align: center;
|
|
100
|
+
align-items: center;
|
|
101
|
+
transition: all 300ms ease 0s;
|
|
102
|
+
color: #1b1b1b;
|
|
103
|
+
letter-spacing: 0px;
|
|
104
|
+
min-width: 0px;
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
white-space: nowrap;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:hover {
|
|
113
|
+
.booking-pisell-tabs-tab-content {
|
|
114
|
+
background-color: #f1f1f1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.booking-pisell-tabs-tab-active {
|
|
119
|
+
.booking-pisell-tabs-tab-content {
|
|
120
|
+
color: #fff;
|
|
121
|
+
background: var(--primary-600, #7F56D9);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
value: string | number;
|
|
4
|
+
isMini?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
prefix?: React.ReactElement;
|
|
8
|
+
suffix?: React.ReactElement;
|
|
9
|
+
}
|
|
10
|
+
declare const index: (props: IProps) => JSX.Element;
|
|
11
|
+
export default index;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import { PisellText } from '@pisell/materials';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
11
|
+
var index = function index(props) {
|
|
12
|
+
var _context$appHelper$ut;
|
|
13
|
+
var context = useEngineContext();
|
|
14
|
+
var value = props.value;
|
|
15
|
+
var locale = ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en';
|
|
16
|
+
var _useMemo = useMemo(function () {
|
|
17
|
+
if (!props.isMini) return ['', ''];
|
|
18
|
+
if (!locale) return ['From', ''];
|
|
19
|
+
if (locale.toLowerCase().includes('zh')) return ['', '起'];
|
|
20
|
+
return ['From', ''];
|
|
21
|
+
}, [locale, props.isMini]),
|
|
22
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
23
|
+
_prefix = _useMemo2[0],
|
|
24
|
+
_suffix = _useMemo2[1];
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: classNames('pisell-price-text', props.className)
|
|
27
|
+
}, props.prefix, _prefix ? /*#__PURE__*/React.createElement("span", {
|
|
28
|
+
className: "pisell-price-text-prefix-text",
|
|
29
|
+
style: {
|
|
30
|
+
fontSize: '0.65em',
|
|
31
|
+
marginRight: 4
|
|
32
|
+
}
|
|
33
|
+
}, _prefix) : null, /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
34
|
+
value: value
|
|
35
|
+
}), _suffix ? /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
style: {
|
|
37
|
+
fontSize: '0.65em',
|
|
38
|
+
marginLeft: 4
|
|
39
|
+
},
|
|
40
|
+
className: "pisell-price-text-suffix-text"
|
|
41
|
+
}, _suffix) : null, props.suffix);
|
|
42
|
+
};
|
|
43
|
+
export default index;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import GridLayout from "../gridLayout";
|
|
4
|
-
import { PisellText } from '@pisell/materials';
|
|
5
4
|
import { locales } from '@pisell/utils';
|
|
6
5
|
import { Skeleton } from 'antd';
|
|
6
|
+
import Decimal from 'decimal.js';
|
|
7
7
|
import "./index.less";
|
|
8
|
+
import PisellPriceText from "../pisellPriceText";
|
|
8
9
|
|
|
9
10
|
// 装修端配置项均为 isXXX,这里先适配一部分
|
|
10
11
|
|
|
@@ -55,17 +56,29 @@ var ProductGroup = function ProductGroup(_ref) {
|
|
|
55
56
|
return "".concat(locales.getText('pisell2.product-select.stock'), "\uFF1A").concat(item.stock_quantity);
|
|
56
57
|
};
|
|
57
58
|
var renderPrice = function renderPrice(item) {
|
|
58
|
-
|
|
59
|
+
var _price = item.price,
|
|
60
|
+
_original_price = item.original_price,
|
|
61
|
+
is_bundle = item.is_bundle,
|
|
62
|
+
minimum_markup_price = item.minimum_markup_price;
|
|
63
|
+
var price = _price;
|
|
64
|
+
var original_price = _original_price;
|
|
65
|
+
if (is_bundle) {
|
|
66
|
+
price = new Decimal(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
|
|
67
|
+
original_price = new Decimal(original_price).plus(new Decimal(minimum_markup_price)).toFixed(2);
|
|
68
|
+
}
|
|
69
|
+
if (!showZeroPrice && !parseFloat(price)) return null;
|
|
59
70
|
return !!isPrice || !!isOriginPrice ? /*#__PURE__*/React.createElement("div", {
|
|
60
71
|
className: "price-info"
|
|
61
72
|
}, isPrice ? /*#__PURE__*/React.createElement("div", {
|
|
62
73
|
className: "price"
|
|
63
|
-
}, /*#__PURE__*/React.createElement(
|
|
64
|
-
value:
|
|
65
|
-
|
|
74
|
+
}, /*#__PURE__*/React.createElement(PisellPriceText, {
|
|
75
|
+
value: price,
|
|
76
|
+
isMini: is_bundle
|
|
77
|
+
})) : null, !!isOriginPrice && parseFloat(original_price) ? /*#__PURE__*/React.createElement("div", {
|
|
66
78
|
className: "original-price"
|
|
67
|
-
}, /*#__PURE__*/React.createElement(
|
|
68
|
-
value:
|
|
79
|
+
}, /*#__PURE__*/React.createElement(PisellPriceText, {
|
|
80
|
+
value: original_price,
|
|
81
|
+
isMini: is_bundle
|
|
69
82
|
})) : null) : null;
|
|
70
83
|
};
|
|
71
84
|
var renderItem = function renderItem(item) {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.product-card {
|
|
20
|
+
user-select: none;
|
|
20
21
|
cursor: pointer;
|
|
21
22
|
border-radius: 12px;
|
|
22
23
|
background: var(--ps-card-bg, #fff);
|
|
@@ -195,7 +196,19 @@
|
|
|
195
196
|
font-style: normal;
|
|
196
197
|
font-weight: 400;
|
|
197
198
|
line-height: 24px;
|
|
198
|
-
text-decoration-line: line-through;
|
|
199
|
+
// text-decoration-line: line-through;
|
|
200
|
+
position: relative;
|
|
201
|
+
&::before {
|
|
202
|
+
content: '';
|
|
203
|
+
display: block;
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: 50%;
|
|
206
|
+
left: 0;
|
|
207
|
+
width: 100%;
|
|
208
|
+
height: 1px;
|
|
209
|
+
background-color: #4e4e4e;
|
|
210
|
+
transform: translateY(-50%);
|
|
211
|
+
}
|
|
199
212
|
|
|
200
213
|
> span {
|
|
201
214
|
vertical-align: middle;
|
|
@@ -58,14 +58,13 @@
|
|
|
58
58
|
.booking-pisell-tabs-tab {
|
|
59
59
|
.booking-pisell-tabs-tab-content {
|
|
60
60
|
background: var(--ps-tab-item-bg, #ffffff) !important;
|
|
61
|
-
font-weight:
|
|
61
|
+
font-weight: 600;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.booking-pisell-tabs-tab-active {
|
|
66
66
|
.booking-pisell-tabs-tab-content {
|
|
67
67
|
background: var(--ps-tab-item-active-bg, #8157d5) !important;
|
|
68
|
-
font-weight: 600;
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
|
@@ -20,7 +20,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
20
20
|
import { getUniqueId, locales } from '@pisell/utils';
|
|
21
21
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
22
22
|
import { useMemoizedFn } from 'ahooks';
|
|
23
|
-
import { PisellToast } from '@pisell/materials';
|
|
24
23
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
25
24
|
import { isSessionProduct, request, getProductTotalPrice, getIsEject } from "../../../booking/utils";
|
|
26
25
|
import { getProductExtend } from "../../../booking/info2/service/addService/utils";
|
|
@@ -31,16 +30,16 @@ import { getProductDetail } from "../../../booking/info/service/serve";
|
|
|
31
30
|
import { useService } from "../../../booking/info/service/serviceManager";
|
|
32
31
|
import ProductSelect from "../../../productSelect";
|
|
33
32
|
import "./index.less";
|
|
34
|
-
import { addService } from "../../utils";
|
|
33
|
+
import { addService, addServiceScroll } from "../../utils";
|
|
35
34
|
import NotAvailable from "../notAvailable";
|
|
36
35
|
var AddSerivce = function AddSerivce(props) {
|
|
37
|
-
var _context$appHelper$ut, _context$appHelper$ut2, _state$bookingConfig2, _state$client2, _state$service5, _state$service6;
|
|
36
|
+
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _state$bookingConfig2, _state$client2, _state$service5, _state$service6;
|
|
38
37
|
var onEdit = props.onEdit,
|
|
39
38
|
state = props.state,
|
|
40
39
|
dispatch = props.dispatch,
|
|
41
40
|
_props$renderMode = props.renderMode,
|
|
42
41
|
renderMode = _props$renderMode === void 0 ? 'current' : _props$renderMode;
|
|
43
|
-
var _useState = useState(
|
|
42
|
+
var _useState = useState(true),
|
|
44
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
44
|
loading = _useState2[0],
|
|
46
45
|
setLoading = _useState2[1];
|
|
@@ -48,6 +47,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
48
47
|
var notAvailableRef = useRef(null);
|
|
49
48
|
var isLoadedServiceRef = useRef(false);
|
|
50
49
|
request.setRequest(context.appHelper.utils.request);
|
|
50
|
+
var Toast = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.Toast;
|
|
51
51
|
var _useService = useService({
|
|
52
52
|
renderMode: renderMode,
|
|
53
53
|
onEdit: onEdit,
|
|
@@ -287,7 +287,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
287
287
|
},
|
|
288
288
|
callback: function () {
|
|
289
289
|
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
|
|
290
|
-
var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _list;
|
|
290
|
+
var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity;
|
|
291
291
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
292
292
|
while (1) switch (_context3.prev = _context3.next) {
|
|
293
293
|
case 0:
|
|
@@ -356,17 +356,23 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
356
356
|
}
|
|
357
357
|
cacheItem = getProductExtend({
|
|
358
358
|
cacheItem: cacheItem,
|
|
359
|
-
state: state
|
|
359
|
+
state: state,
|
|
360
|
+
isDisabledTime: true
|
|
360
361
|
});
|
|
361
362
|
if (state.renderType === 'eventBooking') {
|
|
362
363
|
cacheItem.autoClose = false;
|
|
363
364
|
}
|
|
364
365
|
if (cacheItem.autoClose) {
|
|
365
366
|
cacheItem.autoClose = false;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
367
|
+
_addService = addService(state.service.value, cacheItem), _list = _addService.list, quantity = _addService.quantity;
|
|
368
|
+
Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
|
|
369
|
+
className: "add-toast-wrap"
|
|
370
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
371
|
+
className: "add-toast-title"
|
|
372
|
+
}, cacheItem.title), /*#__PURE__*/React.createElement("div", {
|
|
373
|
+
className: "add-toast-quantity"
|
|
374
|
+
}, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
|
|
375
|
+
addServiceScroll(e.rowKey, cacheItem);
|
|
370
376
|
dispatch({
|
|
371
377
|
type: 'setService',
|
|
372
378
|
payload: {
|
|
@@ -286,6 +286,7 @@ var TicketBooking = function TicketBooking() {
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
+
_modalState.service.value = [];
|
|
289
290
|
_modalState.service.cacheItem = null;
|
|
290
291
|
_modalState.service.addTimeModal = false;
|
|
291
292
|
_modalState.service.changeService = false;
|
|
@@ -808,7 +809,8 @@ var TicketBooking = function TicketBooking() {
|
|
|
808
809
|
locale: engineProps.locale,
|
|
809
810
|
refreshData: _refreshData,
|
|
810
811
|
setActiveTab: _setActiveTab,
|
|
811
|
-
clearAllValue: _clearAllValue
|
|
812
|
+
clearAllValue: _clearAllValue,
|
|
813
|
+
drawerMask: true
|
|
812
814
|
}),
|
|
813
815
|
setGlobalState: _setModalState,
|
|
814
816
|
setState: setState,
|
|
@@ -8,6 +8,7 @@ import React, { useLayoutEffect, useMemo, useRef } from 'react';
|
|
|
8
8
|
import { Provider, createStore } from "./miniRedux";
|
|
9
9
|
import { locales } from '@pisell/utils';
|
|
10
10
|
import dayjs from 'dayjs';
|
|
11
|
+
import { cloneDeep } from 'lodash';
|
|
11
12
|
import TicketBooking from "./components/ticketBooking/index";
|
|
12
13
|
import { request } from "../../utils";
|
|
13
14
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
@@ -141,7 +142,7 @@ export default (function (props) {
|
|
|
141
142
|
request.setRequest(context.appHelper.utils.request);
|
|
142
143
|
}, []);
|
|
143
144
|
useMemo(function () {
|
|
144
|
-
var store = createStore(_objectSpread(_objectSpread({}, initialState), {}, {
|
|
145
|
+
var store = createStore(_objectSpread(_objectSpread({}, cloneDeep(initialState)), {}, {
|
|
145
146
|
bookingConfigParams: bookingConfigParams,
|
|
146
147
|
productExtensionType: productExtensionType
|
|
147
148
|
}));
|
|
@@ -47,6 +47,7 @@ declare const _default: {
|
|
|
47
47
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
48
48
|
"pisell2.ticket-booking.not-available-title": string;
|
|
49
49
|
"pisell2.ticket-booking.not-available-ok": string;
|
|
50
|
+
"pisell2.ticket-booking.in-cart": (number: number) => string;
|
|
50
51
|
};
|
|
51
52
|
"zh-CN": {
|
|
52
53
|
"pisell2.ticket-booking.info": string;
|
|
@@ -96,6 +97,7 @@ declare const _default: {
|
|
|
96
97
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
97
98
|
"pisell2.ticket-booking.not-available-title": string;
|
|
98
99
|
"pisell2.ticket-booking.not-available-ok": string;
|
|
100
|
+
"pisell2.ticket-booking.in-cart": (number: number) => string;
|
|
99
101
|
};
|
|
100
102
|
"zh-HK": {
|
|
101
103
|
"pisell2.ticket-booking.info": string;
|
|
@@ -145,6 +147,7 @@ declare const _default: {
|
|
|
145
147
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
146
148
|
"pisell2.ticket-booking.not-available-title": string;
|
|
147
149
|
"pisell2.ticket-booking.not-available-ok": string;
|
|
150
|
+
"pisell2.ticket-booking.in-cart": (number: number) => string;
|
|
148
151
|
};
|
|
149
152
|
};
|
|
150
153
|
export default _default;
|