Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtao committed Sep 26, 2016
1 parent 93f1925 commit a257a47
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 140 deletions.
25 changes: 8 additions & 17 deletions src/app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="app">
<div id="app">
<section class="welcome" v-show="welcome" transition="welcome"></section>
<section class="mobile-tips" style="dislay:none;" v-show="isnotMobile">
<div class="mobile-tips-inner">
Expand Down Expand Up @@ -37,21 +37,12 @@ require('assets/css/base.scss')
export default {
replace: false,
store,
route: {
activate({
from,
to,
next
}) {
next()
}
},
data() {
return {
appload: false,
welcome: false,
isnotMobile:false,
decline: false,
appload: false,//主结构
welcome: false,//欢迎页
isnotMobile:false,//是否为移动设备访问
decline: false //router animation
}
},
created() {
Expand All @@ -64,16 +55,16 @@ export default {
};
return flag;
}();
if(!isMobile){
this.isnotMobile = true;
}
if (this.$route.matched.length === 1) {
this.welcome = true;
}
this.appload = true;
setTimeout(() => {
this.welcome = false;
}, 2000)
if(!isMobile){
this.isnotMobile = true;
}
},
events: {
'route-pipe' (_decline) {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/css/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@
}




/*聊天详情*/

.chat-dialogue-entry-collect {
Expand Down
17 changes: 10 additions & 7 deletions src/assets/css/common.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import 'reset.css';
@import 'weui.min.css';
@import 'iconfont.css';

/**/

a,
button,
input,
Expand Down Expand Up @@ -102,10 +104,11 @@ body,
border-top: 0;
}

.padding-top-1{
.padding-top-1 {
padding-top: 1px;
}


/*1px线*/

._line-fine:not(:first-child)::before {
Expand Down Expand Up @@ -173,6 +176,7 @@ body,
left: 15px;
}


/*cell 箭头*/

.weui_select_before .weui_cell_hd::before,
Expand All @@ -183,16 +187,16 @@ body,
vertical-align: middle;
}


/*weui end*/


/*
router-view -> transition="cover"
cover开头的 是router-view过渡切换是公用的样式
_cover-* 是会被cover 影响的元素
*/



.cover-transition {
opacity: 1;
transition: .35s opacity ease;
Expand Down Expand Up @@ -233,7 +237,7 @@ body,

._cover-content {
position: relative;
width:100%;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 1;
Expand All @@ -242,7 +246,7 @@ body,
transform: translate3d(0%, 0, 0);
height: calc(100% - 45px);
background-color: #efeff4;
box-shadow: 0px 0 41px rgba(0,0,0,.1);
box-shadow: 0px 0 41px rgba(0, 0, 0, .1);
}


Expand Down Expand Up @@ -278,15 +282,13 @@ body,
}



/*
component- 开头的 是router-view最外层的组件元素
*/

[class*="component-"] {}



/* 保证next page 能覆盖住 current page */

._full_inner {
Expand Down Expand Up @@ -324,6 +326,7 @@ body,

/* components */


/*top-handle.vue*/

._cover-top .top-back {
Expand Down
55 changes: 32 additions & 23 deletions src/assets/css/contact.css
Original file line number Diff line number Diff line change
@@ -1,45 +1,54 @@
.weui_cells_contact-head {
margin-top:0;
margin-top: 0;
}
.weui_cells_contact-head .weui_cell{
padding:9px 15px

.weui_cells_contact-head .weui_cell {
padding: 9px 15px
}
.weui_cells_contact-head .weui_cell_hd{

.weui_cells_contact-head .weui_cell_hd {
height: 36px;
width: 36px;
overflow: hidden;
margin-right:10px;
margin-right: 10px;
}
.img-obj-cover{

.img-obj-cover {
display: block;
border:0;
border: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.component-contact{
background:#f1f0f6;

.component-contact {
background: #f1f0f6;
overflow: auto;
}

.contact-friends .weui_cells::before,
.contact-friends .weui_cells::after{
.contact-friends .weui_cells::after {
visibility: hidden;
}
.contact-friends .weui_cells{
margin-top:0;

.contact-friends .weui_cells {
margin-top: 0;
}
.contact-alpha{
padding-left:15px;

.contact-alpha {
padding-left: 15px;
height: 20px;
line-height: 20px;
font-size:14px;
color:#888888;
font-size: 14px;
color: #888888;
}
.contact-friends .weui_cell_primary{
font-size:16px;

.contact-friends .weui_cell_primary {
font-size: 16px;
}

.contact-friends .weui_cell_hd img {
width: 35px;
margin-right: 5px;
display: block;
}
.contact-friends .weui_cell_hd img{
width:35px;
margin-right:5px;
display:block;
}
20 changes: 11 additions & 9 deletions src/assets/css/dialogue-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
/* opacity: 0 ; */
}


.voice-inner .voice-volume span:nth-child(1) {
width: 24px;
visibility: hidden;
Expand Down Expand Up @@ -289,21 +288,24 @@
width: 8px;
}


/**/

.recording-cancel {
// display: none;
}
.recording-cancel p{
border-radius:3px;
background-color:#9d383e;

.recording-cancel p {
border-radius: 3px;
background-color: #9d383e;
}
.cancel-inner{

.cancel-inner {
width: 110px;
height: 110px;
margin: 0 auto;
background-image:url(../images/record-cancel.png);
background-repeat:no-repeat;
background-position:center center;
background-image: url(../images/record-cancel.png);
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
}
}
3 changes: 1 addition & 2 deletions src/assets/css/iconfont.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
url('//at.alicdn.com/t/font_1474796923_6082804.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('//at.alicdn.com/t/font_1474796923_6082804.svg#iconfont') format('svg'); /* iOS 4.1- */
}



.iconfont {
font-family:"iconfont" !important;
font-size:16px;
Expand Down
20 changes: 11 additions & 9 deletions src/assets/css/me.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
.me-line .weui_cell_hd img{
.me-line .weui_cell_hd img {
width: 60px;
display: block;
}
.me-line .weui_cell_primary{
font-size:14px;
color:#111111;

.me-line .weui_cell_primary {
font-size: 14px;
color: #111111;
}
.me-line .weui_cell_primary p:first-child{
font-size:18px;

.me-line .weui_cell_primary p:first-child {
font-size: 18px;
}
.me-line .weui_cell_hd{

.me-line .weui_cell_hd {
margin-right: 5px;
border-radius: 5px;
overflow: hidden;
border:1px solid #cccccc;
border: 1px solid #cccccc;
}

33 changes: 16 additions & 17 deletions src/filters.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
const _filters = {}

/**
* 时间格式化
* 对Date的扩展,将 Date 转化为指定格式的String
* 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
* 对Date的扩展,将 Date 转化为指定格式的String
* 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
* 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
* 例子:
* (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
* (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
* //author: meizz
* (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
* //author: meizz
*/
const _filters = {

}
_filters.fmtDate = function(_date, fmt) {
var date = new Date(_date)
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
Expand All @@ -30,9 +29,9 @@ _filters.fmtDate = function(_date, fmt) {
return fmt;
}


export default (Vue) => {
Object.keys(_filters).forEach(key => {
Vue.filter(key, _filters[key])
})
// _filters[]
Vue.filter(key, _filters[key])
})
}
4 changes: 1 addition & 3 deletions src/views/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<li class="item _line-fine" v-for="item in wechat_list" transition="chat-item">
<div class="info" :class="{
'current':currentIndex==$index
}" @touchstart="info_touchstart($index)" @touchend="info_touchend" v-touch:tap="info_tap($index)" v-touch:swipeleft="info_swipeleft($index)" v-touch-options:swipe="{ direction: 'horizontal' }">
}" @touchstart="info_touchstart($index)" v-touch:tap="info_tap($index)" v-touch:swipeleft="info_swipeleft($index)" v-touch-options:swipe="{ direction: 'horizontal' }">
<div class="ico-box">
<i :class="item.chatConfigModel | f_news 'nclass'" v-text="item.chatBaseModel | f_news 'ntext'" v-show="item.chatBaseModel | f_news 'nshow'"></i>
<div class="ico">
Expand Down Expand Up @@ -90,7 +90,6 @@ export default {
info_touchstart(_index) {
this.currentIndex = -1
},
info_touchend() {},
info_tap(_index) {
var index = _index;
if (index >= 0 && !this.isTouchSwipe) {
Expand All @@ -102,7 +101,6 @@ export default {
this.isTouchSwipe = false
},
info_swipeleft(_index) {
// console.log('swipeleft')
event.stopPropagation()
if (!this.isTouchSwipe) {
this.isTouchSwipe = true
Expand Down
Loading

0 comments on commit a257a47

Please sign in to comment.