// packageA/mycomponent/goodsComponent/plugin/market/market.js
var app = getApp();

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: null,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    is_market:false,
    prdocut_market_name:'',
    prdocut_market_name_apps:'',
    marketShow:false,
    prdocut_market:{}
  },
  observers: {
    data: function (plugin) {
      if (plugin) {
        this.init(plugin);
      }
    },
  },

  /**
   * 组件的方法列表
   */
  methods: {
    init(data) {
      // 应用市场
      if(data.plugin){
        if (!app._isTextEmpty(data.plugin.prdocut_market)) {
          this.setData({
            is_market: true,
            prdocut_market: data.plugin.prdocut_market,
            prdocut_market_name: data.plugin.prdocut_market.plugin,
            prdocut_market_name_apps: data.plugin.prdocut_market.apps,
          });
        }
      }
      
    },
    // 应用市场
    marketShowTap(e) {
      this.setData({
        marketShow: true,
      });
    },
    closeMarketShow() {
      this.setData({
        marketShow: false,
      });
    },
  },
});
