Component({
  properties: {
    // 这里定义了innerText属性，属性值可以在组件使用时指定
    object:{
      type:Object,
      value:null
    },

  },
  data: {
    // 这里是一些组件内部数据
    yc:false,
    btn: 1,
    ad:false,
    autoplay:true,
    interval:3000,
    duration:1000,
    someData: {},
    max_sw_height:100,
  },

  ready: function () {
    var data_arr=this.properties.object.data;
    var is_show=0;
    for(var i in data_arr){
         var item=data_arr[i];
         var now=new Date();
         if((!item.beg_date || now>new Date(item.beg_date))
           && (!item.end_date || now<new Date(item.end_date)))
         {
              this.setData({is_show:1});
              break;
         }
    }


  },
  methods: {

    customMethod: function () { },
    //---智能跳转---
    go_url:function(e){
			  var url=e.currentTarget.dataset.url;
			  getApp().goto(url);
		},
    nv_void(e){
      var feedId=e.currentTarget.dataset.feedid;
      var finderUserName=e.currentTarget.dataset.finderusername;
      var video_type=e.currentTarget.dataset.video_type;
      getApp().openChannelsActivity({
        feedId,
        finderUserName,
        video_type
      })
    },
    imageLoad:function(e){
      var imgwidth = e.detail.width;
      var imgheight = e.detail.height;
      //宽高比
      var ratio = imgwidth / imgheight;
      //计算的高度值
      var viewHeight = 750 / ratio;
      var hei=this.data.max_sw_height;

      if (hei< viewHeight) {
          this.setData({ max_sw_height: viewHeight });
       }
    }
  }
})
