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

如皋做公司网站铁路专业简历制作

如皋做公司网站,铁路专业简历制作,网站托管好吗,外贸手工做兼职的网站意图通知 获取router事件中传递参数并跳转 目前点击通知消息打开应用的指定页面#xff0c;通过为通知添加行为意图的方式。也就是在wants的parameters中设置自定义参数#xff0c;然后在UIAbility的onNewWant或者onCreate方法中 解析配置的自定义参数信息判断跳转不同页面通过为通知添加行为意图的方式。也就是在wants的parameters中设置自定义参数然后在UIAbility的onNewWant或者onCreate方法中 解析配置的自定义参数信息判断跳转不同页面参考文档 https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/notification-with-wantagent-V5 在UIAbility根据传递的params不同选择拉起不同的页面可参考 https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-ui-widget-event-router-V5 import { NavBar } from ../component/NavBar; import { notificationManager } from kit.NotificationKit; import { common, wantAgent } from kit.AbilityKit; import { hilog } from kit.PerformanceAnalysisKit; import { BusinessError } from kit.BasicServicesKit;Component Entry struct DemoNotification {State TAG: string [PublishOperation];State DOMAIN_NUMBER: number 0xFF00;State wantAgentInfo: wantAgent.WantAgentInfo {wants: [{bundleName: com.example.yumi,abilityName: EntryAbility}],operationType: wantAgent.OperationType.START_ABILITY,requestCode: 100};onPageShow(): void {// 请求通知授权let context getContext(this) as common.UIAbilityContext;notificationManager.isNotificationEnabled().then((data: boolean) {hilog.info(this.DOMAIN_NUMBER, this.TAG, isNotificationEnabled success, data: JSON.stringify(data));if (!data) {notificationManager.requestEnableNotification(context).then(() {hilog.info(this.DOMAIN_NUMBER, this.TAG, [ANS] requestEnableNotification success);}).catch((err: BusinessError) {if (1600004 err.code) {hilog.error(this.DOMAIN_NUMBER, this.TAG,[ANS] requestEnableNotification refused, code is ${err.code}, message is ${err.message});} else {hilog.error(this.DOMAIN_NUMBER, this.TAG,[ANS] requestEnableNotification failed, code is ${err.code}, message is ${err.message});}});}}).catch((err: BusinessError) {hilog.error(this.DOMAIN_NUMBER, this.TAG,isNotificationEnabled fail, code is ${err.code}, message is ${err.message});});// 通知角标let badgeNumber: number 10;notificationManager.setBadgeNumber(badgeNumber).then(() {hilog.info(this.DOMAIN_NUMBER, this.TAG, setBadgeNumber 10 success.);badgeNumber 11;notificationManager.setBadgeNumber(badgeNumber).then(() {hilog.info(this.DOMAIN_NUMBER, this.TAG, setBadgeNumber 11 success.);});});}publishNotification() {let notificationRequest: notificationManager.NotificationRequest {// 描述通知的请求id: 1, // 通知IDcontent: {// 通知内容notificationContentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // 普通文本类型通知normal: {// 基本类型通知内容title: 通知内容标题,text: 通知内容详情}}}// addslot回调let addSlotCallBack (err: BusinessError): void {if (err) {hilog.info(this.DOMAIN_NUMBER, this.TAG, addSlot failed, code is ${err.code}, message is ${err.message});} else {hilog.info(this.DOMAIN_NUMBER, this.TAG, addSlot success);}}notificationManager.addSlot(notificationManager.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack);notificationManager.publish(notificationRequest).then(() { // 发布通知console.info(publish success);}).catch((err: Error) {console.error(publish failed,message is ${err});});}async publishNotificationWant() {let wantAgentInfo: wantAgent.WantAgentInfo {wants: [{bundleName: com.example.yumi, // 自己应用的bundleNameabilityName: EntryAbility,parameters: { page: view/Car } // 自己点击通知需要跳转的页面}],operationType: wantAgent.OperationType.START_ABILITIES,requestCode: 1,}const wantAgentObj await wantAgent.getWantAgent(wantAgentInfo)await notificationManager.publish({content: {notificationContentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,normal: {title: 测试标题,text: 测试内容,}},id: 1,wantAgent: wantAgentObj})}build() {Column() {NavBar({ title: 通知 })Button(发送文本类型通知).onClick(() {this.publishNotification()})Button(发送通知-为通知添加行为意图).onClick(() {this.publishNotificationWant()})}} }import { AbilityConstant, UIAbility, Want } from kit.AbilityKit; import { hilog } from kit.PerformanceAnalysisKit; import { router, Router, window } from kit.ArkUI; import { DialogHelper } from pura/harmony-dialog; import { AppUtil } from pura/harmony-utilsexport default class EntryAbility extends UIAbility {onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {hilog.info(0x0000, testTag, %{public}s, Ability onCreate);AppUtil.init(this.context)}onDestroy(): void {hilog.info(0x0000, testTag, %{public}s, Ability onDestroy);}onWindowStageCreate(windowStage: window.WindowStage): void {// Main window is created, set main page for this abilityhilog.info(0x0000, testTag, %{public}s, Ability onWindowStageCreate);windowStage.loadContent(pages/Splash)}onWindowStageDestroy(): void {// Main window is destroyed, release UI related resourceshilog.info(0x0000, testTag, %{public}s, Ability onWindowStageDestroy);}onForeground(): void {// Ability has brought to foregroundhilog.info(0x0000, testTag, %{public}s, Ability onForeground);}onBackground(): void {// Ability has back to backgroundhilog.info(0x0000, testTag, %{public}s, Ability onBackground);}onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {hilog.info(0x0000, testTag, %{public}s, Ability onNewWant);//点击Notification通知并打开App的具体页面let page want?.parameters?.page as stringrouter.pushUrl({url: page})console.log(want参数want?.parameters?.page)} }
http://www.w-s-a.com/news/830828/

