card.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="">
  3. <view class="card" style="display: flex;" v-for="(item,index) in cardList" :key="index">
  4. <view v-if="checkAllShow" class="center" style="width: 10%;background-color: #F1F1F1;">
  5. <u-checkbox shape="circle" @change="checkboxChange" v-model="item.checked" :name="index"></u-checkbox>
  6. </view>
  7. <navigator url="/pages/publish/detail" hover-class="none" class="" >
  8. <image class="bg" src="@/static/del/del.png"></image>
  9. <view class="content">
  10. <text class="text-cut-1 title">消费新势能 老品牌向新网红的跃迁之路!{{item.id}}</text>
  11. <block>
  12. <view class="cu-tag btn-bg-color round sm tag" v-for="(item,index) in 3" :key="index">
  13. 天河区
  14. </view>
  15. <!-- <text class="text-gray margin-top-10">...</text> -->
  16. </block>
  17. <view class="time">
  18. <text>报名截至时间:2021.07.08</text>
  19. </view>
  20. </view>
  21. <image v-if="item.status==0" class="status" src="@/static/icon/fail.png" mode="widthFix"></image>
  22. <image v-if="item.status==1" class="status" src="@/static/icon/pass1.png" mode="widthFix"></image>
  23. <image v-if="item.status==2" class="status" src="@/static/icon/await.png" mode="widthFix"></image>
  24. </navigator>
  25. </view>
  26. <block v-if="checkAllShow & current!=2">
  27. <view class="" style="height: 110rpx;"></view>
  28. <view class="bottom-bar" >
  29. <view class="left">
  30. <u-checkbox @change="checkAllChange" shape="circle" v-model="checkAll" >全选</u-checkbox>
  31. </view>
  32. <view class="btn-bg-color center right">
  33. <text v-if="current==0">结束活动</text>
  34. <text v-if="current==1">参加活动</text>
  35. </view>
  36. </view>
  37. </block>
  38. </view>
  39. </template>
  40. <script>
  41. export default{
  42. props:{
  43. cardList:Array,
  44. current:Number
  45. },
  46. data(){
  47. return {
  48. checkAllShow:false,
  49. }
  50. },
  51. computed:{
  52. checkAll:{
  53. get(){
  54. let tmpList= this.cardList.filter(item=>item.checked == true)
  55. if (tmpList.length == this.cardList.length) {
  56. return true
  57. }
  58. return false
  59. },
  60. set(){
  61. }
  62. }
  63. },
  64. methods: {
  65. showCheckAll(){
  66. this.checkAllShow=!this.checkAllShow
  67. },
  68. checkboxChange(e) {
  69. this.$emit('checkboxChange',e)
  70. },
  71. checkAllChange(e){
  72. this.$emit('checkAllChange',e)
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .bottom-bar {
  79. position: fixed;
  80. bottom: 0;
  81. z-index: 99;
  82. width: 100%;
  83. background-color: #FFFFFF;
  84. height: 100rpx;
  85. display: flex;
  86. .left {
  87. width: 70%;
  88. display: flex;
  89. flex-direction: column;
  90. justify-content: center;
  91. padding-left: 30rpx;
  92. }
  93. .right {
  94. width: 30%;
  95. }
  96. }
  97. .card {
  98. overflow: hidden;
  99. position: relative;
  100. background-color: #FFFFFF;
  101. margin: 20rpx;
  102. border-radius: 20rpx;
  103. .bg {
  104. border-radius: 20rpx 20rpx 0 0;
  105. width: 100vw;
  106. height: 250rpx;
  107. }
  108. .status {
  109. position: absolute;
  110. right: 0;
  111. bottom: -10rpx;
  112. width: 100rpx;
  113. }
  114. .content {
  115. padding: 10rpx 20rpx;
  116. .title {
  117. font-weight: 800;
  118. font-size: 30rpx;
  119. }
  120. .tag {
  121. padding: 20rpx 32rpx;
  122. margin: 20rpx 20rpx 20rpx 0;
  123. }
  124. .time {
  125. font-size: 24rpx;
  126. margin-bottom: 20rpx;
  127. }
  128. }
  129. }
  130. </style>