瀏覽代碼

官网代码

miaofuhao 1 年之前
父節點
當前提交
92c994d470

+ 1 - 0
.eslintrc.js

@@ -18,6 +18,7 @@ module.exports = {
18 18
     "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
19 19
     "prettier/prettier": "off",
20 20
     "vue/multi-word-component-names": "off",
21
+    '@typescript-eslint/no-var-requires': 'off',
21 22
     "@typescript-eslint/no-explicit-any": ["off"]
22 23
   },
23 24
 };

+ 0 - 0
1.txt


File diff suppressed because it is too large
+ 24713 - 0
package-lock.json


+ 2 - 0
package.json

@@ -11,6 +11,8 @@
11 11
     "axios": "^1.6.8",
12 12
     "core-js": "^3.8.3",
13 13
     "element-plus": "^2.6.2",
14
+    "node-sass": "^6.0.1",
15
+    "sass-loader": "^10.2.0",
14 16
     "vue": "^3.2.13",
15 17
     "vue-router": "^4.0.3",
16 18
     "vuex": "^4.0.0"

二進制
src/assets/bg.png


+ 87 - 0
src/components/home/home-meun copy.vue

@@ -0,0 +1,87 @@
1
+<template>
2
+  <div class="common-layout">
3
+    <el-container>
4
+      <el-header>
5
+        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
6
+          <div class="flex-grow"></div>
7
+          <template v-for="(item, index) in menus"  v-bind:key="index">
8
+            <el-menu-item  v-if="item.meta.title !== '产品介绍'">{{ item.meta.title }}</el-menu-item>
9
+            <!-- <el-sub-menu v-else index="2">
10
+              <template #title>产品介绍</template>
11
+              
12
+              <el-menu-item v-for="(item, index) in productData"  v-bind:key="index" index="index">{{item.name}}</el-menu-item>
13
+
14
+            </el-sub-menu> -->
15
+          </template>
16
+        </el-menu>
17
+      </el-header>
18
+      <el-main>
19
+        <el-scrollbar style="margin-top: 20px;">
20
+          <router-view />
21
+        </el-scrollbar>
22
+      </el-main>
23
+    </el-container>
24
+  </div>
25
+</template>
26
+<script setup>
27
+import { ref,onMounted } from 'vue'
28
+import request from '../../utils/request'
29
+import routers from "../../router";
30
+import { useRouter } from "vue-router";
31
+import { ArrowDown } from '@element-plus/icons-vue'
32
+
33
+const apiUrl = ref('http://39.164.159.226:8100/')
34
+const productData = ref([])
35
+const menus = routers.options.routes.find((o) => { return o.name === 'home'; }).children;
36
+const router = useRouter();
37
+const index = menus.findIndex((o) => { return o.path === router.currentRoute.value.path });
38
+const activeIndex = ref(index)
39
+onMounted(()=>{
40
+    getList()
41
+})
42
+function getList() {
43
+    request.get('/Product/product').then((res)=>{
44
+        res.data.length>0 ? (productData.value = res.data) : (productData.value = [])
45
+    })
46
+}
47
+const handleSelect = (key, keyPath) => {
48
+  console.log(key, keyPath)
49
+  activeIndex.value = Number(key);
50
+  router.push(menus[key])
51
+}
52
+</script>
53
+<style lang="scss" scoped>
54
+  :deep(.el-menu ){
55
+    background:none;
56
+    border: none !important;
57
+
58
+  }
59
+  :deep(.el-menu--horizontal>.el-menu-item.is-active ) {
60
+    color: #fff !important;
61
+      border: none;
62
+  }
63
+  :deep(.el-menu-item:not(.is-disabled):hover){
64
+    background: none !important;
65
+  }
66
+  :deep(.el-menu-item:not(.is-disabled):focus){
67
+    background-color:rgba(220,38,38,0) !important;
68
+  }
69
+  :deep(.el-sub-menu__title){
70
+    font-size: 26px;
71
+    font-weight: bold;
72
+  }
73
+  :deep(.el-sub-menu__title:hover){
74
+    background: none !important;
75
+  }
76
+  :deep(.el-menu-item){
77
+    font-size: 26px;
78
+    font-weight: bold;
79
+  }
80
+  :deep(.el-dropdown-link){
81
+    font-size: 22px;
82
+    color: inherit;
83
+  }
84
+  .flex-grow {
85
+    flex-grow: 0.8;
86
+  }
87
+</style>

+ 90 - 0
src/components/home/home-meun.vue

