<template>
  <!--<div class="pp_top text-center important-height" @click="goback()" v-if="showback">-->
  <!--<span class="glyphicon back text-center">返回</span>-->
  <!--&lt;!&ndash;<span class="pp_title">{{toptitle}}<span v-if="showback">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>&ndash;&gt;-->
  <!--</div>-->
  <div class="page-header app-header auto" >
    <div @click="goback()" v-if="showback">
      <img src="../../assets/返回.png" width="30px"/>
    </div>
  </div>
</template>
<script>
  export default {
    title: 'TOP',
    data () {
      return {
        // toptitle: this.toptext
      }
    },
    props: {
      // toptext: {
      //   type: String,
      //   default: '用户操作'
      // },
      showback: {
        type: Boolean,
        default: true
      }
    },
    methods: {
      goback () {
        if(window.currentPage==='选择用户'){
          this.$showMessage('退出后，所有填写内容将不可恢复，确认退出！', ['confirm', 'cancel']).then((res) => {
            if (res === 'confirm') {
              this.$dispatch('returnPage')
            }
          })
        }else{
          this.$dispatch('returnPage')
        }

      }
    }
  }
</script>
<style scoped>
  .app-header {
    border-radius: 50%;
    position:fixed;
    background: rgba(73, 158, 223, 0.12);
    color: #FFF;
    padding: 8px;
    text-align: center;
    font-size: 1.2em;
    z-index: 10;
    opacity:0.5;
    bottom: 50px;
    margin-top: -20px;
  }
</style>

