洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
1.8 KiB

10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
  1. <template>
  2. <view class="box">
  3. <view class="flex-b" @click="openMap">
  4. <view class="left_text">
  5. <view class="adr ">{{ info.schoolName}}</view>
  6. <view class="distance">{{ info.address }}</view>
  7. </view>
  8. <view class="mapEntry">
  9. <image src="@/static/images/icon/daohuang.png" mode=""></image>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. props: ['info'],
  17. methods: {
  18. openMap() {
  19. console.log('怎么回事?')
  20. // uni.getLocation({
  21. // type: 'wgs84',
  22. // success: function (res) {
  23. // const latitude = res.latitude;
  24. // const longitude = res.longitude;
  25. // console.log(res)
  26. // uni.openLocation({
  27. // latitude: latitude,
  28. // longitude: longitude,
  29. // success: function () {
  30. // console.log('success');
  31. // }
  32. // });
  33. // }
  34. // });
  35. this.$store.dispatch('getCity')
  36. uni.getLocation({
  37. type: 'wgs84',
  38. success: function (res) {
  39. console.log('当前位置的经度:' + res.longitude);
  40. console.log('当前位置的纬度:' + res.latitude);
  41. },
  42. fail: function(err) {
  43. console.log(err)
  44. },
  45. complete: function(nono) {
  46. console.log('没有吗?')
  47. console.log(nono)
  48. }
  49. });
  50. // 121.045332, 31.19884
  51. uni.openLocation({
  52. latitude: 30.356038,
  53. longitude: 120.210342,
  54. success: function () {
  55. console.log('success');
  56. }
  57. });
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .box {
  64. padding: 24rpx;
  65. border-radius: 20rpx;
  66. background: #fff;
  67. .flex-b {
  68. align-items: center;
  69. .left_text {
  70. flex: 1;
  71. .adr {
  72. font-size: 28rpx;
  73. color: #333333;
  74. font-weight: 500;
  75. }
  76. .distance {
  77. margin-top: 18rpx;
  78. color: #999;
  79. font-size: 24rpx;
  80. }
  81. }
  82. .mapEntry {
  83. width: 55rpx;
  84. height: 55rpx;
  85. }
  86. }
  87. }
  88. </style>