modal.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="modal">
  3. <tui-modal :show="showModal" custom padding="0rpx" width="546rpx" @cancel="closeModal">
  4. <view class="modal-container">
  5. <view class="close-modal">
  6. <tui-icon name="shut" color="#999999" @click="closeModal"></tui-icon>
  7. </view>
  8. <view class="modal-title">温馨提示</view>
  9. <view class="modal-prompt">
  10. <span v-for="item in promptList" :key="item">{{ item }}</span>
  11. </view>
  12. <view class="modal-btn" v-if="showBtn">
  13. <button @click="closeModal">取消</button>
  14. <button>注册开店</button>
  15. </view>
  16. </view>
  17. </tui-modal>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. showModal: {
  24. type: Boolean,
  25. default: false
  26. },
  27. promptList:{
  28. type: Array,
  29. default: () => {
  30. return []
  31. }
  32. },
  33. showBtn: {
  34. type: Boolean,
  35. default: false
  36. }
  37. },
  38. data() {
  39. return {
  40. };
  41. },
  42. methods: {
  43. closeModal(){
  44. this.$emit('closeModal')
  45. }
  46. },
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .modal-container{
  51. position: relative;
  52. padding: 44rpx 0 32rpx;
  53. .close-modal{
  54. position: absolute;
  55. top: 25rpx;
  56. right: 25rpx;
  57. }
  58. .modal-title{
  59. font-size: 36rpx;
  60. color: #3D3D3D;
  61. text-align: center;
  62. margin-bottom:34rpx;
  63. }
  64. .modal-prompt{
  65. @include flex(center, column);
  66. font-size: 28rpx;
  67. color: #666666;
  68. }
  69. .modal-btn{
  70. margin-top: 24rpx;
  71. padding: 0 58rpx;
  72. box-sizing: border-box;
  73. @include flex(space-between);
  74. button{
  75. width: 190rpx;
  76. height: 76rpx;
  77. font-size: 28rpx;
  78. text-align: center;
  79. line-height: 76rpx;
  80. border-radius: 16rpx;
  81. margin: 0;
  82. &:first-of-type{
  83. border: 1rpx solid #999999;
  84. color: #999999;
  85. background-color:#FFFFFF;
  86. }
  87. &:last-of-type{
  88. color: #FFFFFF;
  89. background-color: $primary-color;
  90. }
  91. }
  92. }
  93. }
  94. </style>