85 lines
1.4 KiB
JavaScript
85 lines
1.4 KiB
JavaScript
// driver/pages/detail/detail.js
|
|
const app = getApp()
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
rootUrl: app.AppService.apiConfig.configurl,
|
|
deliveryDetail: {}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
const id = options.id || ''
|
|
this.getDetail(id)
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
// 获取详情
|
|
getDetail: function (id) {
|
|
const url = '/mobile/detail_delivery'
|
|
app.AppService.appRequest(url, 'POST', {
|
|
delivery_id: id
|
|
}, (res) => {
|
|
const deliveryDetail = res.data
|
|
this.setData({
|
|
deliveryDetail
|
|
})
|
|
})
|
|
},
|
|
|
|
//展示图片
|
|
previewImage: function (e) {
|
|
wx.previewImage({
|
|
current: '', // 当前显示图片的http链接
|
|
urls: [e.target.dataset.url] // 需要预览的图片http链接列表
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
|
|
}) |