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

    websocketServer:"ws://192.168.1.221:9090/websocket/?userId=3",
    sendMessageAbility: false,
    toSendMessage: 'test',
    closeLinkAbility: false,
    log: '',
    //dates: dateFtt("yyyy-MM-dd", new Date()),
    translate: ['中文(简体)', '英文', '韩语', '日语', '俄罗斯语', '意大利语', '法语'], 
    index: 0,
    recordList:[],
    conferenceName:null,
    date:null
  },
  bindtran(e){
    this.setData({
      index: e.detail.value,
    });
  },
  onLoad(query) { 
    var that = this;
    var userId = app.globalData.userId;
    //var mid = app.mid;
    var mid = query.mid;
    this.setData({
      conferenceName: query.conferenceName,
      date:query.date
    });
    console.log("会议id", mid);
    dd.httpRequest({
      url: recordlistUrl,
      method: 'POST',
      data: {
        userId: userId,
        mid: mid,
        // mid: mid
      },
      dataType: 'json',
      success: function(res) {
        console.log('success----', res)
        var recordList = that.data.recordList;
        recordList = res.data.result;
        that.setData({

          recordList
        });
        console.log(that.data.recordList);
      },
      fail: function(res) {
        console.log("httpRequestFail---", res)
        //   dd.alert({ content: JSON.stringify(res) });
      },
      complete: function(res) {
        dd.hideLoading();
      }

    });
  //  //websocket实时刷新
  //   dd.connectSocket({
  //     url: this.data.websocketServer,
  //     data: {},
  //     header: {
  //       'content-type': 'application/json'
  //     },
  //     method: "GET",
  //   });
  //   // 注意： 回调方法的注册在整个E应用启动阶段只要做一次，调多次会有多次回调
  //   dd.onSocketClose((res) => {
  //     dd.alert({ content: '连接已关闭！' });
  //     this.setData({
  //       sendMessageAbility: false,
  //       closeLinkAbility: false,
  //     });
  //   });
  //   // 注意： 回调方法的注册在整个E应用启动阶段只要做一次，调多次会有多次回调
  //   dd.onSocketOpen((res) => {
  //     dd.alert({ content: '连接已打开！' });
  //     this.setData({
  //       sendMessageAbility: true,
  //       closeLinkAbility: true,
  //     });
  //   });
  },
  onReady() {
    // 页面加载完成
  },

  onShow(query) {
   
  },
 
  onHide() {
    // 页面隐藏
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息

  },
});
