activity.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="safe-area-inset-bottom">
  3. <u-sticky style="margin-top: -4rpx;">
  4. <view class="flex">
  5. <view class="" style="width: 85%;">
  6. <u-tabs active-color="#FF9447" :list="list" :is-scroll="false" :current="current" @change="change">
  7. </u-tabs>
  8. </view>
  9. <view class="bg-white center" style="width: 15%;">
  10. <image @click="checkAll" style="width: 50rpx;height: 50rpx;" src="../../static/icon/setting.png"></image>
  11. </view>
  12. </view>
  13. </u-sticky>
  14. <card :current="current" @checkboxChange="checkboxChange" @checkAllChange="checkAllChange" :cardList="cardList" ref="cardRef"></card>
  15. </view>
  16. </template>
  17. <script>
  18. import card from "./comps/card.vue"
  19. export default {
  20. components:{
  21. card
  22. },
  23. data() {
  24. return {
  25. list: [{
  26. name: '发起'
  27. }, {
  28. name: '可参加'
  29. },
  30. {
  31. name:'已参加'
  32. }],
  33. current: 0,
  34. cardList: [{
  35. id: "1",
  36. checked: false,
  37. status:0
  38. },
  39. {
  40. id: "2",
  41. checked: false,
  42. status:1
  43. },
  44. {
  45. id: "3",
  46. checked: false,
  47. status:2
  48. },
  49. ],
  50. }
  51. },
  52. methods:{
  53. checkboxChange(e){
  54. let index=e.name
  55. this.cardList[index].checked=e.value
  56. },
  57. checkAllChange(e){
  58. this.cardList.forEach(item=>{
  59. item.checked = e.value
  60. })
  61. },
  62. change(index) {
  63. this.current = index
  64. },
  65. checkAll(){
  66. this.$refs.cardRef.showCheckAll()
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. </style>