oak-pay-business 2.2.0 → 2.2.1

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 (53) hide show
  1. package/es/aspects/withdraw.d.ts +4 -4
  2. package/es/components/account/detail/web.d.ts +1 -1
  3. package/es/components/account/detail/web.js +2 -2
  4. package/es/components/account/detail/web.pc.d.ts +1 -1
  5. package/es/components/account/detail/web.pc.js +2 -2
  6. package/es/components/accountOper/list/index.js +118 -6
  7. package/es/components/accountOper/list/index.json +10 -1
  8. package/es/components/accountOper/list/index.less +125 -0
  9. package/es/components/accountOper/list/index.xml +56 -0
  10. package/es/components/accountOper/list/locales/zh-CN.json +9 -1
  11. package/es/components/accountOper/list/mobile.module.less +48 -0
  12. package/es/components/accountOper/list/web.d.ts +12 -1
  13. package/es/components/accountOper/list/web.js +58 -24
  14. package/es/components/accountOper/list/web.module.less +27 -0
  15. package/es/components/accountOper/list/web.pc.d.ts +14 -2
  16. package/es/components/accountOper/list/web.pc.js +43 -8
  17. package/es/components/pay/detail/index.js +11 -0
  18. package/es/components/pay/detail/index.xml +10 -0
  19. package/es/components/pay/detail/locales/zh-CN.json +5 -1
  20. package/es/components/pay/detail/web.d.ts +1 -0
  21. package/es/components/pay/detail/web.js +12 -5
  22. package/es/components/pay/detail/web.pc.d.ts +1 -0
  23. package/es/components/pay/detail/web.pc.js +15 -5
  24. package/es/components/pay/list/web.pc.js +2 -0
  25. package/es/components/withdraw/create/index.d.ts +1 -0
  26. package/es/components/withdraw/create/index.js +4 -0
  27. package/es/components/withdraw/create/index.xml +4 -0
  28. package/es/components/withdraw/create/locales/zh-CN.json +2 -1
  29. package/es/components/withdraw/create/web.d.ts +1 -0
  30. package/es/components/withdraw/create/web.js +6 -2
  31. package/es/components/withdraw/create/web.pc.d.ts +1 -0
  32. package/es/components/withdraw/create/web.pc.js +4 -1
  33. package/es/components/withdraw/display/web.pc.module.less +4 -2
  34. package/es/configuration/attrUpdateMatrix.js +6 -1
  35. package/es/data/i18n.js +17 -3
  36. package/es/entities/Order.d.ts +2 -2
  37. package/es/locales/common/zh_CN.json +1 -0
  38. package/es/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
  39. package/es/oak-app-domain/Order/Schema.d.ts +3 -3
  40. package/es/oak-app-domain/Order/Storage.js +1 -4
  41. package/lib/aspects/withdraw.d.ts +4 -4
  42. package/lib/components/pay/detail/index.js +11 -0
  43. package/lib/configuration/attrUpdateMatrix.js +6 -1
  44. package/lib/context/BackendRuntimeContext.d.ts +1 -1
  45. package/lib/data/i18n.js +17 -3
  46. package/lib/entities/Order.d.ts +2 -2
  47. package/lib/locales/common/zh_CN.json +1 -0
  48. package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
  49. package/lib/oak-app-domain/Order/Schema.d.ts +3 -3
  50. package/lib/oak-app-domain/Order/Storage.js +1 -4
  51. package/lib/utils/application.d.ts +1 -1
  52. package/package.json +2 -2
  53. package/src/entities/Order.ts +1 -1
@@ -3,7 +3,7 @@ export declare function getWithdrawCreateData(params: {
3
3
  accountId: string;
4
4
  price: number;
5
5
  withdrawAccountId?: string;
6
- }, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
6
+ }, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
7
7
  id: string;
8
8
  } & {
9
9
  accountId: string;
@@ -17,7 +17,7 @@ export declare function getWithdrawCreateData(params: {
17
17
  modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
18
18
  operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
19
19
  accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
20
- }) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
20
+ }) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
21
21
  id: string;
22
22
  } & {
23
23
  accountId: string;
@@ -31,7 +31,7 @@ export declare function getWithdrawCreateData(params: {
31
31
  modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
32
32
  operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
33
33
  accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
34
- }) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
34
+ }) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
35
35
  id: string;
