Skip to content

Commit 6915e53

Browse files
committed
首页
1 parent 4b3ef23 commit 6915e53

19 files changed

+2181
-631
lines changed

api/banner.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default $axios => ({
2+
// 首页banner
3+
bannerList(params) {
4+
return $axios({
5+
url: '/banner/index', method: 'get', params
6+
})
7+
},
8+
// 获取配置
9+
getWebConfig(params) {
10+
return $axios({
11+
url: '/setting/configure', method: 'get', params
12+
})
13+
}
14+
})

assets/scss/reset.scss

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
html, body, div, span, applet, object, iframe,
2+
p, blockquote, pre,
3+
a, abbr, acronym, address, big, cite, code,
4+
del, dfn, img, ins, kbd, q, s, samp,
5+
small, strike, sub, sup, tt, var,
6+
b, u, i, center,
7+
dl, dt, dd, ol, ul, li,
8+
fieldset, form, label, legend,
9+
table, caption, tbody, tfoot, thead, tr, th, td,
10+
article, aside, canvas, details, embed,
11+
figure, figcaption, footer, header, hgroup,
12+
menu, nav, output, ruby, section, summary,
13+
time, mark, audio, video {
14+
margin: 0;
15+
padding: 0;
16+
border: 0;
17+
font-size: 100%;
18+
font: inherit;
19+
vertical-align: baseline;
20+
}
21+
/* HTML5 display-role reset for older browsers */
22+
article, aside, details, figcaption, figure,
23+
footer, header, hgroup, menu, nav, section {
24+
display: block;
25+
}
26+
body {
27+
line-height: 1;
28+
}
29+
ol, ul {
30+
list-style: none;
31+
}
32+
blockquote, q {
33+
quotes: none;
34+
}
35+
blockquote:before, blockquote:after,
36+
q:before, q:after {
37+
content: '';
38+
content: none;
39+
}
40+
table {
41+
border-collapse: collapse;
42+
border-spacing: 0;
43+
}
44+
html, body {
45+
width: 100%;
46+
height: 100%;
47+
font-family: 'PingFangSC-Light', 'PingFang SC', 'STHeitiSC-Light', 'Helvetica-Light', 'Arial', 'sans-serif';
48+
// overflow-y: auto !important;
49+
// padding-right: 0 !important;
50+
}
51+
@font-face {
52+
font-family: 'font_family'; /* Project id 3251212 */
53+
src: url('//at.alicdn.com/t/font_3251212_cjw99x5fe1f.woff2?t=1650783774466') format('woff2'),
54+
url('//at.alicdn.com/t/font_3251212_cjw99x5fe1f.woff?t=1650783774466') format('woff'),
55+
url('//at.alicdn.com/t/font_3251212_cjw99x5fe1f.ttf?t=1650783774466') format('truetype');
56+
}

assets/scss/variable.scss

