siteDetails.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="">
  3. <uni-popup ref="siteDetailsPopupRef" type="bottom">
  4. <view class="details-box">
  5. <scroll-view :style="{'height':scrollH +'px' }" scroll-y="true" :show-scrollbar="false">
  6. <template v-if="info">
  7. <view class="site-name">{{info.locationName}}</view>
  8. <view class="site-location">
  9. {{`${info.provinceName}${info.cityName}${info.areaName}${info.address}`}}
  10. </view>
  11. <view class="site-distance">距离{{getDistance(info.distance)}}</view>
  12. <view class="site-time">
  13. <text class="time-lable">办公时间</text>
  14. <text class="site-time-val">{{info.workTimeRemark}}</text>
  15. </view>
  16. </template>
  17. </scroll-view>
  18. <view class="details-btn">
  19. <view class="site-btn" @click.stop="getPhoneCall(info.mapContactList)">
  20. <svg t="1733972888261" class="icon" viewBox="0 0 1024 1024" version="1.1"
  21. xmlns="http://www.w3.org/2000/svg" p-id="4331" xmlns:xlink="http://www.w3.org/1999/xlink">
  22. <path
  23. d="M575.7 647.1l69.4-69.2 13.3 2.3c1.7 0.3 4.9 0.9 9.4 1.7 7.4 1.3 15.7 2.9 24.6 4.5 25.5 4.8 50.9 9.8 74.8 14.9 17.3 3.7 33.1 7.3 47 10.7 27.6 6.8 47.3 12.9 59.1 18.6 43 20.8 60 65.5 53.4 122-9.7 81.3-97 174.3-204.4 175.4-121 1.2-291.4-87.7-411.9-214.7C165.3 560.4 81.8 406.9 98 278.3c8.5-67.1 40.2-115.9 87.8-147.2 32.4-21.3 69.4-32.5 97.9-34.6 38.2-2.8 69.6 9.6 92.5 38 9.7 12 19.7 36.1 32.2 73.3 3.6 10.9 7.4 22.8 11.3 35.4 7 23 14.1 47.6 20.9 72.2 2.4 8.6 4.5 16.6 6.4 23.7 1.1 4.3 2 7.4 2.4 9.1l3.7 14.2-80.4 81.8c44.5 89 122.6 169.8 203 202.9z m13.5 60l-15.3-5.1c-105.4-35.6-205.4-139.4-256.3-252.3l-7.3-16.2 85-86.4c-1.5-5.6-3.1-11.6-4.9-17.9-6.6-24.1-13.5-48.2-20.4-70.7-3.8-12.3-7.4-23.7-10.9-34.2-10.2-30.5-19.1-52-23.3-57.2-11.8-14.6-26.4-20.4-48.2-18.8-20.2 1.5-48.7 10.1-73.1 26.2-35.2 23.2-58.3 58.6-64.8 110.3-13.8 108.7 63.1 250.2 198.4 392.7C459.5 794.9 617 877 721.8 876c79.2-0.8 146.4-72.5 153.2-129.4 4.3-36.6-4.3-59.4-24.4-69.1-7.5-3.6-24.7-8.9-48.9-14.9-13.4-3.3-28.6-6.8-45.4-10.4-23.3-5-48.4-10-73.5-14.7-7.2-1.3-13.9-2.6-20.1-3.7l-73.5 73.3z"
  24. p-id="4332">
  25. </path>
  26. </svg>
  27. <text class="site-text">立即联系</text>
  28. </view>
  29. <view class="site-btn" @click.stop="openLocation(info)">
  30. <svg t="1733972953937" class="icon" viewBox="0 0 1024 1024" version="1.1"
  31. xmlns="http://www.w3.org/2000/svg" p-id="8440" xmlns:xlink="http://www.w3.org/1999/xlink">
  32. <path
  33. d="M894.185422 128.023792 129.814578 445.743994 445.99982 577.744353 571.860343 893.929596Z"
  34. p-id="8441"></path>
  35. </svg>
  36. <text class="site-text">一键导航</text>
  37. </view>
  38. </view>
  39. </view>
  40. </uni-popup>
  41. <telList ref="telListRef" />
  42. </view>
  43. </template>
  44. <script>
  45. // import { EventBus } from "@/utils/vueBus.js"
  46. import { openMap } from "@/utils/openApp.js"
  47. import { distanceCalculate } from "@/utils/tool.js";
  48. import telList from "./telList.vue"
  49. export default {
  50. data() {
  51. return {
  52. scrollH: 0,
  53. info: null,
  54. }
  55. },
  56. components: { telList },
  57. created() {
  58. const windowHeight = uni.getSystemInfoSync().windowHeight;
  59. this.scrollH = windowHeight * 0.7 - uni.upx2px(150)
  60. },
  61. mounted() {
  62. // EventBus.$on('TianDiTuSite', (res) => {
  63. // const { longitude, latitude } = res;
  64. // this.openDetails(res);
  65. // });
  66. },
  67. beforeDestroy() {
  68. // EventBus.$off('someEvent'); // 确保在组件销毁前移除事件监听
  69. },
  70. methods: {
  71. getDistance(num) {
  72. return distanceCalculate(num)
  73. },
  74. getPhoneCall(tel) {
  75. this.$refs.telListRef.open({ tel })
  76. },
  77. openLocation(info) {
  78. const { areaCode, cityCode, provinceCode, provinceName, cityName, areaName, address } = info
  79. const name = `${provinceName}${cityName}${areaName}${address}`;
  80. const code = areaCode || cityCode || provinceCode
  81. openMap({ name, code: code, type: "baidu" })
  82. },
  83. openDetails(res) {
  84. this.info = res;
  85. this.$refs.siteDetailsPopupRef.open()
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .uni-popup {
  92. z-index: 1002;
  93. .details-box {
  94. height: 70vh;
  95. padding: 0 30rpx;
  96. background-color: #fff;
  97. border-radius: 20rpx 20rpx 0 0;
  98. .site-name {
  99. font-size: 36rpx;
  100. padding-top: 30rpx;
  101. padding-bottom: 15rpx;
  102. }
  103. .site-location,
  104. .site-distance {
  105. padding-top: 10rpx;
  106. // color: #8e8c8c;
  107. font-size: 28rpx;
  108. }
  109. .site-distance {
  110. color: #7D7D7D;
  111. }
  112. .site-time {
  113. margin-top: 15rpx;
  114. background-color: #fff;
  115. border-top: 1rpx solid #F0F0F0;
  116. padding: 15rpx 0;
  117. display: flex;
  118. justify-content: space-between;
  119. font-size: 28rpx;
  120. text {
  121. flex-shrink: 0;
  122. }
  123. .time-lable {
  124. color: #7D7D7D;
  125. }
  126. .site-time-val {
  127. width: 1rpx;
  128. flex: 1;
  129. padding-left: 30rpx;
  130. // text-align: right;
  131. }
  132. }
  133. .details-btn {
  134. width: 100%;
  135. height: 150rpx;
  136. padding-top: 30rpx;
  137. display: flex;
  138. justify-content: center;
  139. align-items: center;
  140. .site-btn {
  141. width: 260rpx;
  142. height: 80rpx;
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. color: #fff;
  147. border-radius: 10rpx;
  148. background-color: #3291F8;
  149. &+.site-btn {
  150. margin-left: 50rpx;
  151. }
  152. .icon {
  153. width: 50rpx;
  154. height: 50rpx;
  155. path {
  156. fill: #fff;
  157. }
  158. }
  159. .site-text {
  160. font-size: 30rpx;
  161. padding-left: 20rpx;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. </style>