const { getCustomerService } = require("../../common");

// packageH/project_verification/components/quickMenu/quickMenu.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {},

  /**
   * 组件的初始数据
   */
  data: {
    displayCustomerServicePopup: false,
    customerService: {
      customer_open: false,
      online: "",
      service_QRcode: "",
      service_mobile: "",
    },
  },

  lifetimes: {
    ready() {
      getCustomerService().then((res) => {
        if (typeof res === "string") {
          this.setData({
            ["customerService.online"]: res,
          });
        } else {
          this.setData({
            customerService: res,
          });
        }
      });
    },
  },
  /**
   * 组件的方法列表
   */
  methods: {
    showCustomerServicePopup() {
      this.setData({
        displayCustomerServicePopup: !this.data.displayCustomerServicePopup,
      });
    },
  },
});
