Skip to content

Commit 8b24a63

Browse files
author
fanny
committed
css rule add alertTip flex
1 parent 05053ab commit 8b24a63

40 files changed

+2738
-2461
lines changed

package-lock.json

Lines changed: 2455 additions & 2398 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"html-webpack-plugin": "^2.30.1",
5353
"http-proxy-middleware": "^0.18.0",
5454
"node-notifier": "^5.1.2",
55-
"node-sass": "^4.9.0",
55+
"node-sass": "^4.9.2",
5656
"optimize-css-assets-webpack-plugin": "^3.2.0",
5757
"ora": "^1.2.0",
5858
"portfinder": "^1.0.13",

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
</script>
2222

2323
<style lang="scss">
24-
@import './style/common';
24+
@import './style/common.scss'; // reset 和 公共的css
2525
.router-fade-enter-active, .router-fade-leave-active {
2626
transition: opacity .3s;
2727
}

src/NOTE.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,44 @@ Boolean,是指在DOM树中,注册了该listener的元素,是否会先于
3838
当一个元素嵌套了另一个元素,两个元素都对同一个事件注册了一个处理函数时,所发生的事件冒泡和事件捕获是两种不同的事件传播方式。
3939
事件传播模式决定了元素以哪个顺序接收事件。进一步的解释可以查看 事件流 及 JavaScript Event order 文档。 如果没有指定, useCapture 默认为 false 。
4040

41-
TODO svg换成iconfont 让小艾做一套
41+
### flex布局 https://blog.csdn.net/baiding1123/article/details/47663217
42+
43+
### css书写顺序
44+
3.3 属性书写顺序
45+
[建议] 同一 rule set 下的属性在书写时,应按功能进行分组,并以 Formatting Model(布局方式、位置) > Box Model(尺寸) > Typographic(文本相关) > Visual(视觉效果) 的顺序书写,以提高代码的可读性。
46+
解释:
47+
48+
Formatting Model 相关属性包括:position / top / right / bottom / left / float / display / overflow 等
49+
Box Model 相关属性包括:border / margin / padding / width / height 等
50+
Typographic 相关属性包括:font / line-height / text-align / word-wrap 等
51+
Visual 相关属性包括:background / color / transition / list-style 等
52+
另外,如果包含 content 属性,应放在最前面。
53+
54+
示例:
55+
56+
.sidebar {
57+
/* formatting model: positioning schemes / offsets / z-indexes / display / ... */
58+
position: absolute;
59+
top: 50px;
60+
left: 0;
61+
overflow-x: hidden;
62+
63+
/* box model: sizes / margins / paddings / borders / ... */
64+
width: 200px;
65+
padding: 5px;
66+
border: 1px solid #ddd;
67+
68+
/* typographic: font / aligns / text styles / ... */
69+
font-size: 14px;
70+
line-height: 20px;
71+
72+
/* visual: colors / shadows / gradients / ... */
73+
background: #f5f5f5;
74+
color: #333;
75+
-webkit-transition: color 1s;
76+
-moz-transition: color 1s;
77+
transition: color 1s;
78+
}
79+
80+
81+
### setTimeout setInterval es6箭头函数不改变this指向

src/commitDetail.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22
*** vue项目初始化 32b85057ab3eeaee10446d4727f165c9da1d5f46
33
*** css初始化 结构目录创建 03d02d43f7825424569c1b1b638255565026ca4e
44
*** 移动端适配 路由懒加载 css书写方案 2498ba9725608131d7cc2eadea09daba108ce104
5+
56
*** 安装依赖 完成首页
67
npm i vuex showdown iscroll fastclick better-scroll axios -S
78
npm i node-sass sass-loader http-proxy-middleware -D
9+
810
5f18534dcb413eb2714da0f95e8ea4869ef489c4
911
*** 引入mint-ui vue-light-swiper vue-awesome-swiper 写一个test页(mint-ui暂时放在生产依赖)
12+
1013
8e4ab7f5efaf0ad116d614a9ec71a4e6d9b09e87
1114
*** 封装axios 超时重新请求 添加svg的icon
1215
note: https://github.com/KokoTa/Vue2-transition 路由切换动画
16+
1317
d5c6d2bf873068e96234181d1afc507fce71a19a
14-
*** 引入store 改写了请求方式 完成首页和登录页
18+
*** 引入store 改写了请求方式 完成首页
19+
1520
6f37a2e017ae903142b25db9a9e67b06e5138412
16-
*** 增加一个scroll事件的监听
21+
*** 增加一个scroll事件的监听test.vue
22+
23+
*** 完成通用组件

