miaofuhao преди 1 година
родител
ревизия
f5e64f65f1

+ 2 - 1
.env.development

@@ -1,4 +1,5 @@
1 1
 # 请注意,所有的环境变量前需要加上VUE_APP_前缀,这是Vue CLI项目的要求
2 2
 
3 3
 # 设置API地址
4
-VUE_APP_BASE_API_URL=http://39.164.159.226:8100/
4
+# VUE_APP_BASE_API_URL=http://39.164.159.226:8100/
5
+VUE_APP_BASE_API_URL=http://192.168.1.15:8100/

+ 1 - 1
.env.production

@@ -1,2 +1,2 @@
1 1
 # 设置API地址
2
-VUE_APP_BASE_API_URL=http://39.164.159.226:8100/
2
+VUE_APP_BASE_API_URL=/api/

BIN
0513dist.zip


+ 0 - 3
src/views/admin/product.vue

@@ -162,9 +162,6 @@ let ruleForm = reactive<any>({
162 162
   name: '',
163 163
   nameContent: '',
164 164
   nameFile: [],
165
-  type: '',
166
-  typeContent: '',
167
-  typeFile: [],
168 165
 })
169 166
 let typeRuleForm = reactive<any>({
170 167
   id: 0,

+ 37 - 4
src/views/home/home-activity.vue

@@ -22,12 +22,23 @@
22 22
         
23 23
         <div class="main-title" >
24 24
             {{activityDetails.title}}
25
-            <el-button @click="handleView" class="returnBtn" type="warning" link>返回首页</el-button>
25
+            <el-button @click="handleturn" class="returnBtn" type="warning" link>返回首页</el-button>
26 26
         </div>
27 27
         <div class="main-time">{{activityDetails.createTime.split(' ')[0]}}</div>
28 28
         <div class="main-content">
29 29
             <img :src="apiUrl+ Object.values(activityDetails.fileInfo)[0]" align="right" width="300" hspace="30" vspace="30">
30
-            {{activityDetails.content}}
30
+            <div style="text-indent: 2em;" 
31
+            v-for="(item,index) in activityDetails.content && activityDetails.content.split('\n')" 
32
+            :key="index">
33
+                {{item}}
34
+            </div>
35
+        </div>
36
+        <div class="main-img">
37
+            <el-row :gutter="20" style="width: 100%;">
38
+                <el-col :span="6" v-for="(item, index) in imgItemData" :key="index">
39
+                    <img class="img-item" :src="apiUrl+ Object.values(activityDetails.fileInfo)[0]">
40
+                </el-col>
41
+            </el-row>
31 42
         </div>
32 43
     </div>
33 44
 </template>
@@ -35,21 +46,32 @@
35 46
 <script setup name="HomeActivity">
36 47
     import { ref, onMounted } from 'vue'
37 48
     import request from '../../utils/request'
38
-    const apiUrl = ref('http://39.164.159.226:8100/')
49
+    const apiUrl = ref(process.env.VUE_APP_BASE_API_URL)
39 50
     const detailFlag = ref(false)
40 51
     const activityData = ref([])
41 52
     const activityDetails = ref({})
53
+    const imgItemData = ref([])
42 54
     onMounted(()=>{
43 55
         getList()
44 56
     })
45 57
     function getList() {
46 58
         request.get('/Activity/activity').then((res)=>{
47
-            res.data.length>0 ? (activityData.value = res.data) : (activityData.value = [])
59
+            activityData.value = []
60
+            if (res.data.length>0) {
61
+                activityData.value = res.data
62
+                // console.log(Object.values(activityDetails.value.fileInfo));
63
+                // imgItemData.value = Object.values(activityDetails.fileInfo)
64
+            }
48 65
         })
49 66
     }
50 67
     function handleView(item) {
51 68
         handleturn()
52 69
         activityDetails.value = item
70
+        imgItemData.value = []
71
+        Object.values(item.fileInfo).forEach((ele)=>{
72
+            imgItemData.value.push(ele)
73
+        })
74
+        console.log(imgItemData.value);
53 75
     }
54 76
     function handleturn() {
55 77
         detailFlag.value = !detailFlag.value
@@ -120,6 +142,17 @@
120 142
             width: 100%;
121 143
             font-size: 16px;
122 144
             line-height: 36px;
145
+            min-width: 360px;
146
+
147
+        }
148
+        .main-img{
149
+            width: 100%;
150
+            margin-top: 30px;
151
+            .img-item{
152
+                width: 100%;
153
+
154
+            }
155
+
123 156
         }
124 157
     }
125 158
 </style>

+ 2 - 9
src/views/home/home-intro.vue

@@ -11,14 +11,7 @@
11 11
                 <div class="contetn-title">
12 12
                     <div class="titel-text1">{{introData.name}}</div>
13 13
                 </div>
14
-                <div class="content-text">
15
-                    <p v-html="introData.content">
16
-                        
17
-                    </p>
18
-                    
19
-
20
-
21
-                </div>
14
+                <div class="content-text" v-for="(item,index) in introData.content && introData.content.split('\n')" :key="index">{{item}}</div>
22 15
             </div>
23 16
             
24 17
         </div>
@@ -29,7 +22,7 @@
29 22
 <script setup name="HomeIntro">
30 23
     import { ref,onMounted } from 'vue' 
31 24
     import request from '../../utils/request'
32
-    const apiUrl = ref('http://39.164.159.226:8100/')
25
+    const apiUrl = ref(process.env.VUE_APP_BASE_API_URL)
33 26
     const resultUrl = ref('')
34 27
     const introData = ref({})
35 28
     onMounted(()=>{

+ 5 - 6
src/views/home/home-longhair.vue

@@ -11,9 +11,6 @@
11 11
                     <div class="textTitle">
12 12
                         {{item.name}}
13 13
                     </div>
14
-                    <div class="textInfo">
15
-                        {{item.content}}
16
-                    </div>
17 14
                 </div>
18 15
             </el-col>
19 16
         </el-row>
@@ -39,8 +36,10 @@
39 36
                             <div class="titel-text1">{{productDetails.name}}</div>
40 37
                             <div class="titel-text2">{{productDetails.dateOfBirth}} </div>
41 38
                         </div>
42
-                        <div class="content-text">
43
-                            {{productDetails.content}}
39
+                        <div class="content-text" style="text-indent: 2em;" 
40
+                        v-for="(item,index) in productDetails.content && productDetails.content.split('\n')" 
41
+                        :key="index">
42
+                            {{item}}
44 43
                         </div>
45 44
                     </el-col>
46 45
                     <el-col :span="8" class="item-image">
@@ -54,7 +53,7 @@
54 53
 <script setup name="homeLonghair">
55 54
     import { ref, onMounted } from 'vue'
56 55
     import request from '../../utils/request'
57
-    const apiUrl = ref('http://39.164.159.226:8100/')
56
+    const apiUrl = ref(process.env.VUE_APP_BASE_API_URL)
58 57
     const detailFlag = ref(false)
59 58
     const productData = ref([])
60 59
     const productDataEnd = ref([])

+ 5 - 3
src/views/home/home-main.vue

@@ -34,8 +34,10 @@
34 34
         <div class="main-content">
35 35
             <el-row :gutter="50" style="width: 100%;">
36 36
                 <el-col :span="16" class="item-content">
37
-                    <div class="content-text">
38
-                        {{mainDetails.content}}
37
+                    <div class="content-text" style="text-indent: 2em;" 
38
+                    v-for="(item,index) in mainDetails.content && mainDetails.content.split('\n')" 
39
+                    :key="index">
40
+                        {{item}}
39 41
                     </div>
40 42
                 </el-col>
41 43
                 <el-col :span="8" class="item-image">
@@ -49,7 +51,7 @@
49 51
 <script setup name="HomeMain">
50 52
     import { ref, onMounted } from 'vue'
51 53
     import request from '../../utils/request'
52
-    const apiUrl = ref('http://39.164.159.226:8100/')
54
+    const apiUrl = ref(process.env.VUE_APP_BASE_API_URL)
53 55
     const detailFlag = ref(false)
54 56
     const mainData = ref([])
55 57
     const mainDetails = ref({})

+ 19 - 5
src/views/home/home-product.vue

@@ -14,14 +14,17 @@
14 14
                         {{productData.nameContent}}
15 15
                     </div>
16 16
                 </div>
17
-                <div class="item-model">
18
-                    <div class="model-title">{{productData.type}}</div>
19
-                    <div class="model-content">
20
-                        {{productData.typeContent}}
17
+                <div class="item-model" v-for="(item, index) in typeData" :key="index">
18
+                    <div class="model-title">{{item.type}}</div>
19
+                    <div class="model-content" style="text-indent: 2em;" 
20
+                        v-for="(itemChild,index) in item.typeContent && item.typeContent.split('\n')" 
21
+                        :key="index">
22
+                            {{itemChild}}
21 23
                     </div>
24
+
22 25
                     <div class="model-image">
23 26
                         <el-row :gutter="50">
24
-                            <el-col :span="12"  v-for="(val, key,index) in productData.typeFileInfo" :key="index">
27
+                            <el-col :span="12" v-for="(val, key,index) in item.typeFileInfo" :key="index">
25 28
                                 <el-image style="width: 100%; margin: 15px;" :src="apiUrl+val" fit="fill" />
26 29
                             </el-col>
27 30
                         </el-row>
@@ -40,6 +43,7 @@
40 43
     const route = useRoute()
41 44
     const apiUrl = process.env.VUE_APP_BASE_API_URL
42 45
     const productData = ref([])
46
+    const typeData = ref([])
43 47
     const productId = ref('')
44 48
     onBeforeRouteUpdate((res) => {
45 49
         productId.value = res.query.id
@@ -54,6 +58,16 @@
54 58
         request.get('/Product/product/'+productId.value).then((res)=>{
55 59
             if (res.data) {
56 60
                 productData.value = res.data
61
+                getType()
62
+            }
63
+        })
64
+    }
65
+    function getType() {
66
+        // /Type/type?productId=1
67
+        request.get('/Type/type?productId='+productId.value).then((res)=>{
68
+            if (res.data) {
69
+                typeData.value = res.data
70
+                console.log(typeData.value);
57 71
             }
58 72
         })
59 73
     }