jhwxapp/miniprogram/pageage/project_attendance/project_attendanceUser/info/index.js

124 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-07-01 23:58:39 +08:00
import {
attendanceUser
} from '../../../../api/projectAttendance'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: "",
infoData: {},
projectName:"",
request: app.globalData.reqUrl,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {
id
} = options
this.setData({
id,
projectName:app.globalData.projectName
})
this.getInfo();
},
/**
* 获取详情信息
*
*/
getInfo() {
attendanceUser(this.data.id).then(res => {
if (res.code == 200) {
this.setData({
infoData: res.data
})
}
});
},
/**
* 查看考勤信息
*/
onQueryData() {
wx.redirectTo({
url: '../../project_attendanceData/list/index?workerId='+this.data.infoData.workerId+"&id="+this.data.id
})
},
//展示图片
showImg: function (e) {
let path = e.currentTarget.dataset.set
let urls = [];
if (path.indexOf('http:')>-1 || path.indexOf('https:')>-1) {
urls.push(path);
} else {
urls.push(this.data.request + path);
}
debugger
wx.previewImage({
urls: urls,
current: urls[0]
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index'
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})