feat: support Pricings flow (#2250)

* feat: fix price display

* feat: support subscription

* feat: fix select-plan-> signup -> buy-plan -> login flow

* feat: support paid-user to login and jump to the pricing page

* feat: support more subscription state

* feat: add payment providers for plan

* feat: format code

* feat: gofumpt

* feat: redirect to buy-plan-result page when user have pending subscription

* feat: response err when pricing don't exit

* Update PricingListPage.js

* Update ProductBuyPage.js

* Update LoginPage.js

---------

Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
haiwu
2023-08-24 23:20:50 +08:00
committed by GitHub
parent 8073dfa88c
commit 05b2f00057
31 changed files with 759 additions and 295 deletions

View File

@ -190,7 +190,7 @@ class PricingEditPage extends React.Component {
onChange={(value => {
this.updatePricingField("plans", value);
})}
options={this.state.plans.map((plan) => Setting.getOption(`${plan.owner}/${plan.name}`, `${plan.owner}/${plan.name}`))}
options={this.state.plans.map((plan) => Setting.getOption(plan.name, plan.name))}
/>
</Col>
</Row>
@ -294,7 +294,7 @@ class PricingEditPage extends React.Component {
</Button>
</Col>
<Col>
<PricingPage pricing={this.state.pricing}></PricingPage>
<PricingPage pricing={this.state.pricing} owner={this.state.pricing.owner}></PricingPage>
</Col>
</React.Fragment>
);