index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
  39. :localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
  40. </view>
  41. </template>
  42. <script>
  43. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  44. export default {
  45. components: {
  46. baTreePicker
  47. },
  48. data() {
  49. return {
  50. searchFrom: {
  51. keyWord: null
  52. },
  53. seletedAll: false, //全选状态
  54. checkListLen: 0,
  55. }
  56. },
  57. methods: {
  58. _seletedAll() {
  59. this.seletedAll = !this.seletedAll
  60. },
  61. confirm() {},
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .content-box {
  67. height: 100vh;
  68. overflow: hidden;
  69. display: flex;
  70. flex-direction: column;
  71. background-color: $page-bg;
  72. }
  73. .searchBox {
  74. background-color: #dedede;
  75. height: 100rpx;
  76. padding: 0 20rpx;
  77. input {
  78. height: 80rpx;
  79. width: 540rpx;
  80. background: #f9f9f9 !important;
  81. padding-left: 10rpx;
  82. border-radius: 5rpx;
  83. }
  84. }
  85. .list_box {
  86. flex: 1;
  87. overflow: hidden;
  88. padding: 6rpx 0;
  89. .u-list {
  90. height: 100% !important;
  91. }
  92. }
  93. .bottom-wrapper {
  94. height: 80rpx;
  95. background: #fff;
  96. padding: 0 32rpx;
  97. /deep/ .uni-checkbox-input-checked {
  98. background-color: $theme-color !important;
  99. border-color: $theme-color !important;
  100. }
  101. }
  102. </style>