red-card.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view>
  3. <!-- 红包弹窗 -->
  4. <view class="windows" :class="winState">
  5. <!-- 遮罩层 -->
  6. <view class="mask" @touchmove.stop.prevent="discard" @tap="closeRed"></view>
  7. <view class="layer" @touchmove.stop.prevent="discard">
  8. <view class="open-redenvelope">
  9. <view class="from">
  10. <image :src="packet.userAvatar"></image>
  11. {{ packet.userName }}的红包
  12. </view>
  13. <template v-if="packet.Records">
  14. <template v-for="(r,index) in packet.Records">
  15. <view class="money" v-if="r.robUid===userData.user.operId">
  16. {{r.money}}
  17. </view>
  18. </template>
  19. </template>
  20. <view class="blessing">恭喜发财,大吉大利</view>
  21. <view class="top">
  22. <view class="close-btn">
  23. <view class="icon close" @tap="closeRed"></view>
  24. </view>
  25. <template v-if="packet.Records">
  26. <view v-if="!xxx()" class="img" @tap="robRed">开</view>
  27. <view v-else-if="packet.Records.length===0" class="img" @tap="robRed">开</view>
  28. </template>
  29. </view>
  30. <view class="showDetails" @tap="toDetails">
  31. 查看领取详情
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name:'red-card',
  41. data() {
  42. return {
  43. $url:''
  44. };
  45. },
  46. props: {
  47. winState: {
  48. type: String,
  49. default: ''
  50. },
  51. },
  52. methods:{
  53. xxx(){
  54. let isRob = false;
  55. for(var i in this.packet.Records){
  56. if(this.packet.Records[i].robUid === this.userData.user.operId){
  57. isRob = true;
  58. }
  59. }
  60. return isRob;
  61. },
  62. discard(){
  63. return;
  64. },
  65. toDetails(){
  66. this.$u.vuex('packet',this.packet)
  67. uni.navigateTo({
  68. url:'./detail'
  69. })
  70. },
  71. robRed(){
  72. this.$emit('robRed',true);
  73. },
  74. closeRed(){
  75. this.$emit("closeRed", true)
  76. },
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. @import "@/pageC/chat/style.scss";
  82. </style>