Skip to content

Commit 202be86

Browse files
committed
perf: plan
1 parent 81899ab commit 202be86

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

packages/global/support/wallet/sub/type.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ export const TeamStandardSubPlanItemSchema = z.object({
3030
// Active
3131
annualBonusPoints: z.int().optional(), // 年度赠送积分
3232

33+
/** 企微设置 */
34+
wecom: z
35+
.object({
36+
price: z.number().optional().describe('企微价格'),
37+
points: z.number().optional().describe('企微积分')
38+
})
39+
.optional(),
40+
3341
// @deprecated
3442
pointPrice: z.number().optional()
3543
});

projects/app/src/pageComponents/price/Standard.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { postCreatePayBill } from '@/web/support/wallet/bill/api';
1212
import { getDiscountCouponList } from '@/web/support/wallet/sub/discountCoupon/api';
1313
import { BillTypeEnum } from '@fastgpt/global/support/wallet/bill/constants';
1414
import StandardPlanContentList from '@/components/support/wallet/StandardPlanContentList';
15-
import MyBox from '@fastgpt/web/components/common/MyBox';
1615
import {
1716
DiscountCouponStatusEnum,
1817
DiscountCouponTypeEnum
@@ -51,7 +50,6 @@ const Standard = ({
5150
// Check if it's a wecom team
5251
const isWecomTeam = !!userInfo?.team?.isWecomTeam;
5352

54-
// alert(`isWecomTeam: ${JSON.stringify(Object.keys(userInfo?.team))}`);
5553
const [packageChange, setPackageChange] = useState<PackageChangeStatusEnum>();
5654
const { subPlans, feConfigs } = useSystemStore();
5755
const [selectSubMode, setSelectSubMode] = useState<`${SubModeEnum}`>(
@@ -109,15 +107,19 @@ const Standard = ({
109107
...standardSubLevelMap[level as `${StandardSubLevelEnum}`],
110108
...(value.desc ? { desc: value.desc } : {}),
111109
...(value.name ? { label: value.name } : {}),
112-
price: value.price * (selectSubMode === SubModeEnum.month ? 1 : 10),
110+
price: isWecomTeam
111+
? value.wecom?.price ?? value.price
112+
: value.price * (selectSubMode === SubModeEnum.month ? 1 : 10),
113113
level: level as `${StandardSubLevelEnum}`,
114114
maxTeamMember: myStandardPlan?.maxTeamMember || value.maxTeamMember,
115115
maxAppAmount: myStandardPlan?.maxApp || value.maxAppAmount,
116116
maxDatasetAmount: myStandardPlan?.maxDataset || value.maxDatasetAmount,
117117
chatHistoryStoreDuration: value.chatHistoryStoreDuration,
118118
maxDatasetSize: value.maxDatasetSize,
119119
annualBonusPoints: selectSubMode === SubModeEnum.month ? 0 : value.annualBonusPoints,
120-
totalPoints: value.totalPoints * (selectSubMode === SubModeEnum.month ? 1 : 12),
120+
totalPoints: isWecomTeam
121+
? value.wecom?.points ?? value.totalPoints
122+
: value.totalPoints * (selectSubMode === SubModeEnum.month ? 1 : 12),
121123

122124
// custom plan
123125
priceDescription: value.priceDescription,
@@ -128,6 +130,7 @@ const Standard = ({
128130
: [];
129131
}, [
130132
subPlans?.standard,
133+
isWecomTeam,
131134
selectSubMode,
132135
myStandardPlan?.maxTeamMember,
133136
myStandardPlan?.maxApp,

0 commit comments

Comments
 (0)