schema.uvue 1.8 KB
Newer Older
W
wanganxp 已提交
1
<template>
H
hdx 已提交
2
  <view>
3
    <!-- #ifdef APP -->
H
hdx 已提交
4
    <button class="button" @click="openSchema('https://uniapp.dcloud.io/uni-app-x')">使用外部浏览器打开指定URL</button>
5
    <!-- #endif -->
D
DCloud_LXH 已提交
6
    <!-- #ifdef APP-ANDROID -->
H
hdx 已提交
7
    <button class="button" @click="openSchema('market://details?id=com.tencent.mm')">使用应用商店打开指定App</button>
D
DCloud_LXH 已提交
8 9 10 11 12 13
    <button class="button" @click="openSchema('androidamap://viewMap?sourceApplication=Hello%20uni-app&poiname=DCloud&lat=39.9631018208&lon=116.3406135236&dev=0')">
      打开地图坐标
    </button>
    <!-- #endif -->
    <!-- #ifdef APP-IOS -->
    <button class="button" @click="openSchema('itms-apps://search.itunes.apple.com//WebObjects//MZSearch.woa/wa/search?media=software&lterm=')">打开 AppStore 到搜索页</button>
W
wanganxp 已提交
14 15
    <button class="button" @click="openSchema('http://maps.apple.com/?q=数字天堂公司&sll=39.9631018208,116.3406135236&z=10&t=s')">打开 iOS 地图坐标</button>
    <!-- apple协议:https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html -->
D
DCloud_LXH 已提交
16
    <!-- #endif -->
17 18 19 20 21 22 23
    <!-- #ifdef WEB -->
    <view class="tip">
    <text>仅Android/iOS设备的浏览器中支持使用此功能,需先安装“Hello uni-app x”应用,如未安装请前往以下网页安装:</text>
    <text class="link" @click="openSchema('https://hellouniappx.dcloud.net.cn/')">https://hellouniappx.dcloud.net.cn/</text>
    </view>
    <button class="button" @click="openSchema('hellouniappx://')">启动 Hello uni-app x 应用</button>
    <!-- #endif -->
H
hdx 已提交
24
  </view>
W
wanganxp 已提交
25 26
</template>

D
DCloud_LXH 已提交
27 28
<script setup lang="uts">
import { openSchema } from '@/uni_modules/uts-openSchema'
W
wanganxp 已提交
29 30 31
</script>

<style>
H
hdx 已提交
32 33 34
  .button {
    margin: 15px;
  }
35 36 37 38 39 40 41 42
  .tip {
    padding: 8px;
  }
  .link {
    color: #7A7E83;
    font-size: 14px;
    line-height: 20px;
  }
W
wanganxp 已提交
43
</style>