Rule.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="rule-detail-wrap" v-show="openRule">
  3. <view class="rule-bg" @click="closeRule" :class="openRule ? 'active' : ''"></view>
  4. <view class="rule-content" v-on:click.stop>
  5. <view class="title pr">
  6. <text class="">活动规则</text>
  7. <text class="iconfont icon-guanbi" @click="closeRule"></text>
  8. </view>
  9. <view class="content">{{ setting.bargain_rules }}</view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. /*是否显示*/
  18. openRule: false
  19. };
  20. },
  21. props: ['isRule', 'setting'],
  22. watch: {
  23. isRule: function(n, o) {
  24. if (n != o) {
  25. this.openRule = n;
  26. }
  27. }
  28. },
  29. methods: {
  30. /*关闭规则*/
  31. closeRule() {
  32. this.openRule = false;
  33. this.$emit('close');
  34. }
  35. }
  36. };
  37. </script>
  38. <style>
  39. .rule-detail-wrap {
  40. position: fixed;
  41. top: 0;
  42. bottom: 0;
  43. left: 0;
  44. right: 0;
  45. width: 100%;
  46. z-index: 999;
  47. }
  48. .rule-detail-wrap .rule-bg {
  49. position: absolute;
  50. top: 0;
  51. bottom: 0;
  52. left: 0;
  53. right: 0;
  54. background-color: rgb(0, 0, 0);
  55. opacity: 0;
  56. transition: all 0.3s ease-out;
  57. }
  58. .rule-detail-wrap .rule-bg.active {
  59. opacity: 0.8;
  60. }
  61. .rule-detail-wrap .rule-content {
  62. position: absolute;
  63. bottom: 0;
  64. left: 0;
  65. right: 0;
  66. background-color: #fff;
  67. border-top-left-radius: 20rpx;
  68. border-top-right-radius: 20rpx;
  69. transition: all 0.3s ease-out;
  70. box-sizing: border-box;
  71. }
  72. .rule-detail-wrap .rule-content .title {
  73. height: 100rpx;
  74. display: flex;
  75. align-items: center;
  76. justify-content: center;
  77. font-size: 32rpx;
  78. position: relative;
  79. color: #333;
  80. box-sizing: border-box;
  81. }
  82. .rule-detail-wrap .rule-content .iconfont {
  83. position: absolute;
  84. right: 20rpx;
  85. top: 20rpx;
  86. }
  87. .rule-detail-wrap .rule-content .content {
  88. padding: 30rpx;
  89. max-height: 600rpx;
  90. font-size: 28rpx;
  91. line-height: 150%;
  92. overflow-y: auto;
  93. }
  94. </style>