HarmonyOS 是否支持从App跳转到应用市场的App主页

HarmonyOS
2024-12-25 10:24:02
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
put_get

参考示例如下:

import Want from '@ohos.app.ability.Want';
import common from '@ohos.app.ability.common';

@Entry
@Component
struct Index {
  @State appId: string = 'appId';
  controller: TextInputController = new TextInputController();

  build() {
    Row() {
      Column() {
        TextInput({ text: this.appId, placeholder: '请输入应用的appId', controller: this.controller })
          .width('90%')
          .onChange((value: string) => {
            this.appId = value
          })
        Button('点击跳转到HarmonyOS版应用市场详情页面')
          .margin({ top: 50 })
          .onClick(() => {
            const want: Want = {
              uri: `store://appgallery.huawei.com/app/detail?id=${this.appId}`
            };
            const context = getContext(this) as common.UIAbilityContext;
            context.startAbility(want).then(() => {
              //拉起成功
            }).catch(() => {
              // 拉起失败
            });
          })
      }
      .width('100%')
    }
    .height('100%')
  }
}
分享
微博
QQ
微信
回复
2024-12-25 13:44:37
相关问题
如何跳转到应用市场app下载页面?
8030浏览 • 1回复 待解决
如何app跳转到系统相机
5701浏览 • 1回复 已解决
怎么跳转打开系统应用市场app
2702浏览 • 1回复 待解决
鸿蒙APP如何跳转到Android APP
15713浏览 • 3回复 待解决
怎样才能跳转到应用市场界面?
1277浏览 • 2回复 待解决
HarmonyOS app中怎么跳转到系统设置?
757浏览 • 1回复 待解决
HarmonyOS applink浏览器跳转到应用
340浏览 • 1回复 待解决
HarmonyOS 在H5中如何跳转到应用市场
1125浏览 • 1回复 待解决
HarmonyOS 跳转应用市场
216浏览 • 1回复 待解决