let app = getApp();
//替换成开发者后台设置的安全域名
let domain = app.globalData.domain;
Page({

  data: {
    meets: [
      { name: 'video', value: '视频会议', checked: true },
      { name: 'ordinary', value: '普通会议' }
    ],
    checks: [
      { name: "投影仪", value: '0', checked: false },
      { name: "电视机", value: '1', checked: false },
      { name: "空调", value: '2', checked: false },
      { name: "Wifi", value: '3', checked: false },
    ],
        dates: dateFtt("yyyy-MM-dd", new Date()),
        // times: dateFtt("hh:mm", new Date()),
        index: 0,
        showView: false,
        
  },
  clicks: function(e) {
    let index = e.currentTarget.dataset.index;
    let arrs = this.data.checks;
    if (arrs[index].checked == false) {
      arrs[index].checked = true;
    } else {
      arrs[index].checked = false;
    }
    this.setData({
      checks: arrs
    })

  },
  //  点击时间组件确定事件  
  onChange(e) {
    console.log(e.detail.value);
    this.setData({
      dates: e.detail.value
      //times: e.detail.value,
    })
  },

  onLoad: function(options) {
    // 生命周期函数--监听页面加载
    showView: (options.showView == "true" ? true : false)
  },

  //显示隐藏
  onChangeShowState: function() {
    var that = this;
    that.setData({
      showView: (!that.data.showView),
      se_btn_hide: false
    })
  },
  findConference: function(e){
    console.log('form发生了submit事件，携带数据为：', e.detail.value)
   var num= encodeURIComponent('number=1');
    console.log(num);
    dd.reLaunch({//& query=number % 3D1 & page=x % 2Fy % 2Fz
        url: '../index/index?person=' + e.detail.value.person 
       
     // url: '../index/index?query=number%3D1'
      })

  },
  onReady() {
    // 页面加载完成
  },
  onShow() {
    // 页面显示
  },
  onHide() {
    // 页面隐藏
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息
    return {
      title: 'My App',
      desc: 'My App description',
      path: 'pages/index/index',
    };
  },
});
function dateFtt(fmt, date) { //author: meizz   
  var o = {
    "M+": date.getMonth() + 1,                 //月份   
    "d+": date.getDate(),                    //日   
    "h+": date.getHours(),                   //小时   
    "m+": date.getMinutes(),                 //分   
    "s+": date.getSeconds(),                 //秒   
    "q+": Math.floor((date.getMonth() + 3) / 3), //季度   
    "S": date.getMilliseconds()             //毫秒   
  };
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt))
      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  return fmt;
}

