|
@@ -1,18 +1,50 @@
|
|
|
<template>
|
|
|
- <u-popup mode="center" round="10" :show="isShow" :closeOnClickOverlay="false">
|
|
|
+ <u-popup v-if="showData" mode="center" round="10" :show="showMod" :closeOnClickOverlay="false">
|
|
|
<view class="dialog">
|
|
|
- <view class="close" v-if="type === 3">
|
|
|
+ <view class="close">
|
|
|
<u-icon name="close" color="#9E9E9E" size="24" @tap="closeDialog"></u-icon>
|
|
|
</view>
|
|
|
<view class="top">
|
|
|
- <image src="@/static/images/dialog/insurance-icon1.png" mode="widthFix" v-if="type === 3"></image>
|
|
|
- <image src="@/static/images/dialog/insurance-icon2.png" mode="widthFix" v-if="type === 2"></image>
|
|
|
+ <image
|
|
|
+ v-if="[2, 3].includes(showData.remindIn)"
|
|
|
+ src="@/static/images/dialog/insurance-icon1.png"
|
|
|
+ mode="widthFix"
|
|
|
+ ></image>
|
|
|
+ <image
|
|
|
+ v-if="[1].includes(showData.remindIn)"
|
|
|
+ src="@/static/images/dialog/insurance-icon2.png"
|
|
|
+ mode="widthFix"
|
|
|
+ ></image>
|
|
|
</view>
|
|
|
<view class="title">保险购买提示</view>
|
|
|
- <view class="text" v-if="type === 3">距离保险期还有{{ day }}天,请及时续保,以免影响接单!</view>
|
|
|
- <view class="text" v-if="type === 2">保险已过期,为了您的安全保障,请及时续保,以免影响接单!</view>
|
|
|
+ <view class="text" v-if="[1].includes(showData.remindIn)"
|
|
|
+ >您在{{ showData.websitName }}网点入驻申请已审核通过,请尽快购买意外保险,以免影响接单</view
|
|
|
+ >
|
|
|
+ <view class="text" v-if="[2].includes(showData.remindIn)"
|
|
|
+ >您在{{ showData.websitName }}网点的意外险距离到期还有{{
|
|
|
+ calculateDaysDifference(item.endTime)
|
|
|
+ }}天,请及时续保,以免影响接单</view
|
|
|
+ >
|
|
|
+ <view class="text" v-if="[3].includes(showData.remindIn)"
|
|
|
+ >您在{{ showData.websitName }}网点的意外险已过期,为了您的安全保障,请及时续保,以免影响接单</view
|
|
|
+ >
|
|
|
<view class="btn">
|
|
|
- <u-button text="去续保" shape="circle" type="primary" @click="clickButton()"> </u-button>
|
|
|
+ <u-button
|
|
|
+ v-if="[1].includes(showData.remindIn)"
|
|
|
+ text="去购买"
|
|
|
+ shape="circle"
|
|
|
+ type="primary"
|
|
|
+ @click="clickButton()"
|
|
|
+ >
|
|
|
+ </u-button>
|
|
|
+ <u-button
|
|
|
+ v-if="[2, 3].includes(showData.remindIn)"
|
|
|
+ text="去续保"
|
|
|
+ shape="circle"
|
|
|
+ type="primary"
|
|
|
+ @click="clickButton()"
|
|
|
+ >
|
|
|
+ </u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
@@ -21,36 +53,69 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
props: {
|
|
|
- isShow: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
- type: {
|
|
|
- type: Number,
|
|
|
- default: 0 // 2=保险过期提示 3=保险快到期提示
|
|
|
+ data: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
}
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
- day: 0
|
|
|
+ isShow: false,
|
|
|
+ type: 0, // 2=保险过期提示 3=保险快到期提示
|
|
|
+ day: 0,
|
|
|
+ data_: []
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- onLoad() {},
|
|
|
+ watch: {
|
|
|
+ data(newVal, oldVal) {
|
|
|
+ this.data_ = JSON.parse(JSON.stringify(newVal)).map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ show_: true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
- initData() {
|
|
|
- const userInfo = this.$store.state.userInfo
|
|
|
- this.day = userInfo.limitInsureDay
|
|
|
+ computed: {
|
|
|
+ showData() {
|
|
|
+ return this.data_.find(item => item.show_)
|
|
|
},
|
|
|
+ showMod() {
|
|
|
+ return !!this.showData
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
+ methods: {
|
|
|
closeDialog() {
|
|
|
- this.$emit('close')
|
|
|
+ var index = this.data_.map(item => item.websitId).indexOf(this.showData.websitId)
|
|
|
+ if (~index) {
|
|
|
+ this.data_.splice(index, 1, {
|
|
|
+ ...this.showData,
|
|
|
+ show_: false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
clickButton() {
|
|
|
- this.$emit('handle')
|
|
|
+ this.$navToPage({
|
|
|
+ url: '/packageEnter/pages/insurance/myInsuranceBuy/index?websitId=' + this.showData.websitId
|
|
|
+ })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.closeDialog()
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ calculateDaysDifference(timeString) {
|
|
|
+ const inputDate = new Date(timeString)
|
|
|
+ const currentDate = new Date()
|
|
|
+ const timeDiff = currentDate - inputDate
|
|
|
+ const daysDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24))
|
|
|
+ return daysDiff
|
|
|
}
|
|
|
}
|
|
|
}
|