@pisell/private-materials 3.4.61 → 3.4.62

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.
Files changed (282) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +10 -10
  11. package/es/components/Sales/Summary/utils.d.ts +1 -1
  12. package/es/components/appointmentBooking/components/Voucher/index.js +16 -1
  13. package/es/components/booking/addons/model.d.ts +1 -10
  14. package/es/components/booking/components/footer/utils.js +36 -37
  15. package/es/components/booking/components/voucher/index.js +39 -14
  16. package/es/components/booking/forms/model.d.ts +1 -10
  17. package/es/components/booking/info/model.d.ts +1 -10
  18. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  19. package/es/components/booking/info/service2/utils.js +2 -1
  20. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  21. package/es/components/booking/model.d.ts +1 -9
  22. package/es/components/booking/notes/model.d.ts +1 -10
  23. package/es/components/booking/payments/model.d.ts +1 -10
  24. package/es/components/eftposPay/amount.d.ts +1 -1
  25. package/es/components/eftposPay/device.d.ts +1 -1
  26. package/es/components/eftposPay/store/index.d.ts +1 -1
  27. package/es/components/pay/toC/PaymentList/index.d.ts +1 -1
  28. package/es/components/pay/toC/PaymentList/index.js +54 -5
  29. package/es/components/pay/toC/PaymentList/index.less +58 -1
  30. package/es/components/pay/toC/PaymentList/payment/credit_card.png +0 -0
  31. package/es/components/pay/toC/PaymentList/payment/visa.png +0 -0
  32. package/es/components/pay/toC/PaymentList/serve.d.ts +1 -1
  33. package/es/components/pay/toC/PaymentList/serve.js +8 -0
  34. package/es/components/pay/toC/PaymentList/utils.d.ts +26 -0
  35. package/es/components/pay/toC/PaymentList/utils.js +187 -6
  36. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +127 -36
  37. package/es/components/pay/toC/index.js +2 -1
  38. package/es/components/pay/toC/locales.d.ts +6 -0
  39. package/es/components/pay/toC/locales.js +9 -3
  40. package/es/components/pay/toC/model.d.ts +1 -9
  41. package/es/components/schedules/model.d.ts +1 -9
  42. package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -1
  43. package/es/components/walletList/index.js +180 -41
  44. package/es/components/walletList/locales.d.ts +9 -0
  45. package/es/components/walletList/locales.js +12 -3
  46. package/es/components/walletList/serve.d.ts +19 -0
  47. package/es/components/walletList/serve.js +94 -5
  48. package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
  49. package/es/components/walletList/tempHolderSelector/index.js +196 -0
  50. package/es/components/walletList/tempHolderSelector/index.less +63 -0
  51. package/es/index.d.ts +2 -1
  52. package/es/index.js +2 -1
  53. package/es/plus/productSelect/index.js +5 -1
  54. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  55. package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
  56. package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
  57. package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  58. package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
  59. package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
  60. package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  61. package/es/plus/selectHolder/components/HolderList/index.js +43 -0
  62. package/es/plus/selectHolder/index.d.ts +7 -0
  63. package/es/plus/selectHolder/index.js +236 -0
  64. package/es/plus/selectHolder/index.less +117 -0
  65. package/es/plus/selectHolder/locales.d.ts +21 -0
  66. package/es/plus/selectHolder/locales.js +20 -0
  67. package/es/plus/selectHolder/types.d.ts +104 -0
  68. package/es/plus/selectHolder/types.js +1 -0
  69. package/es/plus/selectHolder/utils.d.ts +9 -0
  70. package/es/plus/selectHolder/utils.js +16 -0
  71. package/es/plus/walletEditor/WalletEditor.js +60 -2
  72. package/es/plus/walletEditor/locales.d.ts +9 -0
  73. package/es/plus/walletEditor/locales.js +12 -3
  74. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  75. package/es/plus/walletPassGallery/components/passList/index.js +17 -5
  76. package/es/plus/walletPassGallery/index.js +223 -41
  77. package/es/plus/walletPassGallery/index.less +1 -1
  78. package/es/plus/walletPassGallery/locales.d.ts +15 -0
  79. package/es/plus/walletPassGallery/locales.js +29 -5
  80. package/es/plus/walletPassGallery/serve.d.ts +15 -1
  81. package/es/plus/walletPassGallery/serve.js +59 -2
  82. package/es/plus/walletPassGallery/utils.d.ts +48 -0
  83. package/es/plus/walletPassGallery/utils.js +342 -0
  84. package/es/pro/Selector/Selector.d.ts +1 -1
  85. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  86. package/lib/components/appointmentBooking/components/Voucher/index.js +21 -1
  87. package/lib/components/booking/addons/model.d.ts +1 -10
  88. package/lib/components/booking/components/footer/utils.js +6 -8
  89. package/lib/components/booking/components/voucher/index.js +37 -7
  90. package/lib/components/booking/forms/model.d.ts +1 -10
  91. package/lib/components/booking/info/model.d.ts +1 -10
  92. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  93. package/lib/components/booking/info/service2/utils.js +2 -1
  94. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  95. package/lib/components/booking/model.d.ts +1 -9
  96. package/lib/components/booking/notes/model.d.ts +1 -10
  97. package/lib/components/booking/payments/model.d.ts +1 -10
  98. package/lib/components/eftposPay/amount.d.ts +1 -1
  99. package/lib/components/eftposPay/device.d.ts +1 -1
  100. package/lib/components/eftposPay/store/index.d.ts +1 -1
  101. package/lib/components/pay/toC/PaymentList/index.d.ts +1 -1
  102. package/lib/components/pay/toC/PaymentList/index.js +36 -5
  103. package/lib/components/pay/toC/PaymentList/index.less +58 -1
  104. package/lib/components/pay/toC/PaymentList/payment/credit_card.png +0 -0
  105. package/lib/components/pay/toC/PaymentList/payment/visa.png +0 -0
  106. package/lib/components/pay/toC/PaymentList/serve.d.ts +1 -1
  107. package/lib/components/pay/toC/PaymentList/serve.js +6 -1
  108. package/lib/components/pay/toC/PaymentList/utils.d.ts +26 -0
  109. package/lib/components/pay/toC/PaymentList/utils.js +155 -7
  110. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +85 -1
  111. package/lib/components/pay/toC/index.js +2 -1
  112. package/lib/components/pay/toC/locales.d.ts +6 -0
  113. package/lib/components/pay/toC/locales.js +9 -3
  114. package/lib/components/pay/toC/model.d.ts +1 -9
  115. package/lib/components/schedules/model.d.ts +1 -9
  116. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -1
  117. package/lib/components/walletList/index.js +105 -5
  118. package/lib/components/walletList/locales.d.ts +9 -0
  119. package/lib/components/walletList/locales.js +12 -3
  120. package/lib/components/walletList/serve.d.ts +19 -0
  121. package/lib/components/walletList/serve.js +26 -3
  122. package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
  123. package/lib/components/walletList/tempHolderSelector/index.js +166 -0
  124. package/lib/components/walletList/tempHolderSelector/index.less +63 -0
  125. package/lib/index.d.ts +2 -1
  126. package/lib/index.js +6 -3
  127. package/lib/plus/productSelect/index.js +4 -1
  128. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  129. package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
  130. package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
  131. package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  132. package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
  133. package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
  134. package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  135. package/lib/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
  136. package/lib/plus/selectHolder/index.d.ts +7 -0
  137. package/lib/plus/selectHolder/index.js +202 -0
  138. package/lib/plus/selectHolder/index.less +117 -0
  139. package/lib/plus/selectHolder/locales.d.ts +21 -0
  140. package/lib/{components/wallet/Voucher → plus/selectHolder}/locales.js +15 -15
  141. package/lib/plus/selectHolder/types.d.ts +104 -0
  142. package/lib/plus/selectHolder/types.js +17 -0
  143. package/lib/plus/selectHolder/utils.d.ts +9 -0
  144. package/lib/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
  145. package/lib/plus/walletEditor/WalletEditor.js +53 -0
  146. package/lib/plus/walletEditor/locales.d.ts +9 -0
  147. package/lib/plus/walletEditor/locales.js +12 -3
  148. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  149. package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
  150. package/lib/plus/walletPassGallery/index.js +154 -27
  151. package/lib/plus/walletPassGallery/index.less +1 -1
  152. package/lib/plus/walletPassGallery/locales.d.ts +15 -0
  153. package/lib/plus/walletPassGallery/locales.js +32 -5
  154. package/lib/plus/walletPassGallery/serve.d.ts +15 -1
  155. package/lib/plus/walletPassGallery/serve.js +17 -5
  156. package/lib/plus/walletPassGallery/utils.d.ts +48 -0
  157. package/lib/plus/walletPassGallery/utils.js +287 -0
  158. package/lib/pro/Selector/Selector.d.ts +1 -1
  159. package/lowcode/event-select-holder/meta.ts +2 -2
  160. package/lowcode/select-holder/meta.ts +220 -0
  161. package/lowcode/select-holder/snippets.ts +41 -0
  162. package/package.json +4 -4
  163. package/es/components/wallet/Detail/index.d.ts +0 -42
  164. package/es/components/wallet/Detail/index.js +0 -1182
  165. package/es/components/wallet/Detail/index.less +0 -386
  166. package/es/components/wallet/Detail/locales.d.ts +0 -153
  167. package/es/components/wallet/Detail/locales.js +0 -170
  168. package/es/components/wallet/Detail/model.d.ts +0 -13
  169. package/es/components/wallet/Detail/model.js +0 -22
  170. package/es/components/wallet/Detail/serve.d.ts +0 -39
  171. package/es/components/wallet/Detail/serve.js +0 -64
  172. package/es/components/wallet/DetailContext.d.ts +0 -25
  173. package/es/components/wallet/DetailContext.js +0 -162
  174. package/es/components/wallet/DiscountCard/index.d.ts +0 -3
  175. package/es/components/wallet/DiscountCard/index.js +0 -218
  176. package/es/components/wallet/DiscountCard/index.less +0 -9
  177. package/es/components/wallet/DiscountCard/model.d.ts +0 -14
  178. package/es/components/wallet/DiscountCard/model.js +0 -22
  179. package/es/components/wallet/PointCard/index.d.ts +0 -3
  180. package/es/components/wallet/PointCard/index.js +0 -169
  181. package/es/components/wallet/PointCard/index.less +0 -9
  182. package/es/components/wallet/PointCard/model.d.ts +0 -13
  183. package/es/components/wallet/PointCard/model.js +0 -22
  184. package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
  185. package/es/components/wallet/RechargeableCard/index.js +0 -463
  186. package/es/components/wallet/RechargeableCard/index.less +0 -108
  187. package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
  188. package/es/components/wallet/RechargeableCard/model.js +0 -28
  189. package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
  190. package/es/components/wallet/RechargeableCard/serve.js +0 -32
  191. package/es/components/wallet/Voucher/index.d.ts +0 -12
  192. package/es/components/wallet/Voucher/index.js +0 -131
  193. package/es/components/wallet/Voucher/index.less +0 -9
  194. package/es/components/wallet/Voucher/locales.d.ts +0 -21
  195. package/es/components/wallet/Voucher/locales.js +0 -20
  196. package/es/components/wallet/Voucher/model.d.ts +0 -13
  197. package/es/components/wallet/Voucher/model.js +0 -22
  198. package/es/components/wallet/carouselArrow.png +0 -0
  199. package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
  200. package/es/components/wallet/components/FooterButtons/index.js +0 -81
  201. package/es/components/wallet/components/FooterButtons/index.less +0 -91
  202. package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
  203. package/es/components/wallet/components/UsageRules/index.js +0 -147
  204. package/es/components/wallet/components/UsageRules/index.less +0 -157
  205. package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
  206. package/es/components/wallet/components/WalletBar/index.js +0 -19
  207. package/es/components/wallet/components/WalletBar/index.less +0 -36
  208. package/es/components/wallet/components/WalletCard.d.ts +0 -11
  209. package/es/components/wallet/components/WalletCard.js +0 -91
  210. package/es/components/wallet/components/index.d.ts +0 -3
  211. package/es/components/wallet/components/index.js +0 -4
  212. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -33
  213. package/es/components/wallet/hooks/useWalletCard.js +0 -147
  214. package/es/components/wallet/index.d.ts +0 -10
  215. package/es/components/wallet/index.js +0 -807
  216. package/es/components/wallet/index.less +0 -151
  217. package/es/components/wallet/locales.d.ts +0 -132
  218. package/es/components/wallet/locales.js +0 -139
  219. package/es/components/wallet/model.d.ts +0 -37
  220. package/es/components/wallet/model.js +0 -86
  221. package/es/components/wallet/serve.d.ts +0 -150
  222. package/es/components/wallet/serve.js +0 -205
  223. package/es/components/wallet/utils/formatUtils.d.ts +0 -36
  224. package/es/components/wallet/utils/formatUtils.js +0 -73
  225. package/lib/components/wallet/Detail/index.d.ts +0 -42
  226. package/lib/components/wallet/Detail/index.js +0 -874
  227. package/lib/components/wallet/Detail/index.less +0 -386
  228. package/lib/components/wallet/Detail/locales.d.ts +0 -153
  229. package/lib/components/wallet/Detail/locales.js +0 -194
  230. package/lib/components/wallet/Detail/model.d.ts +0 -13
  231. package/lib/components/wallet/Detail/model.js +0 -43
  232. package/lib/components/wallet/Detail/serve.d.ts +0 -39
  233. package/lib/components/wallet/Detail/serve.js +0 -44
  234. package/lib/components/wallet/DetailContext.d.ts +0 -25
  235. package/lib/components/wallet/DetailContext.js +0 -118
  236. package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
  237. package/lib/components/wallet/DiscountCard/index.js +0 -209
  238. package/lib/components/wallet/DiscountCard/index.less +0 -9
  239. package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
  240. package/lib/components/wallet/DiscountCard/model.js +0 -43
  241. package/lib/components/wallet/PointCard/index.d.ts +0 -3
  242. package/lib/components/wallet/PointCard/index.js +0 -190
  243. package/lib/components/wallet/PointCard/index.less +0 -9
  244. package/lib/components/wallet/PointCard/model.d.ts +0 -13
  245. package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
  246. package/lib/components/wallet/RechargeableCard/index.js +0 -380
  247. package/lib/components/wallet/RechargeableCard/index.less +0 -108
  248. package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
  249. package/lib/components/wallet/RechargeableCard/model.js +0 -49
  250. package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
  251. package/lib/components/wallet/Voucher/index.d.ts +0 -12
  252. package/lib/components/wallet/Voucher/index.js +0 -146
  253. package/lib/components/wallet/Voucher/index.less +0 -9
  254. package/lib/components/wallet/Voucher/locales.d.ts +0 -21
  255. package/lib/components/wallet/Voucher/model.d.ts +0 -13
  256. package/lib/components/wallet/Voucher/model.js +0 -43
  257. package/lib/components/wallet/carouselArrow.png +0 -0
  258. package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
  259. package/lib/components/wallet/components/FooterButtons/index.js +0 -109
  260. package/lib/components/wallet/components/FooterButtons/index.less +0 -91
  261. package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
  262. package/lib/components/wallet/components/UsageRules/index.js +0 -113
  263. package/lib/components/wallet/components/UsageRules/index.less +0 -157
  264. package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
  265. package/lib/components/wallet/components/WalletBar/index.less +0 -36
  266. package/lib/components/wallet/components/WalletCard.d.ts +0 -11
  267. package/lib/components/wallet/components/WalletCard.js +0 -97
  268. package/lib/components/wallet/components/index.d.ts +0 -3
  269. package/lib/components/wallet/components/index.js +0 -45
  270. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -33
  271. package/lib/components/wallet/hooks/useWalletCard.js +0 -111
  272. package/lib/components/wallet/index.d.ts +0 -10
  273. package/lib/components/wallet/index.js +0 -580
  274. package/lib/components/wallet/index.less +0 -151
  275. package/lib/components/wallet/locales.d.ts +0 -132
  276. package/lib/components/wallet/locales.js +0 -163
  277. package/lib/components/wallet/model.d.ts +0 -37
  278. package/lib/components/wallet/model.js +0 -91
  279. package/lib/components/wallet/serve.d.ts +0 -150
  280. package/lib/components/wallet/serve.js +0 -85
  281. package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
  282. package/lib/components/wallet/utils/formatUtils.js +0 -73
