nearbyDetails.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view>
  3. <!--pages/nearbyDetails/nearbyDetails.wxml-->
  4. <map id="myMap" class="map" :latitude="lat" :longitude="lng" :markers="markers" show-location></map>
  5. <view class="pdlr20">
  6. <view class="bgfff li r10">
  7. <view class="dflex cont">
  8. <view class="title flex">
  9. <view style="font-weight: bold;font-size:32rpx" class="mb20">{{title}}</view>
  10. <!-- <text style="font-size:24rpx">{{account}}</text> -->
  11. </view>
  12. <view class="yue dflex">
  13. <image src="/static/pages/images/nearby_icon.png" class="mr20" @tap="goNavigation"></image>
  14. <image src="/static/pages/images/nearby_icon1.png" @tap="makePhoneCall"></image>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="bgfff li r10 ">
  19. <view class="dflex dizhi">
  20. <image src="/static/pages/images/position_icon.png"></image>
  21. 店铺地址:
  22. <text>{{address}}</text>
  23. </view>
  24. <view class="phone dflex" @tap="makePhoneCall">
  25. <image src="/static/pages/images/phone.png"></image>
  26. 联系电话:
  27. <text>{{phone}}</text>
  28. </view>
  29. </view>
  30. <view class="bgfff li r10 ">
  31. <view class="dflex time">
  32. <image src="/static/pages/images/nearbytime.png"></image>
  33. 营业时间:
  34. <text>{{businessTime}}</text>
  35. </view>
  36. <!-- <view class="distribution dflex">
  37. <image src="/pages/images/distribution.png"></image>
  38. 配送服务:
  39. <text>由蜂鸟提供配送服务</text>
  40. </view> -->
  41. </view>
  42. <!-- <view class="bgfff li r10 dflex qualifications">
  43. <view class="dflex foot">
  44. <image src="/pages/images/zizi.png"></image>
  45. 查看运营资质
  46. </view>
  47. <view class="right">
  48. <image src="/pages/images/rico.png"></image>
  49. </view>
  50. </view> -->
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. // pages/nearbyDetails/nearbyDetails.js
  56. const req = require("../../utils/request.js");
  57. var QQMapWX = require("../../utils/qqmap.js");
  58. export default {
  59. data() {
  60. return {};
  61. },
  62. components: {},
  63. props: {},
  64. /**
  65. * 生命周期函数--监听页面加载
  66. */
  67. onLoad: function (options) {
  68. // console.log(options);
  69. this.id = options.id;
  70. },
  71. /**
  72. * 生命周期函数--监听页面显示
  73. */
  74. onShow: function () {
  75. this.getnearbyDetails();
  76. },
  77. methods: {
  78. getnearbyDetails() {
  79. // console.log(this.id);
  80. req.getRequest('/api/merchant/detail', {
  81. id: this.id
  82. }, data => {
  83. this.setData(data);
  84. let markers = {
  85. latitude: data.lat,
  86. longitude: data.lng,
  87. iconPath: "/static/pages/images/location.png"
  88. };
  89. this.setData({
  90. 'markers[0].latitude': data.lat,
  91. 'markers[0].longitude': data.lng,
  92. 'markers[0].iconPath': "/static/pages/images/location.png"
  93. });
  94. });
  95. // console.log(this);
  96. },
  97. makePhoneCall() {
  98. uni.makePhoneCall({
  99. phoneNumber: this.phone
  100. });
  101. },
  102. // 导航
  103. goNavigation() {
  104. let plugin = requirePlugin('routePlan');
  105. let key = req.public.mapLBSKEY; //使用在腾讯位置服务申请的key
  106. let referer = req.getStorage('appName'); //调用插件的app的名称
  107. let endPoint = JSON.stringify({
  108. //终点
  109. 'name': this.title,
  110. 'latitude': this.lat,
  111. 'longitude': this.lng
  112. });
  113. uni.navigateTo({
  114. url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
  115. });
  116. }
  117. }
  118. };
  119. </script>
  120. <style>
  121. @import "./nearbyDetails.css";
  122. </style>