Merge branch 'dev' into release

This commit is contained in:
Xu Chang 2024-07-16 20:51:55 +08:00
commit 7e42b51419
55 changed files with 547 additions and 349 deletions

View File

@ -12,8 +12,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;
@ -26,8 +26,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;
@ -40,8 +40,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;
@ -54,8 +54,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;

View File

@ -18,7 +18,7 @@ declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<Enti
data: RowWithActions<EntityDict, T>[];
loading: boolean;
tablePagination?: React.ReactNode;
rowSelection?: import("antd/es/table/interface").TableRowSelection<RowWithActions<EntityDict, T>> | undefined;
rowSelection?: any;
hideHeader?: boolean | undefined;
disableSerialNumber?: boolean | undefined;
size?: "small" | "middle" | "large" | undefined;
@ -46,21 +46,16 @@ declare const ListPro: <T extends keyof EntityDict>(props: {
data: RowWithActions<EntityDict, T>[];
loading?: boolean | undefined;
tablePagination?: any;
rowSelection?: import("antd/es/table/interface").TableRowSelection<RowWithActions<EntityDict, T>> | undefined;
rowSelection?: any;
disableSerialNumber?: boolean | undefined;
size?: "small" | "middle" | "large" | undefined;
scroll?: ({
x?: string | number | true | undefined;
y?: string | number | undefined;
} & {
scrollToFirstRowOnChange?: boolean | undefined;
}) | undefined;
scroll?: any;
empty?: any;
opWidth?: number | undefined;
oakPath?: string | undefined;
}) => React.ReactElement;
declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
column?: number | Record<import("antd").Breakpoint, number> | undefined;
column?: number | Record<Breakpoint, number> | undefined;
entity: T;
attributes: OakAbsAttrDef[];
data: Partial<EntityDict[T]["Schema"]>;

View File

@ -1,7 +1,3 @@
/**
* 抽象组件在业务层根据EntityDict的重新声明
* by Xc 20230807
*/
import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
import AbsList from 'oak-frontend-base/es/components/list';
import AbsListPro from 'oak-frontend-base/es/components/listPro';

View File

