index.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import MHeader from '@/components/m-header';
  2. import request from '@/helpers/request';
  3. import { browser } from '@/helpers/utils';
  4. import { state } from '@/state';
  5. import { defineComponent } from 'vue';
  6. import styles from './index.module.less';
  7. // 预览协议 - 原生实名认证使用
  8. export default defineComponent({
  9. name: 'preview-protocol',
  10. data() {
  11. return {
  12. protocolHTML: '' as any
  13. };
  14. },
  15. async mounted() {
  16. let type = 'REGISTER';
  17. try {
  18. // 判断是否有协议内容
  19. if (!this.protocolHTML) {
  20. const { data } = await request.get(
  21. '/edu-app/open/userContractRecord/queryLatestContractTemplate',
  22. {
  23. params: {
  24. contractType: type || 'REGISTER'
  25. }
  26. }
  27. );
  28. this.protocolHTML = data.contractTemplateContent || '';
  29. }
  30. } catch {
  31. //
  32. }
  33. },
  34. render() {
  35. return (
  36. <div id="mProtocol">
  37. {browser().isApp && <MHeader />}
  38. <div
  39. class={[
  40. styles.mProtocol,
  41. this.$route.query.type ? styles[this.$route.query.type as any] : ''
  42. ]}
  43. v-html={this.protocolHTML}></div>
  44. </div>
  45. );
  46. }
  47. });