|
|
- // pagesA/facepeople/facepeople.js
- import moment from '../../utils/moment'
-
- function CurentTime() {
- var now = new Date();
- var year = now.getFullYear(); //年
- var month = now.getMonth() + 1; //月
- var day = now.getDate(); //日
- var hh = now.getHours(); //时
- var mm = now.getMinutes(); //分
- var clock = year + "-";
- if (month < 10)
- clock += "0";
- clock += month + "-";
- if (day < 10)
- clock += "0";
- clock += day + " ";
- // if (hh < 10)
- // clock += "0";
- // clock += '00' + ":";
- // // if (mm < 10) clock += '0';
- clock += '00:00:00';
- return (clock);
- }
-
- function CurentTime1() {
- var now = new Date();
- var year = now.getFullYear() + 3; //年
- var month = now.getMonth() + 1; //月
- var day = now.getDate(); //日
- var hh = now.getHours(); //时
- var mm = now.getMinutes(); //分
- var clock = year + "-";
- if (month < 10)
- clock += "0";
- clock += month + "-";
- if (day < 10)
- clock += "0";
- clock += day + " ";
- // if (hh < 10)
- // clock += "0";
- // clock += hh + ":";
- // if (mm < 10) clock += '0';
- // clock += mm;
- clock += '23:59:59';
- return (clock);
- }
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- date: moment().format('YYYY-MM-DD HH:mm:ss'),
- show: false,
- value: '',
- show2: false,
- facename: '',
- minDate: '',
- minDate1: '',
- endtime: '',
- starttime: '',
- datetimerange: [CurentTime(), CurentTime1()],
- chooseface: false,
- avatarPath: "", // 上传的图片数据
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- if(this.data.avatarPath){
- this.setData({
- show2: true
- })
- }
- },
- CurentTime() {
- var now = new Date();
- var year = now.getFullYear(); //年
- var month = now.getMonth() + 1; //月
- var day = now.getDate(); //日
- var hh = now.getHours(); //时
- var mm = now.getMinutes(); //分
- var clock = year + "-";
- if (month < 10)
- clock += "0";
- clock += month + "-";
- if (day < 10)
- clock += "0";
- clock += day + " ";
- // if (hh < 10)
- // clock += "0";
- // clock += '00' + ":";
- // // if (mm < 10) clock += '0';
- clock += '00:00:00';
- return (clock);
- },
- changeshow2() {
- this.setData({
- show2: true
- })
- },
- onChange2(e) {
- this.setData({
- facename: e.detail
- })
- },
- bindDateChange: function (e) {
- var str = e.detail.value + " 00:00:00"
- this.data.datetimerange[0] = str
- this.setData({
- starttime: str,
- })
- },
- bindDateChange1: function (e) {
- var str = e.detail.value + " 23:59:59"
- this.data.datetimerange[1] = str
- this.setData({
- endtime: str
- })
- },
- onSearch() {
-
- },
- onCancel() {
-
- },
- // 新增人脸
- addFace() {
-
- // wx.chooseImage({
- // count: 1,
- // sizeType: ['original', 'compressed'],
- // success: function (res) {
- // console.log(res)
- // wx.getImageInfo({
- // src: res.tempFilePaths[0],
- // success(res) {
- // wx.navigateTo({
- // url: '/pagesA/selectFace/selectFace?data=' + JSON.stringify(res)
- // })
- // }
- // })
- // }
- // });
-
- wx.navigateTo({
- url: '/pagesA/selectFace/selectFace',
- })
- },
- // 弹出框
- changeshow() {
- this.setData({
- show: true
- })
- },
- onClose() {
- this.setData({
- show: false,
- show2: false
- })
- },
- // 跳转详情页
- gotoinfo() {
- wx.navigateTo({
- url: '/pagesA/faceinfo/faceinfo',
- })
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- }
- })
|