error-pop.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view>
  3. <u-popup :show="errorShow" :closeOnClickOverlay="false" :safeAreaInsetBottom="false" @close="closeClick" mode="center" :round="10">
  4. <view class="error-box">
  5. <view class="flex_box flex_row_center">
  6. <u-image src="@/static/image/error-img.png" width="112rpx" height="112rpx"></u-image>
  7. </view>
  8. <view :class="['tips-value',{'is-center': isCenter}]">
  9. <view class="">
  10. {{content}}
  11. </view>
  12. <view class="tips-value-extra" v-if="extraText">
  13. {{extraText}}
  14. </view>
  15. </view>
  16. <view class="btn-box">
  17. <u-button class="no-btn" type="primary" :plain="true" :text="cancelBtnText" @click="closeClick"></u-button>
  18. <u-button class="yes-btn" type="primary" :text="confirmBtnText" @click="confirmClick"></u-button>
  19. </view>
  20. </view>
  21. </u-popup>
  22. </view>
  23. </template>
  24. <script>
  25. export default{
  26. props:{
  27. value:{
  28. type:Boolean,
  29. default:false
  30. },
  31. content: {
  32. type:String,
  33. default:''
  34. },
  35. extraText: {
  36. type:String,
  37. default:''
  38. },
  39. cancelBtnText: {
  40. type:String,
  41. default:'否'
  42. },
  43. confirmBtnText: {
  44. type:String,
  45. default:'是'
  46. },
  47. isCenter: {
  48. type:Boolean,
  49. default:false
  50. }
  51. },
  52. watch:{
  53. value: {
  54. handler(val) {
  55. this.errorShow = val
  56. },
  57. immediate:true
  58. }
  59. },
  60. data() {
  61. return {
  62. errorShow:false
  63. }
  64. },
  65. methods:{
  66. closeClick() {
  67. this.$emit('close')
  68. },
  69. confirmClick() {
  70. this.$emit('confirm')
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .error-box {
  77. width: 580rpx;
  78. padding: 48rpx 36rpx 48rpx;
  79. .tips-value {
  80. color: #1D212A;
  81. font-family: "PingFang SC";
  82. font-size: 32rpx;
  83. font-style: normal;
  84. font-weight: bold;
  85. margin-top: 32rpx;
  86. &.is-center{
  87. text-align: center;
  88. }
  89. &-extra{
  90. font-weight: 400;
  91. font-size: 28rpx;
  92. color: rgba(153, 153, 153, 1);
  93. }
  94. }
  95. .btn-box {
  96. display: flex;
  97. justify-content: space-between;
  98. margin-top: 60rpx;
  99. .no-btn {
  100. width: 244rpx;
  101. border-radius: 16rpx;
  102. border: 1px solid #BFC8DB;
  103. color: #86909C;
  104. font-size: 32rpx;
  105. }
  106. .yes-btn {
  107. width: 244rpx;
  108. border-radius: 16rpx;
  109. background: #0256FF;
  110. font-size: 32rpx;
  111. }
  112. }
  113. }
  114. </style>