person.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. year: null
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad(options) {
  13. this.setData({
  14. year: options.year
  15. })
  16. this.getData();
  17. },
  18. getData() {
  19. _Http.basic({
  20. "id": 20220920161302,
  21. "content": {
  22. "year": this.data.year,
  23. "targettype": "人员目标",
  24. "hrid": wx.getStorageSync('userMsg').hrid
  25. },
  26. }).then(res => {
  27. if (res.msg != '成功') return wx.showToast({
  28. title: res.data,
  29. icon: "none"
  30. })
  31. this.setData({
  32. person: res.data
  33. })
  34. })
  35. },
  36. /* 选择年份 */
  37. bindDateChange({
  38. detail
  39. }) {
  40. if (this.data.year == detail.value) return;
  41. this.setData({
  42. "year": detail.value
  43. });
  44. this.getData();
  45. },
  46. /**
  47. * 生命周期函数--监听页面初次渲染完成
  48. */
  49. onReady() {
  50. },
  51. /**
  52. * 生命周期函数--监听页面显示
  53. */
  54. onShow() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面隐藏
  58. */
  59. onHide() {
  60. },
  61. /**
  62. * 生命周期函数--监听页面卸载
  63. */
  64. onUnload() {
  65. },
  66. /**
  67. * 页面相关事件处理函数--监听用户下拉动作
  68. */
  69. onPullDownRefresh() {
  70. },
  71. /**
  72. * 页面上拉触底事件的处理函数
  73. */
  74. onReachBottom() {
  75. },
  76. /**
  77. * 用户点击右上角分享
  78. */
  79. onShareAppMessage() {
  80. }
  81. })