msg.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="">
  3. <view class="m_body">
  4. </view>
  5. <view class="m_msg">
  6. <view class="m_title">
  7. {{title}}
  8. </view>
  9. <view :class="btnArr.length>1?'m_btn':'m_btn_sing'">
  10. <text selectable="true"class="m_btn_option" :class="'m_btn_'+index" v-for="(item,index) in btnArr" @click="determine(index)" :key="index">{{item}}</text>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. props: ['title', 'btnArr'],
  18. data() {
  19. return {
  20. }
  21. },
  22. created() {
  23. },
  24. methods: {
  25. determine(index) {
  26. this.$emit("determine", index);
  27. }
  28. }
  29. }
  30. </script>
  31. <style scoped lang="scss">
  32. .m_body {
  33. position: fixed;
  34. z-index: 99;
  35. background-color: #000000;
  36. opacity: 0.4;
  37. top: 0;
  38. left: 0;
  39. right: 0;
  40. bottom: 0;
  41. }
  42. .m_msg {
  43. width: 500rpx;
  44. // height: 400rpx;
  45. padding: 0rpx 0 40rpx 0;
  46. position: fixed;
  47. top: 50%;
  48. left: 50%;
  49. border-radius: 10rpx;
  50. transform: translate(-50%, -50%);
  51. z-index: 100;
  52. background-color: #fff;
  53. opacity: 1;
  54. .m_title {
  55. margin-top: 40rpx;
  56. padding: 20rpx 0 60rpx;
  57. text-align: center;
  58. color: red;
  59. }
  60. .m_btn {
  61. display: flex;
  62. padding: 0 50rpx;
  63. justify-content: space-between;
  64. }
  65. .m_btn_sing {
  66. display: flex;
  67. padding: 0 50rpx;
  68. justify-content: center;
  69. }
  70. .m_btn_option {
  71. padding: 0rpx 60rpx;
  72. border-radius: 10rpx;
  73. font-size: 25rpx;
  74. line-height: 50rpx;
  75. }
  76. .m_btn_0 {
  77. background-color: #EA252C;
  78. color: #fff;
  79. }
  80. .m_btn_1 {
  81. background-color: #c3c0c0;
  82. color: #fff;
  83. }
  84. }
  85. </style>