visitorcheckdetail.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. const util = require('../../../utils/util.js');
  2. const api = require('../../../utils/api.js');
  3. const app = getApp();
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. userInfo: {
  10. photo: '',
  11. name: '辽宁',
  12. cardNum: '401311188603041535',
  13. phone: '15838122222',
  14. visitorName: '软件工程学院计算机系刘天仙',
  15. type: '亲属',
  16. buildNum: '一号宿舍楼',
  17. roomNum: '502宿舍',
  18. reason: '探亲'
  19. },
  20. list: []
  21. },
  22. getUserInfoArray: function(e) {
  23. const that = this;
  24. let userInfo = [];
  25. userInfo.push({
  26. key: '访客姓名:',
  27. value: that.data.userInfo.name
  28. }, {
  29. key: '身份证号:',
  30. value: that.data.userInfo.cardNum
  31. }, {
  32. key: '手机号:',
  33. value: that.data.userInfo.phone
  34. }, {
  35. key: '被访人:',
  36. value: that.data.userInfo.visitorName
  37. }, {
  38. key: '身份类型:',
  39. value: that.data.userInfo.type
  40. }, {
  41. key: '访问楼栋:',
  42. value: that.data.userInfo.buildNum
  43. }, {
  44. key: '访问宿舍:',
  45. value: that.data.userInfo.roomNum
  46. }, {
  47. key: '访问原因:',
  48. value: that.data.userInfo.reason
  49. })
  50. that.setData({
  51. list: userInfo
  52. })
  53. },
  54. /**
  55. * 生命周期函数--监听页面加载
  56. */
  57. onLoad: function(options) {
  58. const that = this;
  59. that.getUserInfoArray();
  60. },
  61. /**
  62. * 生命周期函数--监听页面初次渲染完成
  63. */
  64. onReady: function() {
  65. },
  66. /**
  67. * 生命周期函数--监听页面显示
  68. */
  69. onShow: function() {
  70. },
  71. /**
  72. * 生命周期函数--监听页面隐藏
  73. */
  74. onHide: function() {
  75. },
  76. /**
  77. * 生命周期函数--监听页面卸载
  78. */
  79. onUnload: function() {
  80. },
  81. /**
  82. * 页面相关事件处理函数--监听用户下拉动作
  83. */
  84. onPullDownRefresh: function() {
  85. },
  86. /**
  87. * 页面上拉触底事件的处理函数
  88. */
  89. onReachBottom: function() {
  90. }
  91. })