oak-pay-business 3.0.3 → 3.1.0

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 (196) hide show
  1. package/es/components/AbstractComponents.d.ts +11 -62
  2. package/es/components/account/detail/index.js +58 -76
  3. package/es/components/account/detail/index.xml +1 -1
  4. package/es/components/accountOper/pure/List.pc.d.ts +0 -1
  5. package/es/components/aliPay/upsert/index.d.ts +5 -0
  6. package/es/components/aliPay/upsert/index.js +44 -0
  7. package/es/components/aliPay/upsert/index.json +1 -0
  8. package/es/components/aliPay/upsert/locales/zh-CN.json +7 -0
  9. package/es/components/aliPay/upsert/web.pc.d.ts +7 -0
  10. package/es/components/aliPay/upsert/web.pc.js +29 -0
  11. package/es/components/aliPay/upsert/web.pc.module.less +3 -0
  12. package/es/components/apAccount/config/index.d.ts +4 -0
  13. package/es/components/apAccount/config/index.js +60 -0
  14. package/es/components/apAccount/config/index.json +1 -0
  15. package/es/components/apAccount/config/locales/zh-CN.json +7 -0
  16. package/es/components/apAccount/config/web.pc.d.ts +17 -0
  17. package/es/components/apAccount/config/web.pc.js +118 -0
  18. package/es/components/apAccount/config/web.pc.module.less +55 -0
  19. package/es/components/apAccount/upsert/index.d.ts +4 -0
  20. package/es/components/apAccount/upsert/index.js +93 -0
  21. package/es/components/apAccount/upsert/index.json +1 -0
  22. package/es/components/apAccount/upsert/locales/zh-CN.json +25 -0
  23. package/es/components/apAccount/upsert/web.pc.d.ts +8 -0
  24. package/es/components/apAccount/upsert/web.pc.js +139 -0
  25. package/es/components/apAccount/upsert/web.pc.module.less +4 -0
  26. package/es/components/apProduct/config/index.d.ts +5 -0
  27. package/es/components/apProduct/config/index.js +60 -0
  28. package/es/components/apProduct/config/index.json +1 -0
  29. package/es/components/apProduct/config/locales/zh-CN.json +7 -0
  30. package/es/components/apProduct/config/web.pc.d.ts +11 -0
  31. package/es/components/apProduct/config/web.pc.js +98 -0
  32. package/es/components/apProduct/config/web.pc.module.less +62 -0
  33. package/es/components/apProduct/upsert/index.d.ts +5 -0
  34. package/es/components/apProduct/upsert/index.js +67 -0
  35. package/es/components/apProduct/upsert/index.json +1 -0
  36. package/es/components/apProduct/upsert/locales/zh-CN.json +34 -0
  37. package/es/components/apProduct/upsert/web.pc.d.ts +8 -0
  38. package/es/components/apProduct/upsert/web.pc.js +107 -0
  39. package/es/components/offlineAccount/upsert/index.d.ts +0 -1
  40. package/es/components/order/list/index.d.ts +0 -1
  41. package/es/components/order/pay/index.d.ts +1 -1
  42. package/es/components/order/pay/info.d.ts +0 -1
  43. package/es/components/pay/channelPicker2/web.d.ts +0 -1
  44. package/es/components/pay/channelPicker2/web.pc.d.ts +0 -1
  45. package/es/components/pay/detail/index.js +55 -65
  46. package/es/components/pay/detail/index.less +5 -3
  47. package/es/components/pay/detail/index.xml +8 -7
  48. package/es/components/pay/detail/locales/zh-CN.json +9 -1
  49. package/es/components/pay/list/index.d.ts +0 -1
  50. package/es/components/payConfig/system/index.d.ts +0 -1
  51. package/es/components/refund/list/index.d.ts +0 -1
  52. package/es/components/ship/system/index.d.ts +0 -1
  53. package/es/components/ship/wechatMpShip/upsert/index.d.ts +0 -1
  54. package/es/components/sysAccount/transferList/index.d.ts +0 -1
  55. package/es/components/withdraw/detail/index.d.ts +0 -1
  56. package/es/components/withdraw/display/web.d.ts +0 -1
  57. package/es/components/withdraw/display/web.pc.d.ts +0 -1
  58. package/es/components/withdrawTransfer/list/index.d.ts +0 -1
  59. package/es/components/wpAccount/config/index.js +11 -1
  60. package/es/components/wpAccount/upsert/index.js +1 -0
  61. package/es/components/wpProduct/config/index.js +4 -0
  62. package/es/data/i18n.js +124 -1
  63. package/es/entities/AliPay.d.ts +10 -0
  64. package/es/entities/AliPay.js +13 -0
  65. package/es/entities/ApAccount.d.ts +35 -0
  66. package/es/entities/ApAccount.js +89 -0
  67. package/es/entities/ApProduct.d.ts +19 -0
  68. package/es/entities/ApProduct.js +44 -0
  69. package/es/oak-app-domain/ActionDefDict.d.ts +1 -0
  70. package/es/oak-app-domain/ActionDefDict.js +2 -0
  71. package/es/oak-app-domain/AliPay/Schema.d.ts +19 -0
  72. package/es/oak-app-domain/AliPay/Schema.js +1 -0
  73. package/es/oak-app-domain/AliPay/Storage.d.ts +3 -0
  74. package/es/oak-app-domain/AliPay/Storage.js +25 -0
  75. package/es/oak-app-domain/AliPay/_baseSchema.d.ts +45 -0
  76. package/es/oak-app-domain/AliPay/_baseSchema.js +1 -0
  77. package/es/oak-app-domain/AliPay/locales/zh_CN.json +8 -0
  78. package/es/oak-app-domain/ApAccount/Action.d.ts +5 -0
  79. package/es/oak-app-domain/ApAccount/Action.js +2 -0
  80. package/es/oak-app-domain/ApAccount/Schema.d.ts +19 -0
  81. package/es/oak-app-domain/ApAccount/Schema.js +1 -0
  82. package/es/oak-app-domain/ApAccount/Storage.d.ts +3 -0
  83. package/es/oak-app-domain/ApAccount/Storage.js +132 -0
  84. package/es/oak-app-domain/ApAccount/Style.d.ts +3 -0
  85. package/es/oak-app-domain/ApAccount/Style.js +26 -0
  86. package/es/oak-app-domain/ApAccount/_baseSchema.d.ts +141 -0
  87. package/es/oak-app-domain/ApAccount/_baseSchema.js +1 -0
  88. package/es/oak-app-domain/ApAccount/locales/zh_CN.json +58 -0
  89. package/es/oak-app-domain/ApProduct/Schema.d.ts +19 -0
  90. package/es/oak-app-domain/ApProduct/Schema.js +1 -0
  91. package/es/oak-app-domain/ApProduct/Storage.d.ts +3 -0
  92. package/es/oak-app-domain/ApProduct/Storage.js +53 -0
  93. package/es/oak-app-domain/ApProduct/Style.d.ts +3 -0
  94. package/es/oak-app-domain/ApProduct/Style.js +13 -0
  95. package/es/oak-app-domain/ApProduct/_baseSchema.d.ts +75 -0
  96. package/es/oak-app-domain/ApProduct/_baseSchema.js +1 -0
  97. package/es/oak-app-domain/ApProduct/locales/zh_CN.json +26 -0
  98. package/es/oak-app-domain/EntityDict.d.ts +235 -0
  99. package/es/oak-app-domain/Pay/Storage.js +1 -1
  100. package/es/oak-app-domain/Pay/_baseSchema.d.ts +2 -2
  101. package/es/oak-app-domain/Storage.js +6 -0
  102. package/es/oak-app-domain/StyleDict.js +4 -0
  103. package/es/oak-app-domain/SysAccountOper/Storage.js +1 -1
  104. package/es/oak-app-domain/SysAccountOper/_baseSchema.d.ts +2 -2
  105. package/es/oak-app-domain/WithdrawChannel/Storage.js +1 -1
  106. package/es/oak-app-domain/WithdrawChannel/_baseSchema.d.ts +2 -2
  107. package/es/timers/index.d.ts +1 -1
  108. package/es/triggers/order.js +2 -2
  109. package/es/triggers/withdraw.d.ts +1 -1
  110. package/es/utils/apProduct.d.ts +2 -0
  111. package/es/utils/apProduct.js +25 -0
  112. package/es/utils/pay.d.ts +0 -1
  113. package/es/utils/pay.js +5 -0
  114. package/es/utils/payClazz/AliPay/AliPay.d.ts +50 -0
  115. package/es/utils/payClazz/AliPay/AliPay.debug.d.ts +39 -0
  116. package/es/utils/payClazz/AliPay/AliPay.debug.js +157 -0
  117. package/es/utils/payClazz/AliPay/AliPay.js +368 -0
  118. package/es/utils/payClazz/AliPay/index.d.ts +3 -0
  119. package/es/utils/payClazz/AliPay/index.js +3 -0
  120. package/es/utils/payClazz/WechatPay/WechatPay.js +2 -2
  121. package/es/utils/ship.js +23 -28
  122. package/lib/aspects/ship.js +2 -3
  123. package/lib/aspects/withdraw.js +1 -2
  124. package/lib/checkers/abstractChecker.js +2 -2
  125. package/lib/data/i18n.js +124 -1
  126. package/lib/entities/AliPay.d.ts +10 -0
  127. package/lib/entities/AliPay.js +16 -0
  128. package/lib/entities/ApAccount.d.ts +35 -0
  129. package/lib/entities/ApAccount.js +92 -0
  130. package/lib/entities/ApProduct.d.ts +19 -0
  131. package/lib/entities/ApProduct.js +47 -0
  132. package/lib/features/index.js +2 -3
  133. package/lib/hooks/useFeatures.js +1 -1
  134. package/lib/oak-app-domain/ActionDefDict.d.ts +1 -0
  135. package/lib/oak-app-domain/ActionDefDict.js +28 -26
  136. package/lib/oak-app-domain/AliPay/Schema.d.ts +19 -0
  137. package/lib/oak-app-domain/AliPay/Schema.js +4 -0
  138. package/lib/oak-app-domain/AliPay/Storage.d.ts +3 -0
  139. package/lib/oak-app-domain/AliPay/Storage.js +28 -0
  140. package/lib/oak-app-domain/AliPay/_baseSchema.d.ts +45 -0
  141. package/lib/oak-app-domain/AliPay/_baseSchema.js +2 -0
  142. package/lib/oak-app-domain/AliPay/locales/zh_CN.json +8 -0
  143. package/lib/oak-app-domain/ApAccount/Action.d.ts +5 -0
  144. package/lib/oak-app-domain/ApAccount/Action.js +5 -0
  145. package/lib/oak-app-domain/ApAccount/Schema.d.ts +19 -0
  146. package/lib/oak-app-domain/ApAccount/Schema.js +4 -0
  147. package/lib/oak-app-domain/ApAccount/Storage.d.ts +3 -0
  148. package/lib/oak-app-domain/ApAccount/Storage.js +135 -0
  149. package/lib/oak-app-domain/ApAccount/Style.d.ts +3 -0
  150. package/lib/oak-app-domain/ApAccount/Style.js +29 -0
  151. package/lib/oak-app-domain/ApAccount/_baseSchema.d.ts +141 -0
  152. package/lib/oak-app-domain/ApAccount/_baseSchema.js +2 -0
  153. package/lib/oak-app-domain/ApAccount/locales/zh_CN.json +58 -0
  154. package/lib/oak-app-domain/ApProduct/Schema.d.ts +19 -0
  155. package/lib/oak-app-domain/ApProduct/Schema.js +4 -0
  156. package/lib/oak-app-domain/ApProduct/Storage.d.ts +3 -0
  157. package/lib/oak-app-domain/ApProduct/Storage.js +56 -0
  158. package/lib/oak-app-domain/ApProduct/Style.d.ts +3 -0
  159. package/lib/oak-app-domain/ApProduct/Style.js +16 -0
  160. package/lib/oak-app-domain/ApProduct/_baseSchema.d.ts +75 -0
  161. package/lib/oak-app-domain/ApProduct/_baseSchema.js +2 -0
  162. package/lib/oak-app-domain/ApProduct/locales/zh_CN.json +26 -0
  163. package/lib/oak-app-domain/EntityDict.d.ts +235 -0
  164. package/lib/oak-app-domain/Pay/Storage.js +1 -1
  165. package/lib/oak-app-domain/Pay/_baseSchema.d.ts +2 -2
  166. package/lib/oak-app-domain/Storage.js +48 -42
  167. package/lib/oak-app-domain/StyleDict.js +34 -30
  168. package/lib/oak-app-domain/SysAccountOper/Storage.js +1 -1
  169. package/lib/oak-app-domain/SysAccountOper/_baseSchema.d.ts +2 -2
  170. package/lib/oak-app-domain/WithdrawChannel/Storage.js +1 -1
  171. package/lib/oak-app-domain/WithdrawChannel/_baseSchema.d.ts +2 -2
  172. package/lib/timers/index.d.ts +1 -1
  173. package/lib/triggers/order.js +2 -2
  174. package/lib/triggers/withdraw.js +1 -2
  175. package/lib/types/DependentExceptions.js +1 -1
  176. package/lib/utils/apProduct.d.ts +2 -0
  177. package/lib/utils/apProduct.js +28 -0
  178. package/lib/utils/application.js +2 -2
  179. package/lib/utils/pay.d.ts +0 -1
  180. package/lib/utils/pay.js +9 -4
  181. package/lib/utils/payClazz/AliPay/AliPay.d.ts +50 -0
  182. package/lib/utils/payClazz/AliPay/AliPay.debug.d.ts +39 -0
  183. package/lib/utils/payClazz/AliPay/AliPay.debug.js +162 -0
  184. package/lib/utils/payClazz/AliPay/AliPay.js +372 -0
  185. package/lib/utils/payClazz/AliPay/index.d.ts +3 -0
  186. package/lib/utils/payClazz/AliPay/index.js +6 -0
  187. package/lib/utils/payClazz/WechatPay/WechatPay.js +2 -2
  188. package/lib/utils/payClazz/index.js +3 -4
  189. package/lib/utils/ship.js +30 -35
  190. package/lib/utils/shipClazz/index.js +3 -4
  191. package/lib/utils/wpProduct.js +1 -2
  192. package/lib/utils/wpProductFrontend.js +2 -3
  193. package/package.json +6 -5
  194. package/src/entities/AliPay.ts +31 -0
  195. package/src/entities/ApAccount.ts +134 -0
  196. package/src/entities/ApProduct.ts +75 -0
