花粉乐分享平台宣传视频
> 华为资讯 > 华为资讯 > 鸿蒙编程 > HarmonyOS 应用开发在线体验
HarmonyOS 应用开发在线体验
来源:JAVA架构前端技术
2023-01-03 10:22:13
343
管理

HarmonyOS 应用开发在线体验

技术相关

使用语言: Js

体验内容: lianxiren

工具:在线开发

https://playground.harmonyos.com/#/cn/onlineDemo?ha_source=harmonyos&ha_sourceid=9011

展示效果与代码理解

Html

{{$item.name}} {{$item.phone}} {{detailObj.name}} phone : {{detailObj.phone}} 名字 电话 取消 确认

Css

.container { display: flex; flex-direction: row; justify-content: flex-start;}.list { margin-right: 14px; width: 100%;}.content { display: flex; flex-direction: column; justify-content: center; flex: 1; overflow: hidden;}.flex-row { display: flex; flex-direction: row; align-items: center; width: 200px;}@media screen and (device-type: tv) { .list { width: 50%; padding-right: 24px; padding-left: 24px; }}.list-item { height: 64px; margin: 0 14px; display: flex; flex-direction: row; align-items: center;}@media screen and (device-type: wearable) { .list-item { height: 80px; } .content { color:#ffffff; }}@media screen and (device-type: tv) { .list-item { height: 64px; border-radius: 8px; padding-left: 24px; background-color: #2c2c2c; display: flex; flex-direction: row; align-items: center; margin: 5px 0; } .content { color: #b4b4b4; }}.list-image { height: 46px; width: 46px;}.list-text { margin-left: 16px; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; flex: 1;}.detail-container { width: 0; height: 0; overflow: hidden; color: #b4b4b4;}.right-image { width: 0px; height: 0px;}@media screen and (device-type: phone) { .right-image { width: 30px; height: 30px; }}@media screen and (device-type: tv) { .detail-container { position: absolute; right: 14px; top: 50%; width: 50%; height: 100%; transform: translateY(-50%); display: flex; flex-direction: column; justify-content: center; align-items: center; } .detail-image { height: 100px; width: 100px; } .detail-name, .detail-phone { margin-top: 12px; font-size: 20px; white-space: nowrap; text-overflow: ellipsis; text-align: center; max-height: 2rem; overflow: hidden; width: 100%; }}.dialog-div { width: 280px; background-color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between;}.input-box { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 50px;}.inner-btn { width: 200px; height: 40px; margin-top: 10px; display: flex; justify-content: space-around; align-items: center;}.btn { font-size: 15px; background: none; border: none; color: #1460f7;}.label { width: 40px; font-size: 16px;}.input { font-size: 16px; line-height: 32px; width: 160px; border: none; border-bottom: 1px solid #c8c8c8;}.avatar { width: 150px; height: 150px; margin: 20px;}Jsconst HEAD_IMAGE = ["/common/head0.png", "/common/head1.png", "/common/head2.png", "/common/head3.png", "/common/head4.png"];export default { //数据字段定义 contactList: [ { image: HEAD_IMAGE[0], name: "Alan", phone: "020-00000000" }, { image: HEAD_IMAGE[2], name: "Bob", phone: "020-11111111" }, { image: HEAD_IMAGE[3], name: "Carl", phone: "0755-33333333" }, { image: HEAD_IMAGE[4], name: "David", phone: "19876543210" }, { image: HEAD_IMAGE[0], name: "Alan", phone: "020-00000000" }, { image: HEAD_IMAGE[1], name: "Bob", phone: "020-11111111" }, { image: HEAD_IMAGE[2], name: "Carl", phone: "12345678910" }, { image: HEAD_IMAGE[3], name: "David", phone: "19876543210" }, { image: HEAD_IMAGE[4], name: "Alan", phone: "020-00000000" }, { image: HEAD_IMAGE[0], name: "Bob", phone: "020-11111111" }, { image: HEAD_IMAGE[1], name: "Carl", phone: "12345678910" }, { image: HEAD_IMAGE[2], name: "David", phone: "19876543210" }, { image: HEAD_IMAGE[3], name: "Alan", phone: "020-00000000" }, { image: HEAD_IMAGE[4], name: "Bob", phone: "020-11111111" }, { image: HEAD_IMAGE[0], name: "Carl", phone: "12345678910" }, { image: HEAD_IMAGE[1], name: "David", phone: "19876543210" } ], //只做数据字段定义 isPhoneDevice: false, name: "", phone: "", detailObj: { image: "", name: "", phone: "" },}相关可以讨论的问题手机跳出的二级页面点取消就不会保存修改的信息,点确认就会保存,还有怎么关掉这个页面,实现这些的代码在哪里或者是怎么实现的?电视点击小图但右边的大图也会更新,实现这个逻辑的代码在哪?就是js最后两段代码是有固定格式还是有方法技巧的?

花粉社群VIP加油站

2
点赞
赏礼
赏钱
0
收藏
免责声明:本文仅代表作者个人观点,与花粉乐分享无关。其原创性以及文中陈述文字和内容未经本网证实,对本文以及其中全部或者 部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
凡本网注明 “来源:XXX(非花粉乐分享)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对 其真实性负责。
如因作品内容、版权和其它问题需要同本网联系的,请在一周内进行,以便我们及时处理。
QQ:2443165046 邮箱:info@hflfx.com
关于作者
理想青年(采蜜高手)
文章
456
主题
0
关注
0
粉丝
0
点击领取今天的签到奖励!
签到排行
随手拍
54个圈友 0个话题
华为手机随手拍,记录生活点滴之美好
华为P30pro
51个圈友 0个话题
这里是华为P30pro手机交流圈,欢迎华为P30pro用户进群交流
体验官
60个圈友 2个话题
华为花粉体验官,体验官专属的交流群
登录后查看您创建的圈子
登录后查看您创建的圈子
所有圈子
杭州互联网违法和不良信息举报平台 网络110报警服务 浙ICP备17046585号
2
0
分享
请选择要切换的马甲:

个人中心

每日签到

我的消息

内容搜索