|
@@ -0,0 +1,170 @@
|
|
|
+<template>
|
|
|
+ <div class="pages--search" :data-top="Offset">
|
|
|
+ <search ref="getH" id="mySearch" key="search-page" @input="goSearchInput" @submit="goSearch"></search>
|
|
|
+ <van-sticky :offset-top="Offset">
|
|
|
+ <van-tabs v-model="active"
|
|
|
+ title-active-color="#2ABED1"
|
|
|
+ title-inactive-color="#5F5E64"
|
|
|
+ color="#2ABED1"
|
|
|
+ >
|
|
|
+ <van-tab :title="item.label" :name="item.type" v-for="item in tabs" :key="item.type"></van-tab>
|
|
|
+ </van-tabs>
|
|
|
+ </van-sticky>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ <h1>4544454545454</h1>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import { Component, Vue } from 'vue-property-decorator'
|
|
|
+import Search from '@/components/Search.vue'
|
|
|
+import { Tabs, Tab, Icon, Sticky, Toast } from 'vant'
|
|
|
+// import { mapActions } from 'vuex'
|
|
|
+ // import { MixinTop } from '@/utils/mixin-top'
|
|
|
+ @Component({
|
|
|
+ name: 'home',
|
|
|
+ // mixins: [MixinTop],
|
|
|
+ components: {
|
|
|
+ [Tab.name]: Tab,
|
|
|
+ [Tabs.name]: Tabs,
|
|
|
+ [Sticky.name]: Sticky,
|
|
|
+ [Icon.name]: Icon,
|
|
|
+ Search
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // ...mapActions({
|
|
|
+ // ajaxData: 'main/getHome'
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+export default class extends Vue {
|
|
|
+ // protected ajaxData: any
|
|
|
+ pageData: any = {}
|
|
|
+ searchTop = 54
|
|
|
+ active = 'all1'
|
|
|
+ searchInput = ''
|
|
|
+ tabs = [
|
|
|
+ {
|
|
|
+ type: 'all1',
|
|
|
+ label: '全部'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'all2',
|
|
|
+ label: '招标'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'all3',
|
|
|
+ label: '法律法规'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'all4',
|
|
|
+ label: '行业报告'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ created () {
|
|
|
+ this.pageData = {
|
|
|
+ new: [
|
|
|
+ {
|
|
|
+ img: require('@/assets/images/bgApp.png'),
|
|
|
+ type: 'pdf',
|
|
|
+ id: '1',
|
|
|
+ title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
+ money: 200000
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'excel',
|
|
|
+ img: require('@/assets/images/bgApp.png'),
|
|
|
+ id: '2',
|
|
|
+ title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
+ money: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'word',
|
|
|
+ img: require('@/assets/images/bgApp.png'),
|
|
|
+ id: '3',
|
|
|
+ title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
+ money: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'ppt',
|
|
|
+ img: require('@/assets/images/bgApp.png'),
|
|
|
+ id: '4',
|
|
|
+ title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
+ money: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'other',
|
|
|
+ img: require('@/assets/images/bgApp.png'),
|
|
|
+ id: '5',
|
|
|
+ title: '优化招投标市场营商环境与国企优化招投标市场营商环境与国企...',
|
|
|
+ money: 200
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mounted () {
|
|
|
+ this.onFocus()
|
|
|
+ const tempI = (this.$refs.getH as Vue).$el as HTMLDivElement
|
|
|
+ this.searchTop = tempI.offsetHeight
|
|
|
+ }
|
|
|
+
|
|
|
+ get Offset () {
|
|
|
+ const tempN = document.querySelector('.j-header.jy-app-header') as HTMLDivElement
|
|
|
+ if (tempN) {
|
|
|
+ return tempN.offsetHeight - 1 + this.searchTop
|
|
|
+ } else {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ onFocus () {
|
|
|
+ const tempN = document.querySelector('#mySearch input') as HTMLInputElement
|
|
|
+ if (tempN) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ tempN.focus()
|
|
|
+ setTimeout(() => {
|
|
|
+ tempN.focus()
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ goSearch (search: any) {
|
|
|
+ console.log(search)
|
|
|
+ }
|
|
|
+
|
|
|
+ goSearchInput (search: string) {
|
|
|
+ this.searchInput = search
|
|
|
+ }
|
|
|
+
|
|
|
+ goContent (item: any) {
|
|
|
+ console.log(item)
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.pages--search {
|
|
|
+ background: #F5F6F7;
|
|
|
+ padding-bottom: 40px;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+</style>
|