Skip to content

Commit

Permalink
添加天气图标
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobinwu committed Apr 12, 2017
1 parent 9f16c1c commit b14d59c
Show file tree
Hide file tree
Showing 26 changed files with 42 additions and 32 deletions.
24 changes: 17 additions & 7 deletions assets/component/timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
template(v-if="list.length > 0")
div.line
ul
li(v-for="(item, index) in list", :style="{marginLeft: (index+1) % 2 === 0 ? liEvenStyle : '0'}")
li(v-for="(item, index) in list", :style="{marginLeft: (index+1) % 2 === 0 ? liEvenStyle : '0'}", :key="item.id")
span.circle(:style="{backgroundColor: '#' + (item.colorHex ? item.colorHex : 'f5f5f5'), borderColor: '#' + (item.colorHex ? item.colorHex : '808080')}")
i.fa(:style="{color: '#' + (item.colorHex ? 'fff' : '808080')}", :class="'fa-' + computedType(item)")
div.item-container
div.item-header
span {{item.createDate | date}} {{item.weekday | weekday}}
span {{item.createDate | time}} {{item.weather | weather}}
span
{{item.createDate | time}}  
img.weather-icon(:src="item.weather | weather")
div.item-content
p.text-container(v-html="item.content", :class="{ hasImg: item.MediaChildren.length > 0 }")
div.img-container(v-if="item.MediaChildren.length > 0")
img.item-content-img(:src="getImg(item)")
div.mask(v-if="isVideo(item)")
i.fa.fa-video-camera
template(v-else)
p 没有数据
img.no-data(src="../public/images/dist/noDataFound.png")
</template>
<script>
import Vue from 'vue'
Expand Down Expand Up @@ -51,7 +53,7 @@
return value.substr(8,2) + ':' + value.substr(10,2);
},
'weather': index =>{
return weather[index].name;
return weather[index].url;
}
},
methods: {
Expand Down Expand Up @@ -83,7 +85,7 @@
if(item.MediaChildren[i].mediaType === 2){
return true;
}
}
}
return false;
}
},
Expand Down Expand Up @@ -117,6 +119,9 @@
left: 7px;
z-index: -1;
}
.no-data{
margin: 100px auto;
}
ul{
li{
box-sizing: border-box;
Expand Down Expand Up @@ -181,6 +186,11 @@
color: $gray;
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
.weather-icon{
width: 23px;
height: auto;
vertical-align: text-top;
}
span{
&:first-child{
float: left;
Expand All @@ -200,10 +210,10 @@
border-bottom-left-radius: $border-radius;
border-bottom-right-radius: $border-radius;
.text-container{
line-height: 1.5;
line-height: 1.4;
text-align: justify;
max-height: 100px;
overflow: hidden;
overflow: hidden;
&.hasImg{
float: left;
width: 290px;
Expand Down
20 changes: 10 additions & 10 deletions assets/config/weather.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const weather = [
{value: 0, name: '晴天'},
{value: 1, name: '多云'},
{value: 2, name: '阴天'},
{value: 3, name: '大雨'},
{value: 4, name: '雷雨'},
{value: 5, name: '小雨'},
{value: 6, name: '雾'},
{value: 7, name: '雪'},
{value: 8, name: '雾霾'},
{value: 9, name: '夜间'}
{value: 0, name: '晴天', url: '../public/images/dist/weathersun1.png'},
{value: 1, name: '多云', url: '../public/images/dist/weathervariablesun2.png'},
{value: 2, name: '阴天', url: '../public/images/dist/weathercloud3.png'},
{value: 3, name: '大雨', url: '../public/images/dist/weatherstorm4.png'},
{value: 4, name: '雷雨', url: '../public/images/dist/weathertempest5.png'},
{value: 5, name: '小雨', url: '../public/images/dist/weathermistyrain6.png'},
{value: 6, name: '雾', url: '../public/images/dist/weatherfog7.png'},
{value: 7, name: '雪', url: '../public/images/dist/weathersnow8.png'},
{value: 8, name: '雾霾', url: '../public/images/dist/weatherhazy9.png'},
{value: 9, name: '夜间', url: '../public/images/dist/weathermoon10.png'}
];
export default weather;
2 changes: 1 addition & 1 deletion assets/modules/passing/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import Calendar from 'component/calendar'
Vue.use(Row)
Vue.use(Col)
Vue.use(VueLazyload,{
loading: '../../../public/images/loading.gif'
loading: '../../../public/images/dist/loading.gif'
})
export default {
name: 'passingindex',
Expand Down
Binary file added assets/public/images/dist/noDataFound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathercloud3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weatherfog7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weatherhazy9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathermistyrain6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathermoon10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathersnow8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weatherstorm4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathersun1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathertempest5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/dist/weathervariablesun2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/noDataFound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathercloud3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weatherfog7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weatherhazy9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathermistyrain6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathermoon10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathersnow8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weatherstorm4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathersun1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathertempest5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/public/images/weathervariablesun2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions mock-server/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"content": "这也是测试",
"createDate": "20161029153409",
"weekday": 7,
"weather": 0,
"weather": 1,
"address": "广东省深圳市南山区",
"categoryId": 1,
"isPassby": 0,
Expand Down Expand Up @@ -245,10 +245,10 @@

{
"id": 5559423,
"content": "阿狸的",
"content": "西游降魔-吴更新篇",
"createDate": "20161016200657",
"weekday": 1,
"weather": 0,
"weather": 2,
"address": "广东省深圳市南山区",
"categoryId": 2,
"isPassby": 0,
Expand All @@ -274,7 +274,7 @@
"content": "垃圾,愛你喲。😘😘😘😘😘😘",
"createDate": "20161011190600",
"weekday": 5,
"weather": 1,
"weather": 3,
"address": "中国广东省深圳市南山区银河路106",
"categoryId": 3,
"isPassby": 0,
Expand All @@ -286,10 +286,10 @@
},
{
"id": 5440927,
"content": "",
"content": "与男友的那些事...",
"createDate": "20161008200135",
"weekday": 5,
"weather": 0,
"weather": 4,
"address": "中国广东省深圳市南山区银河路106",
"categoryId": 3,
"isPassby": 0,
Expand All @@ -304,7 +304,7 @@
"content": "",
"createDate": "20160923202716",
"weekday": 6,
"weather": 0,
"weather": 5,
"address": "广东省深圳市南山区",
"categoryId": 0,
"isPassby": 0,
Expand All @@ -316,10 +316,10 @@
},
{
"id": 5205672,
"content": "这回哦",
"content": "测试多个图片啦!!!!!",
"createDate": "20160922204408",
"weekday": 5,
"weather": 0,
"weather": 6,
"address": "广东省深圳市南山区",
"categoryId": 4,
"isPassby": 0,
Expand Down Expand Up @@ -515,7 +515,7 @@
"content": "哈哈哈",
"createDate": "20160918132415",
"weekday": 1,
"weather": 0,
"weather": 7,
"address": "广东省深圳市福田区",
"categoryId": 0,
"isPassby": 0,
Expand All @@ -527,10 +527,10 @@
},
{
"id": 5125927,
"content": "仇恨",
"content": "仇恨,世界变得不美好!",
"createDate": "20160918104334",
"weekday": 1,
"weather": 0,
"weather": 8,
"address": "广东省深圳市福田区",
"categoryId": 3,
"isPassby": 0,
Expand All @@ -555,7 +555,7 @@
"content": "哈哈哈",
"createDate": "20160916215700",
"weekday": 6,
"weather": 0,
"weather": 9,
"address": "广东省惠州市惠城区",
"categoryId": 0,
"isPassby": 0,
Expand Down Expand Up @@ -681,7 +681,7 @@
},
{
"id": 4701835,
"content": "香港",
"content": "香港代购",
"createDate": "20160826000501",
"weekday": 6,
"weather": 0,
Expand Down

0 comments on commit b14d59c

Please sign in to comment.