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

105 lines
2.3 KiB

<template>
<view class="pageBgImg">
<topNavbar title="签署合同"></topNavbar>
<!-- <view class="pad">
<view class="card">
<view class="h2">教学合同</view>
</view>
<view class="btnBg" @click="$goPage('/pages/indexEntry/enroll/payment/payment')">同意并签字确认</view>
</view> -->
<!-- @message="handleGetMessage" -->
<web-view :src="webViewUrl"></web-view>
</view>
</template>
<script>
import {
getContractStatus,
getSignContract
} from '@/config/api.js'
export default {
data() {
return {
webViewUrl: '',
schoolId: ''
}
},
beforeDestroy() {
clearInterval(this.timer)
this.timer = null
},
onHide() {
},
onLoad(options) {
this.schoolId = options.schoolId?options.schoolId:this.vuex_userInfo.schoolId
this.trainingApplyId = options.trainingApplyId?options.trainingApplyId: ''
this.timer = setInterval(() => {
this.getContractStatusFn()
}, 3000)
this.getSignContractFn()
},
methods: {
async getSignContractFn() {
uni.showLoading({
title: '正在加载合同...'
})
let info = this.vuex_userInfo
let obj = {
schoolId: this.schoolId,
studentId: this.studentId,
}
if(this.trainingApplyId) obj.trainingApplyId = this.trainingApplyId
const {
data: res
} = await getSignContract(obj)
uni.hideLoading()
this.webViewUrl = res.url
},
handleGetMessage(e){
console.log('handleGetMessage',e)
if(e.detail.data[0].result=='success'){
uni.navigateTo({
url: '/pages/indexEntry/enroll/payment/payment'
})
}
},
// 查询签约状态
async getContractStatusFn() {
const {
data: res
} = await getContractStatus({
studentId: this.studentId
})
if (res.flowStatus == 2) {
clearInterval(this.timer)
this.timer = null
uni.navigateTo({
url: '/pages/indexEntry/enroll/payment/payment'
})
if (res.flowStatus > 2) {
clearInterval(this.timer)
this.timer = null
this.$u.toast('合同已撤销或过期')
}
}
}
}
}
</script>
<style lang="scss" scoped>
.card {
.h2 {
min-height: 800rpx;
text-align: center;
padding: 40rpx 0;
}
}
.btnBg {
width: 396rpx !important;
margin: 100rpx auto 100rpx auto;
}
</style>