red_packet.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view>
  3. <view class="change-container">
  4. <view class="relative width100 height100">
  5. <image class="width100 height100" :src="resource.ex_red_bg" />
  6. <view class="contain">
  7. <view class="text" style="font-size: 64rpx">恭喜您合成蛋糕</view>
  8. <view class="text marginT20" style="font-size: 36rpx">
  9. - 当前已有{{ cakeTotal }}人合成蛋糕 -
  10. </view>
  11. </view>
  12. <image
  13. class="open_red"
  14. :src="isEnd === 0 ? resource.ex_redBag : resource.ex_open_redBag"
  15. @click.stop="open"
  16. />
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import resource from '@/utils/resource'
  23. export default {
  24. props: {
  25. cakeTotal: Number,
  26. isEnd: Number
  27. },
  28. data() {
  29. return {
  30. resource,
  31. materialList: []
  32. }
  33. },
  34. mounted() {},
  35. methods: {
  36. open() {
  37. if (this.isEnd === 0) return
  38. this.$service.weal.carveUpMoney().then((res) => {
  39. if (res.code === '0') {
  40. this.$emit('open')
  41. } else {
  42. this.$message.error(res.msg)
  43. }
  44. })
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .change-container {
  51. position: fixed;
  52. bottom: 48rpx;
  53. left: 30rpx;
  54. width: 694rpx;
  55. height: 732rpx;
  56. .contain {
  57. position: absolute;
  58. top: 68rpx;
  59. width: 100%;
  60. height: 225rpx;
  61. text-align: center;
  62. .text {
  63. color: #fdcd53;
  64. width: 100%;
  65. }
  66. }
  67. .open_red {
  68. position: absolute;
  69. left: 211rpx;
  70. bottom: 117rpx;
  71. width: 272rpx;
  72. height: 272rpx;
  73. }
  74. }
  75. </style>