navigation.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view>
  3. <map class="mapStyle" :markers="markers" :latitude="latitude" :longitude="longitude"></map>
  4. <view class="shopInfo">
  5. <view>
  6. <view class="shopName">{{shopName}}</view>
  7. <view class="shopAddress">
  8. <view>{{address}}</view>
  9. <view>距离{{distance}}km</view>
  10. </view>
  11. </view>
  12. <view class="toNavi" @click="toCall()">去导航</view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. latitude: '',
  21. longitude:'',
  22. markers:[{
  23. latitude:'',
  24. longitude:'',
  25. width:100,
  26. height:100,
  27. iconPath:'../../../static/dianpu.png',
  28. }],
  29. shopName:'',
  30. address:'',
  31. distance:'',
  32. phone:''
  33. };
  34. },
  35. onLoad(options) {
  36. console.log(options);
  37. this.latitude = options.latitude,
  38. this.longitude = options.longitude
  39. this.markers[0].latitude = options.latitude,
  40. this.markers[0].longitude = options.longitude
  41. this.shopName = options.shopTitle
  42. this.address = options.address
  43. this.distance = options.distance
  44. this.phone = options.phone
  45. },
  46. methods:{
  47. toCall(){
  48. let dst = new plus.maps.Point(this.longitude,this.latitude)
  49. let src = new plus.maps.Point(this.longitude,this.latitude)
  50. plus.maps.openSysMap(dst,this.shopName,src)
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="less">
  56. .mapStyle{
  57. width: 100%;
  58. height: 86vh;
  59. }
  60. .shopInfo{
  61. width: 100%;
  62. height: 14vh;
  63. position: absolute;
  64. bottom: 0;
  65. display: flex;
  66. align-items: center;
  67. justify-content: space-between;
  68. .shopName{
  69. font-size: 32rpx;
  70. font-weight: bold;
  71. margin-left: 50rpx
  72. }
  73. .shopAddress{
  74. font-size: 28rpx;
  75. font-weight: 500;
  76. margin-top: 10rpx;
  77. margin-left: 50rpx;
  78. color: #999999;
  79. }
  80. .toNavi{
  81. width: 200rpx;
  82. height: 80rpx;
  83. background: linear-gradient(0deg, #005AFF 0%, #0078FF 100%);
  84. border-radius: 40rpx;
  85. text-align: center;
  86. font-size: 30rpx;
  87. font-weight: bold;
  88. color: #FFFFFF;
  89. line-height: 80rpx;
  90. margin-right: 50rpx;
  91. }
  92. }
  93. </style>