@ -189,7 +189,7 @@ export default OakComponent({
onDepositModalClose() {
this.setDepositOpen(false);
this.setDepPrice(null);
this.setDepositChannel(undefined);
this.setDepositChannel(null);
},
onUfModalClose() {
this.setUfOpen(false);
@ -219,7 +219,7 @@ export default OakComponent({
depositOpen: false,
ufOpen: false,
depPrice: null,
depositChannel: undefined,
depositChannel: null,
depositLoss: [0, '', {}],
depositing: false,
setDepPriceMp(price) { this.setDepPrice(price); },

View File

@ -2,7 +2,6 @@
"usingComponents": {
"l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
"l-popup": "@oak-frontend-base/miniprogram_npm/lin-ui/popup/index",
"l-arc-popup": "@oak-frontend-base/miniprogram_npm/lin-ui/arc-popup/index",
"l-dialog": "@oak-frontend-base/miniprogram_npm/lin-ui/dialog/index",
"deposit-new": "../../deposit/new/index"
}

View File

@ -91,8 +91,8 @@
.ad-container {
padding: 24rpx;
background-color: white;
// .safe-area-inset-bottom();
height: 40vh;
.safe-area-inset-bottom();
// height: 40vh;
.btnBox {
position: fixed;

View File

@ -13,6 +13,7 @@ export default OakComponent({
},
data: {
onChooseChannelMp(channel) { this.onChooseChannel(channel); },
cursorSpacing: 100,
},
formData({ data, features }) {
const payChannels = features.pay.getPayChannels('deposit');
@ -38,9 +39,41 @@ export default OakComponent({
listeners: {
price() {
this.reRender();
if (process.env.OAK_PLATFORM === 'wechatMp') {
wx.createSelectorQuery().in(this).selectAll('#channel,#loss').boundingClientRect(rect => {
let height = 0;
if (rect instanceof Array) {
for (const r of rect) {
height += r.height;
}
}
if (height > 0) {
const cursorSpacing = height + 100;
this.setState({
cursorSpacing,
});
}
}).exec();
}
},
loss() {
this.reRender();
if (process.env.OAK_PLATFORM === 'wechatMp') {
wx.createSelectorQuery().in(this).selectAll('#channel,#loss').boundingClientRect(rect => {
let height = 0;
if (rect instanceof Array) {
for (const r of rect) {
height += r.height;
}
}
if (height > 0) {
const cursorSpacing = height + 100;
this.setState({
cursorSpacing,
});
}
}).exec();
}
}
},
methods: {

View File

@ -1,20 +1,10 @@
<block wx:if="{{payChannels && payChannels.length > 0}}">
<l-form>
<l-form-item label="{{t('deposit:attr.price')}}" label-placement="column">
<!-- <l-input
label="{{t('common::pay.symbol')}}"
label-width="{{70}}"
show-row="{{false}}"
value="{{priceStr || ''}}"
type="number"
placeholder="一次最大充值{{depositMax}}元"
bind:lininput="onDepPriceChangeMp"
focus="{{focus}}"
/> -->
<view style="display:flex;margin-top:8rpx;">
<span style="margin-right:8rpx;">{{t('common::pay.symbol')}}</span>
<view style="display:flex;margin:24rpx 0rpx 16rpx 0rpx;">
<span style="margin-right:8rpx;color:#000;">{{t('common::pay.symbol')}}</span>
<input
cursor-spacing="260"
cursor-spacing="{{cursorSpacing}}"
value="{{priceStr || ''}}"
type="digit"
placeholder="一次最大充值{{depositMax}}元"
@ -24,17 +14,17 @@
/>
</view>
</l-form-item>
<block wx:if="{{price > 0}}">
<l-form-item label="{{t('pay:attr.entity')}}" label-placement="column">
<view wx:if="{{price > 0}}" id="channel">
<l-form-item label="{{t('pay:attr.entity')}}" label-placement="column" >
<channel-picker
payChannels="{{payChannels}}"
payChannel="{{channel}}"
onPick="{{onChooseChannelMp}}"
/>
</l-form-item>
</block>
<block wx:if="{{lossStr}}">
<l-form-item label="{{t('deposit:attr.loss')}}" label-placement="column">
</view>
<view wx:if="{{lossStr}}" id="loss">
<l-form-item label="{{t('deposit:attr.loss')}}" label-placement="column" >
<l-input
hide-label
show-row="{{false}}"
@ -42,7 +32,7 @@
disabled="{{true}}"
/>
</l-form-item>
</block>
</view>
</l-form>
</block>
<block wx:else>

View File

@ -4,6 +4,9 @@ import { StartPayRoutine, JudgeCanPay } from "../../../types/Pay";
export declare function registerFrontendPayRoutine<ED extends EntityDict & BaseEntityDict>(entity: keyof ED, routine: StartPayRoutine, projection: ED['pay']['Selection']['data'], judgeCanPay: JudgeCanPay): void;
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "pay", false, {
onClose: () => void;
onPaid: () => void;
onPayFailure: () => void;
disableAutoPay: boolean;
closeWhenFailure: boolean;
}>) => React.ReactElement;
export default _default;

View File

@ -5,6 +5,7 @@ import { isWeiXin } from 'oak-frontend-base/es/utils/utils';
import { merge } from "oak-domain/lib/utils/lodash";
import { canStartPay } from "../../../utils/wpProductFrontend";
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
import { StartPayFailure } from "../../../types/Exception";
const PayRoutineDict = {
wpProduct: {
projection: {
@ -20,21 +21,22 @@ const PayRoutineDict = {
if (process.env.OAK_PLATFORM === 'wechatMp') {
const { prepayMeta } = meta;
if (prepayMeta) {
const result = await wx.requestPayment(prepayMeta);
process.env.NODE_ENV === 'development' && console.log(result);
try {
const result = await wx.requestPayment(prepayMeta);
process.env.NODE_ENV === 'development' && console.log(result);
}
catch (err) {
throw new StartPayFailure(err.errMsg.includes('cancel')
? features.locales.t('startPayError.userCancel')
: features.locales.t('startPayError.unknown'));
}
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.illegaPayData'),
});
throw new StartPayFailure(features.locales.t('startPayError.illegalPrepayData'));
}
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.falseEnv', { env: 'wechatMp' }),
});
throw new StartPayFailure(features.locales.t('startPayError.falseEnv', { env: 'wechatMp' }));
}
return;
}
@ -50,10 +52,7 @@ const PayRoutineDict = {
});
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.illegaPayData'),
});
throw new StartPayFailure(features.locales.t('startPayError.illegalPrepayData'));
}
}
}
@ -111,7 +110,10 @@ export default OakComponent({
},
properties: {
onClose: () => undefined,
onPaid: () => undefined,
onPayFailure: () => undefined,
disableAutoPay: false,
closeWhenFailure: false,
},
data: {
showCloseConfirmMp: false,
@ -202,32 +204,45 @@ export default OakComponent({
async confirmCloseMp() {
await this.execute('close');
this.cancelCloseMp();
const { onClose } = this.props;
onClose && onClose();
},
goBack() {
this.navigateBack();
},
async startPay() {
const { onPaid, onClose, onPayFailure } = this.props;
const { pay } = this.state;
await PayRoutineDict[pay.entity].routine(pay, this.features);
try {
await PayRoutineDict[pay.entity].routine(pay, this.features);
onPaid && onPaid();
}
catch (err) {
if (this.props.closeWhenFailure) {
await this.execute(undefined, undefined, undefined, [
{
entity: 'pay',
operation: {
id: await generateNewIdAsync(),
action: 'close',
data: {},
filter: {
id: this.props.oakId,
},
},
}
]);
onClose && onClose();
}
else {
onPayFailure && onPayFailure();
}
this.features.message.setMessage({
type: 'warning',
content: err.message,
});
}
},
/* async onWxBridgeReady(payMetaData: any): Promise<void> {
return new Promise(
(resolve, reject) => {
WeixinJSBridge.invoke('getBrandWCPayRequest', payMetaData,
function (res: { err_msg: string }) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
resolve(undefined as void);
}
else {
reject(res.err_msg);
}
}
);
}
);
} */
openChannelSelectMp() {
this.setState({
showChannelSelectMp: true,

View File

@ -196,4 +196,5 @@
display: grid;
grid-template-columns: 1fr 1fr;
gap: 32rpx;
flex: 1;
}

View File

@ -106,57 +106,62 @@
</block>
</view>
<view class="padding"></view>
<block wx:if="{{startPayable}}">
<l-button
size="long"
bind:lintap="startPay"
bg-color="#04BE02"
>
{{t('pay')}}
</l-button>
</block>
<block wx:elif="{{oakExecutable === true}}">
<view class="btn">
<view style="display:flex; align-items: center;justify-content: space-between;gap:16rpx;">
<block wx:if="{{closable && !oakExecutable}}">
<l-button
size="long"
bind:lintap="executeMp"
>
{{t('common::action.update')}}
</l-button>
type="error"
size="long"
bind:lintap="closeMp"
style="flex:1;"
>
{{t('pay:action.close')}}
</l-button>
<l-dialog
show="{{showCloseConfirmMp}}"
type="confirm"
title="{{t('cc.title')}}"
content="{{t('cc.content')}}"
bind:linconfirm="confirmCloseMp"
bind:lincancel="cancelCloseMp"
bind:lintap="cancelCloseMp"
/>
</block>
<block wx:if="{{startPayable}}">
<l-button
plain="true"
size="long"
bind:lintap="resetMp"
>
{{t('common::reset')}}
</l-button>
</view>
</block>
<block wx:elif="{{closable}}">
<l-button
type="error"
size="long"
bind:lintap="closeMp"
>
{{t('pay:action.close')}}
</l-button>
<l-dialog
show="{{showCloseConfirmMp}}"
type="confirm"
title="{{t('cc.title')}}"
content="{{t('cc.content')}}"
bind:linconfirm="confirmCloseMp"
bind:lincancel="cancelCloseMp"
bind:lintap="cancelCloseMp"
/>
</block>
<block wx:else>
<l-button
type="default"
size="long"
bind:lintap="goBack"
>
{{t('common::back')}}
</l-button>
</block>
size="long"
bind:lintap="startPay"
type="success"
style="flex:1;"
>
{{t('pay')}}
</l-button>
</block>
<block wx:elif="{{oakExecutable === true}}">
<view class="btn">
<l-button
plain="true"
size="long"
bind:lintap="resetMp"
>
{{t('common::reset')}}
</l-button>
<l-button
size="long"
bind:lintap="executeMp"
>
{{t('common::action.update')}}
</l-button>
</view>
</block>
<block wx:elif="{{!closable}}">
<l-button
type="default"
size="long"
bind:lintap="goBack"
style="flex:1;"
>
{{t('common::back')}}
</l-button>
</block>
</view>
</view>

View File

@ -16,7 +16,9 @@
"wechatPay": "微信支付",
"startPayError": {
"illegalPrepayData": "没有有效的预支付数据,可能后台是运行在开发环境,请检查",
"falseEnv": "该订单渠道【%{env}】不匹配当前环境"
"falseEnv": "该订单渠道【%{env}】不匹配当前环境",
"userCancel": "用户取消支付",
"unknown": "用户支付失败"
},
"type": {
"label": "支付类型",

View File

@ -152,7 +152,18 @@ export default function Render(props) {
const { t, update, execute, clean, goBack, startPay } = props.methods;
if (pay) {
const { iState, price, entity } = pay;
let BtnPart = startPayable ? (<Button block style={{ backgroundColor: '#04BE02' }} className={Styles.btnWechatPay} onClick={() => startPay()}>
let BtnPart = closable ? (<Button block color="danger" onClick={() => {
Modal.confirm({
title: t('cc.title'),
content: t('cc.content'),
onConfirm: async () => {
await execute('close');
onClose();
}
});
}}>
{t('pay:action.close')}
</Button>) : startPayable ? (<Button block style={{ backgroundColor: '#04BE02' }} className={Styles.btnWechatPay} onClick={() => startPay()}>
{t('pay')}
</Button>) : oakExecutable === true ? (<>
<div className={Styles.btnItem}>
@ -165,18 +176,7 @@ export default function Render(props) {
{t('common::reset')}
</Button>
</div>
</>) : closable ? (<Button block color="danger" onClick={() => {
Modal.confirm({
title: t('cc.title'),
content: t('cc.content'),
onConfirm: async () => {
await execute('close');
onClose();
}
});
}}>
{t('pay:action.close')}
</Button>) : (<Button block color="primary" onClick={goBack}>
</>) : (<Button block color="primary" onClick={goBack}>
{t('common::back')}
</Button>);
return (<div className={Styles.container}>

View File

@ -15,7 +15,7 @@ export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDic
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -197,7 +197,9 @@ const i18ns = [
"wechatPay": "微信支付",
"startPayError": {
"illegalPrepayData": "没有有效的预支付数据,可能后台是运行在开发环境,请检查",
"falseEnv": "该订单渠道【%{env}】不匹配当前环境"
"falseEnv": "该订单渠道【%{env}】不匹配当前环境",
"userCancel": "用户取消支付",
"unknown": "用户支付失败"
},
"type": {
"label": "支付类型",

View File

@ -10,7 +10,7 @@ import * as ArticleMenu from "../ArticleMenu/Schema";
import * as SessionMessage from "../SessionMessage/Schema";
import * as User from "../User/Schema";
export type OpSchema = EntityShape & {
origin: "qiniu" | "wechat" | "unknown" | "ctyun";
origin: "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "unknown";
type: "image" | "video" | "audio" | "file";
bucket?: String<32> | null;
objectId?: String<64> | null;
@ -33,7 +33,7 @@ export type OpSchema = EntityShape & {
};
export type OpAttr = keyof OpSchema;
export type Schema = EntityShape & {
origin: "qiniu" | "wechat" | "unknown" | "ctyun";
origin: "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "unknown";
type: "image" | "video" | "audio" | "file";
bucket?: String<32> | null;
objectId?: String<64> | null;
@ -66,7 +66,7 @@ type AttrFilter = {
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
origin: Q_EnumValue<"qiniu" | "wechat" | "unknown" | "ctyun">;
origin: Q_EnumValue<"qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "unknown">;
type: Q_EnumValue<"image" | "video" | "audio" | "file">;
bucket: Q_StringValue;
objectId: Q_StringValue;

View File

@ -4,7 +4,7 @@ export const desc = {
origin: {
notNull: true,
type: "enum",
enumeration: ["qiniu", "wechat", "unknown", "ctyun"]
enumeration: ["qiniu", "wechat", "ctyun", "aliyun", "tencent", "unknown"]
},
type: {
notNull: true,
@ -120,8 +120,8 @@ export const desc = {
},
{
name: '$$deleteAt$$',
}
]
},
],
}
]
};

View File

@ -1,9 +1,11 @@
export const style = {
color: {
origin: {
qiniu: '#0000FF',
wechat: '#008000',
ctyun: '#6495ED',
qiniu: '#37caff',
wechat: '#2aae67',
ctyun: '#ff0000',
aliyun: '#1677ff',
tencent: '#0052d9',
unknown: '#A9A9A9',
},
type: {
@ -16,6 +18,6 @@ export const style = {
success: '#008000',
failed: '#FF0000',
uploading: '#0000FF',
}
}
},
},
};

View File

@ -1 +1 @@
{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extra2": "非结构化额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadState": "上传状态", "uploadMeta": "上传需要的metadata", "application": "来源应用" }, "v": { "origin": { "qiniu": "七牛云", "ctyun": "天翼云", "wechat": "微信", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" }, "uploadState": { "success": "上传成功", "failed": "上传失败", "uploading": "上传中" } } }
{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extra2": "非结构化额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadState": "上传状态", "uploadMeta": "上传需要的metadata", "application": "来源应用" }, "v": { "origin": { "qiniu": "七牛云", "ctyun": "天翼云", "wechat": "微信", "aliyun": "阿里云", "tencent": "腾讯云", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" }, "uploadState": { "success": "上传成功", "failed": "上传失败", "uploading": "上传中" } } }

View File

@ -34,7 +34,8 @@ export const desc = {
: {
type: "object"
},
entity: {
entity // 如果为true则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio则全额退款)
: {
type: "varchar",
params: {
length: 32

View File

@ -16,4 +16,7 @@ export declare class ExternalPayUtilException<ED extends EntityDict> extends Oak
export declare class RefundExceedMax<ED extends EntityDict> extends OakException<ED> {
constructor(message?: string);
}
export declare class StartPayFailure<ED extends EntityDict> extends OakException<ED> {
constructor(message: string);
}
export declare function makeException<ED extends EntityDict>(msg: string | object): OakException<ED> | undefined;

View File

@ -19,6 +19,11 @@ export class RefundExceedMax extends OakException {
super(message || '可退款的总额不足');
}
}
export class StartPayFailure extends OakException {
constructor(message) {
super(message);
}
}
export function makeException(msg) {
const data = typeof msg === 'string' ? JSON.parse(msg) : msg;
let exception = makeDepedentException(data);

View File

@ -14,7 +14,7 @@ export declare const mergedProjection: {
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -20,6 +20,7 @@ const REFUND_STATE_MATRIX = {
"ABNORMAL": "refunding",
"PROCESSING": 'refunding',
};
const PREPAY_TIMEOUT = 15 * 60 * 1000; // 默认订单15分钟过期
export default class WechatPay extends WechatPayDebug {
wechatPay;
refundGapDays;
@ -169,6 +170,8 @@ export default class WechatPay extends WechatPayDebug {
throw new Error('本支付方法还没来的及实现呢');
}
}
// pay加一个过期时间到期自动close
data.timeoutAt = Date.now() + PREPAY_TIMEOUT;
}
async getState(pay) {
const outTradeNo = compressTo32(pay.id);

View File

@ -48,6 +48,23 @@ const watchers = [
actionData: {
refundable: false,
}
},
{
name: '当pay达到禁止退款期限时关闭退款允许',
entity: 'pay',
filter: () => {
const now = Date.now();
return {
iState: {
$in: ['unpaid', 'paying'],
},
timeoutAt: {
$lt: now,
},
};
},
action: 'close',
actionData: {},
}
];
export default watchers;

View File

@ -12,8 +12,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;
@ -26,8 +26,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;
@ -40,8 +40,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;
@ -54,8 +54,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
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;
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;
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;

View File

@ -4,6 +4,9 @@ import { StartPayRoutine, JudgeCanPay } from "../../../types/Pay";
export declare function registerFrontendPayRoutine<ED extends EntityDict & BaseEntityDict>(entity: keyof ED, routine: StartPayRoutine, projection: ED['pay']['Selection']['data'], judgeCanPay: JudgeCanPay): void;
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "pay", false, {
onClose: () => void;
onPaid: () => void;
onPayFailure: () => void;
disableAutoPay: boolean;
closeWhenFailure: boolean;
}>) => React.ReactElement;
export default _default;

View File

@ -9,6 +9,7 @@ const utils_1 = require("oak-frontend-base/es/utils/utils");
const lodash_1 = require("oak-domain/lib/utils/lodash");
const wpProductFrontend_1 = require("../../../utils/wpProductFrontend");
const uuid_1 = require("oak-domain/lib/utils/uuid");
const Exception_1 = require("../../../types/Exception");
const PayRoutineDict = {
wpProduct: {
projection: {
@ -24,21 +25,22 @@ const PayRoutineDict = {
if (process.env.OAK_PLATFORM === 'wechatMp') {
const { prepayMeta } = meta;
if (prepayMeta) {
const result = await wx.requestPayment(prepayMeta);
process.env.NODE_ENV === 'development' && console.log(result);
try {
const result = await wx.requestPayment(prepayMeta);
process.env.NODE_ENV === 'development' && console.log(result);
}
catch (err) {
throw new Exception_1.StartPayFailure(err.errMsg.includes('cancel')
? features.locales.t('startPayError.userCancel')
: features.locales.t('startPayError.unknown'));
}
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.illegaPayData'),
});
throw new Exception_1.StartPayFailure(features.locales.t('startPayError.illegalPrepayData'));
}
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.falseEnv', { env: 'wechatMp' }),
});
throw new Exception_1.StartPayFailure(features.locales.t('startPayError.falseEnv', { env: 'wechatMp' }));
}
return;
}
@ -54,10 +56,7 @@ const PayRoutineDict = {
});
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.illegaPayData'),
});
throw new Exception_1.StartPayFailure(features.locales.t('startPayError.illegalPrepayData'));
}
}
}
@ -116,7 +115,10 @@ exports.default = OakComponent({
},
properties: {
onClose: () => undefined,
onPaid: () => undefined,
onPayFailure: () => undefined,
disableAutoPay: false,
closeWhenFailure: false,
},
data: {
showCloseConfirmMp: false,
@ -207,32 +209,45 @@ exports.default = OakComponent({
async confirmCloseMp() {
await this.execute('close');
this.cancelCloseMp();
const { onClose } = this.props;
onClose && onClose();
},
goBack() {
this.navigateBack();
},
async startPay() {
const { onPaid, onClose, onPayFailure } = this.props;
const { pay } = this.state;
await PayRoutineDict[pay.entity].routine(pay, this.features);
try {
await PayRoutineDict[pay.entity].routine(pay, this.features);
onPaid && onPaid();
}
catch (err) {
if (this.props.closeWhenFailure) {
await this.execute(undefined, undefined, undefined, [
{
entity: 'pay',
operation: {
id: await (0, uuid_1.generateNewIdAsync)(),
action: 'close',
data: {},
filter: {
id: this.props.oakId,
},
},
}
]);
onClose && onClose();
}
else {
onPayFailure && onPayFailure();
}
this.features.message.setMessage({
type: 'warning',
content: err.message,
});
}
},
/* async onWxBridgeReady(payMetaData: any): Promise<void> {
return new Promise(
(resolve, reject) => {
WeixinJSBridge.invoke('getBrandWCPayRequest', payMetaData,
function (res: { err_msg: string }) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
resolve(undefined as void);
}
else {
reject(res.err_msg);
}
}
);
}
);
} */
openChannelSelectMp() {
this.setState({
showChannelSelectMp: true,

View File

@ -15,7 +15,7 @@ export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDic
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -199,7 +199,9 @@ const i18ns = [
"wechatPay": "微信支付",
"startPayError": {
"illegalPrepayData": "没有有效的预支付数据,可能后台是运行在开发环境,请检查",
"falseEnv": "该订单渠道【%{env}】不匹配当前环境"
"falseEnv": "该订单渠道【%{env}】不匹配当前环境",
"userCancel": "用户取消支付",
"unknown": "用户支付失败"
},
"type": {
"label": "支付类型",

View File

@ -10,7 +10,7 @@ import * as ArticleMenu from "../ArticleMenu/Schema";
import * as SessionMessage from "../SessionMessage/Schema";
import * as User from "../User/Schema";
export type OpSchema = EntityShape & {
origin: "qiniu" | "wechat" | "unknown" | "ctyun";
origin: "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "unknown";
type: "image" | "video" | "audio" | "file";
bucket?: String<32> | null;
objectId?: String<64> | null;
@ -33,7 +33,7 @@ export type OpSchema = EntityShape & {
};
export type OpAttr = keyof OpSchema;
export type Schema = EntityShape & {
origin: "qiniu" | "wechat" | "unknown" | "ctyun";
origin: "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "unknown";
type: "image" | "video" | "audio" | "file";
bucket?: String<32> | null;
objectId?: String<64> | null;
@ -66,7 +66,7 @@ type AttrFilter = {
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
origin: Q_EnumValue<"qiniu" | "wechat" | "unknown" | "ctyun">;
origin: Q_EnumValue<"qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "unknown">;
type: Q_EnumValue<"image" | "video" | "audio" | "file">;
bucket: Q_StringValue;
objectId: Q_StringValue;

View File

@ -7,7 +7,7 @@ exports.desc = {
origin: {
notNull: true,
type: "enum",
enumeration: ["qiniu", "wechat", "unknown", "ctyun"]
enumeration: ["qiniu", "wechat", "ctyun", "aliyun", "tencent", "unknown"]
},
type: {
notNull: true,
@ -123,8 +123,8 @@ exports.desc = {
},
{
name: '$$deleteAt$$',
}
]
},
],
}
]
};

View File

@ -4,9 +4,11 @@ exports.style = void 0;
exports.style = {
color: {
origin: {
qiniu: '#0000FF',
wechat: '#008000',
ctyun: '#6495ED',
qiniu: '#37caff',
wechat: '#2aae67',
ctyun: '#ff0000',
aliyun: '#1677ff',
tencent: '#0052d9',
unknown: '#A9A9A9',
},
type: {
@ -19,6 +21,6 @@ exports.style = {
success: '#008000',
failed: '#FF0000',
uploading: '#0000FF',
}
}
},
},
};

View File

@ -1 +1 @@
{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extra2": "非结构化额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadState": "上传状态", "uploadMeta": "上传需要的metadata", "application": "来源应用" }, "v": { "origin": { "qiniu": "七牛云", "ctyun": "天翼云", "wechat": "微信", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" }, "uploadState": { "success": "上传成功", "failed": "上传失败", "uploading": "上传中" } } }
{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extra2": "非结构化额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadState": "上传状态", "uploadMeta": "上传需要的metadata", "application": "来源应用" }, "v": { "origin": { "qiniu": "七牛云", "ctyun": "天翼云", "wechat": "微信", "aliyun": "阿里云", "tencent": "腾讯云", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" }, "uploadState": { "success": "上传成功", "failed": "上传失败", "uploading": "上传中" } } }

View File

@ -16,4 +16,7 @@ export declare class ExternalPayUtilException<ED extends EntityDict> extends Oak
export declare class RefundExceedMax<ED extends EntityDict> extends OakException<ED> {
constructor(message?: string);
}
export declare class StartPayFailure<ED extends EntityDict> extends OakException<ED> {
constructor(message: string);
}
export declare function makeException<ED extends EntityDict>(msg: string | object): OakException<ED> | undefined;

View File

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeException = exports.RefundExceedMax = exports.ExternalPayUtilException = void 0;
exports.makeException = exports.StartPayFailure = exports.RefundExceedMax = exports.ExternalPayUtilException = void 0;
const tslib_1 = require("tslib");
const types_1 = require("oak-domain/lib/types");
const DependentExceptions_1 = tslib_1.__importDefault(require("./DependentExceptions"));
@ -25,6 +25,12 @@ class RefundExceedMax extends types_1.OakException {
}
}
exports.RefundExceedMax = RefundExceedMax;
class StartPayFailure extends types_1.OakException {
constructor(message) {
super(message);
}
}
exports.StartPayFailure = StartPayFailure;
function makeException(msg) {
const data = typeof msg === 'string' ? JSON.parse(msg) : msg;
let exception = (0, DependentExceptions_1.default)(data);

View File

@ -14,7 +14,7 @@ export declare const mergedProjection: {
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -23,6 +23,7 @@ const REFUND_STATE_MATRIX = {
"ABNORMAL": "refunding",
"PROCESSING": 'refunding',
};
const PREPAY_TIMEOUT = 15 * 60 * 1000; // 默认订单15分钟过期
class WechatPay extends WechatPay_debug_1.default {
wechatPay;
refundGapDays;
@ -172,6 +173,8 @@ class WechatPay extends WechatPay_debug_1.default {
throw new Error('本支付方法还没来的及实现呢');
}
}
// pay加一个过期时间到期自动close
data.timeoutAt = Date.now() + PREPAY_TIMEOUT;
}
async getState(pay) {
const outTradeNo = (0, uuid_1.compressTo32)(pay.id);

View File

@ -50,6 +50,23 @@ const watchers = [
actionData: {
refundable: false,
}
},
{
name: '当pay达到禁止退款期限时关闭退款允许',
entity: 'pay',
filter: () => {
const now = Date.now();
return {
iState: {
$in: ['unpaid', 'paying'],
},
timeoutAt: {
$lt: now,
},
};
},
action: 'close',
actionData: {},
}
];
exports.default = watchers;

View File

@ -1,6 +1,6 @@
{
"name": "oak-pay-business",
"version": "2.2.9",
"version": "2.2.10",
"description": "",
"files": [
"lib/**/*",
@ -30,8 +30,8 @@
"classnames": "^2.3.1",
"dayjs": "^1.11.5",
"oak-domain": "~5.0.15",
"oak-frontend-base": "~5.2.10",
"oak-general-business": "~5.2.5",
"oak-frontend-base": "~5.2.11",
"oak-general-business": "~5.2.6",
"wechat-pay-nodejs": "^0.2.3"
},
"peerDependencies": {

View File

@ -2,7 +2,6 @@
* EntityDict的重新声明
* by Xc 20230807
*/
// @ts-nocheck
import React from 'react';
import { EntityDict } from '../oak-app-domain';

View File

@ -91,8 +91,8 @@
.ad-container {
padding: 24rpx;
background-color: white;
// .safe-area-inset-bottom();
height: 40vh;
.safe-area-inset-bottom();
// height: 40vh;
.btnBox {
position: fixed;

View File

@ -144,7 +144,7 @@ export default OakComponent({
setDepPrice(depPrice: null | number) {
this.setState({ depPrice }, () => this.setDepositLoss());
},
setDepositChannel(depositChannel: PayChannel | undefined) {
setDepositChannel(depositChannel: PayChannel | null) {
this.setState({ depositChannel }, () => this.setDepositLoss());
},
setDepositLoss() {
@ -193,7 +193,7 @@ export default OakComponent({
onDepositModalClose() {
this.setDepositOpen(false);
this.setDepPrice(null);
this.setDepositChannel(undefined);
this.setDepositChannel(null);
},
onUfModalClose() {
this.setUfOpen(false);
@ -223,11 +223,11 @@ export default OakComponent({
depositOpen: false,
ufOpen: false,
depPrice: null as null | number,
depositChannel: undefined as PayChannel | undefined,
depositChannel: null as PayChannel | null,
depositLoss: [0, '', {}] as [number, string, any],
depositing: false,
setDepPriceMp(price: number | null) { this.setDepPrice(price) },
setDepositChannelMp(depositChannel: PayChannel | undefined) { this.setDepositChannel(depositChannel) },
setDepositChannelMp(depositChannel: PayChannel | null) { this.setDepositChannel(depositChannel) },
focus: false,
},
lifetimes: {

View File

@ -16,6 +16,7 @@ export default OakComponent({
},
data: {
onChooseChannelMp(channel: PayChannel) { this.onChooseChannel(channel) },
cursorSpacing: 100,
},
formData({ data, features }) {
const payChannels = features.pay.getPayChannels('deposit');
@ -41,9 +42,41 @@ export default OakComponent({
listeners: {
price() {
this.reRender();
if (process.env.OAK_PLATFORM === 'wechatMp') {
wx.createSelectorQuery().in(this as any).selectAll('#channel,#loss').boundingClientRect(rect => {
let height = 0;
if (rect instanceof Array) {
for (const r of rect) {
height += r.height;
}
}
if (height > 0) {
const cursorSpacing = height + 100;
this.setState({
cursorSpacing,
})
}
}).exec();
}
},
loss() {
this.reRender();
if (process.env.OAK_PLATFORM === 'wechatMp') {
wx.createSelectorQuery().in(this as any).selectAll('#channel,#loss').boundingClientRect(rect => {
let height = 0;
if (rect instanceof Array) {
for (const r of rect) {
height += r.height;
}
}
if (height > 0) {
const cursorSpacing = height + 100;
this.setState({
cursorSpacing,
})
}
}).exec();
}
}
},
methods: {

View File

@ -1,20 +1,10 @@
<block wx:if="{{payChannels && payChannels.length > 0}}">
<l-form>
<l-form-item label="{{t('deposit:attr.price')}}" label-placement="column">
<!-- <l-input
label="{{t('common::pay.symbol')}}"
label-width="{{70}}"
show-row="{{false}}"
value="{{priceStr || ''}}"
type="number"
placeholder="一次最大充值{{depositMax}}元"
bind:lininput="onDepPriceChangeMp"
focus="{{focus}}"
/> -->
<view style="display:flex;margin-top:8rpx;">
<span style="margin-right:8rpx;">{{t('common::pay.symbol')}}</span>
<view style="display:flex;margin:24rpx 0rpx 16rpx 0rpx;">
<span style="margin-right:8rpx;color:#000;">{{t('common::pay.symbol')}}</span>
<input
cursor-spacing="260"
cursor-spacing="{{cursorSpacing}}"
value="{{priceStr || ''}}"
type="digit"
placeholder="一次最大充值{{depositMax}}元"
@ -24,17 +14,17 @@
/>
</view>
</l-form-item>
<block wx:if="{{price > 0}}">
<l-form-item label="{{t('pay:attr.entity')}}" label-placement="column">
<view wx:if="{{price > 0}}" id="channel">
<l-form-item label="{{t('pay:attr.entity')}}" label-placement="column" >
<channel-picker
payChannels="{{payChannels}}"
payChannel="{{channel}}"
onPick="{{onChooseChannelMp}}"
/>
</l-form-item>
</block>
<block wx:if="{{lossStr}}">
<l-form-item label="{{t('deposit:attr.loss')}}" label-placement="column">
</view>
<view wx:if="{{lossStr}}" id="loss">
<l-form-item label="{{t('deposit:attr.loss')}}" label-placement="column" >
<l-input
hide-label
show-row="{{false}}"
@ -42,7 +32,7 @@
disabled="{{true}}"
/>
</l-form-item>
</block>
</view>
</l-form>
</block>
<block wx:else>

View File

@ -196,4 +196,5 @@
display: grid;
grid-template-columns: 1fr 1fr;
gap: 32rpx;
flex: 1;
}

View File

@ -8,6 +8,7 @@ import { StartPayRoutine, JudgeCanPay } from "../../../types/Pay";
import { merge } from "oak-domain/lib/utils/lodash";
import { canStartPay } from "../../../utils/wpProductFrontend";
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
import { StartPayFailure } from "../../../types/Exception";
const PayRoutineDict: Record<string, {
routine: StartPayRoutine;
@ -28,21 +29,24 @@ const PayRoutineDict: Record<string, {
if (process.env.OAK_PLATFORM === 'wechatMp') {
const { prepayMeta } = meta as { prepayMeta: WechatMiniprogram.RequestPaymentOption };
if (prepayMeta) {
const result = await wx.requestPayment(prepayMeta);
process.env.NODE_ENV === 'development' && console.log(result);
try {
const result = await wx.requestPayment(prepayMeta);
process.env.NODE_ENV === 'development' && console.log(result);
}
catch (err: any) {
throw new StartPayFailure(
err.errMsg.includes('cancel')
? features.locales.t('startPayError.userCancel')
: features.locales.t('startPayError.unknown')
);
}
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.illegaPayData'),
});
throw new StartPayFailure(features.locales.t('startPayError.illegalPrepayData'));
}
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.falseEnv', { env: 'wechatMp' }),
});
throw new StartPayFailure(features.locales.t('startPayError.falseEnv', { env: 'wechatMp' }));
}
return;
}
@ -61,10 +65,7 @@ const PayRoutineDict: Record<string, {
);
}
else {
features.message.setMessage({
type: 'error',
content: features.locales.t('startPayError.illegaPayData'),
});
throw new StartPayFailure(features.locales.t('startPayError.illegalPrepayData'));
}
}
}
@ -129,7 +130,10 @@ export default OakComponent({
},
properties: {
onClose: () => undefined as void,
onPaid: () => undefined as void,
onPayFailure: () => undefined as void,
disableAutoPay: false,
closeWhenFailure: false,
},
data: {
showCloseConfirmMp: false,
@ -228,32 +232,45 @@ export default OakComponent({
async confirmCloseMp() {
await this.execute('close');
this.cancelCloseMp();
const { onClose } = this.props;
onClose && onClose();
},
goBack() {
this.navigateBack();
},
async startPay() {
const { onPaid, onClose, onPayFailure } = this.props;
const { pay } = this.state;
await PayRoutineDict[pay!.entity].routine(pay as EntityDict['pay']['Schema'], this.features);
try {
await PayRoutineDict[pay!.entity].routine(pay as EntityDict['pay']['Schema'], this.features);
onPaid && onPaid();
}
catch (err: any) {
if (this.props.closeWhenFailure) {
await this.execute(undefined, undefined, undefined, [
{
entity: 'pay',
operation: {
id: await generateNewIdAsync(),
action: 'close',
data: {},
filter: {
id: this.props.oakId!,
},
},
}
]);
onClose && onClose();
}
else {
onPayFailure && onPayFailure();
}
this.features.message.setMessage({
type: 'warning',
content: err.message,
});
}
},
/* async onWxBridgeReady(payMetaData: any): Promise<void> {
return new Promise(
(resolve, reject) => {
WeixinJSBridge.invoke('getBrandWCPayRequest', payMetaData,
function (res: { err_msg: string }) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
resolve(undefined as void);
}
else {
reject(res.err_msg);
}
}
);
}
);
} */
openChannelSelectMp() {
this.setState({
showChannelSelectMp: true,

View File

@ -106,57 +106,62 @@
</block>
</view>
<view class="padding"></view>
<block wx:if="{{startPayable}}">
<l-button
size="long"
bind:lintap="startPay"
bg-color="#04BE02"
>
{{t('pay')}}
</l-button>
</block>
<block wx:elif="{{oakExecutable === true}}">
<view class="btn">
<view style="display:flex; align-items: center;justify-content: space-between;gap:16rpx;">
<block wx:if="{{closable && !oakExecutable}}">
<l-button
size="long"
bind:lintap="executeMp"
>
{{t('common::action.update')}}
</l-button>
type="error"
size="long"
bind:lintap="closeMp"
style="flex:1;"
>
{{t('pay:action.close')}}
</l-button>
<l-dialog
show="{{showCloseConfirmMp}}"
type="confirm"
title="{{t('cc.title')}}"
content="{{t('cc.content')}}"
bind:linconfirm="confirmCloseMp"
bind:lincancel="cancelCloseMp"
bind:lintap="cancelCloseMp"
/>
</block>
<block wx:if="{{startPayable}}">
<l-button
plain="true"
size="long"
bind:lintap="resetMp"
>
{{t('common::reset')}}
</l-button>
</view>
</block>
<block wx:elif="{{closable}}">
<l-button
type="error"
size="long"
bind:lintap="closeMp"
>
{{t('pay:action.close')}}
</l-button>
<l-dialog
show="{{showCloseConfirmMp}}"
type="confirm"
title="{{t('cc.title')}}"
content="{{t('cc.content')}}"
bind:linconfirm="confirmCloseMp"
bind:lincancel="cancelCloseMp"
bind:lintap="cancelCloseMp"
/>
</block>
<block wx:else>
<l-button
type="default"
size="long"
bind:lintap="goBack"
>
{{t('common::back')}}
</l-button>
</block>
size="long"
bind:lintap="startPay"
type="success"
style="flex:1;"
>
{{t('pay')}}
</l-button>
</block>
<block wx:elif="{{oakExecutable === true}}">
<view class="btn">
<l-button
plain="true"
size="long"
bind:lintap="resetMp"
>
{{t('common::reset')}}
</l-button>
<l-button
size="long"
bind:lintap="executeMp"
>
{{t('common::action.update')}}
</l-button>
</view>
</block>
<block wx:elif="{{!closable}}">
<l-button
type="default"
size="long"
bind:lintap="goBack"
style="flex:1;"
>
{{t('common::back')}}
</l-button>
</block>
</view>
</view>

View File

@ -16,7 +16,9 @@
"wechatPay": "微信支付",
"startPayError": {
"illegalPrepayData": "没有有效的预支付数据,可能后台是运行在开发环境,请检查",
"falseEnv": "该订单渠道【%{env}】不匹配当前环境"
"falseEnv": "该订单渠道【%{env}】不匹配当前环境",
"userCancel": "用户取消支付",
"unknown": "用户支付失败"
},
"type": {
"label": "支付类型",

View File

@ -291,7 +291,24 @@ export default function Render(props: WebComponentProps<EntityDict, 'pay', false
if (pay) {
const { iState, price, entity } = pay;
let BtnPart = startPayable ? (
let BtnPart = closable ? (
<Button
block
color="danger"
onClick={() => {
Modal.confirm({
title: t('cc.title'),
content: t('cc.content'),
onConfirm: async () => {
await execute('close');
onClose();
}
});
}}
>
{t('pay:action.close')}
</Button>
) : startPayable ? (
<Button
block
style={{ backgroundColor: '#04BE02' }}
@ -320,23 +337,6 @@ export default function Render(props: WebComponentProps<EntityDict, 'pay', false
</Button>
</div>
</>
) : closable ? (
<Button
block
color="danger"
onClick={() => {
Modal.confirm({
title: t('cc.title'),
content: t('cc.content'),
onConfirm: async () => {
await execute('close');
onClose();
}
});
}}
>
{t('pay:action.close')}
</Button>
) : (
<Button
block

View File

@ -199,7 +199,9 @@ const i18ns: I18n[] = [
"wechatPay": "微信支付",
"startPayError": {
"illegalPrepayData": "没有有效的预支付数据,可能后台是运行在开发环境,请检查",
"falseEnv": "该订单渠道【%{env}】不匹配当前环境"
"falseEnv": "该订单渠道【%{env}】不匹配当前环境",
"userCancel": "用户取消支付",
"unknown": "用户支付失败"
},
"type": {
"label": "支付类型",

View File

@ -24,6 +24,12 @@ export class RefundExceedMax<ED extends EntityDict> extends OakException<ED> {
}
}
export class StartPayFailure<ED extends EntityDict> extends OakException<ED> {
constructor(message: string) {
super(message);
}
}
export function makeException<ED extends EntityDict>(msg: string | object) {
const data = typeof msg === 'string' ? JSON.parse(msg) : msg;

View File

@ -31,6 +31,7 @@ const REFUND_STATE_MATRIX: Record<string, EntityDict['refund']['OpSchema']['iSta
"PROCESSING": 'refunding',
};
const PREPAY_TIMEOUT = 15 * 60 * 1000; // 默认订单15分钟过期
export default class WechatPay extends WechatPayDebug implements PayClazz {
wechatPay: WechatPaySDK;
@ -194,6 +195,8 @@ export default class WechatPay extends WechatPayDebug implements PayClazz {
throw new Error('本支付方法还没来的及实现呢');
}
}
// pay加一个过期时间到期自动close
data.timeoutAt = Date.now() + PREPAY_TIMEOUT;
}
async getState(pay: OpPay): Promise<[EntityDict['pay']['OpSchema']['iState'], PayUpdateData]> {

View File

@ -57,6 +57,23 @@ const watchers: Watcher<EntityDict, 'pay', BRC>[] = [
actionData: {
refundable: false,
}
},
{
name: '当pay达到禁止退款期限时关闭退款允许',
entity: 'pay',
filter: () => {
const now = Date.now();
return {
iState: {
$in: ['unpaid', 'paying'],
},
timeoutAt: {
$lt: now,
},
};
},
action: 'close',
actionData: {},
}
];