localtion.nvue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <map class="map" @markertap="markertap" :latitude="dataList.latitude" :longitude="dataList.longitude"
  5. :markers="covers">
  6. </map>
  7. </view>
  8. <view class="bottom">
  9. <text class="title">{{dataList.title}}</text>
  10. <text class="bottom-content">{{dataList.content}}</text>
  11. <view class="bottom-list-item">
  12. <view class='bottom-list-item'>
  13. <img class='right-img' src="/static/img/dizhi.png" alt="">
  14. <text class="bottom-list-item-left">{{dataList.localtion}}</text>
  15. </view>
  16. <text class="metre">{{dataList.metre}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. dataList: {
  26. tilte:'',
  27. content:'',
  28. localtion:'',
  29. metre:""
  30. },
  31. title: 'map',
  32. covers: []
  33. }
  34. },
  35. onLoad() {
  36. },
  37. onShow() {
  38. var data=uni.getStorageSync('location')
  39. this.dataList.title=data.title
  40. this.dataList.content=data.companyProfile
  41. this.dataList.localtion=data.province+data.city+data.area
  42. this.dataList.latitude = data.latitude
  43. this.dataList.longitude =data.longitude
  44. this.dataList.metre=data._metre
  45. console.log("data",data)
  46. let newmarker =[];
  47. var id=1;
  48. let maker= {
  49. id: id++,
  50. latitude: data.latitude,
  51. longitude:data.longitude,
  52. iconPath: '../../../static/img/weizhi@2x.png',
  53. }
  54. newmarker.push(maker)
  55. this.covers = newmarker
  56. },
  57. methods: {
  58. }
  59. }
  60. </script>
  61. <style scoped>
  62. .content {
  63. width: 750px;
  64. flex: 1;
  65. }
  66. .title {
  67. font-size: 28rpx;
  68. color: #333333;
  69. padding:0 20rpx;
  70. }
  71. .bottom-content {
  72. font-size: 22rpx;
  73. font-weight: 400;
  74. color: #333333;
  75. padding: 20rpx;
  76. }
  77. .map {
  78. height: 2000rpx;
  79. }
  80. .bottom{
  81. position: fixed;
  82. bottom: 40px;
  83. width: 700rpx;
  84. left:25rpx;
  85. height: 180rpx;
  86. flex: 1;
  87. background: white;
  88. border-radius: 20rpx;
  89. padding: 20rpx 0;
  90. }
  91. .bottom-list-item{
  92. flex-direction: row;
  93. justify-content: space-between;
  94. padding:0 20rpx;
  95. }
  96. .bottom-list-item-left{
  97. font-size: 24rpx;
  98. }
  99. .right-img {
  100. width: 21rpx;
  101. height: 26rpx;
  102. margin-left:-20rpx;
  103. margin-right:10rpx;
  104. }
  105. .metre{
  106. font-size: 24rpx;
  107. }
  108. </style>