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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * @Author: gaorf30153 gaorf30153@hundsun.com
  3. * @Date: 2024-07-30 16:13:41
  4. * @LastEditors: gaorf30153 gaorf30153@hundsun.com
  5. * @LastEditTime: 2024-08-08 18:25:13
  6. * @FilePath: \wxminipro\plugin\pages\signing\map\map.js
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. // plugin/pages/signing/map/map.js
  10. Page({
  11. /**
  12. * 页面的初始数据
  13. */
  14. data: {
  15. longitude: 0,
  16. latitude: 0,
  17. current: {},
  18. scale: 18,
  19. markersList: [],
  20. },
  21. /**
  22. * 生命周期函数--监听页面加载
  23. */
  24. onLoad(options) {
  25. let netWork = JSON.parse(options.params)
  26. this.data.markersList[0] = {
  27. longitude: netWork.longitude,
  28. latitude: netWork.latitude,
  29. title: netWork.branchName,
  30. }
  31. this.setData({
  32. current: netWork,
  33. longitude: netWork.longitude,
  34. latitude: netWork.latitude,
  35. markersList: this.data.markersList,
  36. })
  37. },
  38. goMap() {
  39. let mapObj = wx.createMapContext("map")
  40. mapObj.openMapApp({
  41. longitude: this.data.longitude,
  42. latitude: this.data.latitude,
  43. destination: this.data.current.branchAddress,
  44. })
  45. },
  46. })