Browse Source

详情页footer

master
aBin 3 years ago
parent
commit
f7148c6b84
  1. BIN
      src/assets/16fangzhen.png
  2. BIN
      src/assets/honor-title.png
  3. 69
      src/components/BayWindow/BayWindow.vue
  4. BIN
      src/components/BayWindow/piaochuang.png
  5. 42
      src/components/Footer/Footer.vue
  6. 5
      src/config/api.js
  7. 126
      src/views/FirstPages/FirstPage.vue

BIN
src/assets/16fangzhen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
src/assets/honor-title.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

69
src/components/BayWindow/BayWindow.vue

@ -1,12 +1,27 @@
<template>
<div>
<div id="bay" @mouseout="mouseout" @mouseover="mouseover">
飘窗
<a-icon class="bay-icon" type="close-circle" @click="close" />
<div class="bay-content">
<div class="d-flex justify-center align-center bay-title">
<!-- {{ content.content.source }} -->
<div class="title-bg" v-for="(item, index) in content.contentValue" :key="index">{{ item }}</div>
</div>
<div class="bay-value">
{{ content.content.title }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
content: {
default: () => {},
type: Object,
},
},
data() {
return {
ggRoll: null,
@ -66,14 +81,60 @@ export default {
clearInterval(this.interval);
this.interval = null;
},
close() {
this.$emit('closeBay');
},
},
};
</script>
<style scoped>
.bay-icon {
position: absolute;
right: 0;
top: 0;
font-size: 20px;
cursor: pointer;
color: rgb(204, 204, 204);
}
.bay-title {
height: 32px;
font-size: 18px;
color: #fdebcd;
}
.title-bg {
margin: 0 2px;
height: 30px;
width: 30px;
border: 2px solid #fdebcd;
border-radius: 50%;
text-align: center;
line-height: 24px;
box-shadow: 0 0 2px 2px rgba(183, 19, 17);
}
#bay {
position: fixed;
height: 250px;
width: 250px;
background-color: red;
z-index: 9999;
height: 183px;
width: 278px;
/* background-color: red; */
background-image: url('./piaochuang.png');
background-size: 100% 100%;
}
.bay-content {
width: 218px;
height: 110px;
position: absolute;
bottom: 4px;
left: 24px;
cursor: pointer;
}
.bay-value {
padding: 0 16px 16px 16px;
height: 60px;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
color: rgb(249, 170, 98);
}
</style>

BIN
src/components/BayWindow/piaochuang.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

42
src/components/Footer/Footer.vue

