@pisell/private-materials 3.0.210 → 3.0.212
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 +5 -5
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/Sales/Cart/index.js +3 -1
- package/es/components/Sales/Event/Detail.js +1 -1
- package/es/components/Sales/Init/index.d.ts +4 -0
- package/es/components/Sales/Init/index.js +6 -2
- package/es/components/Sales/Resource/serve.d.ts +1 -0
- package/es/components/Sales/Summary/index.d.ts +3 -0
- package/es/components/Sales/Summary/index.js +9 -3
- package/es/components/Sales/Summary/serve.d.ts +0 -2
- package/es/components/Sales/Summary/serve.js +0 -11
- package/es/components/Sales/Summary/utils.d.ts +15 -1
- package/es/components/Sales/Summary/utils.js +32 -3
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +40 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -8
- package/es/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
- package/es/components/eventBooking/components/Provider/Footer/index.js +2 -2
- package/es/components/eventBooking/components/Provider/Header/index.js +4 -2
- package/es/components/eventBooking/components/Provider/Resource/index.js +4 -21
- package/es/components/eventBooking/components/bookingDetailModal/index.js +98 -32
- package/es/components/eventBooking/components/bookingDetailModal/index.less +1 -1
- package/es/components/eventBooking/components/resourceDisplay/index.less +14 -0
- package/es/components/eventBooking/components/scheduleCalendar/index.less +12 -0
- package/es/components/eventBooking/index.js +2 -1
- package/es/components/eventBooking/locales.d.ts +6 -3
- package/es/components/eventBooking/locales.js +22 -7
- package/es/components/eventBooking/utils.d.ts +9 -0
- package/es/components/eventBooking/utils.js +17 -0
- package/lib/components/Sales/Cart/index.js +6 -4
- package/lib/components/Sales/Event/Detail.js +1 -1
- package/lib/components/Sales/Init/index.d.ts +4 -0
- package/lib/components/Sales/Init/index.js +5 -2
- package/lib/components/Sales/Resource/serve.d.ts +1 -0
- package/lib/components/Sales/Summary/index.d.ts +3 -0
- package/lib/components/Sales/Summary/index.js +11 -3
- package/lib/components/Sales/Summary/serve.d.ts +0 -2
- package/lib/components/Sales/Summary/serve.js +0 -37
- package/lib/components/Sales/Summary/utils.d.ts +15 -1
- package/lib/components/Sales/Summary/utils.js +25 -5
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +75 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -9
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
- package/lib/components/eventBooking/components/Provider/Footer/index.js +2 -2
- package/lib/components/eventBooking/components/Provider/Header/index.js +5 -2
- package/lib/components/eventBooking/components/Provider/Resource/index.js +4 -12
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +73 -17
- package/lib/components/eventBooking/components/bookingDetailModal/index.less +1 -1
- package/lib/components/eventBooking/components/resourceDisplay/index.less +14 -0
- package/lib/components/eventBooking/components/scheduleCalendar/index.less +12 -0
- package/lib/components/eventBooking/index.js +2 -1
- package/lib/components/eventBooking/locales.d.ts +6 -3
- package/lib/components/eventBooking/locales.js +10 -7
- package/lib/components/eventBooking/utils.d.ts +9 -0
- package/lib/components/eventBooking/utils.js +12 -2
- package/package.json +4 -4
|
@@ -253,7 +253,7 @@ export var CartProvider = function CartProvider(_ref) {
|
|
|
253
253
|
var createCartItemData = function createCartItemData() {
|
|
254
254
|
var _cartData = getCurrentData().cartData;
|
|
255
255
|
if (_cartData.currentCartItem) {
|
|
256
|
-
var _eventItem$eventDetai, _eventItem$eventDetai2, _eventItem$eventDetai3, _eventItem$eventDetai4, _startDateInfo$times, _startDateInfo$times$, _eventItem$eventDetai5, _eventItem$eventDetai6, _endDateInfo$times, _endDateInfo$times$sl, _endDateInfo$times$sl2;
|
|
256
|
+
var _eventItem$eventDetai, _eventItem$eventDetai2, _eventItem$eventDetai3, _eventItem$eventDetai4, _startDateInfo$times, _startDateInfo$times$, _eventItem$eventDetai5, _eventItem$eventDetai6, _endDateInfo$times, _endDateInfo$times$sl, _endDateInfo$times$sl2, _eventItem$eventDetai7, _eventItem$eventDetai8, _eventItem$eventDetai9;
|
|
257
257
|
var _ref2 = _cartData.currentCartItem || {},
|
|
258
258
|
_id = _ref2._id,
|
|
259
259
|
_ref2$eventItem = _ref2.eventItem,
|
|
@@ -290,6 +290,8 @@ export var CartProvider = function CartProvider(_ref) {
|
|
|
290
290
|
// 是否显示时间
|
|
291
291
|
show_time: true,
|
|
292
292
|
end_time: endTime ? dayjs(endTime || '').format('HH:mm') : '',
|
|
293
|
+
custom_day_count: (_eventItem === null || _eventItem === void 0 ? void 0 : (_eventItem$eventDetai7 = _eventItem.eventDetail) === null || _eventItem$eventDetai7 === void 0 ? void 0 : (_eventItem$eventDetai8 = _eventItem$eventDetai7.selectDate) === null || _eventItem$eventDetai8 === void 0 ? void 0 : (_eventItem$eventDetai9 = _eventItem$eventDetai8.dates) === null || _eventItem$eventDetai9 === void 0 ? void 0 : _eventItem$eventDetai9.length) || 0,
|
|
294
|
+
is_charge_tax: bookingOptionData === null || bookingOptionData === void 0 ? void 0 : bookingOptionData.is_charge_tax,
|
|
293
295
|
_originData: _objectSpread(_objectSpread({}, _cartData.currentCartItem._originData), {}, {
|
|
294
296
|
product: {
|
|
295
297
|
num: 1,
|
|
@@ -55,7 +55,7 @@ export var EventDetailProvider = function EventDetailProvider(_ref) {
|
|
|
55
55
|
var introduction = {
|
|
56
56
|
title: eventItem.title,
|
|
57
57
|
price: eventItem.price,
|
|
58
|
-
images: [eventItem.image]
|
|
58
|
+
images: eventItem.image ? [eventItem.image] : []
|
|
59
59
|
};
|
|
60
60
|
eventRef.current = eventItem;
|
|
61
61
|
_setDetail({
|
|
@@ -15,6 +15,7 @@ import holder from "../Holder";
|
|
|
15
15
|
import event from "../Event";
|
|
16
16
|
import resource from "../Resource";
|
|
17
17
|
import summary from "../Summary";
|
|
18
|
+
import { useCustomer } from "../Customer";
|
|
18
19
|
// 默认步骤状态
|
|
19
20
|
var defaultState = {};
|
|
20
21
|
|
|
@@ -28,6 +29,8 @@ export var InitProvider = function InitProvider(_ref) {
|
|
|
28
29
|
hooks = _useSales.hooks,
|
|
29
30
|
getCurrentData = _useSales.getCurrentData,
|
|
30
31
|
getSessionStorage = _useSales.getSessionStorage;
|
|
32
|
+
var _useCustomer = useCustomer(),
|
|
33
|
+
appUtils = _useCustomer.appUtils;
|
|
31
34
|
var useCustomInit = hooks.useCustomInit;
|
|
32
35
|
var customInit = useCustomInit();
|
|
33
36
|
var initData = useMemo(function () {
|
|
@@ -78,11 +81,12 @@ export var InitProvider = function InitProvider(_ref) {
|
|
|
78
81
|
var getBoardSetting = useRequest(getBoardSettingApi, {
|
|
79
82
|
manual: true,
|
|
80
83
|
onSuccess: function onSuccess(res) {
|
|
81
|
-
var _res$data, _res$data$config, _res$data$config$reso, _res$data$config$reso2, _res$data2;
|
|
84
|
+
var _res$data, _res$data$config, _res$data$config$reso, _res$data$config$reso2, _res$data2, _appUtils$getStore, _appUtils$getStore$ge, _appUtils$getStore$ge2, _appUtils$getStore$ge3;
|
|
82
85
|
setInitData({
|
|
83
86
|
boardSetting: res === null || res === void 0 ? void 0 : res.data,
|
|
84
87
|
form_id: res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$config = _res$data.config) === null || _res$data$config === void 0 ? void 0 : (_res$data$config$reso = _res$data$config.resource) === null || _res$data$config$reso === void 0 ? void 0 : (_res$data$config$reso2 = _res$data$config$reso.booking_event_v2_resource) === null || _res$data$config$reso2 === void 0 ? void 0 : _res$data$config$reso2.form_id,
|
|
85
|
-
shop_id: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.shop_id
|
|
88
|
+
shop_id: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.shop_id,
|
|
89
|
+
shop: (_appUtils$getStore = appUtils.getStore()) === null || _appUtils$getStore === void 0 ? void 0 : (_appUtils$getStore$ge = _appUtils$getStore.getState()) === null || _appUtils$getStore$ge === void 0 ? void 0 : (_appUtils$getStore$ge2 = _appUtils$getStore$ge.core) === null || _appUtils$getStore$ge2 === void 0 ? void 0 : (_appUtils$getStore$ge3 = _appUtils$getStore$ge2.core) === null || _appUtils$getStore$ge3 === void 0 ? void 0 : _appUtils$getStore$ge3.shop
|
|
86
90
|
});
|
|
87
91
|
}
|
|
88
92
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { createContext, useMemo } from 'react';
|
|
2
2
|
import { useCart } from "../Cart";
|
|
3
3
|
import { calculatePriceDetails } from "./utils";
|
|
4
|
+
import { useInit } from "../Init";
|
|
4
5
|
// 默认步骤状态
|
|
5
6
|
var defaultState = {};
|
|
6
7
|
|
|
@@ -10,14 +11,19 @@ export var SummaryProvider = function SummaryProvider(_ref) {
|
|
|
10
11
|
var children = _ref.children;
|
|
11
12
|
var _useCart = useCart(),
|
|
12
13
|
cartData = _useCart.cartData;
|
|
14
|
+
var _useInit = useInit(),
|
|
15
|
+
initData = _useInit.initData;
|
|
13
16
|
var summaryData = useMemo(function () {
|
|
14
|
-
return calculatePriceDetails(cartData.cartItems);
|
|
15
|
-
}, [cartData.cartItems]);
|
|
17
|
+
return calculatePriceDetails((initData === null || initData === void 0 ? void 0 : initData.shop) || {}, cartData.cartItems);
|
|
18
|
+
}, [cartData.cartItems, initData === null || initData === void 0 ? void 0 : initData.shop]);
|
|
16
19
|
var contextValue = {
|
|
17
20
|
// 商品总价
|
|
18
21
|
subtotal: summaryData.subtotal,
|
|
19
22
|
// 总金额
|
|
20
|
-
total: summaryData.total
|
|
23
|
+
total: summaryData.total,
|
|
24
|
+
taxTitle: summaryData.taxTitle,
|
|
25
|
+
totalTaxFee: summaryData.totalTaxFee,
|
|
26
|
+
isPriceIncludeTax: summaryData.isPriceIncludeTax
|
|
21
27
|
};
|
|
22
28
|
return /*#__PURE__*/React.createElement(SummaryContext.Provider, {
|
|
23
29
|
value: contextValue
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { get, post } from "../../../utils/request";
|
|
2
|
-
|
|
3
|
-
// 获取holder列表
|
|
4
|
-
export var getHolderListApi = function getHolderListApi() {
|
|
5
|
-
return get('/api/holder/list');
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// 创建holder
|
|
9
|
-
export var createHolderApi = function createHolderApi(data) {
|
|
10
|
-
return post('/api/holder/create', data);
|
|
11
|
-
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import Decimal from 'decimal.js';
|
|
1
2
|
interface CartItem {
|
|
2
3
|
price: number | string;
|
|
3
4
|
quantity?: number;
|
|
5
|
+
[k: string]: any;
|
|
4
6
|
}
|
|
5
7
|
interface PriceDetail {
|
|
6
8
|
subtotal: string;
|
|
7
9
|
total: string;
|
|
10
|
+
taxTitle?: string;
|
|
11
|
+
totalTaxFee?: string;
|
|
12
|
+
isPriceIncludeTax?: 0 | 1;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* 计算商品小计(不含其他费用)
|
|
@@ -12,11 +17,20 @@ interface PriceDetail {
|
|
|
12
17
|
* @returns 商品总价字符串,保留2位小数
|
|
13
18
|
*/
|
|
14
19
|
export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @title: 单个商品的税费
|
|
22
|
+
* @description:
|
|
23
|
+
* 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
|
|
24
|
+
* $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
|
|
25
|
+
* @return {*}
|
|
26
|
+
* @Author: xiangfeng.xue
|
|
27
|
+
*/
|
|
28
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
15
29
|
/**
|
|
16
30
|
* 计算所有价格明细
|
|
17
31
|
* @param items - 购物车商品数组
|
|
18
32
|
* @param options - 其他费用配置
|
|
19
33
|
* @returns 价格明细对象
|
|
20
34
|
*/
|
|
21
|
-
export declare const calculatePriceDetails: (items: CartItem[]) => PriceDetail;
|
|
35
|
+
export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
|
|
22
36
|
export {};
|
|
@@ -16,19 +16,48 @@ export var calculateSubtotal = function calculateSubtotal(items) {
|
|
|
16
16
|
return subtotal.toFixed(2);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @title: 单个商品的税费
|
|
21
|
+
* @description:
|
|
22
|
+
* 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
|
|
23
|
+
* $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
|
|
24
|
+
* @return {*}
|
|
25
|
+
* @Author: xiangfeng.xue
|
|
26
|
+
*/
|
|
27
|
+
export var calculateTaxFee = function calculateTaxFee(shopInfo, items) {
|
|
28
|
+
if (!(items !== null && items !== void 0 && items.length)) {
|
|
29
|
+
return '0.00';
|
|
30
|
+
}
|
|
31
|
+
var _ref = shopInfo || {},
|
|
32
|
+
is_price_include_tax = _ref.is_price_include_tax,
|
|
33
|
+
tax_rate = _ref.tax_rate;
|
|
34
|
+
var totalTaxFee = items.reduce(function (sum, item) {
|
|
35
|
+
var price = new Decimal(item.price || 0);
|
|
36
|
+
var taxRate = new Decimal(tax_rate || 0).div(100);
|
|
37
|
+
var productTaxRate = price.times(taxRate).times((item === null || item === void 0 ? void 0 : item.is_charge_tax) || 0).div(taxRate.times(is_price_include_tax || 0).plus(1));
|
|
38
|
+
return sum.plus(productTaxRate);
|
|
39
|
+
}, new Decimal(0));
|
|
40
|
+
return totalTaxFee;
|
|
41
|
+
};
|
|
42
|
+
|
|
19
43
|
/**
|
|
20
44
|
* 计算所有价格明细
|
|
21
45
|
* @param items - 购物车商品数组
|
|
22
46
|
* @param options - 其他费用配置
|
|
23
47
|
* @returns 价格明细对象
|
|
24
48
|
*/
|
|
25
|
-
export var calculatePriceDetails = function calculatePriceDetails(items) {
|
|
49
|
+
export var calculatePriceDetails = function calculatePriceDetails(shopInfo, items) {
|
|
26
50
|
var subtotal = new Decimal(calculateSubtotal(items));
|
|
51
|
+
var totalTaxFee = new Decimal(calculateTaxFee(shopInfo, items));
|
|
52
|
+
console.log('totalTaxFee', totalTaxFee.toFixed(2));
|
|
27
53
|
|
|
28
54
|
// 计算总价
|
|
29
|
-
var total = subtotal;
|
|
55
|
+
var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal : subtotal.plus(totalTaxFee);
|
|
30
56
|
return {
|
|
31
57
|
subtotal: subtotal.toFixed(2),
|
|
32
|
-
total: total.toFixed(2)
|
|
58
|
+
total: total.toFixed(2),
|
|
59
|
+
taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
|
|
60
|
+
totalTaxFee: totalTaxFee.toFixed(2),
|
|
61
|
+
isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
|
|
33
62
|
};
|
|
34
63
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { locales } from '@pisell/utils';
|
|
7
|
+
import { PisellText } from '@pisell/materials';
|
|
8
|
+
import { useSummary } from "../../../../../Sales";
|
|
9
|
+
import useEngineContext from "../../../../../../hooks/useEngineContext";
|
|
10
|
+
import "./index.less";
|
|
11
|
+
import classNames from 'classnames';
|
|
12
|
+
var Total = function Total() {
|
|
13
|
+
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2;
|
|
14
|
+
var _useSummary = useSummary(),
|
|
15
|
+
taxTitle = _useSummary.taxTitle,
|
|
16
|
+
totalTaxFee = _useSummary.totalTaxFee,
|
|
17
|
+
isPriceIncludeTax = _useSummary.isPriceIncludeTax,
|
|
18
|
+
total = _useSummary.total;
|
|
19
|
+
var context = useEngineContext();
|
|
20
|
+
console.log(taxTitle, isPriceIncludeTax, totalTaxFee, total, context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getSymbolic) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.call(_context$appHelper$ut), 'wh97978');
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "event-total-wrap"
|
|
23
|
+
}, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "gst-wrap"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("span", null, taxTitle), /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
26
|
+
value: totalTaxFee,
|
|
27
|
+
showCurrencySymbol: true
|
|
28
|
+
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: classNames('event-total', _defineProperty({}, ['total-gst-wrap'], !isPriceIncludeTax && Number(totalTaxFee) > 0))
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "left"
|
|
32
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.event.total')), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
className: "gst"
|
|
34
|
+
}, locales.getText('pisell2.event.total.gst')(taxTitle, "".concat(context === null || context === void 0 ? void 0 : (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : (_context$appHelper2$u = _context$appHelper2.utils) === null || _context$appHelper2$u === void 0 ? void 0 : (_context$appHelper2$u2 = _context$appHelper2$u.getSymbolic) === null || _context$appHelper2$u2 === void 0 ? void 0 : _context$appHelper2$u2.call(_context$appHelper2$u)).concat(totalTaxFee))) : null), /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
35
|
+
value: total,
|
|
36
|
+
showCurrencySymbol: true,
|
|
37
|
+
className: "event-amount"
|
|
38
|
+
})));
|
|
39
|
+
};
|
|
40
|
+
export default Total;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isMobile, locales } from '@pisell/utils';
|
|
3
|
-
import { PisellText } from '@pisell/materials';
|
|
4
3
|
import ShoppingCart from "../../../../../shoppingCart";
|
|
5
4
|
import { useCart, useHolder, useSummary, useStep } from "../../../../../Sales";
|
|
6
5
|
import SelectHolderModal from "../../SelectHolderModal";
|
|
7
6
|
import ContinueButton from "../ContinueButton";
|
|
7
|
+
import Total from "./Total";
|
|
8
8
|
import "./index.less";
|
|
9
9
|
var CartItem = function CartItem() {
|
|
10
10
|
var _useHolder = useHolder(),
|
|
@@ -56,13 +56,7 @@ var CartItem = function CartItem() {
|
|
|
56
56
|
}
|
|
57
57
|
})), /*#__PURE__*/React.createElement("div", {
|
|
58
58
|
className: "event-footer"
|
|
59
|
-
}, /*#__PURE__*/React.createElement(
|
|
60
|
-
className: "event-total-wrap"
|
|
61
|
-
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.event.total')), /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
62
|
-
value: subtotal,
|
|
63
|
-
showCurrencySymbol: true,
|
|
64
|
-
className: "event-amount"
|
|
65
|
-
})), /*#__PURE__*/React.createElement(ContinueButton, null))), /*#__PURE__*/React.createElement(SelectHolderModal, {
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Total, null), /*#__PURE__*/React.createElement(ContinueButton, null))), /*#__PURE__*/React.createElement(SelectHolderModal, {
|
|
66
60
|
open: open
|
|
67
61
|
}));
|
|
68
62
|
};
|
|
@@ -17,19 +17,51 @@
|
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
gap: 14px;
|
|
19
19
|
margin-top: 6px;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.event-total-wrap {
|
|
24
|
+
color: var(--Text-Text_1, #1b1b1b);
|
|
25
|
+
font-size: 20px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
line-height: 28px;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
align-items: start;
|
|
31
|
+
|
|
32
|
+
> div {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.gst-wrap {
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: 24px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.event-total {
|
|
46
|
+
.left {
|
|
25
47
|
display: flex;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
.gst {
|
|
50
|
+
color: var(--Gray-500, #667085);
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
font-weight: 400;
|
|
53
|
+
line-height: 20px;
|
|
30
54
|
}
|
|
31
55
|
}
|
|
32
56
|
}
|
|
57
|
+
|
|
58
|
+
.total-gst-wrap {
|
|
59
|
+
padding: 14px 0 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.event-amount {
|
|
63
|
+
color: var(--Blue-600, #1570ef);
|
|
64
|
+
}
|
|
33
65
|
}
|
|
34
66
|
|
|
35
67
|
.cart-mobile-item-wrap {
|
|
@@ -40,7 +72,7 @@
|
|
|
40
72
|
.content {
|
|
41
73
|
flex: 1;
|
|
42
74
|
overflow-y: auto;
|
|
43
|
-
padding: 0 0
|
|
75
|
+
padding: 0 0 140px;
|
|
44
76
|
}
|
|
45
77
|
.event-footer {
|
|
46
78
|
z-index: 10;
|
|
@@ -24,7 +24,7 @@ var Footer = function Footer() {
|
|
|
24
24
|
onCloseCart = _useCart.onCloseCart,
|
|
25
25
|
cartData = _useCart.cartData;
|
|
26
26
|
var _useSummary = useSummary(),
|
|
27
|
-
|
|
27
|
+
total = _useSummary.total;
|
|
28
28
|
// 当前本地选中的holder
|
|
29
29
|
var _useState = useState(null),
|
|
30
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -35,7 +35,7 @@ var Footer = function Footer() {
|
|
|
35
35
|
left: /*#__PURE__*/React.createElement("div", {
|
|
36
36
|
className: "section-footer-left"
|
|
37
37
|
}, /*#__PURE__*/React.createElement(PisellText, null, locales.getText('pisell2.event.total')), /*#__PURE__*/React.createElement(PisellText.Amount, {
|
|
38
|
-
value:
|
|
38
|
+
value: total,
|
|
39
39
|
showCurrencySymbol: true,
|
|
40
40
|
className: "amount"
|
|
41
41
|
})),
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { locales } from '@pisell/utils';
|
|
3
3
|
import { useStep, useSales } from "../../../../Sales";
|
|
4
4
|
import ProgressBar from "../../progressBar";
|
|
5
|
+
import { resourceTitle } from "../../../utils";
|
|
5
6
|
import "./index.less";
|
|
6
7
|
var Header = function Header() {
|
|
7
8
|
var _steps$currentStepDat, _steps$currentStepDat2;
|
|
@@ -11,7 +12,8 @@ var Header = function Header() {
|
|
|
11
12
|
prevStep = _useStep.prevStep,
|
|
12
13
|
isFirstStep = _useStep.isFirstStep;
|
|
13
14
|
var _useSales = useSales(),
|
|
14
|
-
removeSessionStorage = _useSales.removeSessionStorage
|
|
15
|
+
removeSessionStorage = _useSales.removeSessionStorage,
|
|
16
|
+
data = _useSales.data;
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* @title: 步骤数据多语言
|
|
@@ -23,7 +25,7 @@ var Header = function Header() {
|
|
|
23
25
|
var steps = {
|
|
24
26
|
'select-category': {
|
|
25
27
|
title: locales.getText('pisell2.event.step')(1),
|
|
26
|
-
description: locales.getText('pisell2.event.select.category')
|
|
28
|
+
description: locales.getText('pisell2.event.select.category')(resourceTitle(data))
|
|
27
29
|
},
|
|
28
30
|
'select-event': {
|
|
29
31
|
title: locales.getText('pisell2.event.step')(2),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { PisellViewGrid } from '@pisell/materials';
|
|
3
3
|
import { isMobile, locales } from '@pisell/utils';
|
|
4
4
|
import { useResource, useSales, useCart, useStep } from "../../../../Sales";
|
|
5
|
-
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
6
5
|
import ResourceDisplay from "../../resourceDisplay";
|
|
6
|
+
import { resourceTitle } from "../../../utils";
|
|
7
7
|
import "./index.less";
|
|
8
8
|
var Resource = function Resource() {
|
|
9
|
-
var _data$
|
|
9
|
+
var _data$resourceData, _data$resourceData$re;
|
|
10
10
|
var _useSales = useSales(),
|
|
11
11
|
data = _useSales.data;
|
|
12
12
|
var _useResource = useResource(),
|
|
@@ -16,7 +16,6 @@ var Resource = function Resource() {
|
|
|
16
16
|
createCartItem = _useCart.createCartItem;
|
|
17
17
|
var _useStep = useStep(),
|
|
18
18
|
nextStep = _useStep.nextStep;
|
|
19
|
-
var context = useEngineContext();
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* @title: 选择资源
|
|
@@ -54,27 +53,11 @@ var Resource = function Resource() {
|
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
55
|
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @title: 资源名称
|
|
60
|
-
* @description:
|
|
61
|
-
* @param {*} useMemo
|
|
62
|
-
* @return {*}
|
|
63
|
-
* @Author: WangHan
|
|
64
|
-
* @Date: 2025-02-08 15:28
|
|
65
|
-
*/
|
|
66
|
-
var resourceTitle = useMemo(function () {
|
|
67
|
-
var _data$initData, _data$initData$boardS, _data$initData$boardS2, _form$setting, _context$appHelper, _context$appHelper$ut, _translation;
|
|
68
|
-
var form = data === null || data === void 0 ? void 0 : (_data$initData = data.initData) === null || _data$initData === void 0 ? void 0 : (_data$initData$boardS = _data$initData.boardSetting) === null || _data$initData$boardS === void 0 ? void 0 : (_data$initData$boardS2 = _data$initData$boardS.event_v2_form) === null || _data$initData$boardS2 === void 0 ? void 0 : _data$initData$boardS2.form;
|
|
69
|
-
var title = (form === null || form === void 0 ? void 0 : (_form$setting = form.setting) === null || _form$setting === void 0 ? void 0 : _form$setting.title) || (form === null || form === void 0 ? void 0 : form.title);
|
|
70
|
-
var translation = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translation;
|
|
71
|
-
return (_translation = translation(title)) === null || _translation === void 0 ? void 0 : _translation.toLowerCase();
|
|
72
|
-
}, [data === null || data === void 0 ? void 0 : (_data$initData2 = data.initData) === null || _data$initData2 === void 0 ? void 0 : _data$initData2.boardSetting]);
|
|
73
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
57
|
className: "event-interface-resource-wrap ".concat(isMobile() ? 'event-interface-resource-mobile-wrap' : '')
|
|
75
58
|
}, /*#__PURE__*/React.createElement("span", {
|
|
76
59
|
className: "title"
|
|
77
|
-
}, locales.getText('pisell2.event.select.campus')(resourceTitle)), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
}, locales.getText('pisell2.event.select.campus')(resourceTitle(data))), /*#__PURE__*/React.createElement("div", {
|
|
78
61
|
className: "content"
|
|
79
62
|
}, data === null || data === void 0 ? void 0 : (_data$resourceData = data.resourceData) === null || _data$resourceData === void 0 ? void 0 : (_data$resourceData$re = _data$resourceData.resourceList) === null || _data$resourceData$re === void 0 ? void 0 : _data$resourceData$re.map(function (item, index) {
|
|
80
63
|
return /*#__PURE__*/React.createElement("div", {
|