// pages/logistics/index.js const util = require('../../utils/util.js'); var api = require('../../config/api.js'); Page({ /** * 页面的初始数据 */ data: { detail: {}, markers: [{ iconPath: "../../static/images/zuobiao.png", id: 0, latitude: 23.099994, longitude: 113.324520, width: 30, height: 30 }, { iconPath: "../../static/images/zuobiao.png", id: 1, latitude: 23.21229, longitude: 113.324520, width: 30, height: 30 }], polyline: [{ points: [{ longitude: 113.324520, latitude: 23.099994 }, { longitude: 113.104520, latitude: 23.35229 }, { longitude: 113.324520, latitude: 23.21229 }], color: "#0075DC", width: 4, dottedLine: false, arrowLine: true }] }, regionchange(e) { console.log(e.type) }, markertap(e) { console.log(e.markerId) }, controltap(e) { console.log(e.controlId) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { let { no, id } = options this.setData({ imgServer: util.imgServer, no, id }) this.getDetail() }, getDetail: function () { wx.showLoading({ title: '加载中' }) util.request(api.LogisticsDetail, { no: this.data.no, goodsId: this.data.id }).then((res) => { if (res.errno === 0) { wx.hideLoading(); this.setData({ detail: res.data }) } }); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { getApp().onPullDownRefresh() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })