<template>
  <view class="model" v-if="show">
    <image
      :src="`${constant.imgUrl}/ghs/home/deserve.png`"
      class="noData_img"
    ></image>
    <view class="no_data_text">{{title}}</view>
    <view class="freeApply" @click="apply">{{btnText}}</view>
    <view class="experience" v-if="expreShow" @click="experienceClick">体验</view>
    <view class="experFrame">
      <view v-if="rightShow">
        <input
            v-model="experCode"
            class="experInput"
            placeholder="请输入体验码"
          />
        <!-- <input type="text"  v-model="experCode" placeholder="请输入体验码" /> -->
        <text class="admin-button-com small blue" @click="rightClick">确定</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    show: {
      type: Boolean,
      default: true,
    },
    btnText: {
      type: String,
      default: '',
    },
    title: {
      type: String,
      default: '',
    },
    authShow: {
      type: Boolean,
      default: false,
    }
  },
  watch: {
    authShow(val) {
      this.expreShow = val
    }
  },
  data() {
    return {
      constant: this.$constant,
      experCode: '',
      expreShow: false,
      rightShow: false
    };
  },
  methods: {
    apply() {
      this.$emit('bthClick')
    },
    experienceClick(){
      this.rightShow = true
      this.expreShow = false
    },
    rightClick() {
      this.$emit('comfirm', this.experCode)
    }
  },
};
</script>

<style lang="scss" scoped>
.model {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  overflow: hidden;
  text-align: center;
  & > .noData_img {
    width: 318upx;
    height: 318upx;
    margin: 332upx auto 0;
  }
  & > .no_data_text {
    font-size: 32px;
    color: #ffffff;
    text-align: center;
    margin: 50upx 0;
  }
  & > .freeApply {
    width: 376px;
    height: 88px;
    line-height: 88upx;
    background: linear-gradient(90deg, #3385ff, #33b0ff);
    border-radius: 44px;
    margin: 0 auto;
    font-size: 32px;
    color: #ffffff;
    text-align: center;
  }
  &>.experience{
    margin-top: 40upx;
    color: #fff;
    font-size: 30upx;
  }
  &>.experFrame{
    margin-top: 50upx;
    height: 50upx;
    &>view{
      margin: 0 auto;
      &>.experInput{
        height: 70upx;
        width: 250upx;
        display: inline-block;
        vertical-align: middle;
        border-radius: 8upx;
        background-color: #fff;
        border: 1px solid #ccc;
        color: #666;
        padding-left: 20upx;
        box-sizing: border-box;
        text-align: left;
      }
      &>text{
        display: inline-block;
        line-height: 70upx;
        padding: 0 20upx;
        background-color: #3385FF;
        vertical-align: middle;
        font-size: 30upx;
        margin-left: 20upx;
      }
    }
  }
}
</style>