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.
|
|
<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> --> <web-view :src="webViewUrl" @message="handleGetMessage"></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.timer = setInterval(() => { this.getContractStatusFn() }, 3000) this.getSignContractFn() }, methods: { async getSignContractFn() { uni.showLoading({ title: '正在加载合同...' }) let info = this.vuex_userInfo const { data: res } = await getSignContract({ schoolId: this.schoolId, studentId: this.studentId }) 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>
|