app-prompt-box.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="app-prompt-box">
  3. <view class="app-content">
  4. <text class="app-title">提示</text>
  5. <view class="app-text">
  6. {{text}}
  7. </view>
  8. <view class="app-buttons dir-left-nowrap">
  9. <view class="app-button app-close" @click="close(false)">取消</view>
  10. <view class="app-line"></view>
  11. <view class="app-button app-sure" @click="close(true)">确认</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'app-prompt-box',
  19. props: {
  20. text: {
  21. type: String,
  22. }
  23. },
  24. methods: {
  25. close(boolean) {
  26. this.$emit('click', boolean);
  27. }
  28. }
  29. }
  30. </script>
  31. <style scoped lang="scss">
  32. .app-prompt-box {
  33. width: 100%;
  34. height: 100%;
  35. position: fixed;
  36. top: 0;
  37. left: 0;
  38. background-color: rgba(153, 153, 153, 0.3);
  39. z-index: 1500;
  40. .app-content {
  41. width: #{620rpx};
  42. border-radius: #{8rpx};
  43. background-color: white;
  44. position: absolute;
  45. top: 50%;
  46. left: 50%;
  47. transform: translate(-50%, -50%);
  48. text-align: center;
  49. .app-title {
  50. display: inline-block;
  51. font-size: #{32rpx};
  52. margin-top: #{40rpx};
  53. margin-bottom: #{64rpx};
  54. color: #353535;
  55. text-align: center;
  56. }
  57. .app-text {
  58. font-size: #{32rpx};
  59. color: #353535;
  60. text-align: center;
  61. margin-bottom: #{64rpx};
  62. }
  63. .app-buttons {
  64. border-top: #{1rpx} solid #e2e2e2;
  65. .app-button {
  66. font-size: #{32rpx};
  67. width: #{309.5rpx};
  68. height: #{88rpx};
  69. line-height: #{88rpx};
  70. text-align: center;
  71. }
  72. .app-sure {
  73. color: #ff4544;
  74. }
  75. .app-close {
  76. color: #666666;
  77. }
  78. .app-line {
  79. width: #{1rpx};
  80. height: #{32rpx};
  81. margin-top: #{30rpx};
  82. color: #e2e2e2;
  83. }
  84. }
  85. }
  86. }
  87. </style>