SAP 电商云 Spartacus UI 的 checkout 设计

简介: SAP 电商云 Spartacus UI 的 checkout 设计

What is behavior before Jerry’s fix

The chapter below described the behavior BEFORE Jerry’s fix.

Scenario1

First step of checkout: shipping address page

url: http://localhost:4299/electronics-spa/en/USD/checkout/shipping-address


当我们直接访问这个页面时,delivery mode 提前从后台加载。


When we directly access this page, the delivery mode is being fetched from backend in advance.

See file checkout.effect.ts below:

f10e9fefa9a97ef289ff7f0f84ce4997.jpg

This means, in this case, if we press “Continue” page in Shipping Address step, there will be NO spinner displayed in Delivery Mode page, since the required delivery mode data is already pre-fetched and available.


此时点击 continue 按钮,大概率是不会有 spinner 显示的,因为 delivery mode 已经处于可用状态了。

6819dca8761fedaeeb05290f3283d497.jpg

Summary:

In this scenario ( when we first access shipping address page, and press continue to reach shipping method page, most probably we will NOT see spinner in shipping method page,


When we reached Shipping method page, there is a HTTP PUT request sent automatically, with preferred delivery mode preselected.

This request is sent by code below: delivery-mode.component.ts


在 shipping method 页面会自动触发一个 HTTP put 请求:


ed91f8f672578421ce62c094abf63d8c.jpg

What is preferred delivery mode?

It’s returned by CheckoutConfigService.getPreferredDeliveryMode:

Preferred delivery mode 也是通过一个方法调用返回的:

By the way, if we press back button in shipping method page, the shipping address page will be displayed again.

The ngOnInit hook will be executed, within this hook this.userAddressService.loadAddresses will be called, which triggers the address loading from backend again. Thus we could see a spinner in Shipping address page again.


如果我们点击 back,会重新回到 address 页面,重新触发 address 的加载逻辑(API 调用):

e2fb44e6fcc34090ffb11d2815152f89.jpg

Scenario2

通过 url 直接进入 delivery mode 页面:

We directly go to step2 – shipping method page via url:

http://localhost:4200/electronics-spa/en/USD/checkout/delivery-mode

In this case, since supported delivery mode has no chance to be pre-loaded by shipping address page, so it’s being loaded now. We could see spinner now.


现在就能看到 spinner 效果了。但是现在的实现里,spinner 并没有覆盖到 continue 和 back 按钮,这个问题需要修复。


However, the back and continue buttons are NOT covered by spinner, this is not good, as it’s not consistent with other steps. We have to fix it.

48ec97b136494d17c69a9dc20af3bbbf.jpg

The Continue button is disabled, since no delivery mode is selected.

Behavior after Jerry’s fix

Fix target:

修复目标

Scenario1: navigate from shipping address page to shipping method page

As described before, in this case the supported delivery mode is already pre-loaded by shipping address page, so we will NOT see spinner in shipping method page.

And since there’s HTTP put request sent automatically, before this request finished:


The radio input control is disabled

The continue button is disabled在 HTTP put 操作结束之前,input 和 continue 按钮必须处于 disabled 状态:

  Figure: the radio input and continue button are disabled when there’s ongoing HTTP put request

Scenario2: direct navigate to shipping method page via url

http://localhost:4200/electronics-spa/en/USD/checkout/delivery-mode

In this case, supported delivery mode are being loaded. We can see spinner, and the spinner already convers both radio input and two buttons(back & continue ).如果直接进入 delivery mode 页面,spinner 需要能覆盖掉 continue 和 back 按钮:

Summary

When we navigate from shipping address page to shipping method page, we will NOT see spinner in latter. The preferred delivery mode is automatically set in UI. There is one HTTP PUT request sent to backend automatically. Before the request finished, both radio input for delivery mode and continue button are disabled.

When we directly navigate to shipping method page, we will see spinner displayed when the request for supported delivery mode does not finish. During this time, the spinner convers both radio input and continue button & back button.

相关文章
|
2月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
|
2月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
|
2月前
|
前端开发 JavaScript API
SAP UI5 sap.ui.require.toUrl 的作用介绍
SAP UI5 sap.ui.require.toUrl 的作用介绍
|
2月前
|
监控 测试技术
SAP 电商云修改 Product Catalog Staged 版本数据后,同步到 online 版本的 UI 操作
SAP 电商云修改 Product Catalog Staged 版本数据后,同步到 online 版本的 UI 操作
|
2月前
|
存储 监控 数据库
SAP 电商云 product catalog 从 staged 到 online 两个版本之间的同步
SAP 电商云 product catalog 从 staged 到 online 两个版本之间的同步
|
2月前
|
监控 安全 数据管理
SAP 电商云 Product catalog 的 staged 和 online 两种版本的设计理念
SAP 电商云 Product catalog 的 staged 和 online 两种版本的设计理念
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
|
2月前
|
网络架构 开发者 UED
Spartacus 2211 的 provideOutlet 方法扩展 UI
Spartacus 2211 的 provideOutlet 方法扩展 UI
Spartacus 2211 的 provideOutlet 方法扩展 UI
|
2月前
|
开发者 UED
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
|
9月前
|
缓存 负载均衡 前端开发
SAP Spartacus 和 Sticky session 相关的话题
SAP Spartacus 和 Sticky session 相关的话题