学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
1.9 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="签署合同"></topNavbar>
  4. <!-- <view class="pad">
  5. <view class="card">
  6. <view class="h2">教学合同</view>
  7. </view>
  8. <view class="btnBg" @click="$goPage('/pages/indexEntry/enroll/payment/payment')">同意并签字确认</view>
  9. </view> -->
  10. <web-view :src="url"></web-view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. getContractStatus,
  16. getSignContract
  17. } from '@/config/api.js'
  18. export default {
  19. data() {
  20. return {
  21. url: '',
  22. schoolId: ''
  23. }
  24. },
  25. beforeDestroy() {
  26. clearInterval(this.timer)
  27. this.timer = null
  28. },
  29. onHide() {
  30. clearInterval(this.timer)
  31. this.timer = null
  32. },
  33. onLoad(options) {
  34. this.schoolId = options.schoolId?options.schoolId:this.vuex_userInfo.schoolId
  35. this.timer = setInterval(() => {
  36. this.getContractStatusFn()
  37. }, 3000)
  38. this.getSignContractFn()
  39. },
  40. methods: {
  41. async getSignContractFn() {
  42. uni.showLoading({
  43. title: '正在加载合同...'
  44. })
  45. let info = this.vuex_userInfo
  46. const {
  47. data: res
  48. } = await getSignContract({
  49. schoolId: this.schoolId,
  50. studentId: this.studentId
  51. })
  52. uni.hideLoading()
  53. this.url = res.url
  54. },
  55. // 查询签约状态
  56. async getContractStatusFn() {
  57. const {
  58. data: res
  59. } = await getContractStatus({
  60. studentId: this.studentId
  61. })
  62. if (res.flowStatus == 2) {
  63. clearInterval(this.timer)
  64. this.timer = null
  65. alert('签约成功')
  66. uni.navigateTo({
  67. url: '/pages/indexEntry/enroll/payment/payment'
  68. })
  69. if (res.flowStatus > 2) {
  70. clearInterval(this.timer)
  71. this.timer = null
  72. this.$u.toast('合同已撤销或过期')
  73. }
  74. }
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .card {
  81. .h2 {
  82. min-height: 800rpx;
  83. text-align: center;
  84. padding: 40rpx 0;
  85. }
  86. }
  87. .btnBg {
  88. width: 396rpx !important;
  89. margin: 100rpx auto 100rpx auto;
  90. }
  91. </style>