学员端小程序
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.

78 lines
1.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="card">
  3. <view class="flex-b" @click="openMap">
  4. <view class="left_text">
  5. <view class="adr ">江西省江西市江西区某某镇尚坤丁兰国际1190号820</view>
  6. <view class="distance">距您100km</view>
  7. </view>
  8. <view class="mapEntry">
  9. <view class="icon">
  10. <image src="@/static/images/index/mapIcon.png" mode=""></image>
  11. </view>
  12. <view class="text">地图导航</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. methods: {
  20. openMap() {
  21. uni.getLocation({
  22. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  23. success: function (res) {
  24. const latitude = res.latitude;
  25. const longitude = res.longitude;
  26. uni.openLocation({
  27. latitude: latitude,
  28. longitude: longitude,
  29. success: function () {
  30. console.log('success');
  31. }
  32. });
  33. }
  34. });
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .card {
  41. padding: 24rpx;
  42. .flex-b {
  43. align-items: center;
  44. .left_text {
  45. flex: 1;
  46. .adr {
  47. font-size: 28rpx;
  48. color: #333333;
  49. font-weight: 500;
  50. }
  51. .distance {
  52. margin-top: 24rpx;
  53. color: #686B73;
  54. font-size: 24rpx;
  55. }
  56. }
  57. .mapEntry {
  58. width: 130rpx;
  59. display: flex;
  60. flex-direction: column;
  61. align-items: center;
  62. .icon {
  63. width: 32rpx;
  64. height: 32rpx;
  65. }
  66. .text {
  67. font-size: 24rpx;
  68. margin-top: 10rpx;
  69. color: $themC;
  70. }
  71. }
  72. }
  73. }
  74. </style>