openLocation.uvue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <template>
  2. <view class="uni-open-location" :class="classCom">
  3. <view class="uni-open-location-map-box">
  4. <map class="uni-open-location-map" :id="mapId" :ref="mapId" :latitude="latitude" :longitude="longitude" :scale="openLocationOptions.scale" :markers="markers"
  5. :layer-style="theme == 'dark' ? '2' : '1'" :show-compass="false" :enable-zoom="true" :enable-scroll="true" :enable-rotate="false" :enable-poi="true" :show-location="true">
  6. </map>
  7. <view class="uni-open-location-map-reset" @click="mapReset">
  8. <text class="uni-open-location-icons uni-open-location-map-reset-icon">{{ icon.position }}</text>
  9. </view>
  10. </view>
  11. <view class="uni-open-location-nav" :style="'height:' + (60 + safeArea.top) + 'px;'">
  12. <view class="uni-open-location-nav-btn uni-open-location-nav-back-btn" :class="[landscapeClassCom]" :style="safeArea.top > 0 ? 'top: ' + safeArea.top + 'px;' : ''"><text
  13. class="uni-open-location-nav-text uni-open-location-nav-back-text uni-open-location-icons" @click="back">{{ icon.back }}</text></view>
  14. </view>
  15. <view class="uni-open-location-footer">
  16. <view class="uni-open-location-address">
  17. <text class="uni-open-location-name-text">
  18. {{ openLocationOptions.name }}
  19. </text>
  20. <text class="uni-open-location-address-text">
  21. {{ openLocationOptions.address }}
  22. </text>
  23. </view>
  24. <view class="uni-open-location-footer-icon-btns">
  25. <view class="uni-open-location-footer-icon-btns-item" @click="navigation">
  26. <view class="uni-open-location-footer-icon-box">
  27. <text class="uni-open-location-icons">{{ icon.navigation }}</text>
  28. </view>
  29. <text class="uni-open-location-footer-btn-text">{{ languageCom['navigation'] }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script lang="uts">
  36. import { openSchema } from '@/uni_modules/uts-openSchema'
  37. // #ifdef APP
  38. import { canOpenURL } from '@/uni_modules/uts-openSchema'
  39. // #endif
  40. import targetPath from '@/uni_modules/uni-openLocation/pages/openLocation/target.png'
  41. //const targetPath = '/uni_modules/uni-openLocation/static/target.png'
  42. type AafeArea = {
  43. top : number,
  44. bottom : number,
  45. left : number,
  46. right : number
  47. }
  48. type IconPath = {
  49. target : string,
  50. position : string,
  51. navigation : string,
  52. back : string,
  53. }
  54. const languageData = {
  55. "en": {
  56. "navigation": "navigation"
  57. },
  58. "zh-Hans": {
  59. "navigation": "导航"
  60. },
  61. "zh-Hant": {
  62. "navigation": "導航"
  63. }
  64. };
  65. export default {
  66. data() {
  67. const id1 = `UniMap1_${(Math.random() * 10e5).toString(36)}` as string;
  68. return {
  69. readyEventName: '',
  70. optionsEventName: '',
  71. successEventName: '',
  72. failEventName: '',
  73. openLocationOptions: {
  74. latitude: 0,
  75. longitude: 0,
  76. scale: 18,
  77. name: '',
  78. address: ''
  79. } as OpenLocationOptions,
  80. safeArea: {
  81. top: 0,
  82. bottom: 0,
  83. left: 0,
  84. right: 0
  85. } as AafeArea,
  86. icon: {
  87. target: '\ue683',
  88. position: '\ue653',
  89. navigation: '\ue640',
  90. back: '\ue651',
  91. } as IconPath,
  92. language: "zh-Hans",
  93. isLandscape: false,
  94. theme: "light",
  95. mapId: id1,
  96. latitude: 0,
  97. longitude: 0,
  98. markers: [] as Marker[]
  99. }
  100. },
  101. onLoad(options : UTSJSONObject) {
  102. this.initPageOptions(options);
  103. this.getSystemInfo();
  104. },
  105. onReady() {
  106. },
  107. onUnload() {
  108. uni.$off(this.optionsEventName, null);
  109. uni.$off(this.readyEventName, null);
  110. uni.$off(this.successEventName, null);
  111. uni.$off(this.failEventName, null);
  112. // #ifdef APP-IOS
  113. __uniappx__nativeEventBus.off(this.optionsEventName, null)
  114. __uniappx__nativeEventBus.off(this.readyEventName, null)
  115. __uniappx__nativeEventBus.off(this.successEventName, null)
  116. __uniappx__nativeEventBus.off(this.failEventName, null)
  117. // #endif
  118. },
  119. onResize() {
  120. const systemInfo = uni.getSystemInfoSync();
  121. this.isLandscape = systemInfo.deviceOrientation == 'landscape';
  122. },
  123. methods: {
  124. initPageOptions(options : UTSJSONObject) {
  125. this.readyEventName = options['readyEventName']! as string;
  126. this.optionsEventName = options['optionsEventName']! as string;
  127. this.successEventName = options['successEventName']! as string;
  128. this.failEventName = options['failEventName']! as string;
  129. uni.$on(this.optionsEventName, (data : UTSJSONObject) => {
  130. console.log('data: ', JSON.stringify(data))
  131. if (data['latitude'] != null) {
  132. this.openLocationOptions.latitude = data['latitude'] as number;
  133. this.latitude = this.openLocationOptions.latitude;
  134. }
  135. if (data['longitude'] != null) {
  136. this.openLocationOptions.longitude = data['longitude'] as number;
  137. this.longitude = this.openLocationOptions.longitude;
  138. }
  139. if (data['scale'] != null) {
  140. this.openLocationOptions.scale = data['scale'] as number;
  141. }
  142. if (data['name'] != null) {
  143. this.openLocationOptions.name = data['name'] as string;
  144. }
  145. if (data['address'] != null) {
  146. this.openLocationOptions.address = data['address'] as string;
  147. }
  148. setTimeout(() => {
  149. this.markers = [
  150. {
  151. id: 1,
  152. latitude: this.openLocationOptions.latitude,
  153. longitude: this.openLocationOptions.longitude,
  154. iconPath: targetPath,
  155. width: 50,
  156. height: 50
  157. } as Marker
  158. ] as Marker[];
  159. }, 300);
  160. uni.$emit(this.successEventName, {});
  161. });
  162. uni.$emit(this.readyEventName, {});
  163. },
  164. getSystemInfo() {
  165. const info = uni.getWindowInfo();
  166. this.safeArea.top = info.safeAreaInsets.top;
  167. this.safeArea.bottom = info.safeAreaInsets.bottom;
  168. this.safeArea.left = info.safeAreaInsets.left;
  169. this.safeArea.right = info.safeAreaInsets.right;
  170. const systemInfo = uni.getSystemInfoSync()
  171. // const osLanguage = systemInfo.osLanguage
  172. const appLanguage = systemInfo.appLanguage
  173. this.language = appLanguage
  174. const osTheme = systemInfo.osTheme
  175. const appTheme = systemInfo.appTheme
  176. if (appTheme != null && appTheme != "auto") {
  177. this.theme = appTheme
  178. } else if (osTheme != null) {
  179. this.theme = osTheme
  180. }
  181. this.isLandscape = systemInfo.deviceOrientation == 'landscape'
  182. // #ifdef WEB
  183. const hostTheme = systemInfo.hostTheme
  184. if (hostTheme != null) {
  185. this.theme = hostTheme
  186. }
  187. const locale = uni.getLocale()
  188. this.language = locale
  189. uni.onLocaleChange((res) => {
  190. if (res.locale) {
  191. this.language = res.locale
  192. }
  193. })
  194. uni.onThemeChange((res) => {
  195. this.theme = res.theme
  196. });
  197. // #endif
  198. // #ifdef APP-ANDROID || APP-IOS
  199. uni.onAppThemeChange((res : AppThemeChangeResult) => {
  200. this.theme = res.appTheme
  201. })
  202. uni.onOsThemeChange((res : OsThemeChangeResult) => {
  203. this.theme = res.osTheme
  204. })
  205. // #endif
  206. },
  207. closeDialogPage() {
  208. // #ifdef APP-ANDROID
  209. uni.closeDialogPage({
  210. dialogPage: this.$page
  211. } as io.dcloud.uniapp.framework.extapi.CloseDialogPageOptions)
  212. // #endif
  213. // #ifndef APP-ANDROID
  214. uni.closeDialogPage({
  215. dialogPage: this.$page
  216. })
  217. // #endif
  218. },
  219. back() {
  220. this.closeDialogPage();
  221. },
  222. getMapContext() : MapContext | null {
  223. return uni.createMapContext(this.mapId, this);
  224. },
  225. moveToLocation() {
  226. const mapContext = this.getMapContext();
  227. if (mapContext != null) {
  228. mapContext.moveToLocation({});
  229. }
  230. },
  231. mapReset() {
  232. this.moveToLocation();
  233. },
  234. navigation() {
  235. const appBaseInfo = uni.getAppBaseInfo();
  236. // #ifdef APP-ANDROID
  237. const src = appBaseInfo.packageName;
  238. // #endif
  239. // #ifdef APP-IOS
  240. const src = appBaseInfo.bundleId;
  241. // #endif
  242. // #ifdef WEB
  243. const src = 'webapp.baidu.openAPIdemo';
  244. // #endif
  245. // #ifdef APP-HARMONY
  246. const src = appBaseInfo.packageName;
  247. // #endif
  248. const list = ["腾讯地图", "高德地图", "百度地图"] as Array<string>;
  249. // #ifdef APP-IOS
  250. list.push("苹果地图");
  251. // #endif
  252. // #ifdef APP-HARMONY
  253. // TODO: 华为地图有问题,暂不支持
  254. // list.push("华为地图");
  255. // #endif
  256. uni.showActionSheet({
  257. itemList: list,
  258. success: (res) => {
  259. let index = res.tapIndex;
  260. if (index >= 0) {
  261. let item = list[index] as string;
  262. try {
  263. let url = "";
  264. if (item == "腾讯地图") {
  265. // #ifdef APP
  266. url = `qqmap://map/routeplan?type=drive&from=我的位置&fromcoord=CurrentLocation&to=${this.openLocationOptions.name}&tocoord=${this.openLocationOptions.latitude},${this.openLocationOptions.longitude}&referer=1`;
  267. // #endif
  268. // #ifdef WEB
  269. url = `https://apis.map.qq.com/uri/v1/marker?marker=coord:${this.openLocationOptions.latitude},${this.openLocationOptions.longitude};title:${this.openLocationOptions.name};addr:${this.openLocationOptions.address}&referer=1`;
  270. // #endif
  271. } else if (item == "高德地图") {
  272. // #ifdef APP-ANDROID
  273. url = `androidamap://route/plan/?sourceApplication=${src}&slat=&slon=&sname=我的位置&dlat=${this.openLocationOptions.latitude}&dlon=${this.openLocationOptions.longitude}&dname=${this.openLocationOptions.name}&dev=0&t=0`;
  274. // #endif
  275. // #ifdef APP-IOS
  276. url = `iosamap://path?sourceApplication=${src}&slat=&slon=&sname=我的位置&dlat=${this.openLocationOptions.latitude}&dlon=${this.openLocationOptions.longitude}&dname=${this.openLocationOptions.name}&dev=0&t=0`;
  277. // #endif
  278. // #ifdef WEB
  279. url = `https://uri.amap.com/navigation?to=${this.openLocationOptions.longitude},${this.openLocationOptions.latitude},${this.openLocationOptions.name},${this.openLocationOptions.address}&mode=car&policy=0&src=mypage&coordinate=gaode&callnative=1`;
  280. // #endif
  281. // #ifdef APP-HARMONY
  282. url = `amapuri://route/plan?dlat=${this.openLocationOptions.latitude}&dlon=${this.openLocationOptions.longitude}&dname=${this.openLocationOptions.name}&sname=我的位置&t=0&sourceApplication=${src}`;
  283. // #endif
  284. } else if (item == "百度地图") {
  285. // #ifdef APP
  286. url = `baidumap://map/direction?origin=我的位置&destination=latlng:${this.openLocationOptions.latitude},${this.openLocationOptions.longitude}|name:${this.openLocationOptions.name}&coord_type=gcj02&mode=driving&src=${src}`;
  287. // #endif
  288. // #ifdef WEB
  289. url = `https://api.map.baidu.com/marker?coord_type=gcj02&location=${this.openLocationOptions.latitude},${this.openLocationOptions.longitude}&title=${this.openLocationOptions.name}&content=${this.openLocationOptions.address}&output=html&src=${src}`;
  290. // #endif
  291. } else if (item == "苹果地图") {
  292. // #ifdef APP-IOS
  293. url = `maps://?ll=${this.openLocationOptions.latitude},${this.openLocationOptions.longitude}&q=${this.openLocationOptions.name}`;
  294. // #endif
  295. } else if (item == "华为地图") {
  296. // #ifdef APP-HARMONY
  297. url = `petalmaps://route?saddr=我的位置&daddr=${this.openLocationOptions.latitude},${this.openLocationOptions.longitude}&type=drive&utm_source=${src}`;
  298. // #endif
  299. }
  300. if (url != "") {
  301. // #ifdef APP-HARMONY
  302. try {
  303. openSchema(url);
  304. } catch(err){
  305. uni.showToast({
  306. title: `打开失败${err.message}`,
  307. icon: "none"
  308. });
  309. }
  310. // #endif
  311. // #ifdef APP-ANDROID || APP-IOS
  312. let schemaPrefix = "";
  313. const schemaIndex = url.indexOf('?');
  314. if (schemaIndex != -1) {
  315. schemaPrefix = url.substring(0, schemaIndex);
  316. }
  317. if (canOpenURL(schemaPrefix)) {
  318. openSchema(url);
  319. } else {
  320. uni.showToast({
  321. title: `请先安装${item}`,
  322. icon: "none"
  323. });
  324. }
  325. // #endif
  326. // #ifdef WEB
  327. window.open(url);
  328. // #endif
  329. }
  330. } catch (err) {
  331. console.error(err);
  332. }
  333. }
  334. }
  335. });
  336. }
  337. },
  338. computed: {
  339. languageCom() : UTSJSONObject {
  340. const textInfo = languageData[this.language] != null ? languageData[this.language] as UTSJSONObject : languageData['zh-Hans'] as UTSJSONObject;
  341. return textInfo;
  342. },
  343. classCom() : string {
  344. let list = [] as Array<string>;
  345. if (this.theme == 'dark') {
  346. list.push('uni-open-location-dark');
  347. } else {
  348. list.push('uni-open-location-light');
  349. }
  350. return list.join(' ');
  351. },
  352. landscapeClassCom() : string {
  353. return this.isLandscape ? 'uni-open-location-landscape' : '';
  354. }
  355. }
  356. }
  357. </script>
  358. <style>
  359. @font-face {
  360. font-family: UniOpenLocationFontFamily;
  361. src: url('data:font/ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI8MUlTAAABjAAAAGBjbWFwgOWDPQAAAgQAAAHIZ2x5ZhfxkmkAAAPcAAAD3GhlYWQpzkauAAAA4AAAADZoaGVhB94DhwAAALwAAAAkaG10eBgAAAAAAAHsAAAAGGxvY2EDjAKGAAADzAAAAA5tYXhwARQAfwAAARgAAAAgbmFtZYQALlwAAAe4AAADM3Bvc3Rnid8OAAAK7AAAAGgAAQAAA4D/gABcBAAAAAAABAAAAQAAAAAAAAAAAAAAAAAAAAYAAQAAAAEAAP9wa2RfDzz1AAsEAAAAAADjV4FYAAAAAONXgVgAAP+ABAADgQAAAAgAAgAAAAAAAAABAAAABgBzAAQAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEA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BvAG0AAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgECAQMBBAEFAQYBBwAGZGFjaGUxE2FuZ2xlLWxlZnQtY2lyY2xlLXMHZGFvaGFuZwdkaW5nd2VpC2RpdHUtdHVkaW5nAAA=') format('truetype');
  362. }
  363. .uni-open-location-icons {
  364. font-family: "UniOpenLocationFontFamily";
  365. font-size: 16px;
  366. font-style: normal;
  367. }
  368. .uni-open-location {
  369. position: relative;
  370. left: 0;
  371. top: 0;
  372. width: 100%;
  373. height: 100%;
  374. background: #f8f8f8;
  375. z-index: 999;
  376. display: flex;
  377. flex-direction: column;
  378. }
  379. .uni-open-location .uni-open-location-map-box {
  380. width: 100%;
  381. flex: 1;
  382. }
  383. .uni-open-location .uni-open-location-map {
  384. width: 100%;
  385. height: 100%;
  386. }
  387. .uni-open-location .uni-open-location-map-reset {
  388. position: absolute;
  389. left: 20px;
  390. bottom: 40px;
  391. width: 40px;
  392. height: 40px;
  393. box-sizing: border-box;
  394. background-color: #fff;
  395. border-radius: 20px;
  396. pointer-events: auto;
  397. box-shadow: 0px 0px 20px 2px rgba(0, 0, 0, .3);
  398. z-index: 9;
  399. display: flex;
  400. justify-content: center;
  401. align-items: center;
  402. }
  403. .uni-open-location .uni-open-location-map-reset .uni-open-location-map-reset-icon {
  404. font-size: 26px;
  405. text-align: center;
  406. line-height: 40px;
  407. }
  408. .uni-open-location .uni-open-location-nav {
  409. position: absolute;
  410. top: 0;
  411. left: 0;
  412. width: 100%;
  413. height: 60px;
  414. background-color: rgba(0, 0, 0, 0);
  415. background-image: linear-gradient(to bottom, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));
  416. }
  417. .uni-open-location .uni-open-location-nav .uni-open-location-nav-btn {
  418. position: absolute;
  419. top: 5px;
  420. left: 5px;
  421. width: 44px;
  422. height: 44px;
  423. display: flex;
  424. justify-content: center;
  425. align-items: center;
  426. }
  427. .uni-open-location .uni-open-location-nav .uni-open-location-nav-btn.uni-open-location-nav-back-btn .uni-open-location-nav-back-text {
  428. color: #fff;
  429. font-size: 26px;
  430. }
  431. .uni-open-location .uni-open-location-footer {
  432. height: 150px;
  433. border-radius: 10px 10px 0px 0px;
  434. overflow: hidden;
  435. background-color: #fff;
  436. display: flex;
  437. flex-direction: row;
  438. align-items: center;
  439. justify-content: space-between;
  440. padding: 0px 20px;
  441. }
  442. .uni-open-location .uni-open-location-footer .uni-open-location-address {
  443. display: flex;
  444. flex-direction: column;
  445. flex: 1;
  446. }
  447. .uni-open-location .uni-open-location-footer .uni-open-location-name-text {
  448. font-size: 18px;
  449. font-weight: bold;
  450. overflow: hidden;
  451. text-overflow: ellipsis;
  452. white-space: nowrap;
  453. }
  454. .uni-open-location .uni-open-location-footer .uni-open-location-address-text {
  455. font-size: 16px;
  456. margin-top: 10px;
  457. overflow: hidden;
  458. text-overflow: ellipsis;
  459. white-space: nowrap;
  460. }
  461. .uni-open-location .uni-open-location-footer-icon-btns {
  462. width: 100px;
  463. display: flex;
  464. flex-direction: row;
  465. justify-content: flex-end;
  466. }
  467. .uni-open-location .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item {
  468. display: flex;
  469. flex-direction: column;
  470. align-items: center;
  471. }
  472. .uni-open-location .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item .uni-open-location-footer-icon-box {
  473. background-color: #f8f8f8;
  474. width: 40px;
  475. height: 40px;
  476. border-radius: 6px;
  477. display: flex;
  478. justify-content: center;
  479. align-items: center;
  480. margin-bottom: 6px;
  481. }
  482. .uni-open-location .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item .uni-open-location-footer-icon-box .uni-open-location-icons {
  483. color: #007aff;
  484. font-size: 24px;
  485. }
  486. .uni-open-location .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item .uni-open-location-footer-btn-text {
  487. font-size: 12px;
  488. text-align: center;
  489. }
  490. .uni-open-location .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item:active {
  491. opacity: 0.6;
  492. }
  493. .uni-open-location.uni-open-location-dark .uni-open-location-map-reset {
  494. background-color: #111111;
  495. }
  496. .uni-open-location.uni-open-location-dark .uni-open-location-map-reset .uni-open-location-map-reset-icon {
  497. color: #d1d1d1;
  498. }
  499. .uni-open-location.uni-open-location-dark .uni-open-location-footer {
  500. background-color: #181818;
  501. }
  502. .uni-open-location.uni-open-location-dark .uni-open-location-footer .uni-open-location-name-text {
  503. color: #fafafa;
  504. }
  505. .uni-open-location.uni-open-location-dark .uni-open-location-footer .uni-open-location-address-text {
  506. color: #fafafa;
  507. }
  508. .uni-open-location.uni-open-location-dark .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item .uni-open-location-footer-icon-box {
  509. background-color: #393939;
  510. }
  511. .uni-open-location.uni-open-location-dark .uni-open-location-footer-icon-btns .uni-open-location-footer-icon-btns-item .uni-open-location-footer-btn-text {
  512. color: #909090;
  513. }
  514. </style>