+35-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
$--color-primary: blue;
1+
$--color-primary: #0048FF;
2+
$--color-primary-light: mix(#fff, $--color-primary, 96%);
3+
4+
5+
// 公用代码
6+
@mixin ellipsisBasic($clamp:2) {
7+
overflow: hidden;
8+
text-overflow: ellipsis;
9+
display: -webkit-box;
10+
-webkit-box-orient: vertical;
11+
-webkit-line-clamp: $clamp;
12+
}
13+
@mixin flex-between($alignItems: center) {
14+
display: flex;
15+
justify-content: space-between;
16+
align-items: $alignItems;
17+
}
18+
@mixin flex-around($alignItems: 'center') {
19+
display: flex;
20+
justify-content: space-around;
21+
align-items: $alignItems;
22+
}
23+
24+
::-webkit-scrollbar {
25+
width: 8px;
26+
height: 8px;
27+
}
28+
::-webkit-scrollbar-thumb {
29+
background-color: rgba(144, 147, 153, 0.7);
30+
border: 3px solid transparent;
31+
border-radius: 7px;
32+
}
33+
::-webkit-scrollbar-thumb:hover {
34+
background-color: rgba(144, 147, 153, 0.7);
35+
}

components/BigTitle.vue

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<template>
2+
<div class='big-title' ref="title">
3+
<div>
4+
<span class="line"></span>
5+
<span class='cn-text'>{{cnText}}</span>
6+
</div>
7+
<div class="more" v-show="moreUrl">
8+
<span>查看更多</span>
9+
<i class="el-icon-arrow-right"></i>
10+
</div>
11+
<p class='en-text'>{{enText}}</p>
12+
</div>
13+
</template>
14+
<script>
15+
export default {
16+
props: {
17+
cnText: {
18+
type: String,
19+
default: '标题',
20+
},
21+
enText: {
22+
type: String,
23+
default: 'TITLE',
24+
},
25+
color: {
26+
type: String,
27+
default: '',
28+
},
29+
align: {
30+
type: String,
31+
default: 'center',
32+
},
33+
moreUrl: {
34+
type: String,
35+
default: '',
36+
},
37+
},
38+
data() {
39+
return {}
40+
},
41+
mounted() {
42+
if (this.color) {
43+
this.$refs.title.style.color = this.color
44+
}
45+
},
46+
methods: {},
47+
}
48+
</script>
49+
<style scoped lang='scss'>
50+
.big-title {
51+
@include flex-between(flex-start);
52+
justify-content: flex-start;
53+
position: relative;
54+
height: 52px;
55+
.line {
56+
background: $--color-primary;
57+
display: inline-block;
58+
width: 2px;
59+
height: 24px;
60+
margin-right: 15px;
61+
position: relative;
62+
z-index: 2;
63+
}
64+
.cn-text {
65+
vertical-align: top;
66+
font-size: 24px;
67+
font-weight: bold;
68+
margin-right: 30px;
69+
position: relative;
70+
z-index: 2;
71+
}
72+
.more {
73+
color: #4d4d4d;
74+
position: relative;
75+
z-index: 2;
76+
margin-top: 8px;
77+
}
78+
.en-text {
79+
font-size: 60px;
80+
font-family: Arial;
81+
font-weight: bold;
82+
color: #fff;
83+
position: absolute;
84+
z-index: 1;
85+
left: 0;
86+
top: -8px;
87+
}
88+
}
89+
</style>

components/Footer.vue

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<template>
2+
<div class='footer'>
3+
<div class='content'>
4+
<p>
5+
<span>
6+
© {{ (new Date).getFullYear() }} {{ $store.state.config.webConfig.site_name }}
7+
</span>
8+
<span v-if="$store.state.config.webConfig.beian"
9+
@click="handleCommand($store.state.config.webConfig.beian)"
10+
class="link">
11+
| {{ $store.state.config.webConfig.beian }}
12+
</span>
13+
<span v-if="$store.state.config.webConfig.copyright"
14+
@click="handleCommand($store.state.config.webConfig.copyright)"
15+
class="link">
16+
| {{ $store.state.config.webConfig.copyright }}
17+
</span>
18+
</p>
19+
<p>
20+
<span v-if="$store.state.config.webConfig.friend_links && $store.state.config.webConfig.friend_links.length"
21+
class="link">
22+
<el-dropdown placement="top-end"
23+
trigger="hover"
24+
@command="handleCommand">
25+
<span class="link">
26+
友情链接
27+
</span>
28+
<el-dropdown-menu slot="dropdown">
29+
<el-dropdown-item v-for="(link,index ) in $store.state.config.webConfig.friend_links"
30+
:key="index"
31+
:command="link.value">{{ link.label }}</el-dropdown-item>
32+
</el-dropdown-menu>
33+
</el-dropdown>
34+
</span>
35+
<span v-if="$store.state.config.webConfig.help_url"
36+
@click="handleCommand($store.state.config.webConfig.help_url)"
37+
class="link"> | 帮助文档</span>
38+
</p>
39+
</div>
40+
</div>
41+
</template>
42+
<script>
43+
export default {
44+
data() {
45+
return {}
46+
},
47+
methods: {
48+
handleCommand(url) {
49+
window.open(url, '_blank')
50+
},
51+
},
52+
}
53+
</script>
54+
<style scoped lang='scss'>
55+
.footer {
56+
width: 100%;
57+
font-size: 14px;
58+
height: 60px;
59+
margin: 0 auto;
60+
background: white;
61+
color: #999999;
62+
border-top: 1px solid #f2f2f2;
63+
64+
.content {
65+
width: 76%;
66+
margin: 0 auto;
67+
line-height: 60px;
68+
display: flex;
69+
justify-content: space-between;
70+
align-items: center;
71+
72+
.link {
73+
cursor: pointer;
74+
color: #999999;
75+
}
76+
}
77+
}
78+
</style>

0 commit comments

Comments
 (0)