// pages/components/toast/toast.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    toastData: {
      type: Object,
      value: {
        titlePicUrl: "",
        titlePicUrlWidth: 0,
        title: [""],
        info: [""],
        isShowOneBut: false,
        isShowTwoBut: false,
        oneButText: "",
        twoButText: "",
        footTop: 0
      }
    },
    oneButCallback: {
      type: ()=> {},
      value: ()=> {}
    },
    twoButCallback: {
      type: ()=> {},
      value: ()=> {}
    },
    visible: {
      type: Boolean,
      value: false
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    navBarHeight: app.globalData.navBarHeight,
    MenuButtonheight: app.globalData.MenuButtonheight,
    MenuButtonTop: app.globalData.MenuButtonTop,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    oneButCallback(){
      if(this.properties.oneButCallback) {
        this.properties.oneButCallback();
        return;
      };
    },
    twoButCallback(){
      if(this.properties.twoButCallback) {
        this.properties.twoButCallback();
        return;
      };
    },
  }
})