src/components/common/alertTip.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<div class="alert_tip">
3+
<div class="alert_overlay"></div>
4+
<section class="tip_text_container">
5+
<div class="tip_icon">
6+
<span></span><span></span>
7+
</div>
8+
<p class="tip_text">{{alertText}}</p>
9+
<div class="tip_confirm" @click="closeTip">确认</div>
10+
</section>
11+
</div>
12+
</template>
13+
14+
<script>
15+
export default {
16+
props: ['alertText'],
17+
methods: {
18+
closeTip () {
19+
this.$emit('closeTip')
20+
}
21+
}
22+
}
23+
</script>
24+
<style lang="scss">
25+
@import '../../style/alertTip.scss';
26+
</style>

src/components/common/loading.vue

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<template>
2+
<div class="loading_container">
3+
<div class="load_img" :style="{ backgroundPositionY: -(positionY % 7) * 2.5 + 'rem' }">
4+
</div>
5+
<svg class="load_ellipse" xmlns="http://www.w3.org/2000/svg" version="1.1">
6+
<ellipse cx="26" cy="10" rx="26" ry="10" style="fill:#ddd;stroke:none;"></ellipse>
7+
</svg>
8+
</div>
9+
</template>
10+
11+
<script>
12+
export default {
13+
data () {
14+
return {
15+
positionY: 0,
16+
timer: null
17+
}
18+
},
19+
mounted () {
20+
this.timer = setInterval(() => {
21+
this.positionY ++
22+
}, 600)
23+
},
24+
beforeDestory () {
25+
clearInterval(this.timer)
26+
}
27+
}
28+
</script>
29+
<style lang="scss">
30+
@import '../../style/loading.scss';
31+
</style>

src/components/header/head.vue

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<header id='head_top'>
2+
<header class='head_top'>
33
<slot name='logo'></slot>
44
<slot name='search'></slot>
55
<section class="head_goback" v-if="goBack" @click="$router.go(-1)">
@@ -52,42 +52,5 @@ export default {
5252
</script>
5353

5454
<style lang="scss" scoped>
55-
@import '../../style/mixin';
56-
#head_top{
57-
background-color: $blue;
58-
position: fixed;
59-
z-index: 100;
60-
left: 0;
61-
top: 0;
62-
@include wh(100%, 1.95rem);
63-
}
64-
.head_goback{
65-
left: 0.4rem;
66-
@include wh(0.6rem, 1rem);
67-
line-height: 2.2rem;
68-
margin-left: .4rem;
69-
}
70-
.head_login{
71-
right: 0.55rem;
72-
@include sc(0.65rem, #fff);
73-
@include ct;
74-
.login_span{
75-
color: #fff;
76-
}
77-
.user_avatar{
78-
fill: #fff;
79-
@include wh(.8rem, .8rem);
80-
}
81-
}
82-
.title_head{
83-
@include center;
84-
width: 50%;
85-
color: #fff;
86-
text-align: center;
87-
.title_text{
88-
@include sc(0.8rem, #fff);
89-
text-align: center;
90-
font-weight: bold;
91-
}
92-
}
55+
@import '../../style/head.scss';
9356
</style>

src/images/activity.png

310 KB
Loading

src/images/add_address.png

1.1 KB
Loading

src/images/add_phone.png

186 Bytes
Loading

src/images/address_bottom.png

290 Bytes
Loading

src/images/bindphone.png

2.97 KB
Loading

src/images/description.png

824 Bytes
Loading

src/images/elmlogo.jpeg

6.02 KB
Loading

src/images/expired.png

193 Bytes
Loading

src/images/fenxiang.png

4.18 KB
Loading

src/images/fl.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/hongbao.png

185 Bytes
Loading

src/images/icon_loading.png

5.89 KB
Loading

src/images/icon_point.png

158 Bytes
Loading

src/images/jifen.jpeg

1.17 KB
Loading

src/images/no-log.png

3.68 KB
Loading

src/images/qianbao.png

1.82 KB
Loading

src/images/qq.png

1.17 KB
Loading

src/images/search.png

1019 Bytes
Loading

src/images/sheng.jpeg

1.22 KB
Loading

src/images/shop_back_svg.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/shopback.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/voucher.png

5.14 KB
Loading

src/images/weixin.png

1.42 KB
Loading

src/images/zhifubao.png

3.26 KB
Loading

src/page/home/home.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head-top signin-up='home'>
44
<span slot='logo' class="head_logo" @click="reload">ele.me</span>
55
</head-top>
6-
<button style="margin-top:100px" @click="goTest">去测试页面</button>
76
</div>
87
</template>
98
<script>
@@ -54,12 +53,13 @@ export default {
5453
},
5554
// 点击图标刷新页面
5655
reload () {
57-
// window.location 只读属性,返回一个 Location对象Location.reload() 方法用来刷新当前页面。该方法只有一个参数,当值为 true 时,将强制浏览器从服务器加载页面资源,当值为 false 或者未传参时,浏览器则可能从缓存中读取页面
56+
// window.location 只读属性,返回一个 Location对象Location.reload() 方法用来刷新当前页面。该方法只有一个参数,
57+
// 当值为 true 时,将强制浏览器从服务器加载页面资源,当值为 false 或者未传参时,浏览器则可能从缓存中读取页面
5858
window.location.reload()
59-
},
60-
goTest () {
61-
this.$router.push('./test')
6259
}
6360
}
6461
}
6562
</script>
63+
<style lang="scss">
64+
@import '../../style/home.scss'
65+
</style>

