mission-list.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="mission-list">
  3. <scroll-view class="scroll-y" scroll-y="true">
  4. <list-item />
  5. <list-item />
  6. <view class="completed-box">
  7. <view class="btn-box">
  8. <view class="btn" @click="toggleBtn">
  9. <image class="icon" :src="`/static/${btnSetting.icon}.png`"></image>
  10. <text class="text">
  11. {{ btnSetting.name }}
  12. </text>
  13. </view>
  14. </view>
  15. <list-item :isClose="true" v-if="showCloseList" />
  16. </view>
  17. </scroll-view>
  18. <tm-tabbar :permission="1" />
  19. </view>
  20. </template>
  21. <script>
  22. // 任务列表
  23. import listItem from './list-item.vue';
  24. export default {
  25. data(){
  26. return {
  27. // 是否展开历史任务
  28. showCloseList: false,
  29. btnSetting: {
  30. icon: 'up-icon', // 图标名
  31. name: '展示历史任务' // 按钮显示名字
  32. },
  33. closeList: [1, 2, 3]
  34. }
  35. },
  36. watch: {
  37. showCloseList(newVal, oldVal) {
  38. if(newVal != oldVal){
  39. this.btnSetting.icon = newVal ? 'up-icon' : 'down-ion';
  40. this.btnSetting.name = newVal ? '收起历史任务' : '展示历史任务';
  41. }
  42. }
  43. },
  44. methods: {
  45. toggleBtn() {
  46. this.showCloseList = !this.showCloseList
  47. }
  48. },
  49. components: {
  50. listItem
  51. }
  52. }
  53. </script>
  54. <style lang="less">
  55. .mission-list {
  56. height: 100%;
  57. padding-top: 15rpx;
  58. .scroll-y {
  59. height: calc(100% - 87.5rpx);
  60. .completed-box {
  61. .btn-box {
  62. display: flex;
  63. justify-content: center;
  64. margin-bottom: 25rpx;
  65. height: 50rpx;
  66. .btn {
  67. display: flex;
  68. justify-content: center;
  69. align-items: center;
  70. width: 225rpx;
  71. height: 50rpx;
  72. border-radius: 37.5rpx;
  73. border: 1.25rpx solid #98A1B3;
  74. .icon {
  75. margin-right: 6.25rpx;
  76. width: 21.25rpx;
  77. height: 12.5rpx;
  78. }
  79. .text {
  80. font-size: 22.5rpx;
  81. color: #98A1B3;
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }
  88. </style>