@pisell/private-materials 6.11.46 → 6.11.47

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.
@@ -0,0 +1 @@
1
+ export declare const formatBookingDetail: (data: any, modalState: any) => any;
@@ -44,8 +44,11 @@ var _getDisabledEdit = function _getDisabledEdit(_ref) {
44
44
  var shop_discount = _ref.shop_discount,
45
45
  bookings = _ref.bookings,
46
46
  payment_status = _ref.payment_status;
47
+ var bookingList = Array.isArray(bookings === null || bookings === void 0 ? void 0 : bookings.list) ? bookings.list : [];
48
+ var appointmentStatus = bookings === null || bookings === void 0 ? void 0 : bookings.appointment_status;
49
+
47
50
  // 如果预约列表里没有商品新信息, 则任何信息都不能编辑
48
- if (bookings.list.some(function (d) {
51
+ if (bookingList.some(function (d) {
49
52
  return !d.detail;
50
53
  })) {
51
54
  return true;
@@ -57,7 +60,7 @@ var _getDisabledEdit = function _getDisabledEdit(_ref) {
57
60
  }
58
61
  var list = ["unfulfilled", "paid", "partially_paid", "unpaid", "payment_processing"];
59
62
  // (支付状态 = 已支付 || 部分付款 || 未付款 || 支付处理中) && 预约状态 !== 已取消
60
- if (bookings.appointment_status === "cancelled" || !list.includes(payment_status)) {
63
+ if (appointmentStatus === "cancelled" || !list.includes(payment_status)) {
61
64
  return true;
62
65
  }
63
66
  return false;
@@ -0,0 +1 @@
1
+ export declare const formatBookingDetail: (data: any, modalState: any) => any;
@@ -56,7 +56,9 @@ var _formatBookingMetadata = (item) => {
56
56
  };
57
57
  };
58
58
  var _getDisabledEdit = ({ shop_discount, bookings, payment_status }) => {
59
- if (bookings.list.some((d) => !d.detail)) {
59
+ const bookingList = Array.isArray(bookings == null ? void 0 : bookings.list) ? bookings.list : [];
60
+ const appointmentStatus = bookings == null ? void 0 : bookings.appointment_status;
61
+ if (bookingList.some((d) => !d.detail)) {
60
62
  return true;
61
63
  }
62
64
  if (shop_discount && Number(shop_discount)) {
@@ -68,7 +70,7 @@ var _getDisabledEdit = ({ shop_discount, bookings, payment_status }) => {
68
70
  "unpaid",
69
71
  "payment_processing"
70
72
  ];
71
- if (bookings.appointment_status === "cancelled" || !list.includes(payment_status)) {
73
+ if (appointmentStatus === "cancelled" || !list.includes(payment_status)) {
72
74
  return true;
73
75
  }
74
76
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.11.46",
3
+ "version": "6.11.47",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -69,8 +69,8 @@
69
69
  "styled-components": "^6.0.0-rc.3",
70
70
  "@pisell/utils": "3.0.2",
71
71
  "@pisell/materials": "6.11.17",
72
- "@pisell/icon": "0.0.11",
73
- "@pisell/date-picker": "3.0.8"
72
+ "@pisell/date-picker": "3.0.8",
73
+ "@pisell/icon": "0.0.11"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": "^18.0.0",