// packageI/newMedia/components/myReleaseItem/myReleaseItem.js
var app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  options: {
    addGlobalClass: true
  },
  properties: {
    item:{
      value:{},
      type:Object
    },
    index:{
      value:0,
      type:Number
    },
    releaseTabIndex:{
      value:1,
      type:Number
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    checkTypeArr:["待审核","审核通过","审核驳回"],
    isOpenArr:["下架","上架"],
    genreArr:["","图文","文章","音频","视频"]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    gotoDetails(){
      let item = this.data.item;
      if(item.is_open!=1) return app.tips("广告已下架");
      if(item.type==2 || item.genre==4){
        let page = this.data.index;
        page = Math.ceil((page + 1) / 15);
        wx.navigateTo({
          url: '/packageI/newMedia/newMediaAdVideo/newMediaAdVideo?vid='+item.id + "&page=" + page + "&advertisingt_type="+item.type
        });
      }else {
        wx.navigateTo({
          url: '/packageI/newMedia/newMediaAdDetails/newMediaAdDetails?id='+item.id,
        });
      }
      
    }
  }
});