36
36
  } & {
37
37
  account?: undefined;
@@ -45,7 +45,7 @@ export declare function getWithdrawCreateData(params: {
45
45
  modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
46
46
  operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
47
47
  accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
48
- }) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
48
+ }) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
49
49
  id: string;
50
50
  } & {
51
51
  account?: undefined;
@@ -19,6 +19,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
19
19
  textColor: string;
20
20
  priceColor: string;
21
21
  bgColor: string;
22
+ onGoToHistory: () => void;
22
23
  }, {
23
24
  newDeposit: () => Promise<void>;
24
25
  setDepositOpen: (v: boolean) => void;
@@ -29,5 +30,4 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
29
30
  onDepositClick: () => void;
30
31
  onDepositModalClose: () => void;
31
32
  onUnfinishedDepositClick: () => void;
32
- onGoToHistory: () => void;
33
33
  }>): React.JSX.Element | null;
@@ -5,8 +5,8 @@ import classNames from 'classnames';
5
5
  import { CentToString } from 'oak-domain/lib/utils/money';
6
6
  import NewDeposit from '../../deposit/new';
7
7
  export default function Render(props) {
8
- const { account, depositMaxCent, newDepositPath, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositLoss, depositing, onWithdraw, textColor, priceColor, bgColor, } = props.data;
9
- const { t, newDeposit, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, onUnfinishedDepositClick, setDepositing, onDepositClick, onDepositModalClose, onGoToHistory, } = props.methods;
8
+ const { account, depositMaxCent, newDepositPath, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositLoss, depositing, onWithdraw, textColor, priceColor, bgColor, onGoToHistory } = props.data;
9
+ const { t, newDeposit, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, onUnfinishedDepositClick, setDepositing, onDepositClick, onDepositModalClose, } = props.methods;
10
10
  if (account) {
11
11
  const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
12
12
  return (<div className={Styles.container}>
@@ -16,6 +16,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
16
16
  depositMeta: any;
17
17
  depositing: boolean;
18
18
  newDepositPath: string;
19
+ onGoToHistory: () => void;
19
20
  }, {
20
21
  newDeposit: () => Promise<string>;
21
22
  setDepositOpen: (v: boolean) => void;
@@ -26,5 +27,4 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
26
27
  onDepositClick: () => void;
27
28
  onDepositModalClose: () => void;
28
29
  onUnfinishedDepositClick: () => void;
29
- onGoToHistory: () => void;
30
30
  }>): React.JSX.Element | null;
@@ -7,8 +7,8 @@ import NewDeposit from '../../deposit/new';
7
7
  import AccountOperList from '../../accountOper/pure/List.pc';
8
8
  import { AccountBookOutlined, ScheduleOutlined } from '@ant-design/icons';
9
9
  export default function Render(props) {
10
- const { account, depositMaxCent, newDepositPath, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositLoss, depositing, onWithdraw, } = props.data;
11
- const { t, newDeposit, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, onUnfinishedDepositClick, setDepositing, onDepositClick, onDepositModalClose, onGoToHistory, } = props.methods;
10
+ const { account, depositMaxCent, newDepositPath, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositLoss, depositing, onWithdraw, onGoToHistory, } = props.data;
11
+ const { t, newDeposit, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, onUnfinishedDepositClick, setDepositing, onDepositClick, onDepositModalClose, } = props.methods;
12
12
  if (account) {
13
13
  const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
14
14
  return (<>
@@ -6,22 +6,28 @@ export default OakComponent({
6
6
  projection: {
7
7
  id: 1,
8
8
  type: 1,
9
- totalPlus: 1,
9
+ avail: 1,
10
10
  availPlus: 1,
11
11
  $$createAt$$: 1,
12
12
  },
13
13
  properties: {
14
14
  accountId: '',
15
15
  },
16
+ data: {
17
+ month: new Date(),
18
+ monthStr: '',
19
+ type: 'both',
20
+ chooseMonth: false,
21
+ chooseType: false,
22
+ pickerStart: dayjs().subtract(10, 'y').startOf('m').format('YYYY-MM-DD'),
23
+ pickerEnd: dayjs().startOf('m').format('YYYY-MM-DD'),
24
+ },
16
25
  filters: [
17
26
  {
18
27
  filter() {
19
28
  const { accountId } = this.props;
20
29
  return {
21
30
  accountId,
22
- avail: {
23
- $ne: 0,
24
- },
25
31
  };
26
32
  }
27
33
  }
@@ -38,19 +44,125 @@ export default OakComponent({
38
44
  const sign = availPlus > 0 ? '+' : '-';
39
45
  const time = dayjs($$createAt$$).format('YYYY-MM-DD HH:mm');
40
46
  const symbol = this.t(`accountOper:v.type.${type}`)[0];
47
+ const bgColor = this.features.style.getColor('accountOper', 'type', type);
41
48
  return {
42
49
  value: `${sign}${plus}`,
43
50
  time,
44
- type,
51
+ type: this.t(`accountOper:v.type.${type}`),
45
52
  symbol,
46
- avail: ThousandCont(ToYuan(avail), 2)
53
+ avail: ThousandCont(ToYuan(avail), 2),
54
+ bgColor,
47
55
  };
48
56
  }),
49
57
  };
50
58
  },
59
+ lifetimes: {
60
+ ready() {
61
+ this.setTypeFilter();
62
+ }
63
+ },
51
64
  methods: {
52
65
  loadMoreMp() {
53
66
  return this.loadMore();
67
+ },
68
+ setType(type) {
69
+ this.setState({
70
+ type,
71
+ }, () => this.setTypeFilter());
72
+ },
73
+ setTypeFilter() {
74
+ const { type } = this.state;
75
+ switch (type) {
76
+ case 'in': {
77
+ this.addNamedFilter({
78
+ '#name': 'type',
79
+ filter: {
80
+ availPlus: {
81
+ $gt: 0,
82
+ },
83
+ }
84
+ }, true);
85
+ break;
86
+ }
87
+ case 'out': {
88
+ this.addNamedFilter({
89
+ '#name': 'type',
90
+ filter: {
91
+ availPlus: {
92
+ $lt: 0,
93
+ },
94
+ }
95
+ }, true);
96
+ break;
97
+ }
98
+ case 'both':
99
+ default: {
100
+ this.addNamedFilter({
101
+ '#name': 'type',
102
+ filter: {
103
+ availPlus: {
104
+ $ne: 0,
105
+ },
106
+ }
107
+ }, true);
108
+ break;
109
+ }
110
+ }
111
+ },
112
+ setMonth(month) {
113
+ if (month) {
114
+ const m = dayjs(month);
115
+ const begin = m.startOf('month').valueOf();
116
+ const end = m.endOf('month').valueOf();
117
+ this.setState({
118
+ monthStr: m.format('YYYY-MM'),
119
+ month,
120
+ }, () => this.addNamedFilter({
121
+ '#name': 'month',
122
+ filter: {
123
+ $$createAt$$: {
124
+ $between: [begin, end],
125
+ }
126
+ }
127
+ }, true));
128
+ }
129
+ else {
130
+ this.setState({
131
+ monthStr: '',
132
+ month: undefined,
133
+ }, () => this.removeNamedFilter({
134
+ '#name': 'month',
135
+ filter: {}
136
+ }, true));
137
+ }
138
+ },
139
+ setChooseMonth(chooseMonth) {
140
+ this.setState({ chooseMonth });
141
+ },
142
+ setChooseType(chooseType) {
143
+ this.setState({ chooseType });
144
+ },
145
+ setMonthMp(e) {
146
+ const { value } = e.detail;
147
+ const month = dayjs(value).valueOf();
148
+ this.setMonth(month);
149
+ },
150
+ openChooseTypeMp() {
151
+ this.setState({
152
+ chooseType: true,
153
+ });
154
+ },
155
+ closeChooseTypeMp() {
156
+ this.setState({
157
+ chooseType: false,
158
+ });
159
+ },
160
+ setTypeMp({ detail }) {
161
+ const { key, } = detail;
162
+ this.setState({
163
+ type: key,
164
+ }, () => this.setTypeFilter());
165
+ this.closeChooseTypeMp();
54
166
  }
55
167
  }
56
168
  });
@@ -1 +1,10 @@
1
- {}
1
+ {
2
+ "usingComponents": {
3
+ "l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
4
+ "l-popup": "@oak-frontend-base/miniprogram_npm/lin-ui/popup/index",
5
+ "l-list": "@oak-frontend-base/miniprogram_npm/lin-ui/list/index",
6
+ "l-radio-group": "@oak-frontend-base/miniprogram_npm/lin-ui/radio-group/index",
7
+ "l-radio": "@oak-frontend-base/miniprogram_npm/lin-ui/radio/index",
8
+ "oak-icon": "@oak-frontend-base/components/icon/index"
9
+ }
10
+ }
@@ -0,0 +1,125 @@
1
+ @import '../../../config/styles/mp/index.less';
2
+ @import '../../../config/styles/mp/mixins.less';
3
+
4
+ .myScroll {
5
+ height: 100%;
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
9
+
10
+ .header {
11
+ position: sticky;
12
+ top: 0rpx;
13
+ left: 0rpx;
14
+ width: 100%;
15
+ z-index: 10;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: space-between;
19
+ padding: 24rpx;
20
+ box-sizing: border-box;
21
+ background-color: @oak-bg-color-page;
22
+ color: @oak-text-color-primary;
23
+ }
24
+
25
+ .headerItem {
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ font-size: 28rpx;
30
+ }
31
+
32
+ .list {
33
+ flex: 1;
34
+ background-color: #fff;
35
+ }
36
+
37
+ .my-list-class {
38
+ border-bottom: 2rpx solid @oak-border-color;
39
+ }
40
+
41
+ .left {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: flex-start;
45
+ padding: 24rpx 0rpx;
46
+ }
47
+
48
+ .right {
49
+ display: flex;
50
+ flex-direction: column;
51
+ align-items: flex-end;
52
+ gap: 16rpx;
53
+ padding: 24rpx 0rpx;
54
+ margin-left: 12rpx;
55
+ }
56
+
57
+ .avatar {
58
+ font-size: 40rpx;
59
+ font-weight: bold;
60
+ width: 96rpx;
61
+ height: 96rpx;
62
+ border-radius: 48rpx;
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ color: @oak-text-color-primary;
67
+ }
68
+
69
+ .middle {
70
+ margin-left: 20rpx;
71
+ display: flex;
72
+ flex-direction: column;
73
+ align-items: flex-start;
74
+ justify-content: center;
75
+ gap: 16rpx;
76
+ }
77
+
78
+ .type {
79
+ font-weight: bold;
80
+ font-size: 32rpx;
81
+ }
82
+
83
+ .sub {
84
+ color: #888;
85
+ font-size: 26rpx;
86
+ }
87
+
88
+ .empty {
89
+ height: calc(100% - 90rpx);
90
+ background-color: #fff;
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ }
95
+
96
+ .content {
97
+ display: flex;
98
+ flex-direction: column;
99
+ align-items: center;
100
+ justify-content: space-between;
101
+ gap: 24rpx;
102
+ }
103
+
104
+ .icon {
105
+ color: @oak-color-primary;
106
+ }
107
+
108
+ .btn {
109
+ color: #333;
110
+ border: 2rpx solid #eee;
111
+ }
112
+
113
+ .container {
114
+ background-color: #fff;
115
+ height: 15vh;
116
+ padding: 32rpx;
117
+ box-sizing: border-box;
118
+ }
119
+
120
+ .radio-group-class {
121
+ width: 100%;
122
+ display: grid;
123
+ grid-column: 3;
124
+ grid-template-columns: 1fr 1fr 1fr;
125
+ }
@@ -0,0 +1,56 @@
1
+ <scroll-view scroll-y bindscrolltolower="loadMoreMp" class="myScroll" refresher-enabled="{{true}}"
2
+ bindrefresherrefresh="bindrefresherrefresh" refresher-triggered="{{refreshing}}">
3
+ <view class="header">
4
+ <picker mode="date" fields="month" value="{{monthStr}}" start="{{pickerStart}}" end="{{pickerEnd}}" bindchange="setMonthMp">
5
+ <view class="headerItem">
6
+ <span>{{monthStr || t('chooseMonth')}}</span>
7
+ <oak-icon name="unfold" size="20" color="#000"/>
8
+ </view>
9
+ </picker>
10
+ <view class="headerItem" bindtap="openChooseTypeMp">
11
+ <oak-icon name="search" size="20" color="#000" />
12
+ <span>{{t('type.'+type)}}</span>
13
+ </view>
14
+ </view>
15
+ <view wx:if="{{accountOpers && accountOpers.length>0}}" class="list">
16
+ <l-list wx:for="{{accountOpers}}" wx:key="id" gap="24" is-link="{{false}}" l-class="my-list-class">
17
+ <view slot="left-section" class="left">
18
+ <view class="avatar" style="background-color:{{item.bgColor}}">{{item.symbol}}</view>
19
+ <view class="middle">
20
+ <view class="type">{{item.type}}</view>
21
+ <view class="sub">{{item.time}}</view>
22
+ </view>
23
+ </view>
24
+ <view slot="right-section" class="right">
25
+ <view style="color:{{item.bgColor}}">{{item.value}}</view>
26
+ <view class="sub">{{t('account:attr.avail')}}:{{item.avail}}</view>
27
+ </view>
28
+ </l-list>
29
+ </view>
30
+ <view wx:else class="empty">
31
+ <view class="content">
32
+ <oak-icon name="refresh" size="48" class="icon"/>
33
+ <view>{{t('common::noData')}}</view>
34
+ <l-button
35
+ plain="true"
36
+ bind:lintap="navigateBack"
37
+ l-class="btn"
38
+ size="long"
39
+ width="160"
40
+ height="80"
41
+ >
42
+ {{t('common::back')}}
43
+ </l-button>
44
+ </view>
45
+ </view>
46
+ </scroll-view>
47
+ <l-popup show="{{chooseType}}" content-align="bottom" bind:lintap="closeChooseTypeMp" >
48
+ <view class="container">
49
+ <l-radio-group current="{{type}}" bind:linchange="setTypeMp" none-checked="{{false}}" placement="row" l-class="radio-group-class">
50
+ <l-radio key="both">{{t('type.both')}}</l-radio>
51
+ <l-radio key="in">{{t('type.in')}}</l-radio>
52
+ <l-radio key="out">{{t('type.out')}}</l-radio>
53
+ </l-radio-group>
54
+ </view>
55
+ </view>
56
+ </l-popup>
@@ -1 +1,9 @@
1
- {}
1
+ {
2
+ "history": "账户历史",
3
+ "chooseMonth": "选择月份",
4
+ "type": {
5
+ "both": "全部",
6
+ "in": "仅收入",
7
+ "out": "仅支出"
8
+ }
9
+ }
@@ -4,4 +4,52 @@
4
4
  min-height: 100%;
5
5
  flex-direction: column;
6
6
  align-items: stretch;
7
+
8
+ .control {
9
+ padding: 4px;
10
+ }
11
+
12
+ .item {
13
+ padding-bottom: 10px;
14
+
15
+ .symbol {
16
+ width: 50px;
17
+ height: 50px;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ border-radius: 25px;
22
+ margin: 10px;
23
+ font-size: large;
24
+ font-weight: bold;
25
+ }
26
+
27
+ .main {
28
+ margin-top: 5px;
29
+ width: 100%;
30
+ }
31
+
32
+ .sub {
33
+ width: 100%;
34
+
35
+ .type {
36
+ font-weight: bold;
37
+ }
38
+ }
39
+ }
40
+
41
+ }
42
+
43
+ .types {
44
+ padding: 20px;
45
+ width: 100%;
46
+ }
47
+
48
+ .empty {
49
+ display: flex;
50
+ width: 100%;
51
+ flex: 1;
52
+ background-color: white;
53
+ align-items: center;
54
+ justify-content: center;
7
55
  }
@@ -8,6 +8,17 @@ export default function Render(props: WebComponentProps<EntityDict, 'accountOper
8
8
  type: string;
9
9
  symbol: string;
10
10
  avail: string;
11
+ bgColor: string;
11
12
  }>;
12
13
  hasMore: boolean;
13
- }>): React.JSX.Element | null;
14
+ month?: Date;
15
+ monthStr: string;
16
+ type: 'in' | 'out' | 'both';
17
+ chooseMonth: boolean;
18
+ chooseType: boolean;
19
+ }, {
20
+ setMonth: (month?: number | Date) => void;
21
+ setType: (type: 'in' | 'out' | 'both') => void;
22
+ setChooseMonth: (cm: boolean) => void;
23
+ setChooseType: (ct: boolean) => void;
24
+ }>): React.JSX.Element;
@@ -1,29 +1,63 @@
1
1
  import React from 'react';
