<template>
  <u-popup v-model="show" mode="center" borderRadius="20" :mask-close-able="false">
    <view class="content">
      <view class="content-icon">
        <u-image width="100%" height="100%" src="/static/img/loss-params-icon.png" />
      </view>
      <view class="content-text">{{ tipText }}</view>
      <view class="content-btn">
        <u-button type="primary" @click="backHome">确认</u-button>
      </view>
    </view>
  </u-popup>
</template>

<script>
export default {
  props: {
    show: {
      type: Boolean,
      default: false
    },
    tipText: {
      type: String,
      default: '参数丢失，返回首页'
    }
  },
  methods: {
    backHome() {
      uni.switchTab({
        url: '/pages/index/index'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.content {
  padding: 60rpx 40rpx;
  width: 590rpx;

  &-icon {
    width: 348rpx;
    height: 395rpx;
    margin: 10rpx auto 0;
  }

  &-text {
    color: #999999;
    font-size: 32rpx;
    text-align: center;
    margin-bottom: 40rpx;
  }
}
</style>
