oak-pay-business 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/aspects/withdraw.d.ts +4 -4
- package/es/checkers/order.js +39 -0
- package/es/components/account/detail/web.d.ts +1 -1
- package/es/components/account/detail/web.js +2 -2
- package/es/components/account/detail/web.pc.d.ts +1 -1
- package/es/components/account/detail/web.pc.js +2 -2
- package/es/components/account/detail/web.pc.module.less +68 -68
- package/es/components/accountOper/list/index.js +118 -6
- package/es/components/accountOper/list/index.json +10 -1
- package/es/components/accountOper/list/index.less +125 -0
- package/es/components/accountOper/list/index.xml +56 -0
- package/es/components/accountOper/list/locales/zh-CN.json +9 -1
- package/es/components/accountOper/list/mobile.module.less +48 -0
- package/es/components/accountOper/list/web.d.ts +12 -1
- package/es/components/accountOper/list/web.js +58 -24
- package/es/components/accountOper/list/web.module.less +27 -0
- package/es/components/accountOper/list/web.pc.d.ts +14 -2
- package/es/components/accountOper/list/web.pc.js +43 -8
- package/es/components/order/pay/index.js +1 -1
- package/es/components/order/pay/info.js +6 -6
- package/es/components/order/pay/info.module.less +24 -24
- package/es/components/order/pay/web.mobile.module.less +35 -35
- package/es/components/order/pay/web.pc.module.less +35 -35
- package/es/components/pay/detail/index.js +11 -0
- package/es/components/pay/detail/index.xml +10 -0
- package/es/components/pay/detail/locales/zh-CN.json +5 -1
- package/es/components/pay/detail/web.d.ts +1 -0
- package/es/components/pay/detail/web.js +12 -5
- package/es/components/pay/detail/web.pc.d.ts +1 -0
- package/es/components/pay/detail/web.pc.js +15 -5
- package/es/components/pay/list/web.pc.js +2 -0
- package/es/components/payConfig/upsert/offline/web.pc.module.less +4 -4
- package/es/components/payConfig/upsert/web.pc.module.less +10 -10
- package/es/components/withdraw/create/index.d.ts +1 -0
- package/es/components/withdraw/create/index.js +4 -0
- package/es/components/withdraw/create/index.xml +4 -0
- package/es/components/withdraw/create/locales/zh-CN.json +2 -1
- package/es/components/withdraw/create/web.d.ts +1 -0
- package/es/components/withdraw/create/web.js +6 -2
- package/es/components/withdraw/create/web.pc.d.ts +1 -0
- package/es/components/withdraw/create/web.pc.js +4 -1
- package/es/components/withdraw/display/web.pc.module.less +4 -2
- package/es/components/withdrawAccount/list/index.less +8 -0
- package/es/components/withdrawAccount/list/index.xml +6 -1
- package/es/configuration/attrUpdateMatrix.js +6 -1
- package/es/context/BackendRuntimeContext.d.ts +1 -1
- package/es/data/i18n.js +21 -3
- package/es/entities/Order.d.ts +4 -3
- package/es/entities/Order.js +1 -0
- package/es/locales/common/zh_CN.json +1 -0
- package/es/locales/error/zh-CN.json +4 -0
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Order/Schema.d.ts +11 -5
- package/es/oak-app-domain/Order/Storage.js +4 -5
- package/es/oak-app-domain/Order/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/System/Storage.js +1 -2
- package/es/utils/application.d.ts +1 -1
- package/es/utils/wpProductFrontend.js +1 -1
- package/lib/aspects/withdraw.d.ts +4 -4
- package/lib/checkers/order.js +39 -0
- package/lib/components/pay/detail/index.js +11 -0
- package/lib/configuration/attrUpdateMatrix.js +6 -1
- package/lib/context/BackendRuntimeContext.d.ts +1 -1
- package/lib/data/i18n.js +21 -3
- package/lib/entities/Order.d.ts +4 -3
- package/lib/entities/Order.js +1 -0
- package/lib/locales/common/zh_CN.json +1 -0
- package/lib/locales/error/zh-CN.json +4 -0
- package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Order/Schema.d.ts +11 -5
- package/lib/oak-app-domain/Order/Storage.js +4 -5
- package/lib/oak-app-domain/Order/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/System/Storage.js +1 -2
- package/lib/utils/application.d.ts +1 -1
- package/lib/utils/wpProductFrontend.js +1 -1
- package/package.json +171 -200
- package/src/entities/Order.ts +4 -2
package/es/aspects/withdraw.d.ts
CHANGED
|
@@ -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, "
|
|
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, "
|
|
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, "
|
|
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, "
|
|
48
|
+
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
|
49
49
|
id: string;
|
|
50
50
|
} & {
|
|
51
51
|
account?: undefined;
|
package/es/checkers/order.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import assert from 'assert';
|
|
2
2
|
import { pipeline } from 'oak-domain/lib/utils/executor';
|
|
3
|
+
import { OakInputIllegalException } from 'oak-domain/lib/types';
|
|
3
4
|
const checkers = [
|
|
4
5
|
{
|
|
5
6
|
type: 'logical',
|
|
@@ -20,6 +21,44 @@ const checkers = [
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
},
|
|
24
|
+
{
|
|
25
|
+
type: 'logicalData',
|
|
26
|
+
entity: 'order',
|
|
27
|
+
action: 'startPaying',
|
|
28
|
+
checker: (operation, context) => {
|
|
29
|
+
const { data, filter } = operation;
|
|
30
|
+
assert(typeof filter.id === 'string');
|
|
31
|
+
return pipeline(() => context.select('order', {
|
|
32
|
+
data: {
|
|
33
|
+
id: 1,
|
|
34
|
+
price: 1,
|
|
35
|
+
paid: 1,
|
|
36
|
+
refunded: 1,
|
|
37
|
+
iState: 1,
|
|
38
|
+
},
|
|
39
|
+
filter: {
|
|
40
|
+
id: filter.id,
|
|
41
|
+
},
|
|
42
|
+
}, {}), (orders) => {
|
|
43
|
+
const [order] = orders;
|
|
44
|
+
const { price, paid, iState, allowPartialPay } = order;
|
|
45
|
+
assert(['unpaid', 'partiallyRefunded'].includes(iState) && paid === 0);
|
|
46
|
+
const { pay$order: pays } = data;
|
|
47
|
+
if (!(pays instanceof Array) || !pays.length) {
|
|
48
|
+
throw new OakInputIllegalException('order', ['pay$order'], 'error::order.nonePay');
|
|
49
|
+
}
|
|
50
|
+
let amount = 0;
|
|
51
|
+
pays.forEach(({ action, data }) => {
|
|
52
|
+
assert(action === 'create');
|
|
53
|
+
const { price } = data;
|
|
54
|
+
amount += price;
|
|
55
|
+
});
|
|
56
|
+
if (!allowPartialPay && amount !== price) {
|
|
57
|
+
throw new OakInputIllegalException('order', ['pay$order'], 'error::order.payAmountNotEnough');
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
},
|
|
23
62
|
{
|
|
24
63
|
// 订单结算,将收入分帐到相关的Account中
|
|
25
64
|
type: 'logicalData',
|
|
@@ -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,
|
|
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,
|
|
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 (<>
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
.card {
|
|
2
|
-
width: 100%;
|
|
3
|
-
|
|
4
|
-
.content {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: stretch;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.oper {
|
|
11
|
-
align-self: center;
|
|
12
|
-
width: 70%;
|
|
13
|
-
margin-bottom: 28px;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
align-items: stretch;
|
|
17
|
-
|
|
18
|
-
.title {
|
|
19
|
-
margin-bottom: 28px;
|
|
20
|
-
align-self: flex-start;
|
|
21
|
-
color: var(--oak-color-primary3);
|
|
22
|
-
font-size: var(--oak-font-size-title-medium);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.grid {
|
|
29
|
-
min-width: 133px;
|
|
30
|
-
border-radius: 6px;
|
|
31
|
-
padding: 16px;
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
margin: 13px;
|
|
35
|
-
|
|
36
|
-
.label {
|
|
37
|
-
font-size: 16px;
|
|
38
|
-
font-weight: 400;
|
|
39
|
-
color: var(--oak-color-primary);
|
|
40
|
-
margin-bottom: 12px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.value {
|
|
44
|
-
font-size: 24px;
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
color: var(--oak-color-primary);
|
|
47
|
-
line-height: 33.6px;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.fortify {
|
|
52
|
-
background-color: var(--oak-color-primary-light);
|
|
53
|
-
|
|
54
|
-
.label {
|
|
55
|
-
font-weight: 900;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.value {
|
|
59
|
-
font-weight: bolder;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.uf {
|
|
64
|
-
margin: 12px;
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
align-items: center;
|
|
68
|
-
padding: 12px;
|
|
1
|
+
.card {
|
|
2
|
+
width: 100%;
|
|
3
|
+
|
|
4
|
+
.content {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
.oper {
|
|
11
|
+
align-self: center;
|
|
12
|
+
width: 70%;
|
|
13
|
+
margin-bottom: 28px;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: stretch;
|
|
17
|
+
|
|
18
|
+
.title {
|
|
19
|
+
margin-bottom: 28px;
|
|
20
|
+
align-self: flex-start;
|
|
21
|
+
color: var(--oak-color-primary3);
|
|
22
|
+
font-size: var(--oak-font-size-title-medium);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.grid {
|
|
29
|
+
min-width: 133px;
|
|
30
|
+
border-radius: 6px;
|
|
31
|
+
padding: 16px;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
margin: 13px;
|
|
35
|
+
|
|
36
|
+
.label {
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
color: var(--oak-color-primary);
|
|
40
|
+
margin-bottom: 12px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.value {
|
|
44
|
+
font-size: 24px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
color: var(--oak-color-primary);
|
|
47
|
+
line-height: 33.6px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.fortify {
|
|
52
|
+
background-color: var(--oak-color-primary-light);
|
|
53
|
+
|
|
54
|
+
.label {
|
|
55
|
+
font-weight: 900;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.value {
|
|
59
|
+
font-weight: bolder;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.uf {
|
|
64
|
+
margin: 12px;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: 12px;
|
|
69
69
|
}
|
|
@@ -6,22 +6,28 @@ export default OakComponent({
|
|
|
6
6
|
projection: {
|
|
7
7
|
id: 1,
|
|
8
8
|
type: 1,
|
|
9
|
-
|
|
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>
|