<template>
  <div class="label">
      <div class="container">
        <text
          style="font-weight: 400;margin-top: 40px;text-indent:60px;margin-left: 20px;margin-right: 20px"
          >欢迎使用{{app_name}}~你需要阅读并同意<a
            style="color: #79BA70;"
            @click="gotoPrivacy"
            >《隐私政策》</a
          >和<a style="color: #79BA70" @click="gotoRouter">《用户协议》</a
          >方可使用{{app_name}}提供的阅读服务，是否同意?</text
        >

        <div style="margin-top:50px">
          <text class="cancel" @click="cancel">取消</text>
          <text class="agree" @click="agree">同意</text>
        </div>
      </div>
  </div>
</template>

<script>
import router from '@system.router'
import webview from '@system.webview'
import it from "../../helper/interface.js";
export default {
  data() {
    return {
      display: false,
      app_name :""
    }
  },
  props: ['display', 'isagree'],
  onInit() {
    this.app_name = it.getAppName();
  },
  onShow(options) {},
  agree() {
    this.$emit('change', {
      display: false
    })
  },
  cancel() {
    this.$app.exit()
  },
  gotoRouter() {
    router.push({
      uri: `/views/Agreement`
    })
  },
  gotoPrivacy() {
    let privacy = this.$app.$def.manifest.config.data.yinsi_addr;
      webview.loadUrl({
        url:privacy,
        showloadingdialog: true
      })
  }
}
</script>
<style>
.label {
  justify-content: center;
  align-items: center;
  width: 750px;
  height: 100%;
  background-color: rgba(0,0,0,.5);
}
.container {
  width: 510px;
  border-radius: 30px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: white;
}
.agree {
  width: 50%;
  height: 80px;
  text-align: center;
  border-bottom-right-radius: 30px;
  background-color: #79BA70;
  color: white;
}
.cancel {
  width: 50%;
  height: 80px;
  text-align: center;
  border-bottom-left-radius: 30px;
  background-color: #f5f5f5;
}
</style>
