学员端小程序
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.

92 lines
1.8 KiB

1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
1 year ago
11 months 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="webViewUrl"></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. webViewUrl: '',
  22. schoolId: ''
  23. }
  24. },
  25. beforeDestroy() {
  26. clearInterval(this.timer)
  27. this.timer = null
  28. },
  29. onHide() {
  30. },
  31. onLoad(options) {
  32. this.schoolId = options.schoolId?options.schoolId:this.vuex_userInfo.schoolId
  33. this.timer = setInterval(() => {
  34. this.getContractStatusFn()
  35. }, 3000)
  36. this.getSignContractFn()
  37. },
  38. methods: {
  39. async getSignContractFn() {
  40. uni.showLoading({
  41. title: '正在加载合同...'
  42. })
  43. let info = this.vuex_userInfo
  44. const {
  45. data: res
  46. } = await getSignContract({
  47. schoolId: this.schoolId,
  48. studentId: this.studentId
  49. })
  50. uni.hideLoading()
  51. this.webViewUrl = res.url
  52. },
  53. // 查询签约状态
  54. async getContractStatusFn() {
  55. const {
  56. data: res
  57. } = await getContractStatus({
  58. studentId: this.studentId
  59. })
  60. if (res.flowStatus == 2) {
  61. clearInterval(this.timer)
  62. this.timer = null
  63. uni.navigateTo({
  64. url: '/pages/indexEntry/enroll/payment/payment'
  65. })
  66. if (res.flowStatus > 2) {
  67. clearInterval(this.timer)
  68. this.timer = null
  69. this.$u.toast('合同已撤销或过期')
  70. }
  71. }
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .card {
  78. .h2 {
  79. min-height: 800rpx;
  80. text-align: center;
  81. padding: 40rpx 0;
  82. }
  83. }
  84. .btnBg {
  85. width: 396rpx !important;
  86. margin: 100rpx auto 100rpx auto;
  87. }
  88. </style>