SAP 电商云 Spartacus UI 的 Product Category Navigation UI 实现

简介: SAP 电商云 Spartacus UI 的 Product Category Navigation UI 实现

本文研究 SAP 电商云 Spartacus UI Product Category Navigation UI 的实现明细。



selector: cx-category-navigation


Component name:CategoryNavigationComponent


navigation node 的数据,从 service 里获取的:


根据 Componentdata 拿到 navigation node 的数据:




根据 Componentdata 拿到 navigation node 的数据:



navigation UI 下面是不同的 nav 子节点:



navigation UI 的 design 是数据驱动的:



nav 节点上有很多 click 事件注册:



在这里加上一行打印信息:




四次打印,两组。


/Brands/all/c/brands 包含在哪个 CMS response 里:


/Open-Catalogue/Cameras/Digital-Cameras/c/575



答案是这个 url:


https://spartacus:9002/occ/v2/electronics-spa/cms/components?fields=DEFAULT¤tPage=0&pageSize=26&componentIds=AllBrandsCategoryLink%2CCanonBrandCategoryLink%2CSonyBrandCategoryLink%2CKodakBrandCategoryLink%2CSamsungBrandCategoryLink%2CToshibaBrandCategoryLink%2CFujifilmBrandCategoryLink%2CKingstonBrandCategoryLink%2CIciduBrandCategoryLink%2CTDKBrandCategoryLink%2CSweexBrandCategoryLink%2CDigitalCamerasCategoryLink%2CDigitalCompactsCategoryLink%2CDigitalSLRCategoryLink%2CFilmCamerasCategoryLink%2CHandheldCamcordersCategoryLink%2CWebcamsCategoryLink%2CCameraAccessoriesCategoryLink%2CCamerasFlashesCategoryLink%2CTripodsCategoryLink%2CCameraLensesCategoryLink%2CFlashMemoryCategoryLink%2CPowerSuppliesCategoryLink%2CColourFilmsCategoryLink%2CBlackAndWhiteFilmsCategoryLink%2CBlankVideotapesCategoryLink&lang=en&curr=USD





取这些 ComponentID:


componentIds: AllBrandsCategoryLink,CanonBrandCategoryLink,SonyBrandCategoryLink,KodakBrandCategoryLink,SamsungBrandCategoryLink,ToshibaBrandCategoryLink,FujifilmBrandCategoryLink,KingstonBrandCategoryLink,IciduBrandCategoryLink,TDKBrandCategoryLink,SweexBrandCategoryLink,DigitalCamerasCategoryLink,DigitalCompactsCategoryLink,DigitalSLRCategoryLink,FilmCamerasCategoryLink,HandheldCamcordersCategoryLink,WebcamsCategoryLink,CameraAccessoriesCategoryLink,CamerasFlashesCategoryLink,TripodsCategoryLink,CameraLensesCategoryLink,FlashMemoryCategoryLink,PowerSuppliesCategoryLink,ColourFilmsCategoryLink,BlackAndWhiteFilmsCategoryLink,BlankVideotapesCategoryLink


Brand 下面又有两个子节点:camera 和 accessories:




Cameras 下面的 6 个子节点:



Accessories 下面的四个子节点:



在 Backoffice,Navigation Node 的名称:Electronics Site


类型:CMSNavigationNode




id:ElectronicsNavNode



有三个子 navigation node:




分配到一个 Link Component 上:



三个子节点的信息能够看见:




categories 的子节点:





以 sony link 为例:




他也是一个 navigation entry:




其 entry 在另一个模型里:



这个模型的类型就是 navigation node entry:



关联到一个 Sony Link Component 上:



这个 Component 有 url 和 category 属性:




它是一个 CMSLinkComponent:



这些 Component 的用途在 SAP 官网能够找到。


站点上的顶部导航菜单通过以下 CMS 组件的配置进行控制:


NavigationComponents - 这些组件代表导航栏的各个部分。 每个部分可以有一个 CMSLinkComponent 对象和一个 CMSNavigationNode 对象,被认为是根节点。


CMSNavigationNodes - 这些组件代表导航树的结构,并具有在下拉菜单中呈现的标题。 每个结构可以有许多 CMSLinkComponent 对象和许多子 CMSNavigationNodes 对象。


CMSLinkComponents - 这些组件在页面上呈现并显示在导航树中的每个点。


相关文章
|
25天前
|
人工智能 搜索推荐 Serverless
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
59 7
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
|
1月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
27 0
|
1月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
15 0
|
25天前
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
16 1
什么是 SAP ABAP 里的 Subscreen
|
25天前
|
网络架构 开发者 UED
Spartacus 2211 的 provideOutlet 方法扩展 UI
Spartacus 2211 的 provideOutlet 方法扩展 UI
10 0
Spartacus 2211 的 provideOutlet 方法扩展 UI
|
1月前
|
开发者 UED
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
15 0
|
1月前
|
安全 开发者
如何在 SAP ERP 系统调试 Product Initial Download
如何在 SAP ERP 系统调试 Product Initial Download
25 0
|
1月前
|
中间件
如何在 SAP CRM 系统调试 Product Initial Download
如何在 SAP CRM 系统调试 Product Initial Download
16 0
|
1月前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
15 0
|
1月前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
33 0

热门文章

最新文章