index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="搜索" @clickLeft="back">
  4. <!--右菜单-->
  5. <template slot="right">
  6. <u-button type="success" size="small" class="u-reset-button" @click="$refs.treePicker._show()"
  7. text="选择分类"></u-button>
  8. </template>
  9. </uni-nav-bar>
  10. <view class="top-wrapper">
  11. <view class="searchBox rx-bc">
  12. <input v-model="searchFrom.keyWord" placeholder="请输入关键字搜索" class="searchInput" />
  13. <view>
  14. <u-button @click="doSearch" type="success" class="u-reset-button" text="搜索">
  15. </u-button>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="list_box">
  20. <u-list>
  21. <view v-for="(item,index) in 100">
  22. <view>{{item}}</view>
  23. </view>
  24. </u-list>
  25. </view>
  26. <view class="bottom-wrapper rx-bc">
  27. <view>
  28. <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
  29. <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
  30. </checkbox>
  31. </view>
  32. <view>
  33. <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" >
  34. <view class="selBtn"> 选择( {{ checkListLen }} ) </view>
  35. </u-button>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. searchFrom: {
  45. keyWord: null
  46. },
  47. seletedAll: false, //全选状态
  48. checkListLen: 0,
  49. }
  50. },
  51. methods: {
  52. _seletedAll() {
  53. this.seletedAll = !this.seletedAll
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .content-box {
  60. height: 100vh;
  61. overflow: hidden;
  62. display: flex;
  63. flex-direction: column;
  64. background-color: $page-bg;
  65. }
  66. .searchBox {
  67. background-color: #dedede;
  68. height: 100rpx;
  69. padding: 0 20rpx;
  70. input {
  71. height: 80rpx;
  72. width: 540rpx;
  73. background: #f9f9f9 !important;
  74. padding-left: 10rpx;
  75. border-radius: 5rpx;
  76. }
  77. }
  78. .list_box {
  79. flex: 1;
  80. overflow: hidden;
  81. padding: 6rpx 0;
  82. .u-list {
  83. height: 100% !important;
  84. }
  85. }
  86. .bottom-wrapper {
  87. height: 80rpx;
  88. background: #fff;
  89. padding: 0 32rpx;
  90. /deep/ .uni-checkbox-input-checked {
  91. background-color: $theme-color !important;
  92. border-color: $theme-color !important;
  93. }
  94. }
  95. </style>