error-pop.vue 1.9 KB

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