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

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    //关注接口
    sendAttention() {
      let json = {};

      let urlStr = app.getNetAddresss("plugin.new-media-advertising.frontend.media-advertisingt.cancel-attention");
      json.advertisingt_member = this.data.item.member_id;


      app._getNetWork({
        url: urlStr,
        data: json,
        success: (resdata) => {
          var res = resdata.data;
          if (res.result != 1) return app.tips(res.msg);
          this.triggerEvent("cancelAttention",this.data.index);
        }
      });
    },
  }
});