@@ -0,0 +1,90 @@
1
+<template>
2
+  <div class="common-layout">
3
+    <el-container>
4
+      <el-header>
5
+        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
6
+          <div class="flex-grow"></div>
7
+          <template v-for="(item, index) in menus"  v-bind:key="index">
8
+            <el-menu-item  v-if="item.meta.title !== '产品介绍'" :index="index">{{ item.meta.title }}</el-menu-item>
9
+            <el-sub-menu v-else :index="index">
10
+              <template #title>产品介绍</template>
11
+              <el-menu-item v-for="(item, index) in productData" v-bind:key="index" index="1" @click="trunHandle(item.id)">{{item.name}}</el-menu-item>
12
+            </el-sub-menu>
13
+          </template>
14
+        </el-menu>
15
+      </el-header>
16
+      <el-main>
17
+        <el-scrollbar style="margin-top: 20px;">
18
+          <router-view />
19
+        </el-scrollbar>
20
+      </el-main>
21
+    </el-container>
22
+  </div>
23
+</template>
24
+<script setup>
25
+import { ref,onMounted } from 'vue'
26
+import request from '../../utils/request'
27
+import routers from "../../router";
28
+import { useRouter } from "vue-router";
29
+import { ArrowDown } from '@element-plus/icons-vue'
30
+
31
+const apiUrl = ref('http://39.164.159.226:8100/')
32
+const productData = ref([])
33
+const menus = routers.options.routes.find((o) => { return o.name === 'home'; }).children;
34
+const router = useRouter();
35
+const index = menus.findIndex((o) => { return o.path === router.currentRoute.value.path });
36
+const activeIndex = ref(index)
37
+onMounted(()=>{
38
+    getList()
39
+})
40
+function getList() {
41
+    request.get('/Product/product').then((res)=>{
42
+        res.data.length>0 ? (productData.value = res.data) : (productData.value = [])
43
+    })
44
+}
45
+const handleSelect = (key, keyPath) => {
46
+  console.log(key, keyPath)
47
+  activeIndex.value = Number(key);
48
+  if (Number(key)!==1) {
49
+    router.push(menus[key])
50
+  }
51
+}
52
+function trunHandle(id) {
53
+  router.push({ name: 'HomeProduct', query: { id }})
54
+}
55
+</script>
56
+<style lang="scss" scoped>
57
+  :deep(.el-menu ){
58
+    background:none;
59
+    border: none !important;
60
+
61
+  }
62
+  :deep(.el-menu--horizontal>.el-menu-item.is-active ) {
63
+    color: #fff !important;
64
+      border: none;
65
+  }
66
+  :deep(.el-menu-item:not(.is-disabled):hover){
67
+    background: none !important;
68
+  }
69
+  :deep(.el-menu-item:not(.is-disabled):focus){
70
+    background-color:rgba(220,38,38,0) !important;
71
+  }
72
+  :deep(.el-sub-menu__title){
73
+    font-size: 26px;
74
+    font-weight: bold;
75
+  }
76
+  :deep(.el-sub-menu__title:hover){
77
+    background: none !important;
78
+  }
79
+  :deep(.el-menu-item){
80
+    font-size: 26px;
81
+    font-weight: bold;
82
+  }
83
+  :deep(.el-dropdown-link){
84
+    font-size: 22px;
85
+    color: inherit;
86
+  }
87
+  .flex-grow {
88
+    flex-grow: 0.8;
89
+  }
90
+</style>

+ 93 - 0
src/components/home/home-meun1.vue

@@ -0,0 +1,93 @@
1
+<template>
2
+  <div class="common-layout">
3
+    <el-container>
4
+      <el-header>
5
+        
6
+        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
7
+          <div class="flex-grow"></div>
8
+          <!-- <template v-for="(item, index) in menus">
9
+            <el-menu-item>{{ item.meta.title }}</el-menu-item>
10
+          </template> -->
11
+          <el-menu-item v-bind:key="index" :index="index" v-for="(item, index) in menus">
12
+            {{ item.meta.title }}
13
+            <!-- <template v-if="item.meta.title === '产品介绍'">
14
+              {{ item.meta.title }}
15
+              <el-dropdown>
16
+                <span class="el-dropdown-link">
17
+                  产品介绍
18
+                  <el-icon class="el-icon--right">
19
+                    <arrow-down />
20
+                  </el-icon>
21
+                </span>
22
+                <template #dropdown>
23
+                  <el-dropdown-menu>
24
+                    <el-dropdown-item>Action 1</el-dropdown-item>
25
+                    <el-dropdown-item>Action 2</el-dropdown-item>
26
+                    <el-dropdown-item>Action 3</el-dropdown-item>
27
+                    <el-dropdown-item disabled>Action 4</el-dropdown-item>
28
+                    <el-dropdown-item divided>Action 5</el-dropdown-item>
29
+                  </el-dropdown-menu>
30
+                </template>
31
+              </el-dropdown>
32
+            </template>
33
+            <template v-else>
34
+              {{ item.meta.title }}
35
+            </template> -->
36
+          </el-menu-item>
37
+        </el-menu>
38
+      </el-header>
39
+      <el-main>
40
+        <el-scrollbar style="margin-top: 20px;">
41
+          <router-view />
42
+        </el-scrollbar>
43
+      </el-main>
44
+    </el-container>
45
+  </div>
46
+</template>
47
+<script setup>
48
+import { ref } from 'vue'
49
+import routers from "../../router";
50
+import { useRouter } from "vue-router";
51
+import { ArrowDown } from '@element-plus/icons-vue'
52
+
53
+const menus = routers.options.routes.find((o) => { return o.name === 'home'; }).children;
54
+const router = useRouter();
55
+console.log(router.currentRoute.value.path, 'router');
56
+const index = menus.findIndex((o) => { return o.path === router.currentRoute.value.path });
57
+const activeIndex = ref(index)
58
+const handleSelect = (key, keyPath) => {
59
+  console.log(key, keyPath)
60
+  activeIndex.value = Number(key);
61
+  console.log(menus[key])
62
+  router.push(menus[key])
63
+}
64
+</script>
65
+<style lang="scss" scoped>
66
+  :deep(.el-menu ){
67
+    background:none;
68
+    border: none !important;
69
+
70
+  }
71
+  :deep(.el-menu--horizontal>.el-menu-item.is-active ) {
72
+    color: #fff !important;
73
+      border: none;
74
+  }
75
+  :deep(.el-menu-item:not(.is-disabled):hover){
76
+    background: none !important;
77
+  }
78
+  :deep(.el-menu-item:not(.is-disabled):focus){
79
+    background-color:rgba(220,38,38,0) !important;
80
+  }
81
+  
82
+  :deep(.el-menu-item){
83
+    font-size: 26px;
84
+    font-weight: bold;
85
+  }
86
+  :deep(.el-dropdown-link){
87
+    font-size: 22px;
88
+    color: inherit;
89
+  }
90
+  .flex-grow {
91
+    flex-grow: 0.8;
92
+  }
93
+</style>

