index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <zj-page-container>
  3. <zj-fiex-column>
  4. <view class="page-content" v-if="!loading">
  5. <view class="rich-text-content" v-show="content">
  6. <rich-text :nodes="content"></rich-text>
  7. </view>
  8. </view>
  9. </zj-fiex-column>
  10. </zj-page-container>
  11. </template>
  12. <script>
  13. import ZjFiexColumn from '@/components/zj-container/zj-fiex-column.vue'
  14. import ZjPageContainer from '@/components/zj-container/zj-page-container.vue'
  15. export default {
  16. components: {
  17. ZjFiexColumn,
  18. ZjPageContainer
  19. },
  20. data() {
  21. return {
  22. loading: true,
  23. content: ''
  24. }
  25. },
  26. onLoad(options) {
  27. if (options.id) {
  28. uni.showLoading({
  29. title: '加载中'
  30. })
  31. this.$api.post('/worker/agreement', options).then(res => {
  32. var { context, agreementName } = res.data
  33. uni.setNavigationBarTitle({
  34. title: agreementName
  35. })
  36. this.content = context
  37. this.$nextTick(() => {
  38. this.loading = false
  39. uni.hideLoading()
  40. })
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. @import './style.scss';
  48. </style>