insuranceDialog.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <u-popup mode="center" round="10" :show="isShow" :closeOnClickOverlay="false">
  3. <view class="dialog">
  4. <view class="close" v-if="type === 3">
  5. <u-icon
  6. name="close"
  7. color="#9E9E9E"
  8. size="24"
  9. @tap="closeDialog"
  10. ></u-icon>
  11. </view>
  12. <view class="top">
  13. <image
  14. src="@/static/images/dialog/insurance-icon1.png"
  15. mode="widthFix"
  16. v-if="type === 3"
  17. ></image>
  18. <image
  19. src="@/static/images/dialog/insurance-icon2.png"
  20. mode="widthFix"
  21. v-if="type === 2"
  22. ></image>
  23. </view>
  24. <view class="title">保险购买提示</view>
  25. <view class="text" v-if="type === 3"
  26. >距离保险期还有{{ day }}天,请及时续保,以免影响接单!</view
  27. >
  28. <view class="text" v-if="type === 2"
  29. >保险已过期,为了您的安全保障,请及时续保,以免影响接单!</view
  30. >
  31. <view class="btn">
  32. <u-button
  33. text="去续保"
  34. shape="circle"
  35. type="primary"
  36. @click="clickButton()"
  37. >
  38. </u-button>
  39. </view>
  40. </view>
  41. </u-popup>
  42. </template>
  43. <script>
  44. export default {
  45. props: {
  46. isShow: {
  47. type: Boolean,
  48. default: false,
  49. },
  50. type: {
  51. type: Number,
  52. default: 0, // 2=保险过期提示 3=保险快到期提示
  53. },
  54. },
  55. data() {
  56. return {
  57. day: 0,
  58. };
  59. },
  60. onLoad() {},
  61. methods: {
  62. initData() {
  63. const userInfo = this.$store.state.userInfo;
  64. this.day = userInfo.limitInsureDay;
  65. },
  66. closeDialog() {
  67. this.$emit('close');
  68. },
  69. clickButton() {
  70. this.$emit('handle');
  71. },
  72. },
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .dialog {
  77. width: 640rpx;
  78. background: #ffffff;
  79. border-radius: 20rpx;
  80. overflow: hidden;
  81. position: relative;
  82. display: flex;
  83. flex-direction: column;
  84. align-items: center;
  85. padding: 0 70rpx 70rpx;
  86. box-sizing: border-box;
  87. .close {
  88. position: absolute;
  89. right: 40rpx;
  90. top: 40rpx;
  91. }
  92. .top {
  93. margin-top: 30rpx;
  94. image {
  95. width: 390rpx;
  96. height: 220rpx;
  97. }
  98. }
  99. .title {
  100. font-size: 44rpx;
  101. font-weight: 500;
  102. }
  103. .text {
  104. text-align: center;
  105. font-size: 32rpx;
  106. color: $sec-font;
  107. line-height: 48rpx;
  108. margin-top: 30rpx;
  109. }
  110. .btn {
  111. width: 100%;
  112. margin-top: 60rpx;
  113. }
  114. }
  115. </style>