You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.8 KiB

1 year ago
  1. // pagesA/faceinfo/faceinfo.js
  2. import moment from '../../utils/moment'
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. startdate: moment().format('YYYY-MM-DD HH:mm:ss'),
  9. enddate: moment().format('YYYY-MM-DD HH:mm:ss'),
  10. minDate: new Date().getTime(),
  11. currentDate: new Date().getTime(),
  12. imgList:["https://img.yzcdn.cn/vant/cat.jpeg"],
  13. selectDateStatus:false,
  14. selectDateStatus1:false,
  15. dateIndex:1,
  16. currentDate1:new Date().getTime()
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad: function (options) {
  22. },
  23. // 时间选择
  24. selectTimeMethods(event){
  25. console.log(event)
  26. if(event.currentTarget.dataset.index == 1){
  27. this.setData({
  28. dateIndex:event.currentTarget.dataset.index,
  29. selectDateStatus:true
  30. })
  31. }else if(event.currentTarget.dataset.index == 2){
  32. this.setData({
  33. dateIndex:event.currentTarget.dataset.index,
  34. selectDateStatus1:true
  35. })
  36. }
  37. },
  38. // 查看图片大图
  39. preview(event) {
  40. console.log(event.currentTarget.dataset.src)
  41. let currentUrl = event.currentTarget.dataset.src
  42. wx.previewImage({
  43. current: currentUrl, // 当前显示图片的http链接
  44. urls: this.data.imgList // 需要预览的图片http链接列表
  45. })
  46. },
  47. confirmMethods(event){
  48. this.setData({
  49. selectDateStatus: false,
  50. selectDateStatus1:false
  51. });
  52. },
  53. cancelMethods(event){
  54. this.setData({
  55. selectDateStatus: false,
  56. selectDateStatus1:false
  57. });
  58. },
  59. // 选择图像有效期
  60. onInput(event) {
  61. let time = moment(event.detail).format("YYYY-MM-DD HH:mm:ss")
  62. if(this.data.dateIndex == 1){
  63. this.setData({
  64. startdate:time,
  65. currentDate: event.detail,
  66. minDate:event.detail
  67. })
  68. }else if(this.data.dateIndex == 2){
  69. this.setData({
  70. enddate:time,
  71. currentDate1: event.detail,
  72. })
  73. }
  74. },
  75. /**
  76. * 生命周期函数--监听页面初次渲染完成
  77. */
  78. onReady: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面显示
  82. */
  83. onShow: function () {
  84. },
  85. /**
  86. * 生命周期函数--监听页面隐藏
  87. */
  88. onHide: function () {
  89. },
  90. /**
  91. * 生命周期函数--监听页面卸载
  92. */
  93. onUnload: function () {
  94. },
  95. /**
  96. * 页面相关事件处理函数--监听用户下拉动作
  97. */
  98. onPullDownRefresh: function () {
  99. },
  100. /**
  101. * 页面上拉触底事件的处理函数
  102. */
  103. onReachBottom: function () {
  104. },
  105. /**
  106. * 用户点击右上角分享
  107. */
  108. onShareAppMessage: function () {
  109. }
  110. })