DocHead.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="notice-warp">
  3. <view class="search-box" style="background-color: #fff;">
  4. <u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72" :show-action="false"
  5. @change="search" bg-color="#f0f2f6" shape="square" />
  6. </view>
  7. <CommonTabs :list="categoryList" @change="change" :current="current" ref="CommonTabs" :icon="icon" type="doc"
  8. @iconClick="iconClick">
  9. </CommonTabs>
  10. </view>
  11. </template>
  12. <script>
  13. import mixin from "../mixin.js"
  14. import CommonTabs from '@/components/CommonTabs'
  15. export default {
  16. mixins: [mixin],
  17. components: {
  18. CommonTabs
  19. },
  20. data() {
  21. return {
  22. icon: 'icon-ym icon-ym-thumb-mode',
  23. keyword: '',
  24. current: 0,
  25. categoryList: [{
  26. fullName: '我的文档',
  27. }, {
  28. fullName: '我的共享'
  29. }, {
  30. fullName: '共享给我'
  31. }, {
  32. fullName: '回收站'
  33. }],
  34. }
  35. },
  36. methods: {
  37. search() {
  38. this.searchTimer && clearTimeout(this.searchTimer);
  39. this.searchTimer = setTimeout(() => {
  40. this.$emit('search', this.keyword)
  41. }, 300);
  42. },
  43. change(e) {
  44. this.current = e;
  45. this.keyword = ''
  46. this.$emit('change', this.current)
  47. },
  48. iconClick(e) {
  49. this.$emit('iconClick')
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. .notice-warp {
  56. z-index: 9;
  57. position: fixed;
  58. top: var(--window-top);
  59. left: 0;
  60. width: 100%;
  61. height: 200rpx;
  62. /*对应mescroll-body的top值*/
  63. font-size: 26rpx;
  64. text-align: center;
  65. background-color: #fff;
  66. }
  67. </style>