map.uvue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view class="page-scroll">
  4. <!-- #endif -->
  5. <view class="page">
  6. <view class="hero-card">
  7. <text class="hero-title">导航信息</text>
  8. <text class="hero-desc">当前为 uni-app x 兼容版地图信息页。</text>
  9. </view>
  10. <view class="summary-strip">
  11. <view class="summary-pill">
  12. <text class="summary-pill-label">纬度</text>
  13. <text class="summary-pill-value">{{ latitudeText }}</text>
  14. </view>
  15. <view class="summary-pill">
  16. <text class="summary-pill-label">经度</text>
  17. <text class="summary-pill-value">{{ longitudeText }}</text>
  18. </view>
  19. </view>
  20. <view class="info-card">
  21. <text class="info-label">服务地址</text>
  22. <text class="info-value">{{ addressText }}</text>
  23. </view>
  24. <view class="info-card">
  25. <text class="info-label">坐标信息</text>
  26. <text class="info-value">纬度:{{ latitudeText }}</text>
  27. <text class="info-value">经度:{{ longitudeText }}</text>
  28. </view>
  29. <view class="action-button" @click="callContact">
  30. <text class="action-button-text">联系客户</text>
  31. </view>
  32. </view>
  33. <!-- #ifdef APP -->
  34. </scroll-view>
  35. <!-- #endif -->
  36. </template>
  37. <script setup lang="uts">
  38. import { ref } from 'vue'
  39. import { navigateToMobile } from '@/utils/api/tool.uts'
  40. const addressText = ref<string>('暂无地址信息')
  41. const latitudeText = ref<string>('0')
  42. const longitudeText = ref<string>('0')
  43. const phoneText = ref<string>('')
  44. const callContact = () : void => {
  45. if (phoneText.value.length == 0) {
  46. uni.showToast({ title: '暂无联系电话', icon: 'none' })
  47. return
  48. }
  49. navigateToMobile(phoneText.value)
  50. }
  51. onLoad((option : UTSJSONObject) => {
  52. addressText.value = (option['address'] as string | null) ?? '暂无地址信息'
  53. latitudeText.value = (option['latitude'] as string | null) ?? '0'
  54. longitudeText.value = (option['longitude'] as string | null) ?? '0'
  55. phoneText.value = (option['phone'] as string | null) ?? ''
  56. })
  57. </script>
  58. <style>
  59. .page-scroll {
  60. flex: 1;
  61. }
  62. .page {
  63. min-height: 1000rpx;
  64. padding: 24rpx;
  65. box-sizing: border-box;
  66. background-color: #edf1ea;
  67. flex-direction: column;
  68. }
  69. .hero-card {
  70. padding: 28rpx;
  71. border-radius: 24rpx;
  72. background-color: #cfe7c7;
  73. flex-direction: column;
  74. }
  75. .hero-title {
  76. font-size: 36rpx;
  77. font-weight: 700;
  78. color: #233121;
  79. }
  80. .hero-desc {
  81. margin-top: 10rpx;
  82. font-size: 24rpx;
  83. color: #4a5b48;
  84. }
  85. .summary-strip {
  86. margin-top: 18rpx;
  87. flex-direction: row;
  88. justify-content: space-between;
  89. }
  90. .summary-pill {
  91. width: 48%;
  92. padding: 20rpx;
  93. border-radius: 20rpx;
  94. background-color: #ffffff;
  95. flex-direction: column;
  96. }
  97. .summary-pill-label {
  98. font-size: 22rpx;
  99. color: #7c887a;
  100. }
  101. .summary-pill-value {
  102. margin-top: 8rpx;
  103. font-size: 28rpx;
  104. font-weight: 700;
  105. color: #233121;
  106. }
  107. .info-card {
  108. margin-top: 18rpx;
  109. padding: 24rpx;
  110. border-radius: 20rpx;
  111. background-color: #ffffff;
  112. flex-direction: column;
  113. }
  114. .info-label {
  115. font-size: 26rpx;
  116. color: #7c887a;
  117. }
  118. .info-value {
  119. margin-top: 12rpx;
  120. font-size: 28rpx;
  121. line-height: 40rpx;
  122. color: #233121;
  123. }
  124. .action-button {
  125. margin-top: 24rpx;
  126. height: 92rpx;
  127. border-radius: 24rpx;
  128. background-color: #233121;
  129. flex-direction: row;
  130. justify-content: center;
  131. align-items: center;
  132. }
  133. .action-button-text {
  134. font-size: 30rpx;
  135. font-weight: 700;
  136. color: #ffffff;
  137. }
  138. </style>