Service.js 1.03 KB
// components/Service/Service.js
// import { IMG_URL } from '~/utils/constantData'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isFixed: {
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    IMG_URL,
    isShow: false,
    showView:false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getMockSetting(){
      let merchantId = wx.getStorageSync('showServicesMerchantId');
      wx.$util.getMockData().then(res=>{
        if(res&&merchantId&&res.merchantId){
          if(res.merchantId.includes(Number(merchantId))){
             this.setData({
              showView:true
            })
          }
        }
      })
    },
    handleShow() {
      this.setData({
        isShow: !this.data.isShow
      })
    }
  },
  lifetimes: {
    attached() {
      wx.$eventbus.on('SERVICES', ()=>{
        this.getMockSetting()
      })
      this.getMockSetting()
    },
  },
})