index.vue 33.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
<template>
  <div class="scrm-sub-client-container">
    <!-- 是否门店账号会影响一些标题文字的显示 accountLevel==4 是门店 -->
    <template v-if="isShowModal">
      <div class="modalLayer"></div>
      <img class="tipPanel" src="@/assets/clientDataOverview/allPicture.png" alt="" />
      <img class="knewBtn" src="@/assets/clientDataOverview/btnBg.png" @click="btnKnewClick" />
    </template>
    <!-- @click="goNextPage" -->
    <div class="bannerWrapBox" v-if="isHasCustomerCountBanner">
      <!-- <img src="@/assets/clientDetail/defaultAvator.png" class="inTimeBtn" alt="" /> -->
      <img class="bannerWrap" usemap="#planetmap" src="@/assets/clientDataOverview/companyBanner.png" alt="" />
      <map name="planetmap" id="planetmap" style="cursor: pointer">
        <!-- href="https://www.baidu.com" -->
        <area shape="rect" coords="849,97,933,121" @click="goNextPage" target="_blank" />
      </map>
    </div>
    <h3 class="pageSubTitle">客户分层</h3>
    <div class="topmsg">
      <div class="leftPieEcharts">
        <span class="title">客户总数</span>
        <span class="subtitle" v-if="accountLevel==4">门店的所有客户数,包括企微客户,导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重</span>
        <span class="subtitle" v-else>企业的所有客户数,包括企业客户和旗下所有门店客户,并根据手机号码识别同一客户后合并去重</span>
        <span class="clientTotal">
          <!-- 可以动态跑数字 -->
          <!-- <animate-number from="0" :to="(topDataObj.customerCount || 0) | overThousandFilter" :key="(topDataObj.customerCount || 0) | overThousandFilter" duration="2000"></animate-number> -->
          {{ (topDataObj.customerCount || 0) | overThousandFilter }}
          <span class="person-text">人</span>
        </span>
        <template v-if="isShowData">
          <div class="topIcon">
            <span class="top-inWechat">已加企微</span>
            <span class="top-outWechat">未加企微</span>
          </div>
          <span class="inWechat">已加企微</span>
          <span class="blueNum">{{ (topDataObj.entmicroAddCustomerCount || 0) | overThousandFilter }}人</span>
          <span class="outWechat">未加企微</span>
          <span class="yellowNum">{{ (topDataObj.entmicroNotAddCustomerCount || 0) | overThousandFilter }}人</span>

          <!-- 引入echart组件 -->
          <pie-echart width="100%" height="360px" :topDataObj="topDataObj"></pie-echart>
          <div class="personsMap" v-if="topDataObj.entmicroAddCustomerCount > 0">
            <pictorial-bar width="100%" height="500px" :entmicroAddCustomerCount="topDataObj.entmicroAddCustomerCount" :entmicroNotAddCustomerCount="topDataObj.entmicroNotAddCustomerCount"></pictorial-bar>
          </div>
        </template>
        <no-data :type="'hasIconText'" v-if="!isShowData"></no-data>
      </div>
      <div class="itembox">
        <div class="no-buy">
          <div class="no-buy-total item">
            <span>潜在意向客户数</span>
            <span>无购车且无其他交易行为的所有客户</span>
            <span v-if="!isEmptyObj">
              {{ (topDataObj.purposeCustomerCount || 0) | overThousandFilter }}
              <span class="person-text">人</span>
            </span>
            <span v-if="!isEmptyObj">
              占比:{{ purposePercent }}%
              <!-- active: !isNoBuyUp 有active就是绿色-->
              <i class="triangle" :class="{ active: isNoBuyUp === 2 }" v-if="isNoBuyUp"></i>
              <i v-else>--</i>
            </span>
            <!-- <i class="vertical-line"></i> -->

            <no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
          </div>
          <el-divider direction="vertical"></el-divider>
          <div class="rightWrap">
            <div class="inCompanyWechatNum item smallWrap">
              <span>已加企微客户数</span>
              <span>
                {{ (topDataObj.purposeCustomerAddCount || 0) | overThousandFilter }}
                <span class="person-text">人</span>
              </span>
              <span>在潜在意向客户中,已加企微的客户</span>
              <!-- <i class="horizontal-line"></i> -->
            </div>
            <el-divider></el-divider>
            <div class="outCompanyWechatNum item smallWrap">
              <span>未加企微客户数</span>
              <span>
                {{ (topDataObj.purposeCustomerNAddCount || 0) | overThousandFilter }}
                <span class="person-text">人</span>
              </span>
              <span>在潜在意向客户中,未加企微的客户</span>
               <!--  &nbsp;&nbsp;&gt;&gt;-->
              <button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel==4">引流企微 <i class="el-icon-d-arrow-right"></i></button>  
            </div>
          </div>
        </div>
        <div class="buy">
          <div class="buy-total item">
            <!-- <span>购买(存档)客户数</span> -->
            <span>基盘客户数</span>
            <span>有购车或其他交易行为的所有客户</span>
            <span v-if="!isEmptyObj">
              {{ (topDataObj.purchaseCustomerCount || 0) | overThousandFilter }}
              <span class="person-text">人</span>
            </span>

            <span v-if="!isEmptyObj">
              占比:{{ purchasePercent }}%
              <i class="triangle" :class="{ active: isBuyUp === 2 }" v-if="isBuyUp"></i>
              <i v-else>--</i>
            </span>

            <no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
            <!-- <i class="vertical-line"></i> -->
          </div>
          <el-divider direction="vertical"></el-divider>
          <div class="rightWrap">
            <div class="inCompanyWechatNum item smallWrap">
              <span>已加企微客户数</span>
              <span>
                {{ (topDataObj.purchaseCustomerAddCount || 0) | overThousandFilter }}
                <span class="person-text">人</span>
              </span>
              <span>在基盘客户中,已加企微的客户</span>
              <!-- <button class="btn">企微魔方&gt;&gt;</button> -->
              <!-- <i class="horizontal-line"></i> -->
            </div>
            <el-divider></el-divider>
            <div class="outCompanyWechatNum item smallWrap">
              <span>未加企微客户数</span>
              <span>
                {{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }}
                <span class="person-text">人</span>
              </span>
              <span>在基盘客户中,未加企微的客户</span>
              <button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel==4" >引流企微 <i class="el-icon-d-arrow-right"></i></button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="middlemsg">
      <h3 class="pageSubTitle">客户分群</h3>
      <div class="itembox">
        <div class="item" v-for="(item, index) in titles" :key="index">
          <p>{{ item.name }}</p>
          <p>{{ item.subName }}</p>
          <p>
            {{ item.num | overThousandFilter }}
            <span class="person-text">人</span>
          </p>
          <img :src="item.url" alt="" />
        </div>
      </div>
    </div>
    <h3 class="pageSubTitle">客户增长趋势</h3>
    <div class="bottommsg">
      <no-data :type="'hasIconText'" v-if="!isShowBarMap"></no-data>
      <template v-if="isShowBarMap">
        <span class="timeDuring">{{ allMapList[0].dateTime }}~{{ allMapList[allMapList.length - 1].dateTime }}</span>
        <span class="lastest">近{{ timeGap }}天</span>
        <button class="btn30 optionBtn" :class="{ activeDayIcon: this.timeGap == 30 }" @click="clickThirty">近30天</button>
        <button class="btn7 optionBtn" :class="{ activeDayIcon: this.timeGap == 7 }" @click="clickSeven">近7天</button>
        <div class="clientAddTrend">
          <div class="one1">
            <span>区间统计:</span>
            <span>
              全部客户:
              <a>{{ bottomDataObj.customerCount | overThousandFilter }}人</a>
            </span>
            <span>
              企微客户:
              <a>{{ bottomDataObj.entmicroCustomerCount | overThousandFilter }}人</a>
            </span>
          </div>
          <div class="one2">
            <span>
              日均新增:
              <a>{{ bottomDataObj.dayAvergGrow | overThousandFilter }}人</a>
            </span>
            <span>
              日均新增:
              <a>{{ bottomDataObj.entmicroDayAvergGrow | overThousandFilter }}人</a>
            </span>
          </div>
        </div>
        <!-- v-if="isShowBarMap" width="100%" -->
        <multiple-echart v-if="isReload" width="100%" height="420px" :totalData="allMapList" :isCloseShowNumTag="isCloseShowNumTag"></multiple-echart>
      </template>
    </div>
    <el-dialog title="提示" :visible.sync="dialogVisible" top="15vh" width="30%" :before-close="handleClose">
      <span>企微魔方正在开发中,敬请期待...</span>
    </el-dialog>
  </div>
