userdt.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="map_container">
  3. <!--定义页面结构,可以使用地图组件也能使用其他组件 -->
  4. </view>
  5. <!-- <view>
  6. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  7. <block slot="backText">返回</block>
  8. <block slot="content">位置</block>
  9. </cu-custom>
  10. <view class="page-body">
  11. <view class="page-section page-section-gap">
  12. <map style="width: 100%; height: 800px;" latitude="38.55">
  13. </map>
  14. </view>
  15. </view>
  16. </view> -->
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. id: 0, // 使用 marker点击事件 需要填写id
  23. title: 'map',
  24. /* latitude: null,
  25. longitude: null, */
  26. amapPlugin:null
  27. }
  28. },
  29. created() {
  30. var amapFile = require('../../components/amap/amap-wx.js')
  31. var that = this;
  32. var myAmapFun = new amapFile.AMapWX({key:'d8ed2499a2fb9634f843f1e500a24726'});
  33. myAmapFun.getPoiAround({
  34. success: function(data){
  35. //成功回调
  36. },
  37. fail: function(info){
  38. //失败回调
  39. console.log(info)
  40. }
  41. })
  42. /* uni.getLocation({
  43. type: 'wgs84',
  44. success: function (res) {
  45. alert(res)
  46. console.log('当前位置的经度:' + res.longitude);
  47. console.log('当前位置的纬度:' + res.latitude);
  48. }
  49. });
  50. uni.chooseLocation({
  51. success: function (res) {
  52. console.log('位置名称:' + res.name);
  53. console.log('详细地址:' + res.address);
  54. console.log('纬度:' + res.latitude);
  55. console.log('经度:' + res.longitude);
  56. this.latitude=res.latitude;
  57. this.longitude=res.longitude;
  58. }
  59. }); */
  60. /* uni.getLocation({
  61. type: 'wgs84',
  62. success: function (res) {
  63. this.latitude=res.latitude;
  64. this.longitude=res.longitude;
  65. console.log('当前位置的经度:' + res.longitude);
  66. console.log('当前位置的纬度:' + res.latitude);
  67. }
  68. });
  69. */
  70. },
  71. methods: {
  72. }
  73. }
  74. </script>
  75. <style>
  76. .map_container{
  77. position: absolute;
  78. top: 0;
  79. bottom: 0;
  80. left: 0;
  81. right: 0;
  82. }
  83. </style>