<template>
  <view style="height: 100vh">
    <zj-page-container>
      <zj-fiex-column>
        <view class="page-content" v-if="!loading">
          <view class="rich-text-content" v-show="content">
            <rich-text :nodes="content"></rich-text>
          </view>
        </view>
      </zj-fiex-column>
    </zj-page-container>
  </view>
</template>
<script>
import ZjFiexColumn from '@/components/zj-container/zj-fiex-column.vue'
import ZjPageContainer from '@/components/zj-container/zj-page-container.vue'
export default {
  components: {
    ZjFiexColumn,
    ZjPageContainer
  },
  data() {
    return {
      loading: true,
      content: ''
    }
  },
  onLoad(options) {
    if (options.id) {
      uni.showLoading({
        title: '加载中'
      })
      this.$api.post('/worker/agreement', options).then(res => {
        var { context, agreementName } = res.data
        uni.setNavigationBarTitle({
          title: agreementName
        })
        this.content = context
        this.$nextTick(() => {
          this.loading = false
          uni.hideLoading()
        })
      })
    }
  }
}
</script>
<style lang="scss" scoped>
@import './style.scss';
</style>
