<template>
  <!--顶部-->
  <view v-if="isShow" class="Width100 ToastBox Height100">
    <view class="Toast PositionA TextCenter BG_FFFFFF BorderR_30rpx">
      <view class="InlineBlock" v-if="type == 1">
        <image :src="$.imgSrc + '/scimg/choose_y1.png'" mode="aspectFit" class="Block FloatL Icon1"></image>
        <text class="Block FontS_32rpx Color_1A1F39 MarginL_36rpx FloatL FontBold">提交数据中...</text>
        <view class="ClearB"></view>
      </view>
      <view class="InlineBlock" v-if="type == 2">
        <image :src="$.imgSrc + '/scimg/choose_y1.png'" mode="aspectFit" class="Block FloatL Icon"></image>
        <text class="Block FontS_32rpx Color_1A1F39 MarginL_36rpx FloatL FontBold">提交成功</text>
        <view class="ClearB"></view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "global-toast",
  props: {
    isShow:{
      type:Boolean,
      default: false
    },
    type:{
      type:Number,
      default: 1
    },
  },
  data() {
    return {
      navHeight:88,
      topHeight:0,
      $:this.$,
    }
  },
  mounted(){
  },
  computed:{
  },
  methods: {
    // 获取url
    getCurPage() {
      let pages = getCurrentPages();
      let curPage = pages[pages.length - 1];
      return curPage
    },
    // 返回
    backPage(){
      this.$emit('backPage')
    },
    // 跳转页面
    skipPage(item) {
      this.$emit('skipPage', item.pageUrl)
    },
  },
}
</script>

<style scoped lang="scss">
  .ToastBox{
    position: fixed;
    left: 0;
    top: 0;
    background-color: rgba(0,0,0,0.6);
    z-index: 999999;
    .Toast{
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%);
      width: calc(100% - 180rpx);
      padding: 60rpx 0rpx;
      .Icon{
        width: 50rpx;
        height: 50rpx;
      }
      @keyframes fadenum{
        0%{-webkit-transform:rotate(0deg)}
        25%{-webkit-transform:rotate(90deg)}
        50%{-webkit-transform:rotate(180deg)}
        75%{-webkit-transform:rotate(270deg)}
        100%{-webkit-transform:rotate(360deg)}
      }
      .Icon1{
        animation:fadenum 1.5s linear infinite;
        width: 50rpx;
        height: 50rpx;
      }
      text{
        line-height: 50rpx;
      }
    }
  }
</style>
