card.vue 3.2 KB

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