2
- import { List, InfiniteScroll, Space } from 'antd-mobile';
2
+ import { List, InfiniteScroll, Space, DatePicker, Button, Popup, Radio, Result } from 'antd-mobile';
3
+ import { DownOutline, SearchOutline, UndoOutline } from 'antd-mobile-icons';
3
4
  import Styles from './mobile.module.less';
4
5
  export default function Render(props) {
5
- const { accountOpers, hasMore } = props.data;
6
- const { t, loadMore } = props.methods;
7
- if (accountOpers?.length) {
8
- return (<div className={Styles.container}>
9
- <List>
10
- {accountOpers.map((oper, idx) => {
11
- const { value, time, type, symbol, avail } = oper;
12
- return (<List.Item key={idx} prefix={<div className={Styles.symbol}>
13
- {symbol}
14
- </div>} description={<Space direction="horizontal" justify="between">
15
- <span>{time}</span>
16
- <span>{t('accountOper:attr.avail')}:{avail}</span>
17
- </Space>}>
18
- <Space direction="horizontal" justify="between">
19
- <span>{type}</span>
20
- <span>{value}</span>
21
- </Space>
22
- </List.Item>);
6
+ const { accountOpers, hasMore, month, type, chooseMonth, chooseType, monthStr } = props.data;
7
+ const { t, loadMore, setType, setMonth, setChooseMonth, setChooseType, navigateBack } = props.methods;
8
+ return (<div className={Styles.container}>
9
+ <Space justify="between" className={Styles.control}>
10
+ <Button size="small" fill="none" onClick={() => setChooseMonth(true)}>
11
+ {monthStr || t('chooseMonth')}
12
+ <DownOutline />
13
+ </Button>
14
+ <Button size="small" fill="none" onClick={() => setChooseType(true)}>
15
+ <SearchOutline />
16
+ {t(`type.${type}`)}
17
+ </Button>
18
+ </Space>
19
+ <DatePicker visible={chooseMonth} value={month || null} onClose={() => setChooseMonth(false)} max={new Date()} precision="month" onConfirm={(value) => {
20
+ setMonth(value);
21
+ setChooseMonth(false);
22
+ }}/>
23
+ <Popup visible={chooseType} onMaskClick={() => setChooseType(false)} onClose={() => setChooseType(false)}>
24
+ <Radio.Group onChange={(type) => {
25
+ setType(type);
26
+ setChooseType(false);
27
+ }} value={type}>
28
+ <Space className={Styles.types} justify="around">
29
+ <Radio value="both">{t('type.both')}</Radio>
30
+ <Radio value="in">{t('type.in')}</Radio>
31
+ <Radio value="out">{t('type.out')}</Radio>
32
+ </Space>
33
+ </Radio.Group>
34
+ </Popup>
35
+ {accountOpers?.length ? <div style={{ flex: 1 }}>
36
+ <List>
37
+ {accountOpers.map((oper, idx) => {
38
+ const { value, time, type, symbol, avail, bgColor } = oper;
39
+ return (<List.Item className={Styles.item} key={idx} prefix={<div className={Styles.symbol} style={{
40
+ backgroundColor: bgColor,
41
+ }}>
42
+ {symbol}
43
+ </div>} description={<Space direction="horizontal" justify="between" className={Styles.main}>
44
+ <span>{time}</span>
45
+ <span>{t('account:attr.avail')}:{avail}</span>
46
+ </Space>}>
47
+ <Space direction="horizontal" justify="between" className={Styles.sub}>
48
+ <span className={Styles.type}>{type}</span>
49
+ <span style={{
50
+ color: bgColor,
51
+ }}>{value}</span>
52
+ </Space>
53
+ </List.Item>);
23
54
  })}
24
- </List>
25
- <InfiniteScroll hasMore={hasMore} loadMore={loadMore}/>
26
- </div>);
27
- }
28
- return null;
55
+ </List>
56
+ <InfiniteScroll hasMore={hasMore} loadMore={loadMore}/>
57
+ </div> : (<div className={Styles.empty}>
58
+ <Result icon={<UndoOutline />} status='success' title={t('common::noData')} description={<Button onClick={() => navigateBack()}>
59
+ {t('common::back')}
60
+ </Button>}/>
61
+ </div>)}
62
+ </div>);
29
63
  }
@@ -0,0 +1,27 @@
1
+
2
+ .control {
3
+ padding: 4px;
4
+ }
5
+
6
+ .value {
7
+ font-size: x-large;
8
+ font-weight: bold;
9
+ }
10
+
11
+ .list {
12
+ min-height: 620px;
13
+ }
14
+
15
+ .types {
16
+ padding: 20px;
17
+ width: 100%;
18
+ }
19
+
20
+ .empty {
21
+ display: flex;
22
+ width: 100%;
23
+ flex: 1;
24
+ background-color: white;
25
+ align-items: center;
26
+ justify-content: center;
27
+ }