仁慧眼-上市公司微财报PC版前端
hailu
2022-11-03 07f4c2bf1ffd09269517826a444c373ec0000a28
src/pages/search.vue
@@ -1,5 +1,5 @@
<template>
    <div class="search">
    <div class="search" @click="visible = false">
        <div class="logo">
            <img src="../assets/images/logo1.png" alt="">
        </div>
@@ -23,7 +23,8 @@
        <van-popup class="pick" v-model="pickToggle" position="bottom" :style="{ height: 'auto', width: '100%' }">
            <van-picker show-toolbar :columns="columns" @confirm="confirm" @cancel="pickHide" />
        </van-popup>
        <div class="clearfix" style="margin-top: 12px;position: relative;min-height: 14vh;">
        <div class="clearfix" style="margin-top: 12px;position: relative;
">
            <div class="loadingbox" v-if="loading1">
                <div class="loading">
                    <van-loading type="spinner" size="60px" />
@@ -33,11 +34,41 @@
            </div>
            <div class="clearfix" style="width: 81%;float: right;margin-top: 2px;">
                <p v-for="(item, index) in companyList" :key="`companyList_${index}`" @click="quickTurn(item)"
                    style="width: 33.33%;float: left;color: white;">{{ `${item.ts_name}(${item.pre_date_show})` }}</p>
                    class="pointer" style="width: 33.33%;float: left;color: white;margin:1px 0">{{
                    `${item.ts_name}(${item.pre_date_show})`
                    }}</p>
                <p v-if="showTips1" style="width: 50%;float: left;color: white;">暂无数据</p>
            </div>
        </div>
        <div class="clearfix" style="margin-top: 12px;position: relative;">
        <div class="clearfix" style="margin-top: 12px;position: relative;
        ">
            <div class="loadingbox" v-if="loading1">
                <div class="loading">
                    <van-loading type="spinner" size="60px" />
                </div>
            </div>
            <div style="
            width: 18%;
            float: left;
            font-size: 14px;
            font-weight: bold;
            color: white;
            text-align: center;
          ">
                财报发布
            </div>
            <div class="clearfix" style="width: 81%; float: right; margin-top: 2px">
                <p class="pointer" v-for="(item, index) in companyListPub" :key="`companyList_${index}`"
                    style="width: 24%; float: left; color: white;margin:1px 0" @click="quickTurn(item)">
                    {{ `${item.ts_name}(${item.pre_date_show})` }}
                </p>
                <p v-if="showTips1pub" style="width: 24%; float: left; color: white; text-align: center">
                    暂无数据
                </p>
            </div>
        </div>
        <div class="clearfix" style="margin-top: 12px;position: relative;
        ">
            <div class="loadingbox" v-if="loading2">
                <div class="loading">
                    <van-loading type="spinner" size="60px" />
@@ -49,8 +80,45 @@
            </div>
            <div class="clearfix" style="width: 81%;float: right;margin-top: 2px;">
                <p v-for="(item, index) in companyList_Semi" :key="`companyList_${index}`" @click="quickTurn(item)"
                    style="width: 33.33%;float: left;color: white;">{{ `${item.ts_name}(${item.pre_date_show})` }}</p>
                    class="pointer" style="width: 33.33%;float: left;color: white;;margin:1px 0">{{
                    `${item.ts_name}(${item.pre_date_show})`
                    }}</p>
                <p v-if="showTips2" style="width: 50%;float: left;color: white;">暂无数据</p>
            </div>
        </div>
        <div class="clearfix" style="margin-top: 12px; position: relative;
        ">
            <div class="loadingbox" v-if="loading2">
                <div class="loading">
                    <van-loading type="spinner" size="60px" />
                </div>
            </div>
            <div style="width: 18%; float: left">
                <p style="
              font-size: 14px;
              font-weight: bold;
              color: white;
              text-align: center;
            ">
                    财报发布
                </p>
                <p style="
              font-size: 14px;
              font-weight: bold;
              color: white;
              text-align: center;
            ">
                    半导体
                </p>
            </div>
            <div class="clearfix" style="width: 81%; float: right; margin-top: 2px">
                <p class="pointer" v-for="(item, index) in companyList_SemiPub" :key="`companyList_${index}`"
                    @click="quickTurn(item)" style="width: 24%; float: left; color: white;margin:1px 0">
                    {{ `${item.ts_name}(${item.pre_date_show})` }}
                </p>
                <p v-if="showTips2pub" style="width: 24%; float: left; color: white; text-align: center">
                    暂无数据
                </p>
            </div>
        </div>
        <div class="to-message pointer" style="max-width: 630px;">
