DownloadSection.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <section id="download">
  3. <v-container fluid>
  4. <v-row align="center" justify="center">
  5. <v-col cols="10">
  6. <v-row align="center" justify="center">
  7. <v-col sm="4" class="hidden-xs-only">
  8. <v-img src="@/assets/img/ill2.svg" class="d-block ml-auto mr-auto" max-width="350px"/>
  9. </v-col>
  10. <v-col cols="12" sm="8" class="white--text text-left">
  11. <h1 class="font-weight-light display-2 mb-2">About Company</h1>
  12. <h1 class="font-weight-light">
  13. {{ companyData.intro }}
  14. </h1>
  15. </v-col>
  16. </v-row>
  17. </v-col>
  18. </v-row>
  19. </v-container>
  20. </section>
  21. </template>
  22. <script>
  23. import axios from 'axios';
  24. export default {
  25. data() {
  26. return {
  27. companyData: {
  28. intro: ""
  29. }
  30. }
  31. },
  32. created() {
  33. this.getCompanyData();
  34. },
  35. methods: {
  36. getCompanyData() {
  37. const websiteCode = this.extractSubstring(window.location.pathname);
  38. let userWebsiteId = "";
  39. axios.get("/api/website/template/getWebsiteByWebsiteCode", {
  40. params: {
  41. websiteCode: websiteCode,
  42. }
  43. }).then(response => {
  44. if (response.data.code === 200) {
  45. userWebsiteId = response.data.data.id;
  46. axios.get("/api/website/template/company", {
  47. params: {
  48. userWebsiteId: userWebsiteId,
  49. }
  50. }).then(response => {
  51. if (response.data.data !== null) {
  52. this.companyData = response.data.data;
  53. }
  54. })
  55. }
  56. })
  57. .catch(error => {
  58. console.error('Error fetching company data:', error);
  59. });
  60. },
  61. extractSubstring(str) {
  62. const startIndex = str.indexOf('/');
  63. if (startIndex !== -1) {
  64. const endIndex = str.indexOf('/', startIndex + 1);
  65. if (endIndex !== -1) {
  66. return str.substring(startIndex + 1, endIndex - 1);
  67. } else {
  68. return str.substring(startIndex + 1);
  69. }
  70. }
  71. return ''; // 如果没有找到匹配,返回空字符串
  72. }
  73. }
  74. }
  75. </script>
  76. <style scoped>
  77. #download {
  78. background-image: url("~@/assets/img/bgDownload.jpg");
  79. background-attachment: fixed;
  80. background-repeat: no-repeat;
  81. background-size: cover;
  82. background-position: center;
  83. height: 500px;
  84. }
  85. #download .container,
  86. #download .row {
  87. height: 100%;
  88. }
  89. </style>