index.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // pages/logistics/index.js
  2. const util = require('../../utils/util.js');
  3. var api = require('../../config/api.js');
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. detail: {},
  10. markers: [{
  11. iconPath: "../../static/images/zuobiao.png",
  12. id: 0,
  13. latitude: 23.099994,
  14. longitude: 113.324520,
  15. width: 30,
  16. height: 30
  17. }, {
  18. iconPath: "../../static/images/zuobiao.png",
  19. id: 1,
  20. latitude: 23.21229,
  21. longitude: 113.324520,
  22. width: 30,
  23. height: 30
  24. }],
  25. polyline: [{
  26. points: [{
  27. longitude: 113.324520,
  28. latitude: 23.099994
  29. }, {
  30. longitude: 113.104520,
  31. latitude: 23.35229
  32. },
  33. {
  34. longitude: 113.324520,
  35. latitude: 23.21229
  36. }],
  37. color: "#ED5D18",
  38. width: 4,
  39. dottedLine: false,
  40. arrowLine: true
  41. }]
  42. },
  43. regionchange(e) {
  44. console.log(e.type)
  45. },
  46. markertap(e) {
  47. console.log(e.markerId)
  48. },
  49. controltap(e) {
  50. console.log(e.controlId)
  51. },
  52. /**
  53. * 生命周期函数--监听页面加载
  54. */
  55. onLoad: function (options) {
  56. let { no, id } = options
  57. this.setData({
  58. imgServer: util.imgServer,
  59. no,
  60. id
  61. })
  62. this.getDetail()
  63. },
  64. getDetail: function () {
  65. wx.showLoading({
  66. title: '加载中'
  67. })
  68. util.request(api.LogisticsDetail, { no: this.data.no, goodsId: this.data.id }).then((res) => {
  69. if (res.errno === 0) {
  70. wx.hideLoading();
  71. this.setData({
  72. detail: res.data
  73. })
  74. }
  75. });
  76. },
  77. /**
  78. * 生命周期函数--监听页面初次渲染完成
  79. */
  80. onReady: function () {
  81. },
  82. /**
  83. * 生命周期函数--监听页面显示
  84. */
  85. onShow: function () {
  86. },
  87. /**
  88. * 生命周期函数--监听页面隐藏
  89. */
  90. onHide: function () {
  91. },
  92. /**
  93. * 生命周期函数--监听页面卸载
  94. */
  95. onUnload: function () {
  96. },
  97. /**
  98. * 页面相关事件处理函数--监听用户下拉动作
  99. */
  100. onPullDownRefresh: function () {
  101. getApp().onPullDownRefresh()
  102. },
  103. /**
  104. * 页面上拉触底事件的处理函数
  105. */
  106. onReachBottom: function () {
  107. },
  108. /**
  109. * 用户点击右上角分享
  110. */
  111. onShareAppMessage: function () {
  112. }
  113. })