index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div>
  3. <!-- <div class="open-image" @click="clear" v-if="openImage">
  4. <img src="@/assets/images/wechat_demo.png" alt="" />
  5. </div> -->
  6. <!--头部-->
  7. <base-info ref="baseInfo" />
  8. <!--小方块-->
  9. <grid-menu />
  10. <!--订单统计-->
  11. <visit-chart ref="visitChart" />
  12. <!--用户-->
  13. <user-chart ref="userChart" />
  14. <!--版本升级-->
  15. <upgrade v-if="force_reminder == 1" />
  16. </div>
  17. </template>
  18. <script>
  19. import baseInfo from './components/baseInfo';
  20. import gridMenu from './components/gridMenu';
  21. import visitChart from './components/visitChart';
  22. import userChart from './components/userChart';
  23. import hotSearch from './hot-search';
  24. import userPreference from './user-preference';
  25. import { auth } from '@/api/system';
  26. import { Notice } from 'iview';
  27. import { getCookies, setCookies } from '@/libs/util';
  28. import { upgradeStatusApi } from '@/api/system';
  29. export default {
  30. name: 'index',
  31. components: {
  32. baseInfo,
  33. gridMenu,
  34. visitChart,
  35. userChart,
  36. hotSearch,
  37. userPreference,
  38. },
  39. data() {
  40. return {
  41. openImage: false,
  42. visitType: 'day', // day, month, year
  43. visitDate: [new Date(), new Date()],
  44. force_reminder: null,
  45. };
  46. },
  47. mounted() {
  48. this.getAuth();
  49. },
  50. methods: {
  51. getAuth() {
  52. auth()
  53. .then((res) => {
  54. let data = res.data || {};
  55. this.force_reminder = data.force_reminder;
  56. if (data.auth_code && data.auth) {
  57. this.authCode = data.auth_code;
  58. this.auth = true;
  59. }
  60. this.openImage = true
  61. })
  62. .catch((res) => {});
  63. },
  64. clear() {
  65. this.openImage = false;
  66. },
  67. },
  68. };
  69. </script>
  70. <style lang="less">
  71. .dashboard-console-visit {
  72. .ivu-radio-group-button .ivu-radio-wrapper {
  73. border: none !important;
  74. box-shadow: none !important;
  75. padding: 0 12px;
  76. }
  77. .ivu-radio-group-button .ivu-radio-wrapper:before,
  78. .ivu-radio-group-button .ivu-radio-wrapper:after {
  79. display: none;
  80. }
  81. }
  82. .open-image {
  83. transition: none;
  84. animation: none;
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. position: fixed;
  89. background-color: rgba(0, 0, 0, 0.6);
  90. height: 100vh;
  91. width: 100vw;
  92. top: 0;
  93. left: 0;
  94. z-index: 1000;
  95. img {
  96. width: 800px;
  97. }
  98. }
  99. </style>