@@ -4,66 +4,15 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { EntityDict } from '../oak-app-domain';
7
- import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, ListButtonProps, OakAbsAttrUpsertDef } from 'oak-frontend-base';
8
- declare const FilterPanel: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
9
- entity: T;
10
- columns: ColumnProps<EntityDict, T>[];
11
- }>) => React.ReactElement;
12
- declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
13
- entity: T;
14
- extraActions: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]);
15
- onAction: onActionFnDef;
16
- disabledOp: boolean;
17
- attributes: OakAbsAttrDef[];
18
- data: RowWithActions<EntityDict, T>[];
19
- loading: boolean;
20
- tablePagination?: React.ReactNode;
21
- rowSelection?: any;
22
- hideHeader?: boolean | undefined;
23
- disableSerialNumber?: boolean | undefined;
24
- size?: "small" | "middle" | "large" | undefined;
25
- scroll?: any;
26
- empty?: React.ReactNode;
27
- opWidth?: number | undefined;
28
- ellipsis?: boolean | undefined;
29
- }>) => React.ReactElement;
30
- declare const ListPro: <T extends keyof EntityDict>(props: {
31
- title?: any;
32
- extraContent?: any;
33
- hideDefaultButtons?: boolean | undefined;
34
- buttonGroup?: ListButtonProps[] | undefined;
35
- onReload?: (() => void) | undefined;
36
- entity: T;
37
- extraActions?: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]) | undefined;
38
- onAction?: onActionFnDef | undefined;
39
- disabledOp?: boolean | undefined;
40
- attributes: OakAbsAttrDef[];
41
- data: RowWithActions<EntityDict, T>[];
42
- loading?: boolean | undefined;
43
- tablePagination?: any;
44
- rowSelection?: any;
45
- disableSerialNumber?: boolean | undefined;
46
- size?: "small" | "middle" | "large" | undefined;
47
- scroll?: any;
48
- empty?: any;
49
- opWidth?: number | undefined;
50
- oakPath?: string | undefined;
51
- }) => React.ReactElement;
52
- declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
53
- column?: number | Record<Breakpoint, number> | undefined;
54
- entity: T;
55
- attributes: OakAbsAttrDef[];
56
- data: Partial<EntityDict[T]["Schema"]>;
57
- title?: string | undefined;
58
- bordered?: boolean | undefined;
59
- layout?: "horizontal" | "vertical" | undefined;
60
- }>) => React.ReactElement;
61
- declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
62
- helps: Record<string, string>;
63
- entity: T;
64
- attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
65
- data: EntityDict[T]["Schema"];
66
- layout: "horizontal" | "vertical";
67
- mode: "default" | "card";
68
- }>) => React.ReactElement;
7
+ import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef } from 'oak-frontend-base';
8
+ import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
9
+ import AbsList from 'oak-frontend-base/es/components/list';
10
+ import AbsListPro from 'oak-frontend-base/es/components/listPro';
11
+ import AbsDetail from 'oak-frontend-base/es/components/detail';
12
+ import AbsUpsert from 'oak-frontend-base/es/components/upsert';
13
+ declare const FilterPanel: <T extends keyof EntityDict>(...props: Parameters<typeof AbsFilterPanel<EntityDict, T>>) => React.ReactElement;
14
+ declare const List: <T extends keyof EntityDict>(...props: Parameters<typeof AbsList<EntityDict, T>>) => React.ReactElement;
15
+ declare const ListPro: <T extends keyof EntityDict>(...props: Parameters<typeof AbsListPro<EntityDict, T>>) => React.ReactElement;
16
+ declare const Detail: <T extends keyof EntityDict>(...props: Parameters<typeof AbsDetail<EntityDict, T>>) => React.ReactElement;
17
+ declare const Upsert: <T extends keyof EntityDict>(...props: Parameters<typeof AbsUpsert<EntityDict, T>>) => React.ReactElement;
69
18
  export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
