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

动力网站代码哪里能搜索引擎优化

动力网站代码,哪里能搜索引擎优化,百度收录是什么意思,hashone wordpress通过startAbilityByType拉起垂类应用 使用场景 开发者可通过特定的业务类型如导航、金融等,调用startAbilityByType接口拉起对应的垂域面板,该面板将展示目标方接入的垂域应用,由用户选择打开指定应用以实现相应的垂类意图。垂域面板为调用…

通过startAbilityByType拉起垂类应用

使用场景

开发者可通过特定的业务类型如导航、金融等,调用startAbilityByType接口拉起对应的垂域面板,该面板将展示目标方接入的垂域应用,由用户选择打开指定应用以实现相应的垂类意图。垂域面板为调用方提供统一的安全、可信的目标方应用,同时降低调用方的接入成本。

约束限制

设备限制 HarmonyOS NEXT Developer Preview0及以上版本的设备

接口说明

接口startAbilityByType11+  是[UIAbilityContext]和[UIExtensionContentSession]提供的支持基于垂域业务类型拉起垂域面板,调用方通过指定特定的垂域业务类型即可拉起对应的垂域面板,在垂域面板上将展示目标方接入的垂域应用。

type为navigation导航对应的wantParam:

属性名称含义数据类型是否缺省
destinationLatitude终点纬度GCJ-02numbersceneType=1或2时不可缺省
destinationLongitude终点经度GCJ-02numbersceneType=1或2时不可缺省
sceneType意图取值 :1:路线规划 2:导航 3: 地点搜索number可缺省,缺省时默认为1
destinationName终点名称stringsceneType=3时不可缺省
originName起点名称(路线规划场景有效)string可缺省
originLatitude起点纬度GCJ-02(路线规划场景有效)number可缺省
originLongitude起点经度GCJ-02(路线规划场景有效)number可缺省
vehicleType交通出行工具:0:驾车 1:步行 2:骑行 3:公交(路线规划场景有效)number可缺省,缺省时由应用自行处理

接入步骤

调用方接入步骤

  1. 导入ohos.app.ability.common模块。

    import common from '@ohos.app.ability.common';
    
  2. 构造接口参数并调用startAbilityByType接口。

示例

import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext;
let wantParam: Record<string, Object> = {'sceneType':1,'destinationLatitude':32.060844,'destinationLongitude':118.78315,'destinationName':'xx市xx路xx号','originName':'xx市xx公园','originLatitude':31.060844,'originLongitude':120.78315,'vehicleType':0
};
let abilityStartCallback: common.AbilityStartCallback = {onError: (code: number, name: string, message: string) => {console.log(`code:` + code + `name:` + name + `message:` + message);}
}
context.startAbilityByType("navigation", wantParam, abilityStartCallback, (err) => {if (err) {console.error(`startAbilityByType fail, err: ${JSON.stringify(err)}`);} else {console.log(`success`);}
});

效果示例图:

效果示例图

