msgPop.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="">
  3. <view class="collpopul" v-for="(i,index) in msgpop" :key="index">
  4. <view class="contxt">
  5. <image :src="i.collAoff?img1:img2" mode="aspectFill" style="width: 30rpx;height: 30rpx;">
  6. </image>
  7. {{i.collAoff?'收藏成功':'已取消收藏'}}
  8. <!-- 收藏成功 -->
  9. </view>
  10. <!-- <view class="goMore" @click="goMore"> -->
  11. <view class="goMore" @click="goMore" v-if="i.collAoff">
  12. <view class="">
  13. 去看看
  14. </view>
  15. <view class="" style="display: flex;height: 100%;justify-content: center;align-items: center;">
  16. <image src="../../static/yyyou.png" mode="aspectFill" style="width: 30rpx;height: 32rpx;">
  17. </image>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: "msgPop",
  26. computed: {
  27. msgpop() {
  28. return this.$store.state.msgpop; // 直接访问 Vuex 中的状态数据
  29. }
  30. },
  31. props: {
  32. itemlist: {
  33. type: Array,
  34. default () {
  35. return []
  36. }
  37. },
  38. // 0 活动 1课程
  39. goNum: {
  40. type: Number,
  41. default () {
  42. return 0
  43. }
  44. }
  45. },
  46. data() {
  47. return {
  48. img1: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect_yellow.png',
  49. img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/delcoll1708391346848.png'
  50. }
  51. },
  52. methods: {
  53. // 删除
  54. delData() {
  55. this.itemlist.shift()
  56. },
  57. // 跳转收藏页面
  58. goMore() {
  59. uni.navigateTo({
  60. url: `/pages/mineCollNew/mineCollNew?ty=${this.goNum}`
  61. })
  62. },
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .collpopul {
  68. position: fixed;
  69. padding: 0 30rpx;
  70. background-color: #fff;
  71. // top: 15%;
  72. box-shadow: 0rpx 10rpx 10rpx 5rpx rgba(0, 0, 0, .1);
  73. z-index: 100;
  74. width: 650rpx;
  75. height: 90rpx;
  76. left: 50%;
  77. transform: translate(-50%, 0);
  78. border-radius: 30rpx;
  79. display: flex;
  80. align-items: center;
  81. // animation: collpopul 1s cubic-bezier(0,0,0.25,1) forwards;
  82. .contxt {
  83. flex: 1;
  84. font-weight: 580;
  85. font-size: 30rpx;
  86. display: flex;
  87. align-items: center;
  88. image {
  89. padding-right: 10rpx;
  90. }
  91. }
  92. .goMore {
  93. // width: 120rpx;
  94. display: flex;
  95. // height: 35rpx;
  96. height: 100%;
  97. line-height: 30rpx;
  98. align-items: center;
  99. color: #F44265;
  100. font-size: 30rpx;
  101. font-weight: bold;
  102. }
  103. }
  104. @keyframes collpopul {
  105. 0% {
  106. // background: red;
  107. top: 0;
  108. }
  109. 100% {
  110. // background: red;
  111. top: 15%;
  112. }
  113. // 100%{
  114. // opacity: 0;
  115. // }
  116. }
  117. </style>