当前位置: 首页 > wzjs >正文

百度 手机网站 友好性求个网站谢谢

百度 手机网站 友好性,求个网站谢谢,佛山电子商务网站设计,杭州网站设计费用上一章讲了Fiori开发中的 Responsiveness(响应式设计)。 SAP学习笔记 - 开发30 - 前端Fiori开发 Responsiveness(响应式设计)-CSDN博客 本章继续学习Fiori 开发中的知识。 目录 1,Device Adaptation(设备…

上一章讲了Fiori开发中的 Responsiveness(响应式设计)。

SAP学习笔记 - 开发30 - 前端Fiori开发 Responsiveness(响应式设计)-CSDN博客

本章继续学习Fiori 开发中的知识。

目录

1,Device Adaptation(设备自适应)

1),HelloPanel.view.xml

2),Component.js

3),运行看效果

4),Detail.view.xml

5),Detail.controller.js 

6),运行看效果


下面是详细内容。

1,Device Adaptation(设备自适应)

SAPUI5 SDK - Demo Kit

先来看一下具体改了什么文件,达到了什么效果。 

简单来说就是实现折叠一部分组件,以节约空间。

1),HelloPanel.view.xml

<mvc:ViewcontrollerName="ui5.walkthrough.controller.HelloPanel"xmlns="sap.m"xmlns:mvc="sap.ui.core.mvc"><PanelheaderText="{i18n>helloPanelTitle}"class="sapUiResponsiveMargin"width="auto"expandable="{device>/system/phone}"expanded="{= !${device>/system/phone} }"><content><Buttonid="helloDialogButton"icon="sap-icon://world"text="{i18n>openDialogButtonText}"press=".onOpenDialog"class="sapUiSmallMarginEnd sapUiVisibleOnlyOnDesktop"/><Buttontext="{i18n>showHelloButtonText}"press=".onShowHello"class="myCustomButton"/><Inputvalue="{/recipient/name}"valueLiveUpdate="true"width="60%"/><FormattedTexthtmlText="Hello {/recipient/name}"class="sapUiSmallMargin sapThemeHighlight-asColor myCustomText"/></content></Panel>
</mvc:View>

在Panel 组件里面,用下面属性来启动自适应:

- expandable="{device>/system/phone}" =》在设备为 phone 的时候,会启用折叠
- expanded="{= !${device>/system/phone} }"> =》该状态指明该部分是否已经处于折叠状态

- sapUiVisibleOnlyOnDesktop =》该CSS 样式用于只显示于Desktop 模式下

2),Component.js

sap.ui.define(["sap/ui/core/UIComponent","sap/ui/model/json/JSONModel","sap/ui/Device"
], (UIComponent, JSONModel, Device) => {"use strict";return UIComponent.extend("ui5.walkthrough.Component", {metadata: {interfaces: ["sap.ui.core.IAsyncContentCreation"],manifest: "json"},init() {// call the init function of the parentUIComponent.prototype.init.apply(this, arguments);// set data modelconst oData = {recipient: {name: "World"}};const oModel = new JSONModel(oData);this.setModel(oModel);// set device modelconst oDeviceModel = new JSONModel(Device);oDeviceModel.setDefaultBindingMode("OneWay");this.setModel(oDeviceModel, "device");// create the views based on the url/hashthis.getRouter().initialize();}});
});

- 指定Device Model为单向模式(默认是双向绑定) 

const oDeviceModel = new JSONModel(Device);
oDeviceModel.setDefaultBindingMode("OneWay");
this.setModel(oDeviceModel, "device");

3),运行看效果

其实就是指定一部分对象作为折叠对象,然后引入Device模块,之后SAP Fiori就全帮你干了。

好像没啥变化哈~

因为这是Desktop 中显示,咱们给调成 phone 模式显示

按 F12,然后调成 phone 模式

这样就会显示折叠

点一下可以展开折叠或再次折叠 

上面在列表上搞了个折叠,当是phone模式的时候,会自适应为折叠。

下面看看在明细画面也做下优化。

4),Detail.view.xml

<mvc:ViewcontrollerName="ui5.walkthrough.controller.Detail"xmlns="sap.m"xmlns:core="sap.ui.core"xmlns:mvc="sap.ui.core.mvc"xmlns:wt="ui5.walkthrough.control"><Pagetitle="{i18n>detailPageTitle}"showNavButton="true"navButtonPress=".onNavBack"><ObjectHeadercore:require="{Date: 'sap/ui/model/type/Date',Currency: 'sap/ui/model/type/Currency'}"responsive="true"fullScreenOptimized="true"number="{parts: ['invoice>ExtendedPrice','view>/currency'],type: 'Currency',formatOptions: {showMeasure: false}}"numberUnit="{view>/currency}"intro="{invoice>ShipperName}"title="{invoice>ProductName}"><attributes><ObjectAttributetitle="{i18n>quantityTitle}"text="{invoice>Quantity}"/><ObjectAttributetitle="{i18n>dateTitle}"text="{path: 'invoice>ShippedDate',type: 'Date',formatOptions: {style: 'long',source: {pattern: 'yyyy-MM-ddTHH:mm:ss'}}}"/></attributes></ObjectHeader><wt:ProductRatingid="rating"class="sapUiSmallMarginBeginEnd"change=".onRatingChange"/></Page>
</mvc:View>

- 通过两句就是启动 ObjectHeader 组件的自适应模式

responsive="true"
fullScreenOptimized="true"

- 那么自适应对象是谁呢?就是这个 <attributes> 部分。

  和上面在 HelloPanel.view.xml 作用在 panel 组件上,用的是不同的属性。

<attributes>
    <ObjectAttribute
        title="{i18n>quantityTitle}"
        text="{invoice>Quantity}"/>
    <ObjectAttribute
        title="{i18n>dateTitle}"
        text="{
            path: 'invoice>ShippedDate',
            type: 'Date',
            formatOptions: {
                style: 'long',
                source: {
                    pattern: 'yyyy-MM-ddTHH:mm:ss'
                }
            }
        }"/>
