-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1390 from longguikeji/feature-desktop-arkstore-api
Feature desktop arkstore api
- Loading branch information
Showing
8 changed files
with
288 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from arkid.core import routers, pages, actions | ||
from arkid.core.translation import gettext_default as _ | ||
|
||
tag = 'extension_buy' | ||
name = '插件购买' | ||
|
||
page = pages.StepPage(tag=tag, name=name) | ||
price_page = pages.CardsPage(name='选择价格') | ||
copies_page = pages.FormPage(name='人天份数') | ||
payment_page = pages.FormPage(name='支付') | ||
|
||
router = routers.FrontRouter( | ||
path=tag, | ||
name=name, | ||
page=page, | ||
icon='extension_buy', | ||
hidden=True | ||
) | ||
|
||
pages.register_front_pages(page) | ||
pages.register_front_pages(price_page) | ||
pages.register_front_pages(copies_page) | ||
pages.register_front_pages(payment_page) | ||
|
||
page.add_pages([ | ||
price_page, | ||
copies_page, | ||
payment_page | ||
]) | ||
|
||
price_page.create_actions( | ||
init_action=actions.DirectAction( | ||
path='/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/', | ||
method=actions.FrontActionMethod.GET | ||
), | ||
local_actions={ | ||
'next': actions.NextAction( | ||
name="选择价格" | ||
), | ||
} | ||
) | ||
|
||
copies_page.create_actions( | ||
init_action=actions.DirectAction( | ||
path="/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/set_copies/", | ||
method=actions.FrontActionMethod.POST | ||
), | ||
global_actions={ | ||
'next': actions.NextAction( | ||
name="创建订单", | ||
path="/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/", | ||
method=actions.FrontActionMethod.POST | ||
), | ||
} | ||
) | ||
|
||
payment_page.create_actions( | ||
init_action=actions.DirectAction( | ||
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment/", | ||
method=actions.FrontActionMethod.GET | ||
), | ||
global_actions={ | ||
'next': actions.NextAction( | ||
name="已支付", | ||
path="/api/v1/tenant/{tenant_id}/arkstore/purchase/order/{order_no}/payment_status/extensions/{uuid}/", | ||
method=actions.FrontActionMethod.GET | ||
), | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from arkid.core import routers, pages, actions | ||
from arkid.core.translation import gettext_default as _ | ||
|
||
tag = 'extension_rent' | ||
name = '插件租赁' | ||
|
||
page = pages.StepPage(tag=tag, name=name) | ||
price_page = pages.CardsPage(name='选择价格') | ||
copies_page = pages.FormPage(name='人天份数') | ||
payment_page = pages.FormPage(name='支付') | ||
|
||
router = routers.FrontRouter( | ||
path=tag, | ||
name=name, | ||
page=page, | ||
icon='extension_rent', | ||
hidden=True | ||
) | ||
|
||
pages.register_front_pages(page) | ||
pages.register_front_pages(price_page) | ||
pages.register_front_pages(copies_page) | ||
pages.register_front_pages(payment_page) | ||
|
||
page.add_pages([ | ||
price_page, | ||
copies_page, | ||
payment_page | ||
]) | ||
|
||
price_page.create_actions( | ||
init_action=actions.DirectAction( | ||
path='/api/v1/tenant/{tenant_id}/arkstore/rent/extensions/{package}/', | ||
method=actions.FrontActionMethod.GET | ||
), | ||
local_actions={ | ||
'next': actions.NextAction( | ||
name="选择价格" | ||
), | ||
} | ||
) | ||
|
||
copies_page.create_actions( | ||
init_action=actions.DirectAction( | ||
path="/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/set_copies/", | ||
method=actions.FrontActionMethod.POST | ||
), | ||
global_actions={ | ||
'next': actions.NextAction( | ||
name="创建订单", | ||
path="/api/v1/tenant/{tenant_id}/arkstore/rent/extensions/{package}/", | ||
method=actions.FrontActionMethod.POST | ||
), | ||
} | ||
) | ||
|
||
payment_page.create_actions( | ||
init_action=actions.DirectAction( | ||
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment/", | ||
method=actions.FrontActionMethod.GET | ||
), | ||
global_actions={ | ||
'next': actions.NextAction( | ||
name="已支付", | ||
path="/api/v1/tenant/{tenant_id}/arkstore/rent/order/{order_no}/payment_status/extensions/{package}/", | ||
method=actions.FrontActionMethod.GET | ||
), | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.