+ 229 - 0
src/components/home/home.vue

@@ -0,0 +1,229 @@
1
+<template>
2
+  <div class="wrap">
3
+    <div class="page">
4
+      <div class="logo">
5
+        <img style="width: 300px; height: 35px" src="@/assets/logo.png" />
6
+      </div>
7
+      <div class="page-main">
8
+        <home-meun/>
9
+      </div>
10
+      <div class="page-footer">
11
+        <el-row :gutter="100">
12
+          <el-col :span="6">
13
+            <div class="footer-item">
14
+              <div class="item-title">
15
+                联系我们
16
+              </div>
17
+              <div class="item-info">
18
+                <el-icon color="#fff"><User /></el-icon>
19
+                {{companyData.contacts}}
20
+              </div>
21
+              <div class="item-info">
22
+                <el-icon><Phone /></el-icon>
23
+                {{companyData.tel}}
24
+              </div>
25
+              <div class="item-info">
26
+                <el-icon><Message /></el-icon>
27
+                {{companyData.mailbox}}
28
+              </div>
29
+              <div class="item-info">
30
+                <el-icon><LocationInformation /></el-icon>
31
+                {{companyData.address}}
32
+              </div>
33
+            </div>
34
+          </el-col>
35
+          <el-col :span="12">
36
+            <div class="footer-item">
37
+              <div class="item-title">售后服务</div>
38
+              <div class="item-text">
39
+                {{companyData.afterSalesContent}}
40
+              </div>
41
+            </div>
42
+          </el-col>
43
+          <el-col :span="6">
44
+            <div class="footer-item">
45
+              <div class="item-title">添加微信</div>
46
+              <div class="item-image">
47
+                <el-image 
48
+                style="width: 120px; height: 120px" 
49
+                :src="apiUrl+ qrCodeUrl" 
50
+                fit="fill" />
51
+              </div>
52
+            </div>
53
+          </el-col>
54
+        </el-row>
55
+      </div>
56
+    </div>
57
+    <div class="chatPop">
58
+      <div class="hideChat" @click="chatHandle" v-if="!chatFlag">
59
+        联系我们
60
+        <br>
61
+        <el-icon color="#0FFF00"><ChatRound /></el-icon>
62
+      </div>
63
+      <div class="showChat" @click="chatHandle" v-if="chatFlag">
64
+        <el-image style="width: 120px; height: 120px" :src="apiUrl+ qrCodeUrl" fit="fill" />
65
+      </div>
66
+    </div>
67
+
68
+  </div>
69
+</template>
70
+
71
+<script setup name="App">
72
+  
73
+  import { ref,onMounted } from "vue";
74
+  import request from '../../utils/request'
75
+  import { User,Phone,Message,LocationInformation,ChatRound } from '@element-plus/icons-vue'
76
+  import HomeMeun from './home-meun.vue'  //  首页
77
+
78
+  const activeName = ref('first')
79
+  const homeMainRef = ref(null)
80
+  const homeLonghairRef = ref(null)
81
+  const homeActivityRef = ref(null)
82
+  const chatFlag = ref(false)
83
+  const apiUrl = ref('http://39.164.159.226:8100/')
84
+  const qrCodeUrl = ref('')
85
+  const companyData = ref({})
86
+  onMounted(()=>{
87
+    const urlPah = require('../../assets/bg.png')
88
+    document.querySelector('body')
89
+      .setAttribute('style', 'background-repeat:no-repeat;background-size:100% 100%; background-image:url("' + urlPah + '") ')
90
+    document.querySelector('html')
91
+      .setAttribute('style', 'background:#000;')
92
+      getList()
93
+  })
94
+  function getList() {
95
+      request.get('/Company/company').then((res)=>{
96
+        if (res.data.length>0) {
97
+          companyData.value = res.data[0]
98
+          qrCodeUrl.value = Object.values(companyData.value.wxFileInfo)[0]
99
+        }
100
+      })
101
+  }
102
+  function chatHandle() {
103
+    chatFlag.value = !chatFlag.value
104
+  }
105
+  const handleClick = (tab) => {
106
+    if (tab.props.name === 'first') {
107
+      homeMainRef.value.detailFlag = false
108
+    } else if (tab.props.name === 'third') {
109
+      homeLonghairRef.value.detailFlag = false
110
+    } else if (tab.props.name === 'fourth') {
111
+      homeActivityRef.value.detailFlag = false
112
+    }
113
+  }
114
+</script>
115
+
116
+<style lang="scss" scoped>
117
+  
118
+  #app {
119
+    font-family: Avenir, Helvetica, Arial, sans-serif;
120
+    -webkit-font-smoothing: antialiased;
121
+    -moz-osx-font-smoothing: grayscale;
122
+    text-align: center;
123
+    color: #9d9d9d;
124
+    margin-top: 60px;
125
+
126
+  }
127
+  :deep(.root){
128
+    --el-color-primary: #000;  
129
+  }
130
+  :deep(.el-tabs__nav-wrap:after){
131
+    height: 0px !important;
132
+  }
133
+  :deep(.el-tabs__nav) {
134
+    float: right;
135
+    .el-tabs__item{
136
+      font-size: 22px;
137
+      color: #9d9d9d;
138
+    }
139
+    .el-tabs__item.is-active{
140
+      color: #fff;
141
+    }
142
+  }
143
+  .title{
144
+    line-height: 50px;
145
+    font-size: 26px;
146
+    font-weight: bold;
147
+  }
148
+  .content{
149
+    font-size: 16px;
150
+    line-height: 30px;
151
+  }
152
+  .wrap {
153
+    .chatPop{
154
+      cursor: pointer;
155
+      margin-top: -70px;
156
+      position: fixed;
157
+      top: 50%;
158
+      right: 0;
159
+      text-align: center;
160
+      background: #636363;
161
+      .hideChat{
162
+        width: 30px;
163
+        word-wrap: break-word;/*英文的时候需要加上这句,自动换行*/
164
+        word-break:break-all;
165
+        border-radius: 5px 0px 0px 5px;
166
+        line-height: 26px;
167
+        padding: 10px;
168
+        color: #fff;
169
+      }
170
+     
171
+    }
172
+    .page {
173
+      width: 80%;
174
+      height: 100%;
175
+      margin: 0 auto;
176
+
177
+      position: relative;
178
+      .logo{
179
+        position: absolute;
180
+        left: 0px;
181
+        top: 36px;
182
+        z-index: 1;
183
+      }
184
+      .page-main{
185
+        /* height: 550px; */
186
+        
187
+        scrollbar-width: none; /* firefox */
188
+        -ms-overflow-style: none; /* IE 10+ */
189
+        overflow-x: hidden;
190
+        overflow-y: hidden;
191
+      }
192
+      .page-footer{
193
+        text-align: left;
194
+        border-top: 2px solid #2c3e50;
195
+        padding:15px;
196
+        margin-top: 80px;
197
+        .footer-item{
198
+          .item-title{
199
+            color: #D0D0D0;
200
+            display: inline-block;
201
+            font-size: 18px;
202
+            line-height: 50px;
203
+            border-bottom: 4px solid;
204
+            border-image: linear-gradient(to right, #FE8700, #80490B) 1;
205
+          }
206
+          .item-info{
207
+            line-height: 36px;
208
+            color: #D0D0D0;
209
+          }
210
+          .item-text{
211
+            margin-top: 15px;
212
+            color: #9d9d9d;
213
+            line-height: 36px;
214
+            text-indent: 2em;
215
+            overflow:hidden;
216
+            text-overflow:ellipsis;
217
+            display:-webkit-box;
218
+            -webkit-box-orient:vertical;
219
+            -webkit-line-clamp:4;
220
+          }
221
+          .item-image{
222
+            margin-top: 30px;
223
+          }
224
+        }
225
+      }
226
+    }
227
+    
228
+  }
229
+</style>

+ 46 - 10
src/router/index.ts

@@ -1,21 +1,57 @@
1 1
 import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
2
-import HomeView from "../views/HomeView.vue";
2
+import HomeView from "@/components/home/home.vue";
3 3
 import AdminLayout from "@/components/layout/admin.vue";
4 4
 
5 5
 const routes: Array<RouteRecordRaw> = [
6
+  // {
7
+  //   path: "/",
8
+  //   name: "homeDetail",
9
+  //   component: HomeView,
10
+  //   children: [
11
+  //     {
12
+  //       path: "/home/product",
13
+  //       component: () => import("@/views/home/home-product.vue"),
14
+  //       name: "HomeProduct",
15
+  //       meta: { title: "产品介绍", icon: "dashboard", affix: true },
16
+  //     },
17
+  //   ],
18
+  // },
6 19
   {
7 20
     path: "/",
8 21
     name: "home",
9 22
     component: HomeView,
10
-  },
11
-  {
12
-    path: "/about",
13
-    name: "about",
14
-    // route level code-splitting
15
-    // this generates a separate chunk (about.[hash].js) for this route
16
-    // which is lazy-loaded when the route is visited.
17
-    component: () =>
18
-      import(/* webpackChunkName: "about" */ "../views/AboutView.vue"),
23
+    children: [
24
+      {
25
+        path: "",
26
+        component: () => import("@/views/home/home-main.vue"),
27
+        name: "HomeMain",
28
+        meta: { title: "首页", icon: "dashboard", affix: true },
29
+      },
30
+      {
31
+        path: "/home/product",
32
+        component: () => import("@/views/home/home-product.vue"),
33
+        name: "HomeProduct",
34
+        meta: { title: "产品介绍", icon: "dashboard", affix: true },
35
+      },
36
+      {
37
+        path: "/home/longhair",
38
+        component: () => import("@/views/home/home-longhair.vue"),
39
+        name: "HomeLonghair",
40
+        meta: { title: "艺术家", icon: "dashboard", affix: true },
41
+      },
42
+      {
43
+        path: "/home/activity",
44
+        component: () => import("@/views/home/home-activity.vue"),
45
+        name: "HomeActivity",
46
+        meta: { title: "参与活动", icon: "dashboard", affix: true },
47
+      },
48
+      {
49
+        path: "/home/intro",
50
+        component: () => import("@/views/home/home-intro.vue"),
51
+        name: "HomeIntro",
52
+        meta: { title: "公司介绍", icon: "dashboard", affix: true },
53
+      },
54
+    ],
19 55
   },
20 56
   {
21 57
     path: "/admin",

+ 0 - 5
src/views/AboutView.vue

@@ -1,5 +0,0 @@
1
-<template>
2
-  <div class="about">
3
-    <h1>This is an about page</h1>
4
-  </div>
5
-</template>

+ 125 - 0
src/views/home/home-activity.vue

@@ -0,0 +1,125 @@
1
+<template>
2
+    <div class="main" v-if="!detailFlag">
3
+        <el-row :gutter="30" class="home-item" v-for="(item, index) in activityData" :key="index">
4
+            <el-col :span="6" class="item-image">
5
+                <el-image style="width: 80%; margin: 10%;" :src="apiUrl+ Object.values(item.fileInfo)[0]" fit="fill" />
6
+            </el-col>
7
+            <el-col :span="18" class="item-content">
8
+                <div class="contetn-title">
9
+                    <div class="titel-text1">{{item.title}}</div>
10
+                    <div class="titel-text2">{{item.createTime.split(' ')[0]}}</div>
11
+                </div>
12
+                <div class="content-text">
13
+                    {{item.content}}
14
+                </div>
15
+                <div class="textView">
16
+                    <el-button size="large" type="warning" link @click="handleView(item)">查看更多</el-button>
17
+                </div>
18
+            </el-col>
19
+        </el-row>
20
+    </div>
21
+    <div class="main" v-if="detailFlag">
22
+        
23
+        <div class="main-title" >
24
+            {{activityDetails.title}}
25
+            <el-button @click="handleView" class="returnBtn" type="warning" link>返回首页</el-button>
26
+        </div>
27
+        <div class="main-time">{{activityDetails.createTime.split(' ')[0]}}</div>
28
+        <div class="main-content">
29
+            <img :src="apiUrl+ Object.values(activityDetails.fileInfo)[0]" align="right" width="300" hspace="30" vspace="30">
30
+            {{activityDetails.content}}
31
+        </div>
32
+    </div>
33
+</template>
34
+
35
+<script setup name="HomeActivity">
36
+    import { ref, onMounted } from 'vue'
37
+    import request from '../../utils/request'
38
+    const apiUrl = ref('http://39.164.159.226:8100/')
39
+    const detailFlag = ref(false)
40
+    const activityData = ref([])
41
+    const activityDetails = ref({})
42
+    onMounted(()=>{
43
+        getList()
44
+    })
45
+    function getList() {
46
+        request.get('/Activity/activity').then((res)=>{
47
+            res.data.length>0 ? (activityData.value = res.data) : (activityData.value = [])
48
+        })
49
+    }
50
+    function handleView(item) {
51
+        handleturn()
52
+        activityDetails.value = item
53
+    }
54
+    function handleturn() {
55
+        detailFlag.value = !detailFlag.value
56
+    }
57
+    // defineExpose({ detailFlag });
58
+</script>
59
+<style scoped lang="scss">
60
+    .main{
61
+        width: 99%;
62
+        text-align: left;
63
+        color: #5e5b57;
64
+        .home-item{
65
+            display: flex;
66
+            width: 100%;
67
+            .item-content{
68
+                font-size: 16px;
69
+                line-height: 30px;
70
+                .contetn-title{
71
+                    display: flex;
72
+                    
73
+                    .titel-text1{
74
+                        color: #9f9a93;
75
+                        width: 50%;
76
+                        text-align: left;
77
+                        line-height: 50px;
78
+                        font-size: 26px;
79
+                        font-weight: bold;
80
+                    }
81
+                    .titel-text2{
82
+                        width: 50%;
83
+                        line-height: 60px;
84
+                        text-align: right;
85
+                    }
86
+                }
87
+                .content-text{
88
+                    font-size: 16px;
89
+                    line-height: 36px;
90
+                    text-indent: 2em;
91
+                    overflow:hidden;
92
+                    text-overflow:ellipsis;
93
+                    display:-webkit-box;
94
+                    -webkit-box-orient:vertical;
95
+                    -webkit-line-clamp:4;
96
+                }
97
+                .textView{
98
+                    text-align: right;
99
+                }
100
+            }
101
+        }
102
+        .main-title{
103
+            text-align: center;
104
+            line-height: 60px;
105
+            font-size: 26px;
106
+            font-weight: bold;
107
+            color: #9f9a93;
108
+            .returnBtn{
109
+                position: absolute;
110
+                right: 8px;
111
+                top: 25px;
112
+            }
113
+        }
114
+        .main-time{
115
+            text-align: center;
116
+            font-size: 16px;
117
+            line-height: 30px;
118
+        }
119
+        .main-content{
120
+            width: 100%;
121
+            font-size: 16px;
122
+            line-height: 36px;
123
+        }
124
+    }
125
+</style>

+ 77 - 0
src/views/home/home-intro.vue

@@ -0,0 +1,77 @@
1
+<template>
2
+    <div class="main">
3
+        <div class="home-item">
4
+            <div class="item-image">
5
+                <el-image 
6
+                style="width: 500px; margin: 15px;" 
7
+                :src="apiUrl+ resultUrl" 
8
+                fit="fill" />
9
+            </div>
10
+            <div class="item-content">
11
+                <div class="contetn-title">
12
+                    <div class="titel-text1">{{introData.name}}</div>
13
+                </div>
14
+                <div class="content-text">
15
+                    <p v-html="introData.content">
16
+                        
17
+                    </p>
18
+                    
19
+
20
+
21
+                </div>
22
+            </div>
23
+            
24
+        </div>
25
+      
26
+    </div>
27
+</template>
28
+
29
+<script setup name="HomeIntro">
30
+    import { ref,onMounted } from 'vue' 
31
+    import request from '../../utils/request'
32
+    const apiUrl = ref('http://39.164.159.226:8100/')
33
+    const resultUrl = ref('')
34
+    const introData = ref({})
35
+    onMounted(()=>{
36
+        getList()
37
+    })
38
+    function getList() {
39
+        request.get('/Company/company').then((res)=>{
40
+            res.data.length>0 ? (introData.value = res.data[0]) : (introData.value = {})
41
+            resultUrl.value = Object.values(introData.value.fileInfo)[0]
42
+        })
43
+    }
44
+</script>
45
+<style scoped lang="scss">
46
+    .main{
47
+        width: 99%;
48
+        color: #5e5b57;
49
+        text-align: left;
50
+        .home-item{
51
+            display: flex;
52
+            width: 100%;
53
+            .item-image{
54
+                margin: 100px 100px 0px 100px;
55
+            }
56
+            .item-content{
57
+                margin-top: 20px;
58
+                font-size: 16px;
59
+                line-height: 30px;
60
+                .contetn-title{
61
+                    .titel-text1{
62
+                        line-height: 50px;
63
+                        font-size: 26px;
64
+                        font-weight: bold;
65
+                        color: #9f9a93;
66
+                    }
67
+                }
68
+                .content-text{
69
+                    
70
+                    font-size: 18px;
71
+                    line-height: 36px;
72
+                    text-indent: 2em;
73
+                }
74
+            }
75
+        }
76
+    }
77
+</style>

+ 145 - 0
src/views/home/home-longhair.vue

@@ -0,0 +1,145 @@
1
+<template>
2
+    <div class="main" v-if="!detailFlag">
3
+        <el-row :gutter="30">
4
+            <el-col :span="12" v-for="(item, index) in productData" :key="index" style="position: relative;">
5
+                <el-image 
6
+                    @click="handleView(item)"
7
+                    style="width: 100%; margin: 15px;" 
8
+                    :src="apiUrl+ Object.values(item.fileInfo)[0]" 
9
+                    fit="fill" />
10
+                <div class="posText">
11
+                    <div class="textTitle">
12
+                        {{item.name}}
13
+                    </div>
14
+                    <div class="textInfo">
15
+                        {{item.content}}
16
+                    </div>
17
+                </div>
18
+            </el-col>
19
+        </el-row>
20
+        <el-row :gutter="30">
21
+            <el-col :span="6" v-for="(item, index) in productDataEnd" :key="index" style="position: relative;">
22
+                <el-image 
23
+                @click="handleView" 
24
+                style="width: 100%; margin: 15px;" 
25
+                :src="apiUrl+ Object.values(item.fileInfo)[0]" 
26
+                fit="fill" />
27
+                <div class="posText">
28
+                    <div class="textTitle">{{item.name}}</div>
29
+                </div>
30
+            </el-col>
31
+        </el-row>
32
+    </div>
33
+    <div class="main" v-if="detailFlag">
34
+        <div class="home-item">
35
+            <el-button @click="handleturn" class="returnBtn" type="warning" link>返回首页</el-button>
36
+                <el-row :gutter="50" style="width: 100%;margin-top: 30px;">
37
+                    <el-col :span="16" class="item-content">
38
+                        <div class="contetn-title">
39
+                            <div class="titel-text1">{{productDetails.name}}</div>
40
+                            <div class="titel-text2">{{productDetails.dateOfBirth}} </div>
41
+                        </div>
42
+                        <div class="content-text">
43
+                            {{productDetails.content}}
44
+                        </div>
45
+                    </el-col>
46
+                    <el-col :span="8" class="item-image">
47
+                        <el-image style="width: 100%;" :src="apiUrl+ Object.values(productDetails.fileInfo)[0]"  fit="fill" />
48
+                    </el-col>
49
+                </el-row>
50
+        </div>
51
+    </div>
52
+</template>
53
+
54
+<script setup name="homeLonghair">
55
+    import { ref, onMounted } from 'vue'
56
+    import request from '../../utils/request'
57
+    const apiUrl = ref('http://39.164.159.226:8100/')
58
+    const detailFlag = ref(false)
59
+    const productData = ref([])
60
+    const productDataEnd = ref([])
61
+    const productDetails = ref({})
62
+    onMounted(()=>{
63
+        getList()
64
+    })
65
+    function getList() {
66
+        request.get('Artist/artist').then((res)=>{
67
+            res.data.length>0 ? (productData.value = res.data) : (productData.value = [])
68
+            productData.value = []
69
+            productDataEnd.value = []
70
+            if (res.data.length>0) {
71
+                res.data.forEach((ele,i) => {
72
+                    if (i<4) {
73
+                        productData.value.push(ele)
74
+                    }else{
75
+                        productDataEnd.value.push(ele)
76
+                    }
77
+                });
78
+            }
79
+        })
80
+    }
81
+    function handleView(item) {
82
+        handleturn()
83
+        productDetails.value = item
84
+    }
85
+    function handleturn() {
86
+        detailFlag.value = !detailFlag.value
87
+    }
88
+    // defineExpose({ detailFlag });
89
+</script>
90
+<style scoped lang="scss">
91
+    .main {
92
+        width: 99%;
93
+        text-align: left;
94
+        color: #5e5b57;
95
+        .posText {
96
+            position: absolute;
97
+            width: 100%;
98
+            bottom: 30px;
99
+            left: 50px;
100
+
101
+            .textTitle {
102
+                font-size: 18px;
103
+                margin-bottom: 15px;
104
+                color: #fff;
105
+            }
106
+
107
+            .textTitle2 {}
108
+        }
109
+        .home-item{
110
+            display: flex;
111
+            width: 100%;
112
+            margin-top: 50px;
113
+            position: relative;
114
+            .returnBtn{
115
+                position: absolute;
116
+                right: 30px;
117
+                top: -15px;
118
+            }
119
+            .item-image{
120
+                margin-top: 50px;
121
+            }
122
+            .item-content{
123
+                font-size: 16px;
124
+                line-height: 30px;
125
+                .contetn-title{
126
+                    .titel-text1{
127
+                        line-height: 50px;
128
+                        font-size: 26px;
129
+                        font-weight: bold;
130
+                    }
131
+                    .titel-text2{
132
+                        line-height: 50px;
133
+                        font-size: 18px;
134
+                        line-height: 60px;
135
+                    }
136
+                }
137
+                .content-text{
138
+                    font-size: 18px;
139
+                    line-height: 80px;
140
+                    text-indent: 2em;
141
+                }
142
+            }
143
+        }
144
+    }
145
+</style>

+ 136 - 0
src/views/home/home-main.vue

@@ -0,0 +1,136 @@
1
+<template>
2
+    <div class="main" v-if="!detailFlag">
3
+        <el-row :gutter="50" style="margin-top: 30px;">
4
+            <el-col :span="8" v-for="(item, index) in mainData" :key="index" style="position: relative; margin-bottom: 15px;">
5
+                <el-card style="background-color: #000; border: 1px solid #5e5b57;">
6
+                    <el-image 
7
+                     style="width: 100%;" 
8
+                     :src="apiUrl+ Object.values(item.contentFileInfo)[0]" 
9
+                     fit="fill" />
10
+                    <div class="posText">
11
+                        <div class="textInfo">
12
+                            {{item.name}}
13
+                        </div>
14
+                        <div class="textView">
15
+                            <el-button size="large" type="warning" link @click="handleView(item)">查看更多</el-button>
16
+                        </div>
17
+                    </div>
18
+                </el-card>
19
+            </el-col>
20
+        </el-row>
21
+    </div>
22
+    <div class="main" v-if="detailFlag">
23
+        <div class="main-title" >
24
+            {{mainDetails.name}}
25
+            <el-button @click="handleturn" class="returnBtn" type="warning" link>返回首页</el-button>
26
+        </div>
27
+        <div class="main-image">
28
+            <el-row :gutter="50">
29
+                <el-col :span="4" v-for="(val, key,index) in mainDetails.fileInfo" :key="index">
30
+                    <el-image style="width: 100%; margin: 15px;" :src="apiUrl+ val"  fit="fill" />
31
+                </el-col>
32
+            </el-row>
33
+        </div>
34
+        <div class="main-content">
35
+            <el-row :gutter="50" style="width: 100%;">
36
+                <el-col :span="16" class="item-content">
37
+                    <div class="content-text">
38
+                        {{mainDetails.content}}
39
+                    </div>
40
+                </el-col>
41
+                <el-col :span="8" class="item-image">
42
+                    <el-image  style="width: 90%; margin:10%;" :src="apiUrl+ Object.values(mainDetails.contentFileInfo)[0]"  fit="fill" />
43
+                </el-col>
44
+            </el-row>
45
+        </div>
46
+    </div>
47
+</template>
48
+
49
+<script setup name="HomeMain">
50
+    import { ref, onMounted } from 'vue'
51
+    import request from '../../utils/request'
52
+    const apiUrl = ref('http://39.164.159.226:8100/')
53
+    const detailFlag = ref(false)
54
+    const mainData = ref([])
55
+    const mainDetails = ref({})
56
+    onMounted(()=>{
57
+        getList()
58
+    })
59
+    function getList() {
60
+        request.get('GwHome/gwhome').then((res)=>{
61
+            res.data.length>0 ? (mainData.value = res.data) : (mainData.value = [])
62
+        })
63
+    }
64
+    function handleView(item) {
65
+        handleturn()
66
+        mainDetails.value = item
67
+    }
68
+    function handleturn() {
69
+        detailFlag.value = !detailFlag.value
70
+    }
71
+    // defineExpose({ detailFlag });
72
+</script>
73
+
74
+<style scoped lang="scss">
75
+    .main{
76
+        width: 98%;
77
+        text-align: left;
78
+        color: #5e5b57;
79
+        .posText{
80
+            .textInfo{
81
+                
82
+                color: #b7b7b7;
83
+                height: 110px;
84
+                text-indent: 2em;
85
+                line-height: 30px;
86
+                overflow:hidden;
87
+                text-overflow:ellipsis;
88
+                display:-webkit-box;
89
+                -webkit-box-orient:vertical;
90
+                -webkit-line-clamp:3;
91
+            }
92
+            .textView{
93
+                text-align: right;
94
+            }
95
+            
96
+        }
97
+        .main-title{
98
+            text-align: left;
99
+            line-height: 60px;
100
+            font-size: 26px;
101
+            font-weight: bold;
102
+            position: relative;
103
+            .returnBtn{
104
+                position: absolute;
105
+                right: 8px;
106
+                top: 25px;
107
+            }
108
+        }
109
+        .main-image{
110
+            border-bottom: 2px solid #2c3e50;
111
+            margin-bottom: 15px;
112
+            padding-bottom: 15px;
113
+        }
114
+        .main-time{
115
+            text-align: center;
116
+            font-size: 16px;
117
+            line-height: 30px;
118
+        }
119
+        .main-content{
120
+            width: 100%;
121
+            display: flex;
122
+            font-size: 16px;
123
+            line-height: 30px;
124
+
125
+            .item-content{
126
+                font-size: 16px;
127
+                line-height: 30px;
128
+                .content-text{
129
+                    font-size: 18px;
130
+                    line-height: 36px;
131
+                    text-indent: 2em;
132
+                }
133
+            }
134
+        }
135
+    }
136
+</style>

+ 101 - 0
src/views/home/home-product.vue

@@ -0,0 +1,101 @@
1
+<template>
2
+    <div class="product">
3
+        <div class="product-item">
4
+                <div class="item-name">
5
+                    <div class="name-title">{{productData.name}}</div>
6
+                    <div class="name-image">
7
+                        <el-row :gutter="50">
8
+                            <el-col :span="4"  v-for="(val, key,index) in productData.nameFileInfo" :key="index">
9
+                                <el-image style="width: 100%; margin: 15px;" :src="apiUrl+val" fit="fill" />
10
+                            </el-col>
11
+                        </el-row>
12
+                    </div>
13
+                    <div class="name-content">
14
+                        {{productData.nameContent}}
15
+                    </div>
16
+                </div>
17
+                <div class="item-model">
18
+                    <div class="model-title">{{productData.type}}</div>
19
+                    <div class="model-content">
20
+                        {{productData.typeContent}}
21
+                    </div>
22
+                    <div class="model-image">
23
+                        <el-row :gutter="50">
24
+                            <el-col :span="12"  v-for="(val, key,index) in productData.typeFileInfo" :key="index">
25
+                                <el-image style="width: 100%; margin: 15px;" :src="apiUrl+val" fit="fill" />
26
+                            </el-col>
27
+                        </el-row>
28
+                    </div>
29
+                </div>
30
+        </div>
31
+      
32
+    </div>
33
+</template>
34
+
35
+<script setup name="HomeMain">
36
+    // import { ref } from 'vue'
37
+    import { ref, onMounted,watch,computed } from 'vue' 
38
+    import { useRoute,onBeforeRouteUpdate } from 'vue-router'
39
+    import request from '../../utils/request'
40
+    const route = useRoute()
41
+    const apiUrl = ref('http://39.164.159.226:8100/')
42
+    const productData = ref([])
43
+    const productId = ref('')
44
+    onBeforeRouteUpdate((res) => {
45
+        productId.value = res.query.id
46
+        getList()
47
+    });
48
+    onMounted(()=>{
49
+        console.log(route.query.id+"-----");
50
+        productId.value = route.query.id
51
+        getList()
52
+    })
53
+    function getList() {
54
+        request.get('/Product/product/'+productId.value).then((res)=>{
55
+            if (res.data) {
56
+                productData.value = res.data
57
+            }
58
+        })
59
+    }
60
+</script>
61
+<style scoped lang="scss">
62
+    .product{
63
+        color: #5e5b57;
64
+        .product-item{
65
+            text-align: left;
66
+            .item-name{
67
+                .name-title{
68
+                    
69
+                    margin-left: 15px;
70
+                    line-height: 50px;
71
+                    font-size: 26px;
72
+                    font-weight: bold;
73
+                    color: #9f9a93;
74
+                }
75
+                .name-image{}
76
+                .name-content{
77
+                    border-top: 2px solid #2c3e50;
78
+                    font-size: 16px;
79
+                    margin-top: 15px;
80
+                    padding-top: 15px;
81
+                    line-height: 30px;
82
+                    text-indent: 2em;
83
+                }
84
+            }
85
+            .item-model{
86
+                margin-top: 15px;
87
+                .model-title{
88
+                    line-height: 50px;
89
+                    font-size: 26px;
90
+                    font-weight: bold;
91
+                }
92
+                .model-content{
93
+                    font-size: 16px;
94
+                    line-height: 30px;
95
+                }
96
+                .model-image{}
97
+            }
98
+        }
99
+        
100
+    }
101
+</style>