home.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 { mapActions } from "vuex";
  10. import api from "@/api/api";
  11. export default {
  12. components: {
  13. Firstmodel,
  14. },
  15. name: "home",
  16. watch: {},
  17. data() {
  18. return {
  19. showColum: {},
  20. };
  21. },
  22. methods: {
  23. getShowColum() {
  24. new Promise((resolve, reject) => {
  25. api
  26. .getShowColum({})
  27. .then((response) => {
  28. if (response.data.code == 200) {
  29. var showlist = response.data.result;
  30. this.$store.commit("SET_SHOWCOLUM", showlist);
  31. this.showColum = showlist;
  32. } else {
  33. resolve(response);
  34. }
  35. })
  36. .catch((error) => {
  37. console.log("catch===>response", response);
  38. reject(error);
  39. });
  40. });
  41. },
  42. },
  43. created() {
  44. this.getShowColum();
  45. },
  46. onLoad() {},
  47. };
  48. </script>
  49. <style scoped>
  50. .cu-list.grid > .cu-item {
  51. padding: 0px 0px;
  52. }
  53. .line2-icon {
  54. width: 60px;
  55. height: 60px;
  56. }
  57. .tab-bar {
  58. display: flex;
  59. justify-content: space-around;
  60. padding: 10px;
  61. background-color: #eee;
  62. }
  63. .tab-bar view {
  64. flex: 1;
  65. text-align: center;
  66. padding: 10px;
  67. border-radius: 5px;
  68. cursor: pointer;
  69. }
  70. .tab-bar view.active {
  71. background-color: #007bff;
  72. color: #fff;
  73. }
  74. </style>