@ -1,7 +1,8 @@
<template>
<div class="footer-box" style="margin-top:100px;position:relative">
<div class="footer-box" :class="isTrue ? 'white' : 'blue'" style="margin-top:100px;position:relative">
<div v-if="!isTrue" class="other-link"></div>
<div class="content-1180">
<div class="d-flex" style="margin-top:20px">
<div class="d-flex" style="margin-top:20px" :class="isTrue ? '' : 'justify-center'">
<div class="footer-title">
<p style="font-size:24px;rgb(51,51,51);font-weight:bold;">网上展厅</p>
<p style="font-size:18px;rgb(102,102,102)">公示公告</p>
@ -19,7 +20,7 @@
</div>
<img src="./erweima.png" style="width:164px;height:94px" alt="" />
</div>
<div style="position:absolute;bottom:30px;z-index: 10;width:640px;">
<div style="position:absolute;bottom:30px;z-index: 10;width:640px;" :style="{ left: isTrue ? '' : '38%' }">
<div class="d-flex">
<div style="margin-right:22px">
山西省朔州市朔城区神头镇 邮编:036002
@ -42,22 +43,51 @@
</div>
</div>
<img src="./yancong.png" style="width:909px;height:412px;position: absolute;right: 0;bottom: 0" alt="" />
<img v-if="isTrue" src="./yancong.png" style="width:909px;height:412px;position: absolute;right: 0;bottom: 0" alt="" />
</div>
</template>
<script>
export default {
data() {
return {};
return {
isTrue: true,
str: '',
};
},
watch: {
'$route.path'(value) {
if (value === '/') {
this.isTrue = true;
} else {
this.isTrue = false;
}
},
},
methods: {},
};
</script>
<style scoped>
.other-link {
height: 80px;
width: 100%;
background-color: #0173a9;
position: absolute;
top: -80px;
left: 0;
z-index: 100;
}
.footer-box {
background: #fff;
height: 320px;
padding: 30px 0;
position: relative;
}
.white {
background: #fff;
}
.blue {
background: rgb(0, 53, 107);
margin-top: 160px !important;
color: #ccc !important;
}
.footer-link {
height: 52px;

5
src/config/api.js

@ -4,6 +4,7 @@ let { proxyUrl, msgUrl } = require('@/config/setting');
const apiDocs = `${proxyUrl}`;
const carousel = `${apiDocs}/carousel`; // 轮播图
const content = `${apiDocs}/content`; // 网站内容
const constant = `${apiDocs}/constant`; // 飘窗
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -23,5 +24,7 @@ export const getContent = params =>
export const getDetail = params => axios.get(`${content}/detail?showPage=${params.showPage}&introId=${params.introId}`);
// 查询当前code下的年份
export const getCondition = params => axios.get(`${content}/condition?showPage=${params.showPage}`);
// 查询飘窗内容
export const getBay = params => axios.get(`${constant}/get?code=piaochuang`);

126
src/views/FirstPages/FirstPage.vue

@ -59,6 +59,15 @@
</div>
</div>
</div>
<div class="mt-4 policy">
<img src="@/assets/16fangzhen.png" alt="" />
<p>
<span class="mr-4">阿弥陀佛</span>
<span class="mr-4">阿弥陀佛</span>
<span class="mr-4">阿弥陀佛</span>
<span>阿弥陀佛</span>
</p>
</div>
<!-- 图片新闻 -->
<div class="news-img p-4 mt-4 d-flex flex-column">
<div class="new-box-title d-flex justify-space-between">
@ -134,6 +143,60 @@
</div>
</div>
</div>
<!-- 专题报道 光荣榜 今天我出镜 -->
<div class="honor-box mt-4 p-4 d-flex justify-space-between">
<div class="flex-1 flex-column content-honor mr-4 p-4">
<div class="honor-title d-flex justify-space-between">
<div style="font-size:22px">
<img style="height:26px" src="@/assets/honor-title.png" alt="" />
专题报道
</div>
<div class="d-flex align-center" style="cursor: pointer;">
更多>
</div>
</div>
<div class="flex-1 flex-column justify-space-between pt-4">
<div v-for="item in specialList" :key="item.introId" class="d-flex justify-space-between">
<div class="one-text" style="cursor: pointer;">{{ item.title }}</div>
<div class="ml-4">{{ $moment(item.publishTime).format('MM/DD') }}</div>
</div>
</div>
</div>
<div class="flex-1 flex-column content-honor mr-4 p-4">
<div class="honor-title d-flex justify-space-between">
<div style="font-size:22px">
<img style="height:26px" src="@/assets/honor-title.png" alt="" />
光荣榜
</div>
<div class="d-flex align-center" style="cursor: pointer;">
更多>
</div>
</div>
<div class="flex-1 flex-column justify-space-between pt-4">
<div v-for="item in gloryList" :key="item.introId" class="d-flex justify-space-between">
<div class="one-text" style="cursor: pointer;">{{ item.title }}</div>
<div class="ml-4">{{ $moment(item.publishTime).format('MM/DD') }}</div>
</div>
</div>
</div>
<div class="flex-1 flex-column content-honor p-4">
<div class="honor-title d-flex justify-space-between">
<div style="font-size:22px">
<img style="height:26px" src="@/assets/honor-title.png" alt="" />
今天我出镜
</div>
<div class="d-flex align-center" style="cursor: pointer;">
更多>
</div>
</div>
<div class="flex-1 flex-column justify-space-between pt-4">
<div v-for="item in exitList" :key="item.introId" class="d-flex justify-space-between">
<div class="one-text" style="cursor: pointer;">{{ item.title }}</div>
<div class="ml-4">{{ $moment(item.publishTime).format('MM/DD') }}</div>
</div>
</div>
</div>
</div>
<!-- 职工风采 -->
<div class="news-demeanor mt-4 p-4 d-flex flex-column">
<div class="new-box-title d-flex justify-space-between">
@ -165,12 +228,13 @@
</div>
</div>
</div>
<BayWindow />
<BayWindow v-if="content && content.title" :content="content" @closeBay="closeBay" />
</div>
</template>
<script>
import { mapActions } from 'vuex';
import BayWindow from '@/components/BayWindow/BayWindow.vue';
import { getBay } from 'config/api';
export default {
components: { BayWindow },
@ -183,6 +247,10 @@ export default {
ImgNews2: [],
ImgNews3: [],
sceneStyle: [],
specialList: [], //
gloryList: [], //
exitList: [], //
content: {},
};
},
created() {
@ -193,6 +261,10 @@ export default {
this.getData('0202', 'ImgNews2', '1');
this.getData('0203', 'ImgNews3', '1');
this.getData('0210', 'sceneStyle', '1');
this.getData('9901', 'specialList', '0');
this.getData('9902', 'gloryList', '0');
this.getData('9903', 'exitList', '0');
this.getBayData();
},
methods: {
...mapActions('home', ['getContent']),
@ -215,10 +287,62 @@ export default {
openPage(path, code, id) {
window.open(`${window.location.href}${path}?code=${code}&introId=${id}`);
},
async getBayData() {
try {
const res = await getBay();
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data);
const obj = {
title: data.code,
content: JSON.parse(data.value),
contentValue: JSON.parse(data.value).source.split(''),
};
this.content = obj;
} else {
console.error(msg);
}
} catch (error) {}
},
closeBay() {
this.content = null;
},
},
};
</script>
<style scoped>
.content-honor {
box-shadow: 0 0 10px 1px rgba(33, 79, 159, 0.15);
flex: 1;
width: 340px;
/* padding: 16px 0 0 0; */
}
.honor-box {
height: 320px;
background-color: #fff;
}
.honor-title {
height: 46px;
border-bottom: 1px solid rgb(51, 51, 51);
}
.policy {
position: relative;
color: rgba(210, 15, 16, 0.85);
font-size: 30px;
}
.policy >>> p {
font-weight: bold;
height: 40px;
width: 600px;
line-height: 40px;
text-align: center;
margin-bottom: 0;
position: absolute;
left: 50%;
margin-left: -300px;
top: 50%;
margin-top: -20px;
}
.demeanor-content-box {
white-space: nowrap;
overflow: hidden;

Loading…
Cancel
Save