爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.5 KiB

1 week ago
  1. <template>
  2. <view class="protocol-dialog" v-if="show">
  3. <view class="dialog-mask"></view>
  4. <view class="dialog-content">
  5. <view class="dialog-title">{{ title }}</view>
  6. <scroll-view class="dialog-body" scroll-y>
  7. <view class="rich-text-wrapper">
  8. <rich-text :nodes="content"></rich-text>
  9. </view>
  10. </scroll-view>
  11. <view class="dialog-footer">
  12. <view class="footer-btn reject" @click="$emit('reject')">拒绝</view>
  13. <view class="footer-divider"></view>
  14. <view class="footer-btn agree" @click="$emit('agree')">同意</view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. name: 'ProtocolDialog',
  22. props: {
  23. show: {
  24. type: Boolean,
  25. default: false
  26. },
  27. title: {
  28. type: String,
  29. default: ''
  30. },
  31. content: {
  32. type: String,
  33. default: ''
  34. }
  35. }
  36. }
  37. </script>
  38. <style scoped>
  39. .protocol-dialog {
  40. position: fixed;
  41. top: 0;
  42. left: 0;
  43. right: 0;
  44. bottom: 0;
  45. z-index: 999;
  46. display: flex;
  47. align-items: center;
  48. justify-content: center;
  49. }
  50. .dialog-mask {
  51. position: absolute;
  52. top: 0;
  53. left: 0;
  54. right: 0;
  55. bottom: 0;
  56. background: rgba(0, 0, 0, 0.6);
  57. }
  58. .dialog-content {
  59. position: relative;
  60. width: 86vw;
  61. max-width: 700rpx;
  62. background: #fff;
  63. border-radius: 32rpx;
  64. overflow: hidden;
  65. z-index: 1;
  66. display: flex;
  67. flex-direction: column;
  68. box-sizing: border-box;
  69. }
  70. .dialog-title {
  71. text-align: center;
  72. font-size: 36rpx;
  73. font-weight: bold;
  74. color: #222;
  75. margin: 48rpx 0 24rpx 0;
  76. }
  77. .dialog-body {
  78. flex: 1;
  79. max-height: 60vh;
  80. min-height: 200rpx;
  81. width: 100%;
  82. padding: 0 40rpx;
  83. font-size: 28rpx;
  84. color: #444;
  85. line-height: 1.8;
  86. box-sizing: border-box;
  87. margin-bottom: 24rpx;
  88. }
  89. .rich-text-wrapper {
  90. width: 100%;
  91. font-size: 28rpx;
  92. color: #444;
  93. line-height: 1.8;
  94. }
  95. :deep(h1), :deep(h2), :deep(h3) {
  96. font-size: 32rpx !important;
  97. font-weight: bold !important;
  98. margin: 24rpx 0 12rpx 0 !important;
  99. color: #222 !important;
  100. }
  101. :deep(p) {
  102. font-size: 28rpx !important;
  103. color: #444 !important;
  104. margin: 0 0 12rpx 0 !important;
  105. line-height: 1.8 !important;
  106. }
  107. .dialog-footer {
  108. display: flex;
  109. flex-direction: row;
  110. border-top: 1rpx solid #eee;
  111. height: 90rpx;
  112. }
  113. .footer-btn {
  114. flex: 1;
  115. text-align: center;
  116. line-height: 90rpx;
  117. font-size: 32rpx;
  118. font-weight: 500;
  119. }
  120. .reject {
  121. color: #888;
  122. background: #fff;
  123. }
  124. .agree {
  125. color: #f79400;
  126. background: #fff;
  127. }
  128. .footer-divider {
  129. width: 1rpx;
  130. background: #eee;
  131. height: 100%;
  132. }
  133. </style>