// packageA/mycomponent/goodsComponent/plugin/member/member.js
var app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    goodsInfo: {
      type: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    show: false,
    openVip: 2,
    
  },
  lifetimes: {
    attached(e) {
      let language = wx.getStorageSync("langIndex");
      this.setData({
        language: language.en,
      });
      this.init();
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    init() {
      if (this.data.goodsInfo.member_discount) {
        if (app._isTextEmpty(this.data.goodsInfo.member_discount.discount)) {
          this.setData({
            openVip: 1,
          });
        } else {
          this.setData({
            openVip: this.data.goodsInfo.member_discount.discount,
          });
        }
      }
    },
    gotoMemberGradeList(e) {
      let tag = e.currentTarget.dataset.o;
      if (tag == "1") {
        wx.navigateTo({
          url: "/packageB/member/MemberGradeList/MemberGradeList",
        });
      }
    },
  }
});