update scheme open alipay

This commit is contained in:
DevWiki 2024-09-11 15:09:21 +08:00
parent 7bd741a8a0
commit ed6cbec7c9
2 changed files with 14 additions and 12 deletions

View File

@ -24,8 +24,9 @@ struct MapPage {
.width(60)
.backgroundColor(Color.Red)
.onClick(() => {
if (this.isLocationPermission) {
}
this.locationHelper.getLocationAddress( 31.12, 121.11, 1, (error: BusinessError, data: geoLocationManager.GeoAddress[]) => {
})
})
SymbolGlyph($r('sys.symbol.xmark')).width(24).height(24).borderRadius(12).onClick(() => {
@ -45,16 +46,13 @@ struct MapPage {
build() {
Column(){
if (this.isShowLocationPopup) {
this.locationViewBuilder();
}
Text(this.locText);
}.width('100%').height('100%')
}
aboutToAppear(): void {
this.locationHelper.requestPermissionsFromUser((allowScope: boolean, allowPrecision: boolean) => {
})
}
}

View File

@ -13,18 +13,22 @@ struct SchemePage {
}
})
Button("Open").width(120).height(36).onClick(() => {
this.openScheme()
Button("OpenApp").width(120).height(36).onClick(() => {
this.openScheme('alipays://platformapi/startapp?appId=20000001')
}).margin({ top: 48 })
Button("OpenStore").width(120).height(36).onClick(() => {
this.openScheme('store://appgallery.huawei.com/app/detail?id=com.alipay.mobile.client')
}).margin({ top: 48 })
}
}
openScheme() {
openScheme(uri: string) {
let context = getContext(this) as common.UIAbilityContext;
let wantInfo: Want = {
action: 'ohos.want.action.viewData',
entities: ['entity.system.browsable'],
uri: 'https://devwiki.net'
// action: 'ohos.want.action.viewData',
// entities: ['entity.system.browsable'],
uri: uri
}
context.startAbility(wantInfo);
}