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.

218 lines
4.7 KiB

1 year ago
  1. // pagesA/facepeople/facepeople.js
  2. import moment from '../../utils/moment'
  3. function CurentTime() {
  4. var now = new Date();
  5. var year = now.getFullYear(); //年
  6. var month = now.getMonth() + 1; //月
  7. var day = now.getDate(); //日
  8. var hh = now.getHours(); //时
  9. var mm = now.getMinutes(); //分
  10. var clock = year + "-";
  11. if (month < 10)
  12. clock += "0";
  13. clock += month + "-";
  14. if (day < 10)
  15. clock += "0";
  16. clock += day + " ";
  17. // if (hh < 10)
  18. // clock += "0";
  19. // clock += '00' + ":";
  20. // // if (mm < 10) clock += '0';
  21. clock += '00:00:00';
  22. return (clock);
  23. }
  24. function CurentTime1() {
  25. var now = new Date();
  26. var year = now.getFullYear() + 3; //年
  27. var month = now.getMonth() + 1; //月
  28. var day = now.getDate(); //日
  29. var hh = now.getHours(); //时
  30. var mm = now.getMinutes(); //分
  31. var clock = year + "-";
  32. if (month < 10)
  33. clock += "0";
  34. clock += month + "-";
  35. if (day < 10)
  36. clock += "0";
  37. clock += day + " ";
  38. // if (hh < 10)
  39. // clock += "0";
  40. // clock += hh + ":";
  41. // if (mm < 10) clock += '0';
  42. // clock += mm;
  43. clock += '23:59:59';
  44. return (clock);
  45. }
  46. Page({
  47. /**
  48. * 页面的初始数据
  49. */
  50. data: {
  51. date: moment().format('YYYY-MM-DD HH:mm:ss'),
  52. show: false,
  53. value: '',
  54. show2: false,
  55. facename: '',
  56. minDate: '',
  57. minDate1: '',
  58. endtime: '',
  59. starttime: '',
  60. datetimerange: [CurentTime(), CurentTime1()],
  61. chooseface: false,
  62. avatarPath: "", // 上传的图片数据
  63. },
  64. /**
  65. * 生命周期函数--监听页面加载
  66. */
  67. onLoad: function (options) {
  68. if(this.data.avatarPath){
  69. this.setData({
  70. show2: true
  71. })
  72. }
  73. },
  74. CurentTime() {
  75. var now = new Date();
  76. var year = now.getFullYear(); //年
  77. var month = now.getMonth() + 1; //月
  78. var day = now.getDate(); //日
  79. var hh = now.getHours(); //时
  80. var mm = now.getMinutes(); //分
  81. var clock = year + "-";
  82. if (month < 10)
  83. clock += "0";
  84. clock += month + "-";
  85. if (day < 10)
  86. clock += "0";
  87. clock += day + " ";
  88. // if (hh < 10)
  89. // clock += "0";
  90. // clock += '00' + ":";
  91. // // if (mm < 10) clock += '0';
  92. clock += '00:00:00';
  93. return (clock);
  94. },
  95. changeshow2() {
  96. this.setData({
  97. show2: true
  98. })
  99. },
  100. onChange2(e) {
  101. this.setData({
  102. facename: e.detail
  103. })
  104. },
  105. bindDateChange: function (e) {
  106. var str = e.detail.value + " 00:00:00"
  107. this.data.datetimerange[0] = str
  108. this.setData({
  109. starttime: str,
  110. })
  111. },
  112. bindDateChange1: function (e) {
  113. var str = e.detail.value + " 23:59:59"
  114. this.data.datetimerange[1] = str
  115. this.setData({
  116. endtime: str
  117. })
  118. },
  119. onSearch() {
  120. },
  121. onCancel() {
  122. },
  123. // 新增人脸
  124. addFace() {
  125. // wx.chooseImage({
  126. // count: 1,
  127. // sizeType: ['original', 'compressed'],
  128. // success: function (res) {
  129. // console.log(res)
  130. // wx.getImageInfo({
  131. // src: res.tempFilePaths[0],
  132. // success(res) {
  133. // wx.navigateTo({
  134. // url: '/pagesA/selectFace/selectFace?data=' + JSON.stringify(res)
  135. // })
  136. // }
  137. // })
  138. // }
  139. // });
  140. wx.navigateTo({
  141. url: '/pagesA/selectFace/selectFace',
  142. })
  143. },
  144. // 弹出框
  145. changeshow() {
  146. this.setData({
  147. show: true
  148. })
  149. },
  150. onClose() {
  151. this.setData({
  152. show: false,
  153. show2: false
  154. })
  155. },
  156. // 跳转详情页
  157. gotoinfo() {
  158. wx.navigateTo({
  159. url: '/pagesA/faceinfo/faceinfo',
  160. })
  161. },
  162. /**
  163. * 生命周期函数--监听页面初次渲染完成
  164. */
  165. onReady: function () {
  166. },
  167. /**
  168. * 生命周期函数--监听页面显示
  169. */
  170. onShow: function () {
  171. },
  172. /**
  173. * 生命周期函数--监听页面隐藏
  174. */
  175. onHide: function () {
  176. },
  177. /**
  178. * 生命周期函数--监听页面卸载
  179. */
  180. onUnload: function () {
  181. },
  182. /**
  183. * 页面相关事件处理函数--监听用户下拉动作
  184. */
  185. onPullDownRefresh: function () {
  186. },
  187. /**
  188. * 页面上拉触底事件的处理函数
  189. */
  190. onReachBottom: function () {
  191. },
  192. /**
  193. * 用户点击右上角分享
  194. */
  195. onShareAppMessage: function () {
  196. }
  197. })