<template>
  <div>
    <van-popup v-model="show" round :style="{ height: '345px', width: '280px', position:'fixed',top: '34%',left: '50%;',transform: 'translateX(-50%)' }">
      <div class="content">
        <h3>服务协议和隐私政策</h3>
        <div class="text_content">
          请您务必审核阅读、充分理解<strong>"服务协议"</strong>和<strong>"隐私政策"</strong>各条款，包括但不限于：为了向你提供及时通讯、内容分享等服务，我们需要收集你的设备信息、操作日志等个人信息。你可以在"设置"中查看、变更、删除个人信息并管理你的授权。你可阅读<span @click="agree_1">《隐私服务协议》</span>和<span @click="agree_2">《用户协议》</span>了解详细信息。如你同意，请点击"同意"开始接受我们的服务。
        </div>
        <div class="btn">
          <van-button
            type="default"
            style="border: none; width: 100px;font-size: 15px;"
            @click="close"
            >暂不使用</van-button
          >
          <van-button
            type="default"
            style="border: none; color: #2e99f5; width: 100px;font-size: 15px;"
            @click="agree"
            >同意</van-button
          >
        </div>
      </div>
    </van-popup>
  </div>
</template>

<script>
export default {
  props: {
    showscret: Boolean,
  },
  data() {
    return {
      show: false,
    };
  },

  watch: {
    showscret(newval, oldval) {
      // console.log(newval);
      this.show = newval; //newval为监听到发生改变数据
    },
  },

  methods: {
    showPopup() {
      this.show = true;
    },
    close() {
      this.show = false;
    },
    agree() {
      this.$parent.checked = true;
      this.$parent.loginshow = true;
      this.$parent.loginshowtwo = false;
      this.show = false;
    },

    agree_1() {
      this.$router.push({ path: "/privacy" });
    },
    agree_2() {
      this.$router.push({ path: "/userAgreement" });
    },
  },
};
</script>

<style scoped>
.content {
  text-align: center;
}
.content h3 {
  font-weight: 600;
  margin: 20px 0;
}

.text_content {
  width: 250px;
  margin: 0 auto;
  text-align: left;
  height: 210px;
  border-bottom: 1px solid #e9e9e9;
}

.text_content span {
  color: #2e99f5;
}

.btn {
  display: flex;
  justify-content: space-around;
  margin-top: 5px;
  font-size: 14px;
}

/deep/ .van-button__text{
    font-size: 15px !important;
}


</style>
