map.uvue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 { onLoad } from '@dcloudio/uni-app'
  40. import { navigateToMobile } from '@/utils/api/tool.uts'
  41. const addressText = ref<string>('暂无地址信息')
  42. const latitudeText = ref<string>('0')
  43. const longitudeText = ref<string>('0')
  44. const phoneText = ref<string>('')
  45. const callContact = () : void => {
  46. if (phoneText.value.length == 0) {
  47. uni.showToast({ title: '暂无联系电话', icon: 'none' })
  48. return
  49. }
  50. navigateToMobile(phoneText.value)
  51. }
  52. onLoad((option : UTSJSONObject) => {
  53. addressText.value = (option['address'] as string | null) ?? '暂无地址信息'
  54. latitudeText.value = (option['latitude'] as string | null) ?? '0'
  55. longitudeText.value = (option['longitude'] as string | null) ?? '0'
  56. phoneText.value = (option['phone'] as string | null) ?? ''
  57. })
  58. </script>
  59. <style>
  60. .page-scroll {
  61. flex: 1;
  62. }
  63. .page {
  64. min-height: 1000rpx;
  65. padding: 24rpx;
  66. box-sizing: border-box;
  67. background-color: #edf1ea;
  68. flex-direction: column;
  69. }
  70. .hero-card {
  71. padding: 28rpx;
  72. border-radius: 24rpx;
  73. background-color: #cfe7c7;
  74. flex-direction: column;
  75. }
  76. .hero-title {
  77. font-size: 36rpx;
  78. font-weight: 700;
  79. color: #233121;
  80. }
  81. .hero-desc {
  82. margin-top: 10rpx;
  83. font-size: 24rpx;
  84. color: #4a5b48;
  85. }
  86. .summary-strip {
  87. margin-top: 18rpx;
  88. flex-direction: row;
  89. justify-content: space-between;
  90. }
  91. .summary-pill {
  92. width: 48%;
  93. padding: 20rpx;
  94. border-radius: 20rpx;
  95. background-color: #ffffff;
  96. flex-direction: column;
  97. }
  98. .summary-pill-label {
  99. font-size: 22rpx;
  100. color: #7c887a;
  101. }
  102. .summary-pill-value {
  103. margin-top: 8rpx;
  104. font-size: 28rpx;
  105. font-weight: 700;
  106. color: #233121;
  107. }
  108. .info-card {
  109. margin-top: 18rpx;
  110. padding: 24rpx;
  111. border-radius: 20rpx;
  112. background-color: #ffffff;
  113. flex-direction: column;
  114. }
  115. .info-label {
  116. font-size: 26rpx;
  117. color: #7c887a;
  118. }
  119. .info-value {
  120. margin-top: 12rpx;
  121. font-size: 28rpx;
  122. line-height: 40rpx;
  123. color: #233121;
  124. }
  125. .action-button {
  126. margin-top: 24rpx;
  127. height: 92rpx;
  128. border-radius: 24rpx;
  129. background-color: #233121;
  130. flex-direction: row;
  131. justify-content: center;
  132. align-items: center;
  133. }
  134. .action-button-text {
  135. font-size: 30rpx;
  136. font-weight: 700;
  137. color: #ffffff;
  138. }
  139. </style>