@@ -319,10 +319,10 @@ export default OakComponent({
319
319
  });
320
320
  const ship = deposit?.ship;
321
321
  if (ship && ship.id) {
322
- if (ship.iState === 'receiving') {
323
- const transactionId = deposit?.pay$deposit?.[0]?.meta?.transaction_id;
324
- console.log('transaction_id', transactionId);
325
- if (process.env.NODE_ENV === 'development') {
322
+ const transactionId = deposit?.pay$deposit?.[0]?.meta?.transaction_id;
323
+ console.log('transaction_id', transactionId);
324
+ if (process.env.NODE_ENV === 'development') {
325
+ if (ship.iState === 'receiving') {
326
326
  await this.features.cache.operate('ship', [{
327
327
  id: await generateNewIdAsync(),
328
328
  action: 'succeedReceiving',
@@ -331,92 +331,74 @@ export default OakComponent({
331
331
  id: ship.id,
332
332
  },
333
333
  }]);
334
- await this.features.cache.refresh('deposit', {
335
- data: {
336
- id: 1,
337
- iState: 1,
338
- },
339
- filter: {
340
- id: unreceivedDepositId,
341
- }
342
- });
343
334
  this.setMessage({
344
335
  type: 'success',
345
336
  content: this.t('ship.success')
346
337
  });
347
338
  return;
348
339
  }
349
- if (transactionId) {
350
- if (wx.openBusinessView) {
351
- wx.openBusinessView({
352
- businessType: 'weappOrderConfirm',
353
- extraData: {
354
- transaction_id: transactionId,
355
- },
356
- success: async () => {
357
- console.log('success');
358
- const { result: mpShipState } = await this.features.cache.exec('getMpShipState', {
359
- shipId: ship.id,
360
- });
361
- if (mpShipState === 'received') {
362
- await this.features.cache.operate('ship', [{
363
- id: await generateNewIdAsync(),
364
- action: 'succeedReceiving',
365
- data: {},
366
- filter: {
367
- id: ship.id,
368
- },
369
- }]);
370
- this.setMessage({
371
- type: 'success',
372
- content: this.t('ship.success')
373
- });
374
- }
375
- else {
376
- console.log(mpShipState);
377
- this.reRender();
378
- // this.setMessage({
379
- // type: 'warning',
380
- // content: this.t('ship.wait'),
381
- // })
382
- }
383
- },
384
- fail() {
385
- console.log('fail');
340
+ }
341
+ if (transactionId) {
342
+ if (wx.openBusinessView) {
343
+ wx.openBusinessView({
344
+ businessType: 'weappOrderConfirm',
345
+ extraData: {
346
+ transaction_id: transactionId,
347
+ },
348
+ success: async () => {
349
+ console.log('success');
350
+ const { result: mpShipState } = await this.features.cache.exec('getMpShipState', {
351
+ shipId: ship.id,
352
+ });
353
+ if (mpShipState === 'received') {
354
+ await this.features.cache.operate('ship', [{
355
+ id: await generateNewIdAsync(),
356
+ action: 'succeedReceiving',
357
+ data: {},
358
+ filter: {
359
+ id: ship.id,
360
+ },
361
+ }]);
386
362
  this.setMessage({
387
- type: 'warning',
388
- content: this.t('ship.fail'),
363
+ type: 'success',
364
+ content: this.t('ship.success')
389
365
  });
390
- },
391
- complete() {
392
366
  }
393
- });
394
- }
395
- else {
396
- //引导用户升级微信版本
397
- this.setMessage({
398
- type: 'warning',
399
- content: this.t('ship.update wechat'),
400
- });
401
- }
367
+ else {
368
+ console.log(mpShipState);
369
+ this.reRender();
370
+ // this.setMessage({
371
+ // type: 'warning',
372
+ // content: this.t('ship.wait'),
373
+ // })
374
+ }
375
+ },
376
+ fail: () => {
377
+ console.log('fail');
378
+ this.setMessage({
379
+ type: 'warning',
380
+ content: this.t('ship.fail'),
381
+ });
382
+ },
383
+ complete: () => {
384
+ }
385
+ });
402
386
  }
403
387
  else {
404
- if (!noMessage) {
405
- this.setMessage({
406
- type: 'warning',
407
- content: this.t('no transactionId'),
408
- });
409
- }
388
+ //引导用户升级微信版本
389
+ this.setMessage({
390
+ type: 'warning',
391
+ content: this.t('ship.update wechat'),
392
+ });
410
393
  }
411
394
  }
412
395
  else {
413
- // if (!noMessage) {
414
- // this.setMessage({
415
- // content: this.t('ship.wait'),
416
- // type: 'warning',
417
- // })
418
- // }
419
- this.reRender();
396
+ if (!noMessage) {
397
+ this.setMessage({
398
+ type: 'warning',
399
+ content: this.t('no transactionId'),
400
+ });
401
+ }
420
402
  }
421
403
  }
422
404
  }
@@ -1,7 +1,7 @@
1
1
  <view class="container">
2
2
  <l-notice-bar show="{{!!unreceivedDepositId}}" front-icon-name="notification" end-icon-name="right"
3
3
  bind:lintap="onUnreceivedDepositClickMp" bind:linicontap="onUnreceivedDepositClickMp">
4
- {{t('ship.unconfirm')}}
4
+ <view style="width:100vw">{{t('ship.unconfirm')}}</view>
5
5
  </l-notice-bar>
6
6
  <view class="info" style="background-color:{{bgColor}};color:{{textColor}};">
7
7
  <view
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EntityDict } from "../../../oak-app-domain";
3
2
  export default function Render(props: {
4
3
  accountOpers: EntityDict['accountOper']['OpSchema'][];
@@ -0,0 +1,5 @@
1
+ import { EntityDict } from '../../../oak-app-domain';
2
+ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "aliPay", false, {
3
+ systemId: string;
4
+ }>) => React.ReactElement;
5
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import { composeServerUrl } from "oak-general-business/es/utils/domain";
2
+ export default OakComponent({
3
+ entity: 'aliPay',
4
+ projection: {
5
+ id: 1,
6
+ refundNotifyUrl: 1,
7
+ payNotifyUrl: 1,
8
+ system: {
9
+ id: 1,
10
+ domain$system: {
11
+ $entity: 'domain',
12
+ data: {
13
+ id: 1,
14
+ protocol: 1,
15
+ url: 1,
16
+ apiPath: 1,
17
+ port: 1,
18
+ },
19
+ },
20
+ }
21
+ },
22
+ isList: false,
23
+ formData({ data }) {
24
+ const domain = data && data.system?.domain$system?.[0];
25
+ const serverUrl = domain && composeServerUrl(domain);
26
+ return {
27
+ aliPay: data,
28
+ serverUrl,
29
+ };
30
+ },
31
+ properties: {
32
+ systemId: '',
33
+ },
34
+ lifetimes: {
35
+ ready() {
36
+ const { systemId } = this.props;
37
+ if (this.isCreation()) {
38
+ this.update({
39
+ systemId,
40
+ });
41
+ }
42
+ }
43
+ }
44
+ });
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,7 @@
1
+ {
2
+ "placeholder": {
3
+ "lossRatio": "填百分比(0.6就代表千分之六)",
4
+ "payNotifyUrl": "endpoint",
5
+ "refundNotifyUrl": "endpoint"
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { EntityDict } from "../../../oak-app-domain";
3
+ import { RowWithActions, WebComponentProps } from "oak-frontend-base";
4
+ export default function render(props: WebComponentProps<EntityDict, 'aliPay', false, {
5
+ aliPay?: (RowWithActions<EntityDict, 'aliPay'>);
6
+ serverUrl: string;
7
+ }>): React.JSX.Element | null;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { Form, Input } from 'antd';
3
+ export default function render(props) {
4
+ const { aliPay, serverUrl } = props.data;
5
+ const { t, update } = props.methods;
6
+ if (aliPay) {
7
+ return (<>
8
+ <Form.Item label={t('aliPay:attr.payNotifyUrl')}>
9
+ <Input prefix={`${serverUrl}/endpoint`} suffix='/${payId}' value={aliPay.payNotifyUrl} placeholder={t('placeholder.payNotifyUrl')} onChange={({ currentTarget }) => {
10
+ const payNotifyUrl = currentTarget.value;
11
+ update({ payNotifyUrl });
12
+ }}/>
13
+ </Form.Item>
14
+ {/* <Form.Item label={t('aliPay:attr.refundNotifyUrl')}>
15
+ <Input
16
+ prefix={`${serverUrl}/endpoint`}
17
+ suffix='/${refundId}'
18
+ value={aliPay.refundNotifyUrl}
19
+ placeholder={t('placeholder.refundNotifyUrl')}
20
+ onChange={({ currentTarget }) => {
21
+ const refundNotifyUrl = currentTarget.value;
22
+ update({ refundNotifyUrl });
23
+ }}
24
+ />
25
+ </Form.Item> */}
26
+ </>);
27
+ }
28
+ return null;
29
+ }
@@ -0,0 +1,3 @@
1
+ .container {
2
+ height: 100%;
3
+ }
@@ -0,0 +1,4 @@
1
+ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "apAccount", true, {
2
+ systemId: string;
3
+ }>) => React.ReactElement;
4
+ export default _default;
@@ -0,0 +1,60 @@
1
+ export default OakComponent({
2
+ entity: 'apAccount',
3
+ isList: true,
4
+ projection: {
5
+ id: 1,
6
+ price: 1,
7
+ mchId: 1,
8
+ appId: 1,
9
+ enabled: 1,
10
+ aliPayId: 1,
11
+ aliPay: {
12
+ id: 1,
13
+ payNotifyUrl: 1,
14
+ refundNotifyUrl: 1,
15
+ },
16
+ refundGapDays: 1,
17
+ taxLossRatio: 1,
18
+ publicKeyPath: 1,
19
+ privateKeyPath: 1,
20
+ refundCompensateRatio: 1,
21
+ allowWithdrawTransfer: 1,
22
+ withdrawTransferLossRatio: 1,
23
+ needReceiving: 1,
24
+ encryptKey: 1,
25
+ alipayRootCertPath: 1,
26
+ alipayPublicCertPath: 1,
27
+ appCertPath: 1,
28
+ mode: 1,
29
+ gateway: 1,
30
+ endpoint: 1,
31
+ callbackUrl: 1,
32
+ wsServiceUrl: 1,
33
+ setting: 1,
34
+ keyType: 1,
35
+ timeout: 1,
36
+ needEncrypt: 1,
37
+ systemId: 1,
38
+ },
39
+ properties: {
40
+ systemId: '',
41
+ },
42
+ filters: [
43
+ {
44
+ filter() {
45
+ const { systemId } = this.props;
46
+ return {
47
+ systemId,
48
+ };
49
+ }
50
+ }
51
+ ],
52
+ formData({ data, legalActions }) {
53
+ return {
54
+ accounts: data,
55
+ canCreate: legalActions?.includes('create') && !data?.find(ele => ele.enabled),
56
+ oakExecutable: this.tryExecute(),
57
+ };
58
+ },
59
+ actions: ['create', 'update', 'remove'],
60
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "tips": "支付宝支付账户是用来配置支付宝支付的账户相关信息",
3
+ "notnull": "属性\"%{value}\"不能为空",
4
+ "noData": "没有数据",
5
+ "confirmDelete": "确定删除",
6
+ "areYouSure": "确认删除本数据吗?"
7
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { EntityDict } from "../../../oak-app-domain";
3
+ import { RowWithActions, WebComponentProps } from "oak-frontend-base";
4
+ import { OakException } from 'oak-domain/lib/types';
5
+ export declare function ApAccount(props: {
6
+ data: RowWithActions<EntityDict, 'apAccount'>;
7
+ systemId: string;
8
+ t: (k: string, param?: any) => string;
9
+ onUpdate?: () => void;
10
+ onRemove?: () => void;
11
+ }): React.JSX.Element;
12
+ export default function render(props: WebComponentProps<EntityDict, 'apAccount', true, {
13
+ accounts?: (RowWithActions<EntityDict, 'apAccount'> & {})[];
14
+ systemId: string;
15
+ canCreate?: boolean;
16
+ oakExecutable: boolean | OakException<EntityDict>;
17
+ }>): React.JSX.Element;
@@ -0,0 +1,118 @@
1
+ import React, { useState } from 'react';
2
+ import { Button, Modal, Alert, Descriptions, Tabs } from 'antd';
3
+ import { PlusCircleOutlined } from '@ant-design/icons';
4
+ import Styles from './web.pc.module.less';
5
+ import Upsert from '../upsert';
6
+ import ApProductConfig from '../../apProduct/config';
7
+ import { OakAttrNotNullException, OakException } from 'oak-domain/lib/types';
8
+ import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
9
+ import { ToYuan } from 'oak-domain/lib/utils/money';
10
+ export function ApAccount(props) {
11
+ const { data: account, t, onUpdate, onRemove, systemId } = props;
12
+ const { refundGapDays, mchId, enabled, price, taxLossRatio, refundCompensateRatio, allowWithdrawTransfer, withdrawTransferLossRatio, needReceiving, appId } = account;
13
+ const [activeKey, setActiveKey] = useState("1");
14
+ const D = (<Descriptions column={1} bordered title={t('apAccount:name')} size="small">
15
+ <Descriptions.Item label={t('apAccount:attr.appId')}>{appId}</Descriptions.Item>
16
+ <Descriptions.Item label={t('apAccount:attr.mchId')}>{mchId}</Descriptions.Item>
17
+ <Descriptions.Item label={t('apAccount:attr.price')}>{ToYuan(price)}{t('common::pay.scale')}</Descriptions.Item>
18
+ <Descriptions.Item label={t('apAccount:attr.taxLossRatio')}>{taxLossRatio}%</Descriptions.Item>
19
+ <Descriptions.Item label={t('apAccount:attr.refundCompensateRatio')}>{refundCompensateRatio}%</Descriptions.Item>
20
+ <Descriptions.Item label={t('apAccount:attr.refundGapDays')}>{refundGapDays}</Descriptions.Item>
21
+ <Descriptions.Item label={t('apAccount:attr.allowWithdrawTransfer')}>{t(`common::${!!allowWithdrawTransfer}`)}</Descriptions.Item>
22
+ <Descriptions.Item label={t('apAccount:attr.withdrawTransferLossRatio')}>{withdrawTransferLossRatio}%</Descriptions.Item>
23
+ <Descriptions.Item label={t('apAccount:attr.enabled')}>{t(`common::${enabled}`)}</Descriptions.Item>
24
+ </Descriptions>);
25
+ if (onUpdate) {
26
+ return (<Tabs activeKey={activeKey} onTabClick={(activeKey) => {
27
+ setActiveKey(activeKey);
28
+ }} tabBarExtraContent={activeKey === "1" && <>
29
+ {onUpdate && <Button style={{ marginRight: 4 }} size="small" onClick={() => onUpdate()}>
30
+ {t('common::action.update')}
31
+ </Button>}
32
+ {onRemove && <Button danger size="small" onClick={() => onRemove()}>
33
+ {t('common::action.remove')}
34
+ </Button>}
35
+ </>} style={{ width: 380, height: 520 }} items={[
36
+ {
37
+ key: '1',
38
+ label: t('common::action.detail'),
39
+ children: D,
40
+ },
41
+ {
42
+ key: '2',
43
+ label: t('apProduct:name'),
44
+ children: (<ApProductConfig oakPath={`$$apProduct-${account.id}`} systemId={systemId} apAccountId={account.id}/>)
45
+ }
46
+ ]}/>);
47
+ }
48
+ return D;
49
+ }
50
+ export default function render(props) {
51
+ const { accounts, oakFullpath, oakExecutable, canCreate, systemId } = props.data;
52
+ const { t, addItem, execute, clean } = props.methods;
53
+ const getNotNullMessage = (entity, attr) => {
54
+ return t('notnull', { value: t(`${entity}:attr.${attr}`) });
55
+ };
56
+ const errMsg = oakExecutable instanceof OakException && (oakExecutable instanceof OakAttrNotNullException ? getNotNullMessage(oakExecutable.getEntity(), oakExecutable.getAttributes()[0]) : t(oakExecutable.message));
57
+ const [upsertId, setUpsertId] = useState('');
58
+ const U = (<Modal width={920} destroyOnClose title={`${t('apAccount:name')}${t('common::action.add')}`} open={!!upsertId} onCancel={() => {
59
+ clean();
60
+ setUpsertId('');
61
+ }} closeIcon={null} onOk={async () => {
62
+ await execute();
63
+ setUpsertId('');
64
+ }} okButtonProps={{
65
+ disabled: oakExecutable !== true,
66
+ }} okText={t('common::confirm')} cancelText={(t('common::action.cancel'))}>
67
+ <div style={{ padding: 10 }}>
68
+ {errMsg && <Alert type="error" message={errMsg} style={{ marginBottom: 20 }}/>}
69
+ <Upsert oakPath={`${oakFullpath}.${upsertId}`} systemId={systemId}/>
70
+ </div>
71
+ </Modal>);
72
+ if (accounts && accounts?.length) {
73
+ return (<div className={Styles.container}>
74
+ {U}
75
+ <div className={Styles.list}>
76
+ {accounts.filter(ele => ele.$$createAt$$ > 1).map((ele, idx) => <div className={Styles.item} key={idx}>
77
+ <ApAccount systemId={systemId} data={ele} t={t} onRemove={ele['#oakLegalActions']?.includes('remove') ? () => {
78
+ Modal.confirm({
79
+ title: t('confirmDelete'),
80
+ content: t('areYouSure'),
81
+ onOk: async () => execute(undefined, undefined, undefined, [
82
+ {
83
+ entity: 'apAccount',
84
+ operation: {
85
+ id: await generateNewIdAsync(),
86
+ action: 'remove',
87
+ data: {},
88
+ filter: {
89
+ id: ele.id,
90
+ },
91
+ }
92
+ }
93
+ ]),
94
+ });
95
+ } : undefined} onUpdate={ele['#oakLegalActions']?.includes('update') ? () => setUpsertId(ele.id) : undefined}/>
96
+ </div>)}
97
+ </div>
98
+ <div className={Styles.btnBar}>
99
+ {canCreate && <Button type="primary" onClick={() => {
100
+ const id = addItem({ systemId });
101
+ setUpsertId(id);
102
+ }}>
103
+ {t('common::action.add')}
104
+ </Button>}
105
+ </div>
106
+ </div>);
107
+ }
108
+ return (<div className={Styles.container2}>
109
+ <Alert type='info' message={t('tips')}/>
110
+ {U}
111
+ <div className={Styles.body}>
112
+ {canCreate ? <PlusCircleOutlined className={Styles.add} shape="circle" style={{ fontSize: 50 }} onClick={() => {
113
+ const id = addItem({ systemId });
114
+ setUpsertId(id);
115
+ }}/> : t('noData')}
116
+ </div>
117
+ </div>);
118
+ }
@@ -0,0 +1,55 @@
1
+ .container {
2
+ min-height: 80vh;
3
+ width: 100%;
4
+ height: 100%;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: stretch;
8
+ flex-wrap: wrap;
9
+
10
+ .list {
11
+ flex: 1;
12
+ display: flex;
13
+ flex-direction: row;
14
+ flex-wrap: wrap;
15
+ align-items: flex-start;
16
+
17
+ .item {
18
+ border: 0.1px solid silver;
19
+ border-radius: 8px;
20
+ margin: 18px;
21
+ padding: 18px;
22
+
23
+ .qrCode:hover {
24
+ cursor: pointer;
25
+ }
26
+ }
27
+ }
28
+
29
+ .btnBar {
30
+ display: flex;
31
+ justify-content: flex-end;
32
+ padding: 12px;
33
+ }
34
+ }
35
+
36
+ .container2 {
37
+ min-height: 80vh;
38
+ width: 100%;
39
+ height: 100%;
40
+ display: flex;
41
+ flex-direction: column;
42
+ align-items: stretch;
43
+
44
+ .body {
45
+ flex: 1;
46
+ display: flex;
47
+ flex-direction: column;
48
+ align-items: center;
49
+ justify-content: center;
50
+
51
+ .add:hover {
52
+ color: var(--oak-color-primary);
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,4 @@
1
+ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "apAccount", false, {
2
+ systemId: string;
3
+ }>) => React.ReactElement;
4
+ export default _default;