目标方接入步骤

  1. 导入ohos.app.ability.UIAbility模块。

    import UIAbility from '@ohos.app.ability.UIAbility';
    
  2. 在module.json5中新增[linkFeature]属性并设置声明当前应用支持的特性功能,从而系统可以从设备已安装应用中找到当前支持该特性的应用。

    配置示例:

    {
    "abilities": [{"skills": [{"uris": [{"scheme": "maps", // 这里仅示意,应用需确保这里声明的的uri能被外部正常拉起"host": "navigation","path": "","linkFeature": "navigation" // 声明应用支持导航功能},{"scheme": "maps", // 这里仅示意,应用需确保这里声明的的uri能被外部正常拉起"host": "routePlan","path": "","linkFeature": "routePlan" // 声明应用支持路线规划功能},{"scheme": "maps", // 这里仅示意,应用需确保这里声明的的uri能被外部正常拉起"host": "search","path": "","linkFeature": "textSearch" // 声明应用支持位置搜索功能}]}]}
    ]
    }
    
  3. 解析参数并做对应处理。

    UIAbility::onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void
    

    在参数want.parameters中会携带Caller方传入的参数(与调用方传入的有些差异),如下表所示:

    属性名称含义数据类型是否缺省
    destinationLatitude终点纬度GCJ-02numbersceneType=1或2时不可缺省
    destinationLongitude终点经度GCJ-02numbersceneType=1或2时不可缺省
    destinationName终点名称stringsceneType=3时不可缺省
    originName起点名称string可缺省,存在时可用于展示路线规划页面
    originLatitude起点纬度GCJ-02number可缺省,存在时可用于展示路线规划页面
    originLongitude起点经度GCJ-02number可缺省,存在时可用于展示路线规划页面
    vehicleType交通出行工具:0:驾车 1:步行 2:骑行 3:公交(路线规划场景有效)number可缺省,缺省时由应用自行处理

    应用可根据[linkFeature]中定义的特性功能,比如路线规划和导航结合接收到的参数开发不同的样式页面。

示例:

import AbilityConstant from '@ohos.app.ability.AbilityConstant';
import hilog from '@ohos.hilog';
import UIAbility from '@ohos.app.ability.UIAbility';
import Want from '@ohos.app.ability.Want';
import window from '@ohos.window';let destinationLatitude:number;
let destinationLongitude:number;
let originLatitude:number | undefined;
let originLongitude:number | undefined;export default class EntryAbility extends UIAbility {onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');destinationLatitude = want.parameters?.destinationLatitude as number;destinationLongitude = want.parameters?.destinationLongitude as number;originLatitude = want.parameters?.originLatitude as number | undefined;originLongitude = want.parameters?.originLongitude as number | undefined;}onWindowStageCreate(windowStage: window.WindowStage) {hilog.info(0x0000, 'testTag', '%{public}s', `Ability onWindowStageCreate: ${JSON.stringify(this.context)}`);const storage: LocalStorage = new LocalStorage({"destinationLatitude": destinationLatitude,"destinationLongitude": destinationLongitude,"originLatitude": originLatitude,"originLongitude": originLongitude} as Record<string, object>);if(originLatitude !== undefined && originLongitude !== undefined) {windowStage.loadContent('pages/IndexForNavigation', storage);} else {windowStage.loadContent('pages/IndexForRoutePlan', storage);}}
}
http://www.yayakq.cn/news/415253/

相关文章:

  • 电商网站的特点网站报价详情
  • 中法电商网站建设wordpress+边框插件
  • 如何确认建设银行网站不是假的登建设厅锁子的是哪个网站
  • 响应式网站多少钱网站建设首选智投未来1
  • 一流的邯郸网站建设网络服务器搭建与管理
  • 最新做做网站免费自己的公网ip可以做网站
  • 公司做外贸网站账号权重查询入口站长工具
  • 不花钱做推广的网站用python做网站的公司
  • 天津网站优化实战百度手机助手下载免费安装
  • 网站建设企业服务wordpress自适应手机
  • 江西赣建建设监理网站找代理公司注册公司需要注意什么
  • 如何做网站短链接WordPress网页小游戏
  • 网站建设近义词电商设计师网站
  • 网站出租建设舆情监测软件免费版
  • 用php制作一个个人信息网站佛山做外贸网站流程
  • 世界网站排名查询免费开源视频cms系统
  • 织梦猫html5高端网络服务机构网站模板单页网站seo怎么做
  • 安徽做网站公司哪家好一点中企动力做网站
  • 江宁滨江网站建设设计类平台网站
  • 网站开发学校有哪些互联网服务行业有哪些工作
  • 学做网站需要掌握哪些知识百度搜索高级搜索技巧
  • 网站开发维护多少钱wordpress打字不显示图片
  • 网站建设文化公司dw做网站一般设为什么样
  • 聊城做网站的公司市场wordpress怎么修改语言设置
  • 南沙做网站wordpress几种系统
  • 外贸营销型网站2018网站设计的价格
  • 网站建设交流论坛地址wordpress 静态 弊端
  • 做设计_素材网站有哪项目进度计划甘特图
  • 湖北网络营销网站电商论坛网站模板
  • 东莞网站建设模板报价福建最大的网络公司排名