mapCard.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="container-view-car" @tap="navCarLocation">
  3. <!-- #ifdef APP -->
  4. <view style="width:300rpx;height: 258rpx;" class="map">
  5. <googleMap keyId="1" width='300rpx' height='258rpx' v-if="latitude" :mapData="{type:3}" :myLocation='{
  6. longitude,
  7. latitude
  8. }'></googleMap>
  9. </view>
  10. <!-- #endif -->
  11. <!-- #ifndef APP -->
  12. <map class="map" :longitude="longitude"
  13. :latitude="latitude" scale="16" show-location style="width:300rpx;height: 258rpx;" :markers="carLocation">
  14. <view class="top-car-location flex-row">
  15. <img style="width: 36rpx;height: 36rpx;" src="https://qiniu.bms16.com/FrKY7Ex5za22plr39ddIsJcjFVpi" alt="">
  16. <text>车辆位置</text>
  17. </view>
  18. </map>
  19. <!-- #endif -->
  20. <view class="car-address">{{carAddress}}</view>
  21. </view>
  22. </template>
  23. <script>
  24. import googleMap from "@/component/googleMap/googleMap";
  25. // component/nomore/nomore.js
  26. export default {
  27. components: {
  28. googleMap,
  29. },
  30. data() {
  31. return {};
  32. },
  33. /**
  34. * 组件的属性列表
  35. */
  36. props: {
  37. longitude: {
  38. type: String,
  39. default: ''
  40. },
  41. latitude: {
  42. type: String,
  43. default: ''
  44. },
  45. carAddress: {
  46. type: String,
  47. default: ''
  48. },
  49. carLocation:{
  50. type:Array,
  51. default:[]
  52. }
  53. },
  54. /**
  55. * 组件的方法列表
  56. */
  57. methods: {
  58. navCarLocation(){
  59. const me=this
  60. uni.navigateTo({
  61. url: '/pages/carLocation/carLocation?longitude=' + me.longitude +'&latitude=' + me.latitude,
  62. success: function(res) {},
  63. fail: function(res) {},
  64. complete: function(res) {}
  65. });
  66. }
  67. }
  68. };
  69. </script>
  70. <style scoped>
  71. .container-view-car{
  72. background-color: #FFF;
  73. border-radius: 40rpx;
  74. width: 100%;
  75. padding: 8rpx;
  76. }
  77. .map{
  78. border-top-left-radius: 40rpx;
  79. border-top-right-radius: 40rpx;
  80. overflow: hidden;
  81. }
  82. .top-car-location{
  83. margin: 15rpx 0 0 15rpx;
  84. align-items: center;
  85. font-weight: 600;
  86. font-size: 28rpx;
  87. color: #060809;
  88. }
  89. .car-address{
  90. font-weight: 400;
  91. font-size: 28rpx;
  92. color: #060809;
  93. height: 80rpx;
  94. line-height: 80rpx;
  95. text-align: center;
  96. width: 300rpx;
  97. white-space: nowrap;
  98. overflow: hidden;
  99. text-overflow: ellipsis;
  100. background-color: #F4F5F6;
  101. border-bottom-left-radius: 40rpx;
  102. border-bottom-right-radius: 40rpx;
  103. margin-top: 8rpx;
  104. }
  105. </style>