2024-01-29 17:42:38 +08:00
|
|
|
// pages/duty/rec-detail/index.js
|
|
|
|
|
const app = getApp();
|
|
|
|
|
|
|
|
|
|
Page({
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面的初始数据
|
|
|
|
|
*/
|
|
|
|
|
data: {
|
|
|
|
|
topBarH: app.globalData.CustomBar,
|
2024-01-30 16:35:55 +08:00
|
|
|
baseUrl: app.FILE_SERVER_URL,
|
|
|
|
|
|
2024-01-29 17:42:38 +08:00
|
|
|
freshIng: false,
|
|
|
|
|
id: "",
|
|
|
|
|
detail: {},
|
|
|
|
|
enclosurelist: []
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
2024-01-30 16:35:55 +08:00
|
|
|
* 预览文件
|
2024-01-29 17:42:38 +08:00
|
|
|
*/
|
2024-01-30 16:35:55 +08:00
|
|
|
filePre: function (params) {
|
|
|
|
|
const url = params.currentTarget.dataset.url;
|
|
|
|
|
const imgs = [];
|
|
|
|
|
this.data.enclosurelist.forEach(item => {
|
|
|
|
|
imgs.push(this.data.baseUrl + item.filepath)
|
|
|
|
|
})
|
|
|
|
|
wx.previewImage({
|
|
|
|
|
urls: imgs,
|
|
|
|
|
current: this.data.baseUrl + url
|
2024-01-29 17:42:38 +08:00
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取附件
|
|
|
|
|
*/
|
|
|
|
|
getFiles: function () {
|
|
|
|
|
app.axios("GET", "common", "/upload/getFile", {
|
2024-01-30 16:35:55 +08:00
|
|
|
otcid: this.data.detail.workId,
|
|
|
|
|
otctype: app.FileType.resumptionAcs
|
2024-01-29 17:42:38 +08:00
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == 1) {
|
|
|
|
|
this.data.enclosurelist = res.data;
|
|
|
|
|
this.setData(this.data)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
|
*/
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
const eventChannel = this.getOpenerEventChannel()
|
2024-01-30 16:35:55 +08:00
|
|
|
eventChannel.on('getItem', (item) => {
|
|
|
|
|
this.data.detail = item;
|
|
|
|
|
this.setData(this.data)
|
|
|
|
|
this.getFiles();
|
2024-01-29 17:42:38 +08:00
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
|
*/
|
|
|
|
|
onReady() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
|
*/
|
|
|
|
|
onShow() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
|
*/
|
|
|
|
|
onHide() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
|
*/
|
|
|
|
|
onUnload() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
|
*/
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
|
*/
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 用户点击右上角分享
|
|
|
|
|
*/
|
|
|
|
|
onShareAppMessage() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|