Skip to content

Commit 4a88928

Browse files
committed
提交首页静态页面
1 parent 9487404 commit 4a88928

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+286
-36
lines changed

.eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
// allow async-await
2525
'generator-star-spacing': 'off',
2626
// allow debugger during development
27-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
28-
"no-tabs": "off"
27+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'/* ,
28+
"no-tabs": "off" */
2929
}
3030
}

build/webpack.dev.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
2626
historyApiFallback: {
2727
rewrites: [
2828
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29-
],
29+
]
3030
},
3131
hot: true,
3232
contentBase: false, // since we use CopyWebpackPlugin.
@@ -41,7 +41,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
4141
proxy: config.dev.proxyTable,
4242
quiet: true, // necessary for FriendlyErrorsPlugin
4343
watchOptions: {
44-
poll: config.dev.poll,
44+
poll: config.dev.poll
4545
}
4646
},
4747
plugins: [

index.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33

44
<head>
55
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
7+
<meta name="screen-orientation" content="portrait"/>
8+
<meta name="apple-mobile-web-app-capable" content="yes">
9+
<meta name="format-detection" content="telephone=no">
10+
<meta name="full-screen" content="yes">
11+
<meta name="x5-fullscreen" content="true">
712
<title>weichen</title>
813
<script src="//g.alicdn.com/fdilab/lib3rd/viewport-units-buggyfill/0.6.2/??viewport-units-buggyfill.hacks.min.js,viewport-units-buggyfill.min.js"></script>
914
</head>

src/App.vue

-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<transition name="router-fade">
44
<router-view></router-view>
55
</transition>
6-
<div class="border"></div>
76
</div>
87
</template>
98

@@ -20,12 +19,4 @@ export default {
2019
.router-fade-enter, .router-fade-leave-active {
2120
opacity: 0;
2221
}
23-
.border{
24-
width: 32px;
25-
height: 40px;
26-
background-color: orange;
27-
border-bottom: 1px solid transparent;
28-
margin-bottom: 15px;
29-
border-image: svg(1px-border param(--color #333)) 2 2 stretch;
30-
}
3122
</style>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/assets/logo.png

-6.69 KB
Binary file not shown.

src/page/Home.vue

+258
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
<template>
2+
<div id="webHome">
3+
<div class="container">
4+
<header class="head">
5+
<input type="text" class="search" placeholder="搜索">
6+
<a class="msg-btn"></a>
7+
</header>
8+
<section class="slider"></section>
9+
<nav class="lesson-list">
10+
<a class="lesson-item" v-for="(item,index) in lessonNav" :key="index">
11+
<img class="lesson-item-icon" :src="item.imgUrl" alt="">
12+
<span class="lesson-item-name">{{item.lessonName}}</span>
13+
</a>
14+
</nav>
15+
<section class="tab-box">
16+
<nav class="tab-nav">
17+
<div class="tab-nav-top">
18+
<a class="tab-nav-item active">系列课程</a>
19+
<a class="tab-nav-item">精品小课</a>
20+
</div>
21+
<div class="tab-border"></div>
22+
</nav>
23+
<section class="tab-cont">
24+
<div class="tab-cont-item" v-for="(item,index) in lessonList" :key="index">
25+
<div class="cont-item-img">
26+
<a>
27+
<img :src="item.imgUrl" alt="">
28+
</a>
29+
</div>
30+
<div class="cont-item-intro">
31+
<h3 class="item-intro-tit">{{item.title}}</h3>
32+
<p class="item-intro-subtit">{{item.subtit}}</p>
33+
<div class="item-intro-info">
34+
<i>{{item.view}}次学习</i>
35+
<a class="ft-green">{{item.price | formatPrice}}</a>
36+
</div>
37+
</div>
38+
</div>
39+
</section>
40+
</section>
41+
</div>
42+
</div>
43+
</template>
44+
<script>
45+
import { formatTime } from '@/js/unit'
46+
export default {
47+
name: 'webHome',
48+
data () {
49+
return {
50+
msg: 'init',
51+
lessonNav: [
52+
{
53+
lessonName: '语文',
54+
imgUrl: require('../assets/images/yuwen.png')
55+
},
56+
{
57+
lessonName: '数学',
58+
imgUrl: require('../assets/images/shuxue.png')
59+
},
60+
{
61+
lessonName: '英语',
62+
imgUrl: require('../assets/images/yingyu.png')
63+
},
64+
{
65+
lessonName: '政治',
66+
imgUrl: require('../assets/images/zhengzhi.png')
67+
},
68+
{
69+
lessonName: '历史',
70+
imgUrl: require('../assets/images/lishi.png')
71+
},
72+
{
73+
lessonName: '地理',
74+
imgUrl: require('../assets/images/dili.png')
75+
},
76+
{
77+
lessonName: '化学',
78+
imgUrl: require('../assets/images/huaxue.png')
79+
},
80+
{
81+
lessonName: '生物',
82+
imgUrl: require('../assets/images/shengwu.png')
83+
},
84+
{
85+
lessonName: '物理',
86+
imgUrl: require('../assets/images/wuli.png')
87+
},
88+
{
89+
lessonName: '其他',
90+
imgUrl: require('../assets/images/qita.png')
91+
}
92+
],
93+
lessonList: [
94+
{
95+
title: '小学语文精彩课程',
96+
subtit: '1-6单元详细讲解',
97+
imgUrl: require('../assets/images/series_1.png'),
98+
view: '2145',
99+
price: 0
100+
},
101+
{
102+
title: '小学语文精彩课程',
103+
subtit: '1-6单元详细讲解',
104+
imgUrl: require('../assets/images/series_2.png'),
105+
view: '2145',
106+
price: 0
107+
},
108+
{
109+
title: '小学语文精彩课程',
110+
subtit: '1-6单元详细讲解',
111+
imgUrl: require('../assets/images/series_1.png'),
112+
view: '2145',
113+
price: 0
114+
}
115+
]
116+
}
117+
},
118+
created () {
119+
this.msg = 'Hello Word ' + formatTime(new Date())
120+
},
121+
filters: {
122+
formatPrice: function (value) {
123+
if (value === 0) return '免费'
124+
return '¥' + value
125+
}
126+
}
127+
}
128+
</script>
129+
130+
<style scoped lang="scss">
131+
@import '../style/variable.scss';
132+
.container{
133+
// padding-top:84px;
134+
background-color:#d2d2d2;
135+
}
136+
.head{
137+
/* position: fixed;
138+
top:0;
139+
left:0;
140+
z-index:10; */
141+
padding:0 30px;
142+
box-sizing: border-box;
143+
width: 100%;
144+
display: flex;
145+
justify-content: space-between;
146+
align-items: center;
147+
height:84px;
148+
background-color: $green;
149+
.search{
150+
width:620px;
151+
height:60px;
152+
line-height: 60px;
153+
box-sizing: border-box;
154+
border-radius: 5px;
155+
padding-left: 64px;
156+
background: #fff url('../assets/images/search.png') no-repeat;
157+
background-position: 24px center;
158+
background-size:31px 31px;
159+
}
160+
.msg-btn{
161+
width:35px;
162+
height: 35px;
163+
background: url('../assets/images/top_msg.png') no-repeat;
164+
background-size: cover;
165+
}
166+
}
167+
.slider{
168+
height:268px;
169+
background-color:#d2d2d2;
170+
}
171+
.lesson-list{
172+
padding:8px 10px;
173+
display: flex;
174+
flex-wrap: wrap;
175+
margin-bottom: 10px;
176+
background-color: #fff;
177+
.lesson-item{
178+
width:20%;
179+
height:144px;
180+
display: flex;
181+
justify-content: center;
182+
align-items: center;
183+
flex-direction: column;
184+
.lesson-item-icon{
185+
width:80px;
186+
height: 80px;
187+
margin-bottom:14px;
188+
}
189+
.lesson-item-name{
190+
font-size:24px;
191+
color:$gray3;
192+
}
193+
}
194+
}
195+
.tab-box{
196+
@at-root .tab-nav-top{
197+
display: flex;
198+
justify-content: space-between;
199+
background-color: #fcfcfc;
200+
@at-root .tab-nav-item{
201+
width: 50%;
202+
height: 88px;
203+
line-height: 88px;
204+
color: $green;
205+
font-size: 36px;
206+
text-align: center;
207+
background-color: #fff;
208+
border-bottom:3px solid #bfbfbf;
209+
}
210+
.active{
211+
color: $orange;
212+
border-color:$orange;
213+
}
214+
}
215+
}
216+
.tab-cont-item{
217+
height:200px;
218+
box-sizing: border-box;
219+
padding:25px 0;
220+
overflow: hidden;
221+
background-color: #fff;
222+
margin-bottom: 2px;
223+
@at-root .cont-item-img{
224+
width: 50%;
225+
height:150px;
226+
float: left;
227+
display: flex;
228+
justify-content: center;
229+
img{
230+
width:300px;
231+
height:100%;
232+
}
233+
}
234+
@at-root .cont-item-intro{
235+
width:50%;
236+
float: left;
237+
box-sizing: border-box;
238+
padding-right:33px;
239+
color:$gray3;
240+
@at-root .item-intro-tit{
241+
font-size:30px;
242+
line-height: 30px;
243+
margin-bottom: 20px;
244+
}
245+
@at-root .item-intro-subtit{
246+
font-size:24px;
247+
height:70px;
248+
overflow: hidden;
249+
}
250+
@at-root .item-intro-info{
251+
display: flex;
252+
justify-content: space-between;
253+
font-size:24px;
254+
color:#757575;
255+
}
256+
}
257+
}
258+
</style>

src/page/pageHome.vue

-19
This file was deleted.

src/router/pages/webHome.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import webHome from '@/page/pageHome'
1+
const home = r => require.ensure([], () => r(require('@/page/Home')), 'home')
22

33
export default {
44
routes: [
55
{
6-
path: '/',
7-
component: webHome
6+
path: '',
7+
redirect: '/home'
8+
},
9+
{
10+
path: '/home',
11+
component: home
812
}
913
]
1014
}

src/style/reset.scss

+4
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ img {
5151
height: 50%;
5252
}
5353
}
54+
i,b{
55+
font-style:normal;
56+
font-weight: normal;
57+
}

src/style/variable.scss

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$green:#3aae95;
2+
$gray3:#333;
3+
$orange:#e8a50c;
4+
5+
.ft-green{
6+
color:$green;
7+
}

0 commit comments

Comments
 (0)