|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-dialog :visible.sync="dialogFormVisible" width="700px" :show-close="showClose">
|
|
|
+ <el-dialog :visible.sync="dialogFormVisible" width="700px" :before-close="beforeClose" :show-close="showClose">
|
|
|
<div class="serviceTitle" slot="title">
|
|
|
<span class="squat"></span>服务到期提醒
|
|
|
</div>
|
|
@@ -81,6 +81,10 @@ export default {
|
|
|
"$route"(){
|
|
|
// 路由变化时重新判断是否需要续费
|
|
|
this.__init()
|
|
|
+ },
|
|
|
+ tenantInfo() {
|
|
|
+ console.log('showInfo ing', this.tenantInfo)
|
|
|
+ this.__init()
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -90,23 +94,41 @@ export default {
|
|
|
__init() {
|
|
|
const { path, query } = this.$route
|
|
|
const tenantInfo = this.tenantInfo
|
|
|
- this.tInfo = { ...tenantInfo }
|
|
|
- // 有效期如果小于0则不能关闭弹窗
|
|
|
- console.log(tenantInfo, 'tenantInfo')
|
|
|
- if(tenantInfo.validRemaining <= 0) {
|
|
|
- this.showClose = false
|
|
|
- } else if(tenantInfo.validRemaining <= 30 && tenantInfo.validRemaining > 0) {
|
|
|
- // 只要续费则弹窗
|
|
|
- this.dialogFormVisible = true
|
|
|
- }
|
|
|
- // 如果是续费页面则不能弹续费, 并且tabrouter 也需要一起判断
|
|
|
- if(path === '/productService' && query.tabrouter == 1 || path === '/productService' && !query.tabrouter) {
|
|
|
+ console.log(+new Date(), '__init', tenantInfo)
|
|
|
+ const tenantRenewStatus = sessionStorage.getItem('tenantRenewStatus')
|
|
|
+ if(tenantRenewStatus) {
|
|
|
this.dialogFormVisible = false
|
|
|
- return
|
|
|
+ } else {
|
|
|
+ this.tInfo = { ...tenantInfo }
|
|
|
+ // 有效期如果小于0则不能关闭弹窗
|
|
|
+ if(tenantInfo.validRemaining <= 0) {
|
|
|
+ this.showClose = false
|
|
|
+ } else if(tenantInfo.validRemaining <= 30 && tenantInfo.validRemaining > 0) {
|
|
|
+ // 只要续费则弹窗
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.showClose = true
|
|
|
+ } else { // 大于30天
|
|
|
+ this.showClose = true
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ }
|
|
|
+ // 如果是续费页面则不能弹续费, 并且tabrouter 也需要一起判断
|
|
|
+ if(path === '/productService' && query.tabrouter == 1 || path === '/productService' && !query.tabrouter) {
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- onSubmit() {
|
|
|
+ beforeClose() { // 续费弹窗关闭前
|
|
|
+ const tInfo = this.tInfo
|
|
|
+ if(tInfo.validRemaining > 0) { // 设置标识,如果机构可用天数大于1天,小于30天则,关闭一次,就不会在提示
|
|
|
+ sessionStorage.setItem('tenantRenewStatus', 1)
|
|
|
+ } else {
|
|
|
+ sessionStorage.removeItem('tenantRenewStatus')
|
|
|
+ }
|
|
|
this.dialogFormVisible = false
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ this.beforeClose()
|
|
|
this.$router.push('/productService')
|
|
|
}
|
|
|
}
|