洛阳学员端
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.

104 lines
2.3 KiB

10 months 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. <!-- @message="handleGetMessage" -->
  11. <web-view :src="webViewUrl"></web-view>
  12. </view>
  13. </template>
  14. <script>
  15. import {
  16. getContractStatus,
  17. getSignContract
  18. } from '@/config/api.js'
  19. export default {
  20. data() {
  21. return {
  22. webViewUrl: '',
  23. schoolId: ''
  24. }
  25. },
  26. beforeDestroy() {
  27. clearInterval(this.timer)
  28. this.timer = null
  29. },
  30. onHide() {
  31. },
  32. onLoad(options) {
  33. this.schoolId = options.schoolId?options.schoolId:this.vuex_userInfo.schoolId
  34. this.trainingApplyId = options.trainingApplyId?options.trainingApplyId: ''
  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. let obj = {
  47. schoolId: this.schoolId,
  48. studentId: this.studentId,
  49. }
  50. if(this.trainingApplyId) obj.trainingApplyId = this.trainingApplyId
  51. const {
  52. data: res
  53. } = await getSignContract(obj)
  54. uni.hideLoading()
  55. this.webViewUrl = res.url
  56. },
  57. handleGetMessage(e){
  58. console.log('handleGetMessage',e)
  59. if(e.detail.data[0].result=='success'){
  60. uni.navigateTo({
  61. url: '/pages/indexEntry/enroll/payment/payment'
  62. })
  63. }
  64. },
  65. // 查询签约状态
  66. async getContractStatusFn() {
  67. const {
  68. data: res
  69. } = await getContractStatus({
  70. studentId: this.studentId
  71. })
  72. if (res.flowStatus == 2) {
  73. clearInterval(this.timer)
  74. this.timer = null
  75. uni.navigateTo({
  76. url: '/pages/indexEntry/enroll/payment/payment'
  77. })
  78. if (res.flowStatus > 2) {
  79. clearInterval(this.timer)
  80. this.timer = null
  81. this.$u.toast('合同已撤销或过期')
  82. }
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .card {
  90. .h2 {
  91. min-height: 800rpx;
  92. text-align: center;
  93. padding: 40rpx 0;
  94. }
  95. }
  96. .btnBg {
  97. width: 396rpx !important;
  98. margin: 100rpx auto 100rpx auto;
  99. }
  100. </style>