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

全自动网站制作系统在哪个网站可以学做衣服

全自动网站制作系统,在哪个网站可以学做衣服,顺德网站建设多少钱,常德做网站专业公司哪家好意图通知 获取router事件中传递参数并跳转 目前点击通知消息打开应用的指定页面,通过为通知添加行为意图的方式。也就是在wants的parameters中设置自定义参数,然后在UIAbility的onNewWant或者onCreate方法中 解析配置的自定义参数信息判断跳转不同页面&a…

意图通知
获取router事件中传递参数并跳转
目前点击通知消息打开应用的指定页面,通过为通知添加行为意图的方式。也就是在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-utils'export 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.yayakq.cn/news/679290/

相关文章:

  • 一流的镇江网站建设可以做代销的网站
  • 环保主题的网站模板百度免费发布信息平台
  • 想做一个自己的网站wordpress有没有付费
  • 东莞皮具网站建设做网站建设比较好的公司
  • 网站建设的功能都需要有哪些dz网站如何搬家
  • 石家庄网站建设高端网站制作教程网站
  • 奢侈品 网站建设方案广东联通通信建设有限公司 网站
  • 科技公司内蒙古网站制作网络服务租赁合同范本
  • 荥阳网站制作全国新冠疫苗接种率
  • 政协网站法治建设版块重庆网约车
  • 手机端网站ui做多少像素网页无法访问是怎么回事
  • 重庆手机网站建设公司对电子商务网站设计的理解
  • 如何制作网页网站淮安网络营销
  • 西安网站建设公司西安网络公司网站建站网站建站
  • 自己做网站买一对一专属定制方案
  • 分享站wordpress主题acfun网站设计改进
  • 触屏手机网站模板app开发
  • 福州市城乡建设发展总公司网站网店怎么开店注册
  • 兴义网站开发福建做网站
  • 网站的站点建设单页网站案例分析
  • 西宁做网站的有吗今天哈尔滨最新通知
  • 网站开发需求分析的内容朔州海外网络推广
  • 杭州建设局江门seo外包公司
  • 北京城建设计集团网站地产公司做网站维护写代码么
  • 优质采官方网站安徽外径建设集团wordpress页面顶部登录
  • 个人网站模板源码深圳保障性住房和公租房区别
  • 苏州网站建设机构网站免费建站o
  • wordpress 用什么服务器配置天津seo优化排名
  • 建设品牌网站视频播放网站开发的报告
  • 网站建设与运营在线考试个人做商机网站如何盈利