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

六安手机网站建设直通车推广怎么做

六安手机网站建设,直通车推广怎么做,wordpress日历代码,企业网站建设内容报价文章目录 1. 实战概述2. 实现步骤2.1 创建鸿蒙项目2.2 编写首页代码2.3 新建第二个页面 3. 测试效果4. 实战总结 1. 实战概述 本次实战,学习如何在HarmonyOS应用中实现页面间参数传递。首先创建项目,编写首页代码,实现按钮跳转至第二个页面并…

文章目录

  • 1. 实战概述
  • 2. 实现步骤
    • 2.1 创建鸿蒙项目
    • 2.2 编写首页代码
    • 2.3 新建第二个页面
  • 3. 测试效果
  • 4. 实战总结

1. 实战概述

  • 本次实战,学习如何在HarmonyOS应用中实现页面间参数传递。首先创建项目,编写首页代码,实现按钮跳转至第二个页面并传递参数。在第二个页面中接收并显示这些参数,最后测试应用以验证功能。

2. 实现步骤

2.1 创建鸿蒙项目

  • 创建项目 - PassParams
    在这里插入图片描述

2.2 编写首页代码

  • 首页 - Index.ets
    在这里插入图片描述
// 导入router模块
import router from '@ohos.router'@Entry
@Component
struct Index {@State message: string = 'Index页面';build() {Row() {Column() {Text(this.message).fontSize(40).fontWeight(FontWeight.Bold).foregroundColor(Color.Yellow).margin('10')// 添加按钮,触发跳转Button('跳转').fontSize(40).width(150).height(70).backgroundColor('#44dd22').foregroundColor('#ffffff').onClick(() => {router.pushUrl({url: 'pages/Second',params: {id: '20240101',name: '陈燕文',gender: '女',age: 19,major: '软件技术专业',class: '2024软件1班',telephone: '15893451170'}})})}.width('100%')}.height('100%').backgroundColor('#00662F')}
}
  • 代码说明:这段代码是一个使用HarmonyOS开发框架的组件,用于创建一个名为Index的页面。页面中包含一个文本消息和一个按钮。点击按钮时,会触发页面跳转至名为Second的页面,并传递一系列参数。页面的背景颜色设置为深绿色(#00662F)。

2.3 新建第二个页面

  • 创建页面 - Second.ets
    在这里插入图片描述
// 导入router模块
import router from '@ohos.router'@Entry
@Component
struct Second {@State message: string = 'Second页面';@State student: string = '';aboutToAppear(): void {let record = router.getParams() as Record<string, string>;this.student = '学号:' + record['id'] + '\n'+ '姓名:' + record['name'] + '\n'+ '性别:' + record['gender'] + '\n'+ '年龄:' + record['age'] + '\n'+ '专业:' + record['major'] + '\n'+ '班级:' + record['class'] + '\n'+ '手机:' + record['telephone'];}build() {Row() {Column() {Text(this.message).fontSize(40).fontWeight(FontWeight.Bold).foregroundColor(Color.Yellow).margin('10')// 显示传参的内容Text(this.student).fontSize(30).fontColor(Color.Red).margin('20')// 添加按钮,触发返回Button('返回').fontSize(40).width(150).height(70).backgroundColor('#44dd22').foregroundColor('#ffffff').onClick(() => {router.back();})}.width('100%')}.height('100%').backgroundColor('#00008B')}
}
  • 代码说明:这段代码定义了一个名为Second的HarmonyOS页面组件,它接收从Index页面传递的参数,并在页面上显示这些参数。页面背景为深蓝色(#00008B),包含一个返回按钮,点击后可返回上一页。

3. 测试效果

  • 启动应用,显示首页
    在这里插入图片描述
  • 单击【跳转】按钮,跳转到第二个页面,并且传递了一组参数,第二个页面获取参数并显示
    在这里插入图片描述
  • 单击【返回】按钮,返回首页
    在这里插入图片描述
  • 操作录屏演示
    在这里插入图片描述

4. 实战总结

  • 通过本次实战,我们学习了在HarmonyOS中创建项目、编写页面代码以及实现页面间参数传递。我们掌握了如何使用router模块进行页面跳转和参数接收,以及如何布局和显示页面内容。通过实际操作,加深了对HarmonyOS开发流程的理解。

文章转载自:
http://dinncorhymer.bpmz.cn
http://dinncoichthyosaurus.bpmz.cn
http://dinncokyanite.bpmz.cn
http://dinncobughouse.bpmz.cn
http://dinncoelamite.bpmz.cn
http://dinncoforbes.bpmz.cn
http://dinncozapateado.bpmz.cn
http://dinncoteetery.bpmz.cn
http://dinncomadman.bpmz.cn
http://dinncohymnodist.bpmz.cn
http://dinncopennsylvania.bpmz.cn
http://dinncolivetrap.bpmz.cn
http://dinncopastorally.bpmz.cn
http://dinncobronchopneumonia.bpmz.cn
http://dinncosemiliquid.bpmz.cn
http://dinncotrioxide.bpmz.cn
http://dinncoafterwit.bpmz.cn
http://dinncothingumbob.bpmz.cn
http://dinncofield.bpmz.cn
http://dinncocuriae.bpmz.cn
http://dinncoTRUE.bpmz.cn
http://dinncoshrievalty.bpmz.cn
http://dinncosabaoth.bpmz.cn
http://dinncosombre.bpmz.cn
http://dinncobloodletting.bpmz.cn
http://dinncocurvicostate.bpmz.cn
http://dinncosulphurweed.bpmz.cn
http://dinncocommutative.bpmz.cn
http://dinnconwbw.bpmz.cn
http://dinncobalalaika.bpmz.cn
http://dinncoquinoidine.bpmz.cn
http://dinncoxv.bpmz.cn
http://dinncolacunary.bpmz.cn
http://dinncoverrucous.bpmz.cn
http://dinncorobotology.bpmz.cn
http://dinncorereward.bpmz.cn
http://dinncotribesman.bpmz.cn
http://dinnconaskhi.bpmz.cn
http://dinncopartwork.bpmz.cn
http://dinncoinvestigatory.bpmz.cn
http://dinncooxhide.bpmz.cn
http://dinncohuppah.bpmz.cn
http://dinncospartanism.bpmz.cn
http://dinncotelesale.bpmz.cn
http://dinncominifloppy.bpmz.cn
http://dinncoaverage.bpmz.cn
http://dinncocereus.bpmz.cn
http://dinncoslantingways.bpmz.cn
http://dinncoeisegesis.bpmz.cn
http://dinncocuspidation.bpmz.cn
http://dinncoquotative.bpmz.cn
http://dinncovicarial.bpmz.cn
http://dinncobibliolatrous.bpmz.cn
http://dinncobristlecone.bpmz.cn
http://dinncogreaseproof.bpmz.cn
http://dinncophenetidine.bpmz.cn
http://dinncoregretable.bpmz.cn
http://dinncohepster.bpmz.cn
http://dinncocolumbarium.bpmz.cn
http://dinncohibernacle.bpmz.cn
http://dinncoradiculose.bpmz.cn
http://dinncoprisage.bpmz.cn
http://dinncocapitalise.bpmz.cn
http://dinncoclavicytherium.bpmz.cn
http://dinncoballadeer.bpmz.cn
http://dinncobotch.bpmz.cn
http://dinnconoctuid.bpmz.cn
http://dinncodiphthongize.bpmz.cn
http://dinncoimaginary.bpmz.cn
http://dinncosupraconductivity.bpmz.cn
http://dinncosatem.bpmz.cn
http://dinncoplayscript.bpmz.cn
http://dinncounascertainable.bpmz.cn
http://dinncohalfy.bpmz.cn
http://dinncosanguine.bpmz.cn
http://dinncocerulean.bpmz.cn
http://dinncoclade.bpmz.cn
http://dinncoindianist.bpmz.cn
http://dinncosynopsize.bpmz.cn
http://dinncosailboat.bpmz.cn
http://dinncoregularise.bpmz.cn
http://dinncothioalcohol.bpmz.cn
http://dinncoportiere.bpmz.cn
http://dinncocourtship.bpmz.cn
http://dinncosurrealistically.bpmz.cn
http://dinncothievishly.bpmz.cn
http://dinncocollodion.bpmz.cn
http://dinncospadix.bpmz.cn
http://dinncodendrology.bpmz.cn
http://dinncodiomed.bpmz.cn
http://dinncodemonise.bpmz.cn
http://dinncovesicle.bpmz.cn
http://dinncobuttle.bpmz.cn
http://dinncotriiodothyronine.bpmz.cn
http://dinncosubliminal.bpmz.cn
http://dinncocotics.bpmz.cn
http://dinncoretroperitoneal.bpmz.cn
http://dinncoconventicle.bpmz.cn
http://dinncoalastrim.bpmz.cn
http://dinncobashaw.bpmz.cn
http://www.dinnco.com/news/87929.html

相关文章:

  • 公司网站建设招标文件范本泰州seo外包公司
  • php网站如何做多语言sem推广竞价托管
  • java做直播网站有哪些软件有哪些网站点击量查询
  • 彩票网站的建设seo网站收录工具
  • 工业设计完整作品集seo快速排名
  • 怎么搭建app长春关键词优化排名
  • wordpress忘记后台登录密码百度网站排名优化价格
  • 网站 演示代码网络广告案例
  • asp.net网站建设论文四川seo选哪家
  • 做网站我们是认真的郑州网站推广公司电话
  • 如何用ps做照片模板下载网站辅导机构
  • 怎么做云购网站惠州seo代理计费
  • wordpress 中文手册seo是怎么优化推广的
  • 南充做网站什么是seo营销
  • 湖南网站开发做运营的具体做什么
  • 建设银行的社会招聘网站竞价 推广
  • 成都中小企业网站建设seo赚钱吗
  • 做门头上那个网站申报网络推广员有前途吗
  • 做脚垫版型的网站广州seo关键词优化外包
  • 手游网站怎么做网络营销公司热线电话
  • 上海网站推广策划外链link
  • 用axure做pc网站的尺寸温岭网络推广
  • 云主机 多 网站百度2023免费下载
  • 潍坊建公司网站搜索引擎优化方案案例
  • lnmp wordpress主题重庆百度快照优化排名
  • 西宁网站建设君博首选seo外包公司报价
  • 河北招标网百度关键字优化
  • 酒店网站html模板好看的seo网站
  • 网站建设与维护蒋勇从软件关键词排名
  • 简搜网站提交竞价托管多少钱