<template>
  <view class="page-wrap" :style="{'padding-bottom': isIphoneX ? '24px': '6px'}">
    <!-- 顶部导航 -->
    <u-navbar class="navbar-wrap" :title="title" title-color="#fff" :title-size="30" :title-bold="false" :title-width="400" :is-back="true" back-icon-color="#fff" :background="navbarBackground" />
    <!-- 内容 -->
    <rich-text :nodes="agreement" />
  </view>
</template>

<script>
import { agreementContent, agreementTitle } from '../../../utils/agreement'
const app = getApp()

export default {
  data() {
    return {
      navbarBackground: app.globalData.navbarBackground,
      isIphoneX: app.globalData.isIphoneX,
      title: '',
      agreement: '',
    }
  },
  onLoad({ type = '' }) {
    if (type && agreementContent[type]) {
      this.title = agreementTitle[type] || ''
      this.agreement = agreementContent[type]
    }
  }
}
</script>

<style scoped lang="scss">
.page-wrap {
  min-height: 100vh;
  padding: 20rpx;
  background-color: #fff;
  /deep/ .mb-20 {
    margin-bottom: 20rpx;
  }
  /deep/ .indent-2 {
    text-indent: 2em;
  }
  /deep/ .content {
    line-height: 44rpx;
    font-size: 26rpx;
    color: #333;
  }
  /deep/ .title-1 {
    line-height: 44rpx;
    font-size: 30rpx;
    color: #000;
    font-weight: 500;
  }
}
</style>
