home.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template name="home">
  2. <view>
  3. <!-- 其他页面内容 -->
  4. <Firstmodel :showColum="showColum"></Firstmodel>
  5. </view>
  6. </template>
  7. <script>
  8. import Firstmodel from "./firstmodel.vue";
  9. import { us, os } from "@/common/util/work.js";
  10. import { mapActions } from "vuex";
  11. import api from "@/api/api";
  12. export default {
  13. components: {
  14. Firstmodel,
  15. },
  16. name: "home",
  17. watch: {},
  18. data() {
  19. return {
  20. usList: us.data,
  21. osList: os.data,
  22. msgCount: 0,
  23. showColum: {},
  24. dot: {
  25. mailHome: false,
  26. },
  27. currentTab: 0, // 当前选中的选项卡索引
  28. };
  29. },
  30. methods: {
  31. getShowColum() {
  32. new Promise((resolve, reject) => {
  33. api
  34. .getShowColum({})
  35. .then((response) => {
  36. if (response.data.code == 200) {
  37. var showlist = response.data.result;
  38. this.$store.commit("SET_SHOWCOLUM", showlist);
  39. this.showColum = showlist;
  40. } else {
  41. resolve(response);
  42. }
  43. })
  44. .catch((error) => {
  45. console.log("catch===>response", response);
  46. reject(error);
  47. });
  48. });
  49. },
  50. },
  51. created() {
  52. this.getShowColum();
  53. },
  54. onLoad() {},
  55. };
  56. </script>
  57. <style scoped>
  58. .cu-list.grid > .cu-item {
  59. padding: 0px 0px;
  60. }
  61. .line2-icon {
  62. width: 60px;
  63. height: 60px;
  64. }
  65. .tab-bar {
  66. display: flex;
  67. justify-content: space-around;
  68. padding: 10px;
  69. background-color: #eee;
  70. }
  71. .tab-bar view {
  72. flex: 1;
  73. text-align: center;
  74. padding: 10px;
  75. border-radius: 5px;
  76. cursor: pointer;
  77. }
  78. .tab-bar view.active {
  79. background-color: #007bff;
  80. color: #fff;
  81. }
  82. </style>