@@ -1,209 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/wallet/DiscountCard/index.tsx
30
- var DiscountCard_exports = {};
31
- __export(DiscountCard_exports, {
32
- default: () => DiscountCard_default
33
- });
34
- module.exports = __toCommonJS(DiscountCard_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_materials = require("@pisell/materials");
37
- var import_model = require("./model");
38
- var import_DetailContext = require("../DetailContext");
39
- var import_WalletCard = __toESM(require("../components/WalletCard"));
40
- var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
41
- var import_utils = require("@pisell/utils");
42
- var import_locales = __toESM(require("../locales"));
43
- var import_index = require("./index.less");
44
- var { Title } = import_materials.Typography;
45
- var Amount = import_materials.PisellText.Amount;
46
- var RechargeableCard = (0, import_model.Provider)((props) => {
47
- var _a, _b, _c;
48
- const { globalState, setGlobalState } = props;
49
- const { currentId, product_discount_card = [], currentDetail } = globalState;
50
- const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
51
- const context = (0, import_useEngineContext.default)();
52
- const utils = context.appHelper.utils || {};
53
- const dvaStore = (_b = (_a = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a.call(utils)) == null ? void 0 : _b.getState();
54
- const platform = (0, import_react.useMemo)(() => (0, import_utils.isMobile)() ? "h5" : "pc", []);
55
- const { openDetail, renderDetail, closeDetail } = (0, import_DetailContext.useDetail)();
56
- const recordViewRef = (0, import_react.useRef)(null);
57
- (0, import_react.useEffect)(() => {
58
- if ((state == null ? void 0 : state.setup) !== "detail" && recordViewRef.current) {
59
- recordViewRef.current.closeDetailModal();
60
- }
61
- }, [state == null ? void 0 : state.setup]);
62
- (0, import_react.useEffect)(() => {
63
- if (globalState.setup && globalState.setup !== (state == null ? void 0 : state.setup)) {
64
- dispatch({
65
- type: "setState",
66
- payload: { setup: globalState.setup }
67
- });
68
- }
69
- }, [globalState.setup]);
70
- const handleBack = () => {
71
- if (recordViewRef.current) {
72
- recordViewRef.current.closeDetailModal();
73
- }
74
- closeDetail();
75
- dispatch({
76
- type: "setState",
77
- payload: { setup: "list" }
78
- });
79
- setGlobalState({
80
- setup: "list"
81
- });
82
- };
83
- const renderItem = (item) => {
84
- return /* @__PURE__ */ import_react.default.createElement(
85
- import_WalletCard.default,
86
- {
87
- item,
88
- currentId,
89
- isDiscountCard: true,
90
- onClick: () => {
91
- setGlobalState({
92
- currentId: item.id
93
- });
94
- }
95
- }
96
- );
97
- };
98
- (0, import_react.useEffect)(() => {
99
- if (currentId) {
100
- dispatch({
101
- type: "setState",
102
- payload: {
103
- currentDetail: product_discount_card.find(
104
- (item) => item.id === currentId
105
- )
106
- }
107
- });
108
- }
109
- }, [currentId]);
110
- (0, import_react.useEffect)(() => {
111
- const enabledCards = product_discount_card.filter(
112
- (item) => item.limit_status === "enable"
113
- );
114
- const total = enabledCards.reduce(
115
- (sum, item) => sum + Number(item.balance),
116
- 0
117
- );
118
- dispatch({
119
- type: "setState",
120
- payload: {
121
- total
122
- }
123
- });
124
- }, [product_discount_card]);
125
- const isEmpty = !product_discount_card.some(
126
- (item) => item.limit_status === "enable"
127
- );
128
- import_utils.locales.init(import_locales.default, ((_c = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _c.translateLocale) || "en");
129
- const formatData = () => {
130
- const fileterArr = product_discount_card.filter(() => {
131
- });
132
- let available = {
133
- title: import_utils.locales.getText("page.wallet.available"),
134
- dataSource: product_discount_card.filter(
135
- (item) => item.limit_status === "enable"
136
- )
137
- };
138
- const unavailable = {
139
- title: import_utils.locales.getText("page.wallet.unavailable"),
140
- dataSource: product_discount_card.filter(
141
- (item) => item.limit_status === "disable"
142
- )
143
- };
144
- return [available, unavailable];
145
- };
146
- const detail = () => {
147
- if (!(currentDetail == null ? void 0 : currentDetail.id)) return null;
148
- const detailWithBar = {
149
- ...currentDetail,
150
- isDiscoundCard: true,
151
- showWalletBar: platform === "h5",
152
- // 添加显示WalletBar的标志
153
- onBack: handleBack
154
- // 添加返回处理函数
155
- };
156
- return renderDetail(detailWithBar);
157
- };
158
- return isEmpty ? /* @__PURE__ */ import_react.default.createElement(import_materials.PisellEmpty, null) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, platform !== "pc" && /* @__PURE__ */ import_react.default.createElement(Title, { className: "wallet-discountCard-title" }, import_utils.locales.getText("page.wallet.discountCard")), /* @__PURE__ */ import_react.default.createElement(
159
- import_materials.RecordView,
160
- {
161
- ref: recordViewRef,
162
- leftSpan: 9,
163
- rightSpan: 15,
164
- gutter: 20,
165
- onRowClick: (currentDetail2) => {
166
- setGlobalState({
167
- currentId: currentDetail2.id || "",
168
- currentDetail: currentDetail2,
169
- setup: "detail"
170
- // 设置状态为detail
171
- });
172
- dispatch({
173
- type: "setState",
174
- payload: { setup: "detail" }
175
- });
176
- openDetail({
177
- ...currentDetail2,
178
- isDiscoundCard: true,
179
- showWalletBar: platform === "h5",
180
- // 添加显示WalletBar的标志
181
- onBack: handleBack
182
- // 添加返回处理函数
183
- });
184
- },
185
- pcDetailModalDisplay: platform === "h5" ? true : false,
186
- padDetailModalDisplay: true,
187
- mobilePadDetailModalDisplay: true,
188
- modalWrapStyle: {
189
- overflowY: "auto",
190
- top: 0,
191
- height: "100%",
192
- zIndex: 998,
193
- position: "fixed",
194
- left: 0,
195
- right: 0
196
- },
197
- split: false,
198
- detail: detail(),
199
- children: null,
200
- emptyButtons: [],
201
- doubleList: true,
202
- doubleListSource: formatData(),
203
- dataSource: product_discount_card,
204
- renderItem: (value) => renderItem(value),
205
- isShowClode: false
206
- }
207
- ));
208
- });
209
- var DiscountCard_default = RechargeableCard;
@@ -1,9 +0,0 @@
1
- .wallet-discountCard-title {
2
- color: var(--Gray-900, #101828);
3
- font-size: 20px;
4
- font-style: normal;
5
- font-weight: 600;
6
- line-height: 30px;
7
- margin-top: 20px;
8
- margin-bottom: 24px;
9
- }
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- total: number;
4
- setup?: 'menu' | 'list' | 'detail' | string;
5
- }
6
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
7
- state: RechargeState;
8
- } & {
9
- dispatch: (params: {
10
- type: string;
11
- payload: any;
12
- }) => void;
13
- }>;
14
- export {};
@@ -1,43 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/components/wallet/DiscountCard/model.tsx
20
- var model_exports = {};
21
- __export(model_exports, {
22
- Context: () => Context,
23
- Provider: () => Provider
24
- });
25
- module.exports = __toCommonJS(model_exports);
26
- var import_utils = require("@pisell/utils");
27
- var defaultState = {
28
- total: 0
29
- };
30
- var { Provider, Context } = (0, import_utils.miniRedux)({
31
- namespace: "state",
32
- state: defaultState,
33
- reducers: {
34
- setState(state, payload) {
35
- return { ...state, ...payload };
36
- }
37
- }
38
- });
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- Context,
42
- Provider
43
- });
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const RechargeableCard: any;
3
- export default RechargeableCard;
@@ -1,190 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/wallet/PointCard/index.tsx
30
- var PointCard_exports = {};
31
- __export(PointCard_exports, {
32
- default: () => PointCard_default
33
- });
34
- module.exports = __toCommonJS(PointCard_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_materials = require("@pisell/materials");
37
- var import_model = require("./model");
38
- var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
39
- var import_utils = require("@pisell/utils");
40
- var import_locales = __toESM(require("../locales"));
41
- var import_index = require("./index.less");
42
- var import_DetailContext = require("../DetailContext");
43
- var import_WalletCard = __toESM(require("../components/WalletCard"));
44
- var { Title } = import_materials.Typography;
45
- var RechargeableCard = (0, import_model.Provider)((props) => {
46
- var _a, _b, _c;
47
- const { globalState, setGlobalState } = props;
48
- const { currentId, currentDetail, point_card } = globalState;
49
- const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
50
- const context = (0, import_useEngineContext.default)();
51
- const utils = context.appHelper.utils || {};
52
- const dvaStore = (_b = (_a = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a.call(utils)) == null ? void 0 : _b.getState();
53
- const recordViewRef = (0, import_react.useRef)(null);
54
- const { openDetail, renderDetail } = (0, import_DetailContext.useDetail)();
55
- (0, import_react.useEffect)(() => {
56
- document.body.id = "body";
57
- }, []);
58
- const platform = (0, import_utils.isMobile)() ? "h5" : "pc";
59
- const renderItem = (item) => {
60
- return /* @__PURE__ */ import_react.default.createElement(
61
- import_WalletCard.default,
62
- {
63
- item,
64
- balanceTitle: import_utils.locales.getText("page.wallet.pointCard"),
65
- currentId,
66
- onClick: () => {
67
- setGlobalState({
68
- type: "setState",
69
- payload: {
70
- currentId: item.id
71
- }
72
- });
73
- }
74
- }
75
- );
76
- };
77
- (0, import_react.useEffect)(() => {
78
- const enabledCards = point_card.filter(
79
- (item) => item.limit_status === "enable"
80
- );
81
- const total = enabledCards.reduce(
82
- (sum, item) => sum + Number(item.balance),
83
- 0
84
- );
85
- dispatch({
86
- type: "setState",
87
- payload: {
88
- total
89
- }
90
- });
91
- }, [point_card]);
92
- const detail = () => {
93
- if (!(currentDetail == null ? void 0 : currentDetail.id)) return null;
94
- const detailWithProps = {
95
- ...currentDetail,
96
- showWalletBar: platform === "h5",
97
- // 添加显示WalletBar的标志
98
- onBack: handleBack
99
- // 添加返回处理函数
100
- };
101
- return renderDetail(detailWithProps);
102
- };
103
- const handleBack = (0, import_react.useCallback)(() => {
104
- if (recordViewRef.current) {
105
- recordViewRef.current.closeDetailModal();
106
- }
107
- setGlobalState({
108
- setup: "list"
109
- });
110
- }, [recordViewRef, setGlobalState]);
111
- const isEmpty = !point_card.some(
112
- (item) => item.limit_status === "enable"
113
- );
114
- import_utils.locales.init(import_locales.default, ((_c = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _c.translateLocale) || "en");
115
- const formatData = () => {
116
- let available = {
117
- title: import_utils.locales.getText("page.wallet.available"),
118
- dataSource: point_card.filter(
119
- (item) => item.limit_status === "enable"
120
- )
121
- };
122
- const unavailable = {
123
- title: import_utils.locales.getText("page.wallet.unavailable"),
124
- dataSource: point_card.filter(
125
- (item) => item.limit_status === "disable"
126
- )
127
- };
128
- return [available, unavailable];
129
- };
130
- (0, import_react.useEffect)(() => {
131
- var _a2;
132
- if (globalState.setup !== "detail") {
133
- (_a2 = recordViewRef.current) == null ? void 0 : _a2.closeDetailModal();
134
- }
135
- }, [globalState.setup]);
136
- return isEmpty ? /* @__PURE__ */ import_react.default.createElement(import_materials.PisellEmpty, null) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, platform !== "pc" && /* @__PURE__ */ import_react.default.createElement(Title, { className: "wallet-pointCard-title" }, import_utils.locales.getText("page.wallet.pointCard")), /* @__PURE__ */ import_react.default.createElement(
137
- import_materials.CardMetricItem,
138
- {
139
- title: import_utils.locales.getText("page.wallet.points"),
140
- style: { margin: "8px 0 24px" },
141
- hint: false,
142
- tags: false,
143
- number: state.total,
144
- showCurrencySymbol: false
145
- }
146
- ), /* @__PURE__ */ import_react.default.createElement(
147
- import_materials.RecordView,
148
- {
149
- ref: recordViewRef,
150
- mobilePadDetailModalDisplay: true,
151
- leftSpan: 9,
152
- rightSpan: 15,
153
- gutter: 20,
154
- onRowClick: (currentDetail2) => {
155
- setGlobalState({
156
- currentId: currentDetail2.id || "",
157
- currentDetail: currentDetail2,
158
- setup: "detail"
159
- // 设置状态为detail
160
- });
161
- const detailWithProps = {
162
- ...currentDetail2,
163
- showWalletBar: platform === "h5",
164
- // 添加显示WalletBar的标志
165
- onBack: handleBack
166
- // 添加返回处理函数
167
- };
168
- openDetail(detailWithProps);
169
- },
170
- modalWrapStyle: {
171
- overflowY: "auto",
172
- top: 68,
173
- height: "calc(100% - 68px)",
174
- zIndex: 998
175
- },
176
- pcDetailModalDisplay: platform === "h5" ? true : false,
177
- padDetailModalDisplay: true,
178
- isShowClode: false,
179
- split: false,
180
- children: null,
181
- detail: detail(),
182
- emptyButtons: [],
183
- doubleList: true,
184
- doubleListSource: formatData(),
185
- dataSource: point_card,
186
- renderItem: (value) => renderItem(value)
187
- }
188
- ));
189
- });
190
- var PointCard_default = RechargeableCard;
@@ -1,9 +0,0 @@
1
- .wallet-pointCard-title {
2
- color: var(--Gray-900, #101828);
3
- font-size: 20px;
4
- font-style: normal;
5
- font-weight: 600;
6
- line-height: 30px;
7
- margin-top: 20px;
8
- margin-bottom: 24px;
9
- }
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- interface RechargeState {
3
- total: number;
4
- }
5
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
- state: RechargeState;
7
- } & {
8
- dispatch: (params: {
9
- type: string;
10
- payload: any;
11
- }) => void;
12
- }>;
13
- export {};
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- export interface RechargeableCardProps {
4
- globalState: any;
5
- setGlobalState: (state: any) => void;
6
- handleAddWalletCard?: (addWallet: () => void) => void;
7
- }
8
- /**
9
- * 充值卡组件
10
- * 管理充值卡的展示和操作
11
- */
12
- declare const RechargeableCard: React.FC<RechargeableCardProps>;
13
- export default RechargeableCard;