<!--
 * @Author: ZZT
 * @Date: 2022-01-25 17:47:48
 * @LastEditors: OBKoro1
 * @LastEditTime: 2022-01-26 16:50:47
-->
<template>
  <view class="content">
    <rich-text :nodes="html" />
  </view>
</template>

<script>
import { fhAgreement } from '../../../../mainWeixinMp/api/merchant/index'
export default {
  data() {
    return {
      html: ''
    }
  },
  onLoad(options) {
    this.init(options)
  },
  methods: {
    async init(options) {
      options.type && this['get' + options.type]()
      if (options.title) {
        uni.setNavigationBarTitle({
          title: options.title
        })
      }
    },
    async getService() {
      try {
        const { results } = await fhAgreement('SERVICE')
        this.html = results.content
      } catch (error) {
        console.log(error)
      }
    },
    async getPrivacy() {
      try {
        const { results } = await fhAgreement('PRIVACY')
        this.html = results.content
      } catch (error) {
        console.log(error)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.content {
  padding: 30rpx;
}
</style>
