rule.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="cu-modal bottom-modal" :class="{ show: visible }">
  3. <view class="mask" @click="close"></view>
  4. <view class="wrapper cu-dialog">
  5. <view>
  6. <view>
  7. <view class="title">
  8. {{ title }}
  9. <view class="close" @click="close">
  10. <text class="cuIcon-close"></text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="content" v-html="data"></view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. type: '',
  24. data: null,
  25. visible:false
  26. }
  27. },
  28. computed: {
  29. title() {
  30. if (this.type == 'wallet_withdraw_xy') {
  31. return '提现协议'
  32. } else {
  33. return '提现规则'
  34. }
  35. }
  36. },
  37. methods: {
  38. show(type) {
  39. this.visible = true
  40. this.type = type
  41. this.data = null
  42. this.refresh()
  43. },
  44. refresh() {
  45. this.getData()
  46. },
  47. async getData() {
  48. const res = await this.$service.user.getParamConfig(this.type)
  49. this.data = res.data
  50. },
  51. close() {
  52. this.visible = false
  53. this.$emit('close', false)
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .mask {
  60. position: absolute;
  61. left: 0;
  62. right: 0;
  63. top: 0;
  64. bottom: 0;
  65. }
  66. .content{
  67. max-height: 60vh;
  68. overflow: auto;
  69. padding-bottom: 60rpx;
  70. }
  71. .wrapper {
  72. background: #fff;
  73. border-radius: 15px 15px 0px 0px !important;
  74. overflow: hidden;
  75. .title {
  76. text-align: center;
  77. font-size: 32rpx;
  78. font-family: Source Han Sans, Source Han Sans;
  79. font-weight: 700;
  80. color: #000000;
  81. padding: 44rpx 0 48rpx 0;
  82. position: relative;
  83. }
  84. .close {
  85. position: absolute;
  86. right: 0;
  87. width: 48rpx;
  88. height: 48rpx;
  89. background: #ebebeb;
  90. border-radius: 48rpx;
  91. color: #a2a2a2;
  92. top: 30rpx;
  93. line-height: 48rpx;
  94. }
  95. }
  96. </style>