</template>

<script>
import $ from 'jquery'
import { rwdImageMaps } from './jquery.rwdImageMaps.js'
import { getDataOverview, getDataOverviewBarMap } from '@/api/modules/clientDataOverview'
import { getLoginCount } from '@/api/modules/loginCount'
import pieEchart from '@/components/echarts/pieEchart'
import multipleEchart from '@/components/echarts/multipleEchart'
import pictorialBar from '@/components/echarts/pictorialBar'
import url1 from '../../assets/clientDataOverview/1.png'
import url2 from '../../assets/clientDataOverview/2.png'
import url3 from '../../assets/clientDataOverview/3.png'
import url4 from '../../assets/clientDataOverview/4.png'
import noData from '@/components/noData/noData'
export default {
  name: 'clientDataOverview',
  components: {
    pieEchart,
    multipleEchart,
    pictorialBar,
    noData
  },
  data() {
    return {
      isCloseShowNumTag:false,
      isReload:true,
      isShowModal: false,
      isHasCustomerCountBanner: false,
      topDataObj: {
        customerCount: 0,
        entmicroAddCustomerCount: 0,
        entmicroNotAddCustomerCount: 0,
        purposeCustomerCount: 0,
        purposeCustomerAddCount: 0, //已加企微客户数
        purposeCustomerNAddCount: 0,
        purchaseCustomerCount: 0,
        purchaseCustomerAddCount: 0,
        purchaseCustomerNAddCount: 0,
        newCarCustomerCount: 0,
        newRenewalCustomerCount: 0,
        burseholderCustomerCount: 0,
        silenceCustomerCount: 0
      },
      titles: [
        {
          name: '新车客户数',
          subName: '购车时间3个月的客户',
          num: 0,
          url: url1
        },
        {
          name: '车险待续保客户数',
          subName: '近一个月内车险即将到期的客户',
          num: 0,
          url: url2
        },
        {
          name: '新车待首保客户数',
          subName: '购车时间5~7个月内,且无保养记录的客户',
          num: 0,
          url: url3
        },
        {
          name: '沉默客户数',
          subName: '超过180天未到店的客户',
          num: 0,
          url: url4
        }
      ],
      isNoBuyUp: 0, //默认环比为增
      isBuyUp: 0,
      bottomDataObj: {},
      allMapList: [],
      isShowBarMap: false, //是否显示底部多种数据图

      timeGap: 7,
      sevenDayStorage: {},
      thirtyDayStorage: {},
      dialogVisible: false,
      //只有门店可以引流企微
      accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
    }
  },

  mounted() {
    document.body.style.overflow = 'hidden'
    var that =this;
     window.addEventListener('resize', () => {
       that.isReload=false
       that.$nextTick(() => {
         that.isReload=true
       });
    })
  },
  computed: {
    isEmptyObj() {
      if (Object.keys(this.topDataObj).length == 0) {
        return true
      }
      return false
    },
    isShowData() {
      return Object.keys(this.topDataObj).length > 0 && this.topDataObj.customerCount > 0 ? true : false
    },
    purposePercent() {
      if (this.topDataObj.purposePercent) return (this.topDataObj.purposePercent * 100).toFixed(2) || 0
      return 0
    },
    purchasePercent() {
      if (this.topDataObj.purchasePercent) return (this.topDataObj.purchasePercent * 100).toFixed(2) || 0
      return 0
    }
  },
  async created() {
         if (window.__POWERED_BY_QIANKUN__) {
      //运行在qiankun容器中
      this.accountLevel = this.$globalState.session.accountLevel
    }

    // 掉两个数据接口
    // await this.getDataOverviewFun()
    await this.getLoginCountFun()
    //先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
    //不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于0,继续显示banner;
    this.getDataOverviewBarMapFun()

  },

  methods: {
    goNextPage() {
      // window.open('https://www.baidu.com', '_blank')
      // this.dialogVisible = true
      // let timer = 3
      // setInterval(() => {
      //   timer--
      //   if (timer == 0) {
      //     this.dialogVisible = false
      //   }
      // }, 1000)
      // this.$router.push('drainage/square/index')
      this.$history.push('/drainage/square/index')
      //要引流企微魔方
      // this.getDataOverviewFun()
      // this.getDataOverviewBarMapFun()
    },
    //引流企微按钮暂时效果
    toGuideCompanyWechat() {
      // window.open('https://www.baidu.com', '_blank')
      // $('.subtitle').hide()
      this.$history.push('/drainage/square/drainage')
      // this.dialogVisible = true
      // let timer = 3
      // setInterval(() => {
      //   timer--
      //   if (timer == 0) {
      //     this.dialogVisible = false
      //   }
      // }, 1000)
    },
    showModalLayer() {
      var baseNavEle = document.querySelector('.scrm-base-nav')
      var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
      var baseNavEleHeight = 0
      var baseSubNavEleHeight = 0

      if (window.__POWERED_BY_QIANKUN__) {
        //运行在qiankun容器中
        baseNavEleHeight = baseNavEle.clientHeight
        baseSubNavEleHeight = baseSubNavEle.clientHeight
      }
      // if (baseNavEle && baseNavEle) {
      //   baseNavEleHeight = baseNavEle.clientHeight
      //   baseSubNavEleHeight = baseSubNavEle.clientHeight
      // }

      var bannerWrapEle = document.querySelector('.bannerWrap')
      var tipPanelEle = document.querySelector('.tipPanel')
      var knewBtnEle = document.querySelector('.knewBtn')
      // setTimeout(() => {
      document.querySelector('.modalLayer').style.display = 'block'
      tipPanelEle.style.display = 'block'
      document.querySelector('.modalLayer').style.width = bannerWrapEle.clientWidth + 'px'
      // document.querySelector('.modalLayer').style.height = document.querySelector('.bannerWrap').offsetHeight + 'px'
      var bannerHeight = bannerWrapEle.clientWidth / 8 + 'px'

      document.querySelector('.modalLayer').style.height = bannerHeight
      document.querySelector('.modalLayer').style.left = window.getComputedStyle(bannerWrapEle).left //bannerWrapEle.offsetLeft + 'px'
      document.querySelector('.modalLayer').style.top = window.getComputedStyle(bannerWrapEle).top //  74 + bannerWrapEle.offsetTop + 'px'

      tipPanelEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + 10 + 'px'
      knewBtnEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + tipPanelEle.clientHeight + 20 + 'px'
      // }, 300)
      console.log(window, '子系统')
      window.addEventListener('resize', () => {
        tipPanelEle.style.display = 'block'
        document.querySelector('.modalLayer').style.width = document.querySelector('.bannerWrap').clientWidth + 'px'

        // document.querySelector('.modalLayer').style.height = document.querySelector('.bannerWrap').offsetHeight + 'px'
        var bannerHeight = document.querySelector('.bannerWrap').clientWidth / 8 + 'px'
        document.querySelector('.modalLayer').style.height = bannerHeight
        document.querySelector('.modalLayer').style.left = window.getComputedStyle(bannerWrapEle).left
        document.querySelector('.modalLayer').style.top = window.getComputedStyle(bannerWrapEle).top
        document.querySelector('.modalLayer').style.visible = tipPanelEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + 10 + 'px'
        knewBtnEle.style.top = baseNavEleHeight + baseSubNavEleHeight + bannerWrapEle.offsetTop + bannerWrapEle.clientHeight + tipPanelEle.clientHeight + 20 + 'px'
      })
    },
    getLoginCountFun() {
      //loginType:2是查客户数据概览浏览次数
      getLoginCount({ loginType: 2 }).then(res => {
        // res = true
        //true和false都接受
        // if (!res) {
        //   return
        // }
        this.isShowModal = res

        this.getDataOverviewFun() //获取客户总数
      })
    },
    //获取上面的数据
    getDataOverviewFun() {
      // const res = await getDataOverview()
      getDataOverview({}).then(res => {
        if (!res) {
          this.isHasCustomerCountBanner = true
          return
        }
        console.log('上面', res)
        this.topDataObj = res

        // this.titles[0].num = res.newCarCustomerCount
        // this.titles[1].num = res.needRenewalCustomerCount
        // this.titles[2].num = res.burseholderCustomerCount
        // this.titles[4].num = res.silenceCustomerCount

        console.log(res, '这是上面数据')
        this.isNoBuyUp = res.purposeUp
        this.isBuyUp = res.purchaseUp
        //先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
        //不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于等于0,继续显示banner;
        console.log(this.accountLevel,this.isShowModal,this.topDataObj.customerCount,'myData')
        if(this.isShowModal && this.accountLevel!==4){
          this.isShowModal=false; //关掉引导层
        }
        if (this.isShowModal && this.accountLevel==4) {
          this.isHasCustomerCountBanner = true
          this.$nextTick(() => {
            $('img[usemap]').rwdImageMaps()
          })
          //打开遮罩层
          setTimeout(() => {
            this.showModalLayer()
          }, 1000)
        } else if (!this.isShowModal && this.topDataObj.customerCount > 0) {
          this.isHasCustomerCountBanner = false
        } else if (!this.isShowModal && this.topDataObj.customerCount <= 0 && this.accountLevel==4) {   
          this.isHasCustomerCountBanner = true
          this.$nextTick(() => {
            $('img[usemap]').rwdImageMaps()
          })
        }

        // if (this.topDataObj.customerCount > 0) {
        //   this.isHasCustomerCountBanner = false
        // } else {
        //   this.isHasCustomerCountBanner = true
        //   this.$nextTick(() => {
        //     $('img[usemap]').rwdImageMaps()
        //   })
        // }
        console.log(this.isHasCustomerCountBanner, 'true/fasle')
        this.$set(this.titles[0], 'num', res.newCarCustomerCount)
        this.$set(this.titles[1], 'num', res.needRenewalCustomerCount)
        this.$set(this.titles[2], 'num', res.burseholderCustomerCount)
        this.$set(this.titles[3], 'num', res.silenceCustomerCount)
      })
      // .catch(err => {
      //   console.log('错误信息:', err)
      // })
    },
    //首次进来获取下方柱状图数据(一进来默认传7天)
    async getDataOverviewBarMapFun(dayCount = 7) {
      const res = await getDataOverviewBarMap({ day: dayCount })
      if (!res) {
        return
      }
      console.log('下方数据', res)
      this.bottomDataObj = res
      if (dayCount == 7) {
        this.sevenDayStorage = res
      } else if (dayCount == 30) {
        this.thirtyDayStorage = res
      }
      this.allMapList = res.customerGrowthTrends
      console.log(this.allMapList, '数组')
      this.isShowBarMap = true //第一次有数据进来,就让图表显示
    },
    clickThirty() {
      this.timeGap = 30
      this.isCloseShowNumTag=true
      if (Object.keys(this.thirtyDayStorage).length == 0) {
        this.getDataOverviewBarMapFun(30) //第一次点击30天,获取数据
      } else {
        this.bottomDataObj = this.thirtyDayStorage
        this.allMapList = this.thirtyDayStorage.customerGrowthTrends
      }
    },
    clickSeven() {
      this.timeGap = 7
      this.isCloseShowNumTag=false
      if (Object.keys(this.sevenDayStorage).length == 0) {
        this.getDataOverviewBarMapFun() //重新掉一遍接口
      } else {
        this.bottomDataObj = this.sevenDayStorage
        this.allMapList = this.sevenDayStorage.customerGrowthTrends
      }
    },
    btnKnewClick() {
      this.isShowModal = false
      // 允许页面滚动:
      document.body.style.overflow = 'visible'
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
  .person-text {
    font-size: 16px !important;
  }

  .modalLayer {
    position: fixed;
    z-index: 99;
    top: 20px;
    left: 20px;
    // visibility: hidden;
    display: none;

    // width: 155px;
    // width: 100%;
    // height: 207px;
    // border: 4px;
    // filter: blur(15px);
    // border-radius: 60px;
    // box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.79);
    outline: 5000px solid rgba(0, 0, 0, 0.79);
    border: 2px solid #fff;
    border-radius: 4px;
  }
  .tipPanel {
    position: fixed;
    z-index: 100;
    top: 25%;
    // top: 0;
    // left: 0;
    //  bottom: 0;
    // right: 0;
    width: 100%;
  }

  .knewBtn {
    position: fixed;
    display: inline-block;
    z-index: 100;
    // width: 124px;
    // height: 40px;
    left: 50%;
    bottom: 18%;
    transform: translateX(-50%);
    //   font-size: 16px;
    //   font-weight: 500;
    //   color: #fff;
    //   background-color: $btnBlue;
    //   border-radius: 4px;
  }
  .bannerWrapBox {
    width: 100%;
    min-width: 1050px;
    // position: relative;
    // .inTimeBtn {
    //   position: absolute;
    //   bottom: 20px;
    //   right: 50px;
    // }

    .bannerWrap {
      width: 100%;

      // height: 146px;

      //object-fit: contain; //保持图片的原始比例,最大程度展示
    }
  }
  .pageSubTitle {
    position: relative;
    margin: 20px 0;
    height: 20px;
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    line-height: 20px;
    letter-spacing: 1px;
  }
  .topmsg {
    display: flex;
    min-width: 1050px;
    .leftPieEcharts {
      position: relative;
      background-color: #fff;
      width: 372px;
      height: 500px; //470
      box-sizing: border-box;
      box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
      .title {
        position: absolute;
        left: 20px;
        top: 20px;
        font-weight: bold;
        font-size: 16px;
        color: #333333;
        height: 22px;
        line-height: 22px;
      }
      .subtitle {
        position: absolute;
        padding-right: 16px;
        left: 20px;
        top: 50px;
        font-size: 14px;
        font-weight: 400;
        color: #999999;
        line-height: 20px;
      }
      .clientTotal {
        position: absolute;
        right: 20px;
        top: 20px;
        height: 26px;
        font-size: 26px;
        font-weight: 500;
        color: #333333;
        line-height: 26px;
        z-index: 9;
      }
      .topIcon {
        position: absolute;
        left: 125px;
        top: 110px;
        width: 160px;
        height: 17px;
        align-items: center;
        font-size: 12px;
        font-family: Helvetica;
        color: #8c8c8c;
        display: flex;
        justify-content: space-between;
        .top-inWechat {
          position: relative;
          &::before {
            content: '';
            position: absolute;
            width: 9px;
            height: 9px;
            border-radius: 50%;
            left: -18px;
            top: 1px;
            background-color: #716aff;
          }
        }
        .top-outWechat {
          position: relative;
          &::before {
            content: '';
            position: absolute;
            width: 9px;
            height: 9px;
            border-radius: 50%;
            left: -18px;
            top: 1px;
            background-color: #fe9c1c;
          }
        }
      }
      .inWechat {
        position: absolute;
        left: 57px;
        top: 365px;
        height: 20px;
        font-size: 14px;
        font-weight: 400;
        color: #333333;
        line-height: 20px;
        z-index: 9;
      }
      .blueNum {
        position: absolute;
        left: 57px;
        top: 389px;
        height: 25px;
        font-size: 18px;

        font-weight: 600;
        color: #716aff;
        line-height: 25px;
        z-index: 9;
      }
      .outWechat {
        position: absolute;
        right: 57px;
        top: 365px;
        height: 20px;
        font-size: 14px;

        font-weight: 400;
        color: #333333;
        line-height: 20px;
        background-color: #fff;
        z-index: 9;
      }
      .yellowNum {
        position: absolute;
        right: 57px;
        top: 389px;
        font-size: 18px;
        font-weight: 600;
        color: #fe9c1c;
        line-height: 25px;
      }
      .personsMap {
        width: 468px;
        position: absolute;
        left: 0;
        bottom: 0px;
        // z-index: 9;
      }
    }
    .itembox {
      width: calc(100% - 372px);
     
      .item {
        // border: 1px solid rgba(121, 121, 121, 1);
        height: 119px;
        box-sizing: border-box;
      }
      .item.no-buy-total,
      .item.buy-total {
        height: 238px;
        width: 50%;
        position: relative;
        > span {
          position: absolute;
          &:first-child {
            font-weight: bold;
            height: 22px;
            font-size: 16px;
            color: #333333;
            line-height: 22px;
            top: 20px;
            left: 24px;
          }
          &:nth-child(2) {
            left: 24px;
            top: 50px;
            height: 20px;
            font-size: 14px;

            font-weight: 400;
            color: #999999;
            line-height: 20px;
          }
          &:nth-child(3) {
            top: 109px;
            // left: 126px;
            left: 33%;
            height: 26px;
            font-size: 26px;
            font-weight: 500;
            color: #333333;
            line-height: 26px;
            letter-spacing: 1px;
          }
          &:nth-child(4) {
            top: 160px;
            // left: 136px;
            left: 33%;
            height: 22px;
            font-size: 16px;
            font-weight: 500;
            color: #333333;
            line-height: 22px;
            // vertical-align: middle;
            > .triangle {
              // position: absolute;
              // left: 51.8%;
              // top: 165px;
              // margin-bottom: 20px;
              display: inline-block;
              vertical-align: middle;
              width: 0px;
              height: 0px;
              border-bottom: 6px solid #ff2020;
              border-left: 6px solid transparent;
              border-right: 6px solid transparent;
              &.active {
                border-bottom: 6px solid #2cca74;
                transform: rotate(180deg);
              }
            }
          }
        }

        .vertical-line {
          position: absolute;
          width: 2px;
          height: 200px;
          background: #f0f0f0;
          top: 20px;
          right: 0;
        }
      }
      .el-divider--vertical {
        display: inline-block;
        width: 1px;
        height: 200px;
        margin: 20px 8px;
        vertical-align: middle;
        position: relative;
      }
      .no-buy,
      .buy {
        display: flex;
        margin-left: 20px;
        background-color: #fff;
        &:last-child {
          margin-top: 20px;
        }
      }
      .rightWrap {
        width: 48%;
        margin-left: 20px;
        position: relative;
        .smallWrap {
          position: relative;
          > span {
            position: absolute;
            &:first-child {
              font-weight: bold;
              height: 22px;
              font-size: 16px;
              color: #333333;
              line-height: 22px;
              top: 20px;
            }
            &:nth-child(2) {
              height: 26px;
              font-size: 26px;
              font-weight: 500;
              color: #333333;
              line-height: 26px;
              right: 20px;
              top: 20px;
            }
            &:nth-child(3) {
              top: 50px;
              height: 20px;
              font-size: 14px;
              font-weight: 400;
              color: #999999;
              line-height: 20px;
            }
          }
          .btn {
            position: absolute;
            right: 20px;
            bottom: 12px;
            padding: 6px 20px;
            box-sizing: border-box;
            border-radius: 4px;
            border: 1px solid $btnBlue;
            background-color: #fff;
            color: #6861ff;
            font-size: 14px;
            font-weight: 400;
          }
        }
        .inCompanyWechatNum {
          // background-color: red;
          // position: absolute;
          width: 100%;
          .horizontal-line {
            position: absolute;
            width: 100%;
            height: 1px;
            background: #f0f0f0;
            bottom: 0;
            right: 0;
          }
        }
        .el-divider--horizontal {
          display: block;
          height: 1px;
          width: 100%;
          margin: 0;
        }
      }
    }
  }
  .middlemsg {
    min-width: 1050px;
    .itembox {
      display: flex;
      width: 100%;
      .item {
        width: 25%;
        // padding: 20px;
        position: relative;
        height: 160px;
        border: 1px solid #fff;
        background-color: #fff;
        box-sizing: border-box;
        box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
        // border: 1px solid rgba(121, 121, 121, 1);
        &:not(:first-child) {
          margin-left: 20px;
        }
        &:hover {
          border: 1px solid $btnBlue;
        }
        p {
          position: absolute;
          &:first-child {
            left: 20px;
            top: 20px;
            height: 22px;
            font-size: 16px;
            font-weight: bold;
            color: #333333;
            line-height: 22px;
          }
          &:nth-child(2) {
            left: 20px;
            top: 46px;
            height: 20px;
            width: 160px;
            font-size: 14px;
            font-weight: 400;
            color: #999999;
            line-height: 20px;
          }
          &:nth-child(3) {
            left: 20px;
            bottom: 32px;
            height: 26px;
            font-size: 26px;
            font-weight: 600;
            color: #333333;
            line-height: 26px;
          }
        }
        img {
          position: absolute;
          right: 20px;
          top: 20px;
        }
      }
    }
  }
  .bottommsg {
    position: relative;
    width: 100%;
    min-width: 1050px;
    height: 578px;
    background-color: #fff;
    .timeDuring {
      margin-left: 20px;
      margin-top: 20px;
      display: inline-block;
      padding-right: 8px;
      height: 20px;
      font-size: 14px;
      font-weight: 400;
      color: #333333;
      line-height: 20px;
      border-right: 1px solid #d9d9d9;
    }
    .lastest {
      // margin-top: 20px;
      display: inline-block;
      height: 20px;
      font-size: 14px;
      font-weight: 400;
      color: #333333;
      line-height: 20px;
      padding-left: 8px;
    }
    .clientAddTrend {
      width: 100%;
      height: 80px;
      .one1 {
        margin-top: 30px;
        height: 36px;
        position: relative;
        span {
          position: absolute;
          font-size: 14px;
          font-weight: 400;
          color: #333333;
          height: 20px;
          line-height: 20px;
          > i {
            font-weight: 500;
          }
        }
        span:nth-child(1) {
          left: 31.5%;
        }
        span:nth-child(2) {
          left: 38.4%;
        }
        span:nth-child(3) {
          left: 54%;
        }
      }
      .one2 {
        height: 40px;
        position: relative;
        span {
          position: absolute;
          font-size: 14px;
          font-weight: 400;
          color: #333333;
          height: 20px;
          line-height: 20px;
          > a {
            font-weight: 500;
          }
        }
        span:nth-child(1) {
          left: 38.4%;
        }
        span:nth-child(2) {
          left: 54%;
        }
      }
    }
    .btn30 {
      float: right;
      margin: 20px 20px 0 20px;
    }
    .btn7 {
      float: right;
      margin-top: 20px;
    }
    .optionBtn {
      width: 68px;
      height: 36px;
      background-color: #fff;
      border-radius: 2px;
      border: 1px solid #999999;
      font-size: 14px;

      font-weight: 400;
      color: #999999;
      &:hover {
        cursor: pointer;
        border: 1px solid $btnBlue;
        color: $btnBlue;
      }
    }
    .activeDayIcon {
      border: 1px solid $btnBlue;
      color: $btnBlue;
    }
  }
}
</style>