</attributes>

5),Detail.controller.js 

sap.ui.define(["sap/ui/core/mvc/Controller","sap/ui/core/routing/History","sap/m/MessageToast","sap/ui/model/json/JSONModel"
], (Controller, History, MessageToast, JSONModel) => {"use strict";return Controller.extend("ui5.walkthrough.controller.Detail", {onInit() {const oViewModel = new JSONModel({currency: "EUR"});this.getView().setModel(oViewModel, "view");const oRouter = this.getOwnerComponent().getRouter();oRouter.getRoute("detail").attachPatternMatched(this.onObjectMatched, this);},…});
});

这里没啥,就是为了在详细页面加几个字段,比如这个Currency,所以加的Model而已

6),运行看效果

点任意一条明细,显示下面画面

哦,我这个用的Remote Data,Order Date 在Meta Data 里没暴漏出来。

我再加一个字段,然后再看看。

默认Destop Web 是这样的:有几个字段是靠右的

调成 phone 模式之后,就变成这样的

其实就是适应手机屏幕尺寸,把一些字段给调在下面表示了 

官方资料里提供的是这两种方式,在实际开发当中还是挺常用的。

其他的肯定还有,官方暂时没提供Sample,以后有Sample再说。

以上就是本篇的全部内容。

更多SAP顾问业务知识请点击下面目录链接或东京老树根的博客主页

https://blog.csdn.net/shi_ly/category_12216766.html

东京老树根-CSDN博客


文章转载自:

http://mSRbV9PI.Lsqxh.cn
http://l3Asjd81.Lsqxh.cn
http://wUlpVER7.Lsqxh.cn
http://t9o5ZPfJ.Lsqxh.cn
http://kKxYW1Ch.Lsqxh.cn
http://wnZU6c4h.Lsqxh.cn
http://m3YmQwd2.Lsqxh.cn
http://Url2qdAH.Lsqxh.cn
http://kufuldEA.Lsqxh.cn
http://6ClTSiuJ.Lsqxh.cn
http://llwS2vs0.Lsqxh.cn
http://wJ8cfMZC.Lsqxh.cn
http://KiOhvLiK.Lsqxh.cn
http://RoMDk4UY.Lsqxh.cn
http://xJ8g6b6l.Lsqxh.cn
http://SICb2u9P.Lsqxh.cn
http://AI4qngw0.Lsqxh.cn
http://h4NwVSoC.Lsqxh.cn
http://iMtYxgtv.Lsqxh.cn
http://82e8zcls.Lsqxh.cn
http://35OjzcqB.Lsqxh.cn
http://OnHNasrF.Lsqxh.cn
http://a6XW84zg.Lsqxh.cn
http://HjpliiWL.Lsqxh.cn
http://3usm9Y9U.Lsqxh.cn
http://1zxaI6H2.Lsqxh.cn
http://aceRthFs.Lsqxh.cn
http://Ey6r7lN7.Lsqxh.cn
http://mkhcywaU.Lsqxh.cn
http://6NvIEQdy.Lsqxh.cn
http://www.dtcms.com/wzjs/769600.html

相关文章:

  • 医疗类网站源码自己制作菜单的app
  • 广州网站建设方案案例苏州网页设计方法
  • 2019做地方门户网站建筑公司网站石家庄
  • 那个网站可以做微课网站树状栏目有点
  • 公选课网页制作与网站建设小学网站建设与管理办法
  • 做网站视频点播难不难推广广告赚钱软件
  • 网站 keywords舟山网络科技有限公司
  • 深圳企业黄页网站腾讯广告投放平台
  • 长沙建设公司网站长沙seo优化多少钱
  • phpcms做企业网站授权php网站访问量代码
  • 网站开发命名规则wordpress音乐批量上传
  • 公司建立网站的意义京东网站建设的意义
  • 做淘宝团购的网站西安都有哪些公司
  • 网站开发 流程最近的新闻头条
  • 阅读网站建设规划书珠海的门户网站有哪些
  • 网站建设走什么科目网络公司
  • 自己设计一个网站首页宣传网站建设方案模板
  • 网站建设施工图片全球设计网优秀版式作品
  • 网站需要人员做一借款撮合网站
  • django做的网站源码邯郸做网站价格
  • 东莞市公司网站建设怎么样兰州网站建设redu
  • 淘宝店铺推广渠道有哪些网店产品seo如何优化
  • 成都专业网站建设价格网络推广公司怎么报税
  • 网页设计网站方案企业文化墙创意设计图
  • 合肥有什么好的网站建设公司上海外贸公司最新招聘
  • 网站开发使用哪些开发语言梦幻西游网页版官方网站
  • 软件开发 网站建设 游戏开发网站建设的报告
  • 网站页面相似度检测安康网站设计
  • 企业网站关键词优化排名应该怎么做做期货资讯网站
  • 自主免费建站网站营销型网站建设公司