integral-model.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view v-if="modelStatus" class="lottery-integral-model">
  3. <view class="box dir-top-nowrap main-center cross-center">
  4. <image class="close" @click="closeModel" src="/static/image/icon/close.png"></image>
  5. <view class="header">
  6. <view>参与此抽奖需要消耗</view>
  7. <view>
  8. <text style="color: #ff4544" v-text="text"></text>
  9. ,是否继续?
  10. </view>
  11. </view>
  12. <view class="bg" :style="{backgroundImage: 'url(' + appImg.lottery.bg+ ')'}"></view>
  13. <view @click="next" class="btn main-center cross-center">
  14. 继续抽奖
  15. </view>
  16. <view @click="closeModel" class="fail">
  17. 放弃抽奖
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {mapState} from 'vuex';
  24. export default {
  25. name: 'integral-model',
  26. computed: {
  27. ...mapState({
  28. appImg: state => state.mallConfig.__wxapp_img,
  29. }),
  30. },
  31. props: {
  32. text: {
  33. type: String,
  34. default: '0积分'
  35. },
  36. },
  37. data() {
  38. return {
  39. modelStatus: false,
  40. params: null,
  41. }
  42. },
  43. methods: {
  44. showModel(...params) {
  45. this.params = params;
  46. this.modelStatus = true;
  47. },
  48. next() {
  49. this.closeModel();
  50. this.$emit('next', this.params);
  51. },
  52. closeModel() {
  53. this.modelStatus = false;
  54. },
  55. }
  56. }
  57. </script>
  58. <style scoped lang="scss">
  59. .lottery-integral-model {
  60. text-align: center;
  61. height: 100vh;
  62. width: 100vw;
  63. position: fixed;
  64. top: 0;
  65. z-index: 1602;
  66. background-color: rgba(0, 0, 0, 0.3);
  67. .box {
  68. position: relative;
  69. text-align: center;
  70. margin: 0 auto;
  71. width: #{534rpx};
  72. background-color: #FFFFFF;
  73. border-radius: #{16rpx};
  74. z-index: 2;
  75. top: 20%;
  76. .close {
  77. position: absolute;
  78. height: #{30rpx};
  79. width: #{30rpx};
  80. top: #{24rpx};
  81. right: #{24rpx};
  82. }
  83. .header {
  84. font-size: #{32rpx};
  85. color: #353535;
  86. font-weight: bold;
  87. margin: #{40rpx} auto;
  88. }
  89. .bg {
  90. background-size: 100% 100%;
  91. background-repeat: no-repeat;
  92. height: #{263rpx};
  93. width: #{355rpx};
  94. display: block;
  95. margin-bottom: #{40rpx};
  96. }
  97. .btn {
  98. height: #{76rpx};
  99. width: #{366rpx};
  100. background-color: #ff4544;
  101. color: #FFFFFF;
  102. font-size: #{32rpx};
  103. border-radius: #{40rpx};
  104. margin-bottom: #{36rpx};
  105. }
  106. .fail {
  107. line-height: 1;
  108. font-size: #{28rpx};
  109. color: #ff4544;
  110. margin-bottom: #{40rpx};
  111. }
  112. }
  113. }
  114. </style>