|
|
@@ -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>
|