相关文章:

  • c 网站开发公司的网站的设计
  • 网站建设多长时间能学会做网站猫要做端口映射吗
  • 新手做网站视频网页设计期末作品要求
  • 做网站用户充值提现郑州高端模板建站
  • 运城做网站方式方法网站改版完成
  • 上海建设网站制作东西湖建设局网站
  • 建设购物网站课程设计建设部领导干部官方网站
  • 沈阳企业制作网站北京两学一做网站
  • 郑州做营销型网站手机网站建设多少钱一个
  • 小说类网站程序外贸商城 wordpress
  • 喀什百度做网站多少钱wordpress 用户介绍
  • 专门做任务的网站手机端网站重构
  • 深圳专业设计网站公司国际网站建设经验
  • 网站产品页排名怎么做网站备案起名要求
  • 成都企业网站建设及公司ppt生活分类信息网站大全
  • 免费企业网站源码下载学服装设计需要什么条件
  • 淘宝网站开发方式深圳平面设计公司排名榜
  • 品牌网站建设收费情况登陆页面模板
  • 十大免费cms建站系统介绍科技网站欣赏
  • 自学做网站需要多久semir是什么品牌
  • 南通网站搜索引擎优化网站首页seo关键词布局
  • 东莞市国外网站建设多少钱wordpress 多媒体插件
  • c2c商城网站建设公司做水果生意去哪个网站
  • 做网站服务器有哪些电子商务网站建立
  • 网站开发的具体流程原材料价格查询网站
  • 深圳响应式网站建设深圳网站建设定制开发 超凡科技
  • 网站建设报价怎么差别那么大wordpress产品属性搭配
  • 高校网站建设情况报告范文pc建站网站
  • 做网站美工要学什么广东省建设厅网站首页
  • 深圳网站设计十年乐云seo网站建设 竞赛 方案