// packageA/mycomponent/invitation/invitation.js
Component({
  /**
	 * 组件的属性列表
	 */
  properties: {
    prop_goods_info: {
      type: null
    },
    tabList: {
      type: null
    },
    min_micro: {
      type: null
    },
    roomdata: {
      type: null
    },
  },
  lifetimes: {
    attached() {
      this.setData({
        showPop: false,
      });
    }
  },
  observers: {
    tabList(tabList) {
      if (tabList.length > 0) {
        console.log(tabList);
        this.setData({
          isPost: tabList[0].id
        });
      }
    }
  },
  /**
	 * 组件的初始数据
	 */
  data: {
    isPost: 1,
    currentIndex: 0,

    showPop: false,
    micro_communities: [],
    page: 1,
    last_page: 1,
  },

  /**
	 * 组件的方法列表
	 */
  methods: {
    changeTab(e) {
      this.setData({
        currentIndex: 0,
        isPost: e.detail.name
      });
    },
    swiperChange(e) {
      this.setData({
        currentIndex: e.detail.current
      });
    },
    //直播间跳转
    gopage(e) {
      let status = e.currentTarget.dataset.status;
      let id = e.currentTarget.dataset.id;
      let backid = e.currentTarget.dataset.backid;
      if (status == 1) {
        wx.navigateTo({
          url: "/packageD/directSeeding/livePage/livePage?id=" + id + "&playerType=live",
        });
      } else if (status == 2) {
        wx.navigateTo({
          url: "/packageD/directSeeding/livePage/livePage?id=" + id + "&playerType=video" + "&backid=" + backid,
        });
      } else if (status == 3) {
        wx.navigateTo({
          url: "/packageD/directSeeding/foreshow/foreshow?id=" + id,
        });
      }
    },
    tapShow() {
      wx.navigateTo({
        url: '/packageA/others/GoodsComment/GoodsComment?gid=' + this.data.prop_goods_info.get_goods.id + '&istype=micro',
      });
    },
    goMicro(e) {
      let id = e.currentTarget.dataset.id;
      wx.navigateTo({
        url: '/packageC/micro_communities/microCommentDetails/microCommentDetails?stickId=' + id,
      });
    },
    closeShow() {
      this.setData({
        showPop: false
      });
    },
  }
});