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

100 lines
2.1 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
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" @message="handleGetMessage"></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. handleGetMessage(e){
  54. console.log('handleGetMessage',e)
  55. if(e.detail.data[0].result=='success'){
  56. uni.navigateTo({
  57. url: '/pages/indexEntry/enroll/payment/payment'
  58. })
  59. }
  60. },
  61. // 查询签约状态
  62. async getContractStatusFn() {
  63. const {
  64. data: res
  65. } = await getContractStatus({
  66. studentId: this.studentId
  67. })
  68. if (res.flowStatus == 2) {
  69. clearInterval(this.timer)
  70. this.timer = null
  71. uni.navigateTo({
  72. url: '/pages/indexEntry/enroll/payment/payment'
  73. })
  74. if (res.flowStatus > 2) {
  75. clearInterval(this.timer)
  76. this.timer = null
  77. this.$u.toast('合同已撤销或过期')
  78. }
  79. }
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .card {
  86. .h2 {
  87. min-height: 800rpx;
  88. text-align: center;
  89. padding: 40rpx 0;
  90. }
  91. }
  92. .btnBg {
  93. width: 396rpx !important;
  94. margin: 100rpx auto 100rpx auto;
  95. }
  96. </style>