src/style/alertTip.scss

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
@import './mixin.scss';
2+
@keyframes tipMove {
3+
0% {transform: scale(1)}
4+
35% {transform: scale(.8)}
5+
70% {transform: scale(1.1)}
6+
100% {transform: scale(1)}
7+
}
8+
.alert_tip {
9+
position: fixed;
10+
top: 0;
11+
left: 0;
12+
right: 0;
13+
bottom: 0;
14+
z-index: 200;
15+
.alert_overlay {
16+
position: fixed;
17+
top: 0;
18+
left: 0;
19+
right: 0;
20+
bottom: 0;
21+
z-index: 199;
22+
opacity: 0.5;
23+
}
24+
.tip_text_container {
25+
position: absolute;
26+
top: 50%;
27+
left: 50%;
28+
display: flex;
29+
flex-direction: column;
30+
justify-content: center;
31+
align-items: center;
32+
border: 1px;
33+
border-radius: .25rem;
34+
padding-top: .6rem;
35+
margin-top: -6rem;
36+
margin-left: -6rem;
37+
width: 12rem;
38+
animation: tipMove .4s;
39+
background-color: rgba(255,255,255,1);
40+
.tip_icon {
41+
span:nth-of-type(1){
42+
@include wh(.12rem, 1.5rem);
43+
background-color: $tip_icon;
44+
}
45+
span:nth-of-type(2){
46+
@include wh(.2rem, .2rem);
47+
border: 1px;
48+
border-radius: 50%;
49+
margin-top: .2rem;
50+
background-color: $tip_icon;
51+
}
52+
}
53+
.tip_text {
54+
margin-top: .8rem;
55+
padding: 0 .4rem;
56+
text-align: center;
57+
line-height: .9rem;
58+
@include sc(.7rem, $tip_text);
59+
}
60+
.tip_confirm {
61+
border: 1px;
62+
border-bottom-left-radius: .25rem;
63+
border-bottom-right-radius: .25rem;
64+
margin-top: .8rem;
65+
width: 100%;
66+
text-align: center;
67+
line-height: 1.8rem;
68+
background-color: $tip_confirm;
69+
}
70+
}
71+
}
72+

src/style/common.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ html,body{
6969
background-size: 100% 100%;
7070
}
7171

72-
.margin{
73-
margin: 0 auto;
74-
}
75-
7672
.left{
7773
float: left;
7874
}

0 commit comments

Comments
 (0)