景徳镇旅游微信小程序
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.

112 lines
2.4 KiB

9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <!-- <map
  4. style="width: 100%;height: 700rpx"
  5. :layer-style='5'
  6. :show-location='true'
  7. :latitude="latitude"
  8. :longitude="longitude"
  9. :markers="markers"
  10. :scale="scale"
  11. @markertap="markertap"
  12. @callouttap='callouttap'>
  13. </map> -->
  14. <locations
  15. :spotGuide="spotGuide"
  16. :spotGuideMarkers="spotGuideMarkers"
  17. />
  18. <tabber select="1"/>
  19. </view>
  20. </template>
  21. <script>
  22. import position from '@/utils/position.js'
  23. import locations from '@/components/tourGuide/locations.vue'
  24. import { mapState, mapGetters } from 'vuex'
  25. export default {
  26. components : {
  27. locations,
  28. },
  29. data() {
  30. return {
  31. // latitude: 23.106574, //纬度
  32. // longitude: 113.324587, //经度
  33. // scale: 12, //缩放级别
  34. // bottomData: false,
  35. // mapCtx: null,
  36. markers:[
  37. // { //标记点A 的信息
  38. // iconPath: "/static/logo.png", //图标
  39. // id: 0,
  40. // width: 20, //图标icon 宽度
  41. // height: 28 ,//图标icon 高度
  42. // latitude: 26.1272,
  43. // longitude: 113.11659
  44. // }
  45. ],
  46. }
  47. },
  48. onLoad() {
  49. // this.$store.commit('')
  50. },
  51. onShow(){
  52. },
  53. computed: {
  54. ...mapGetters(['spotGuide', 'spotGuideMarkers']),
  55. },
  56. onShow() {
  57. // this.mapCtx = wx.createMapContext('map');
  58. // this.mapCtx && this.mapCtx.addCustomLayer({
  59. // layerId: '66c5a2ad2849',
  60. // success: (res) => {
  61. // console.log('success', res);
  62. // },
  63. // fail: (e) => {
  64. // console.log('fail', e);
  65. // },
  66. // });
  67. },
  68. methods: {
  69. //地图点击事件
  70. markertap(e) {
  71. console.log("===你点击了标记点===", e)
  72. this.markers.forEach(n => {
  73. if(n.id == e.detail.markerId){
  74. uni.openLocation({
  75. latitude: n.latitude,
  76. longitude: n.longitude,
  77. })
  78. }
  79. })
  80. },
  81. //地图点击事件
  82. callouttap(e) {
  83. console.log('地图点击事件', e)
  84. },
  85. random(){
  86. let list = []
  87. for(let i = 0;i < 10;i++){
  88. let a = uni.$uv.random(1, 4)
  89. let obj = {
  90. latitude: this.latitude + uni.$uv.random(1, 30) / 1000 * (uni.$uv.random(1, 3) - 2),
  91. longitude: this.longitude + uni.$uv.random(1, 30) / 1000 * (uni.$uv.random(1, 3) - 2),
  92. width: 20, //图标icon 宽度
  93. height: 28 ,//图标icon 高度
  94. iconPath: `/static/image/tourGuide/${a}.png`, //图标
  95. id: i,
  96. }
  97. list.push(obj)
  98. }
  99. this.markers = list
  100. },
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .page{
  106. }
  107. </style>