Skip to content

Commit

Permalink
✨ 完善移动端内容
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub-Laziji committed May 11, 2018
1 parent ca0887e commit 12be496
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
20 changes: 20 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ Vue.prototype.$share = function (message) {
}
}

Vue.prototype.$mobileShare = function (message) {
if (!message) {
message = window.location
} else {
let arr = (window.location + "").split("#")
message = arr[0] + "#" + message
}
if (util.copy(message)) {
Vue.prototype.$dialog.alert({
title: '分享',
message: '链接已复制,去分享给好友吧!!'
})
} else {
Vue.prototype.$dialog.alert({
title: '分享',
message: '链接复制失败,可能因为浏览器不兼容'
})
}
}



Vue.prototype.$util = util
Expand Down
4 changes: 2 additions & 2 deletions src/mobile_views/blog/Details.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<van-nav-bar style="position:fixed;top:0;z-index: 9999; box-shadow: 0px -5px 10px #888888;width: 100%;" :title="blog.title"
left-text="返回" right-text="分享" @click-left="$router.go(-1)" @click-right="" left-arrow/>
left-text="返回" right-text="分享" @click-left="$router.go(-1)" @click-right="$mobileShare()" left-arrow/>
<div style="height: 60px;"></div>
<div style="font-size: 0.9rem;line-height: 1.5;color: #606c71;padding: 10px">
发布 {{blog.createTime}}
Expand Down Expand Up @@ -51,7 +51,7 @@
}).then(() => this.$toast.clear())
},
methods: {
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/mobile_views/blog/Main.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div style="background: #F2F6FC;min-height: 700px">
<van-nav-bar style="position:fixed;top:0;z-index: 9999; box-shadow: 0px -3px 10px #888888;width: 100%;" title="博客列表" />
<van-nav-bar style="position:fixed;top:0;z-index: 9999; box-shadow: 0px -3px 10px #888888;width: 100%;" title="博客列表" right-text="分享"
@click-right="$mobileShare()" />
<div style="height: 60px;"></div>
<router-link :to="`/mobile/user/blog/details/${item.id}`" v-for="(item,index) in blogs" :key="'p'+index">
<van-panel style="margin-bottom: 5px" :title="item.title" :desc="'更新时间 '+item.updateTime">
Expand Down
3 changes: 2 additions & 1 deletion src/mobile_views/project/Details.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<van-nav-bar style="position:fixed;top:0;z-index: 9999; box-shadow: 0px -5px 10px #888888;width: 100%;" :title="project.name"
left-text="返回" right-text="分享" @click-left="$router.go(-1)" @click-right="" left-arrow/>
left-text="返回" right-text="分享" @click-left="$router.go(-1)" @click-right="$mobileShare()" left-arrow/>
<div style="height: 60px;"></div>
<div style="font-size: 0.9rem;line-height: 1.5;color: #606c71;padding: 10px">
发布 {{project.createTime}}
Expand All @@ -13,6 +13,7 @@
<div style="padding: 0px 15px 5px 15px;color: #606266;border-bottom: 1px solid #E4E7ED;">
<van-icon name="points" />&nbsp;{{project.stargazersCount}}&emsp;
<van-icon name="exchange" />&nbsp;{{project.forksCount}}
<van-tag mark type="primary" style="float: right;">{{project.language}}</van-tag>
</div>
<div v-html="project.content" class="markdown-body" style="padding: 10px"></div>
<div style="height: 100px;"></div>
Expand Down
4 changes: 3 additions & 1 deletion src/mobile_views/project/Main.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<template>
<div style="background: #F2F6FC;min-height: 700px">
<van-nav-bar style="position:fixed;top:0;z-index: 9999; box-shadow: 0px -3px 10px #888888;width: 100%;" title="开源项目" />
<van-nav-bar style="position:fixed;top:0;z-index: 9999; box-shadow: 0px -3px 10px #888888;width: 100%;" title="开源项目" right-text="分享"
@click-right="$mobileShare()" />
<div style="height: 60px;"></div>
<router-link :to="`/mobile/user/project/details/${item.name}`" v-for="(item,index) in projects" :key="'p'+index">
<van-panel style="margin-bottom: 5px" :title="item.name" :desc="'更新时间 '+item.updateTime">
<div style="padding: 0px 15px 5px 15px;color: #606266;font-size: 0.9rem">{{item.description}}</div>
<div style="padding: 0px 15px 5px 15px;color: #606266;">
<van-icon name="points" />&nbsp;{{item.stargazersCount}}&emsp;
<van-icon name="exchange" />&nbsp;{{item.forksCount}}
<van-tag mark type="primary" style="float: right;">{{item.language}}</van-tag>
</div>
</van-panel>
</router-link>
Expand Down

0 comments on commit 12be496

Please sign in to comment.