index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 class="please-read">
  9. <view class="please-read-title"> 请阅读: </view>
  10. <view
  11. class="please-read-contract"
  12. v-for="(item, index) in insureAgreeList"
  13. :key="index"
  14. @click="goDetailsAgreement(item)"
  15. >
  16. 《{{ item.agreementName }}》
  17. </view>
  18. </view>
  19. </view>
  20. <view slot="after" class="bottom-reservation">
  21. <u-button :disabled="ins > 0 ? true : false" type="primary" @click="gopay"
  22. >了解并继续{{ ins > 0 ? `(${ins}s)` : '' }}
  23. </u-button>
  24. </view>
  25. </zj-fiex-column>
  26. </zj-page-container>
  27. </template>
  28. <script>
  29. import ZjFiexColumn from '@/components/zj-container/zj-fiex-column.vue'
  30. import ZjPageContainer from '@/components/zj-container/zj-page-container.vue'
  31. import { countdown } from '@/utils/tool.js'
  32. export default {
  33. components: {
  34. ZjFiexColumn,
  35. ZjPageContainer
  36. },
  37. data() {
  38. return {
  39. loading: true,
  40. content: '',
  41. insureAgreeList: [],
  42. ins: 0,
  43. djs: countdown(
  44. s => {
  45. this.ins = s
  46. },
  47. () => {
  48. this.ins = 0
  49. },
  50. 5
  51. ),
  52. websitId: '',
  53. id: ''
  54. }
  55. },
  56. onLoad({ websitId, id }) {
  57. this.id = id
  58. this.websitId = websitId
  59. uni.showLoading({
  60. title: '加载中'
  61. })
  62. this.$api.post('/worker/detail', { id }).then(res => {
  63. var { agreements, policyName, text } = res.data
  64. uni.setNavigationBarTitle({
  65. title: policyName
  66. })
  67. this.content = text
  68. this.insureAgreeList = agreements
  69. this.$nextTick(() => {
  70. this.loading = false
  71. this.djs.start()
  72. uni.hideLoading()
  73. })
  74. })
  75. },
  76. methods: {
  77. goDetailsAgreement(item) {
  78. if (item.id) {
  79. uni.navigateTo({
  80. url: `/packageEnter/pages/insurance/detailsAgreement/index?id=${item.id}`
  81. })
  82. }
  83. },
  84. gopay() {
  85. uni.navigateTo({
  86. url: `/packageEnter/pages/insurance/determineInfo/index?websitId=${this.websitId}&id=${this.id}`
  87. })
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. @import './style.scss';
  94. </style>