@@ -75,6 +143,8 @@
    },
    data() {
        return {
            companyList_SemiPub: [],
            companyListPub: [],
            loading1: true,
            loading2: true,
            columns: [
@@ -104,11 +174,15 @@
            companyList_Semi: [],//公司列表(半导体)
            showTips1: false,//是否显示暂无数据提示
            showTips2: false,//是否显示暂无数据提示
            showTips1pub: false, //是否显示暂无数据提示
            showTips2pub: false, //是否显示暂无数据提示
        }
    },
    activated() {
        this.getCompanyList()
        this.getCompanyList('Semi')
        this.getCompanyListPub()
        this.getCompanyListPub('Semi')
        this.getDefaultReportType()
        this.selectVal = this.columns[0];
        // wxapi.wxRegister(data, option);
@@ -120,6 +194,60 @@
        this.serachList = [];
    },
    methods: {
        //获取公司列表 财报发布
        getCompanyListPub(Plate) {
            let data = {
                PubFlag: true,
                // TypeInfo:  this.selectVal.text,
            }
            if (Plate == 'Semi') {
                data.Plate = 'Semi'
                this.loading2 = true
            } else {
                this.loading1 = true
            }
            let that = this
            that.$axios.post(
                '/DisclosureDate/GetDisclosureDateList',
                data,
            )
                .then((res) => {
                    if (res.data.Data && res.data.Data.length > 0) {
                        if (Plate == 'Semi') {
                            that.showTips2pub = false
                            this.companyList_SemiPub = res.data.Data
                        } else {
                            that.showTips2pub = false
                            this.companyListPub = res.data.Data
                        }
                    } else {
                        if (Plate == 'Semi') {
                            that.showTips2pub = true
                            this.companyList_SemiPub = []
                        } else {
                            that.showTips1pub = true
                            this.companyListPub = []
                        }
                    }
                    if (Plate == 'Semi') {
                        this.loading2 = false
                    } else {
                        this.loading1 = false
                    }
                })
                .catch((err) => {
                    if (Plate == 'Semi') {
                        this.loading2 = false
                        that.showTips2pub = true
                        this.companyList_SemiPub = []
                    } else {
                        this.loading1 = false
                        that.showTips1pub = true
                        this.companyListPub = []
                    }
                })
        },
        /**
         * 获取默认财报类型
         */
@@ -249,6 +377,7 @@
            this.pickHide();
        },
        tohome: function (item) {
            this.visible = false
            // sessionStorage.setItem('param', JSON.stringify({
            //     id: item.id,
            //     type: this.selectVal.value
@@ -258,9 +387,9 @@
            console.log(this.selectVal);
            let imgName = item.StockName + '(' + item.TSCode + ')' + this.selectVal.text
            let routeUrl=this.$router.resolve({
            let routeUrl = this.$router.resolve({
                path: "home",
                 query: {
                query: {
                    name: item.StockName,
                    TSCode: item.TSCode,
                    selectVal: this.selectVal.text,
@@ -282,14 +411,39 @@
         * 快速查看
         */
        quickTurn(item) {
            this.$router.push({
                name: 'home',
                query: {
                    id: 0,
                    ReportType: item.report_type,
                    TSCode: item.ts_code,
                }
            })
            let year = item.end_date.slice(0, 4)
            console.log(item);
            let routeUrl = ''
            if (item.id) {
                routeUrl =  this.$router.resolve({
                    path: 'home',
                    query: {
                        id: 0,
                        type: item.report_type,
                        TSCode: item.ts_code,
                        year: year
                    }
                })
            } else {
                routeUrl = this.$router.resolve({
                    path: 'home',
                    query: {
                        type: item.report_type,
                        TSCode: item.ts_code,
                        year: year
                    }
                })
            }
            // let routeUrl = this.$router.resolve({
            //     path: "home",
            //     query: {
            //         id: 0,
            //         type: item.report_type,
            //         TSCode: item.ts_code,
            //     }
            // })
            window.open(routeUrl.href, '_blank');
        },
        search: function () {
            if (!this.searchVal) {
@@ -330,16 +484,17 @@
.search {
    // background: linear-gradient(to top, #E40A0A, #E56E6E);
    background: linear-gradient(to top, #03a2e9, #09a2e9);
    height: 100vh;
    padding: 150px 15px 0;
    min-height: 100vh;
    padding: 30px 15px 0;
    position: relative;
    .logo {
        height: 0.8rem;
        height: 40px;
        img {
            display: block;
            height: 100%;
            height: 40px;
            width: 150px;
            margin: auto;
        }
    }
@@ -426,9 +581,9 @@
        width: 100%;
        text-align: center;
        padding: 10px 0;
        // margin-top:100px;
        position: fixed;
        bottom: 10px;
        // background-color: #e41616;
        z-index: 9;
        u {