modal.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 @click="btnClick">{{ showText }}</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. showText:{
  38. type:String,
  39. default:'注册开店'
  40. }
  41. },
  42. data() {
  43. return {
  44. };
  45. },
  46. methods: {
  47. closeModal(){
  48. this.$emit('closeModal')
  49. },
  50. btnClick(){
  51. this.$emit('btnClick')
  52. }
  53. },
  54. };
  55. </script>
  56. <style lang="scss" scoped>
  57. .modal-container{
  58. position: relative;
  59. padding: 44rpx 0 32rpx;
  60. .close-modal{
  61. position: absolute;
  62. top: 25rpx;
  63. right: 25rpx;
  64. }
  65. .modal-title{
  66. font-size: 36rpx;
  67. color: #3D3D3D;
  68. text-align: center;
  69. margin-bottom:34rpx;
  70. }
  71. .modal-prompt{
  72. @include flex(center, column);
  73. font-size: 28rpx;
  74. color: #666666;
  75. }
  76. .modal-btn{
  77. margin-top: 24rpx;
  78. padding: 0 58rpx;
  79. box-sizing: border-box;
  80. @include flex(space-between);
  81. button{
  82. width: 190rpx;
  83. height: 76rpx;
  84. font-size: 28rpx;
  85. text-align: center;
  86. line-height: 76rpx;
  87. border-radius: 16rpx;
  88. margin: 0;
  89. &:first-of-type{
  90. border: 1rpx solid #999999;
  91. color: #999999;
  92. background-color:#FFFFFF;
  93. }
  94. &:last-of-type{
  95. color: #FFFFFF;
  96. background-color: $primary-color;
  97. }
  98. }
  99. }
  100. }
  101. </style>