Преглед на файлове

add "cotent" model (unfinished)

fish119 преди 8 години
родител
ревизия
788e800f7a
променени са 9 файла, в които са добавени 583 реда и са изтрити 192 реда
  1. 5 2
      index.html
  2. 7 3
      src/assets/style/main.css
  3. 51 44
      src/components/Header.vue
  4. 12 3
      src/filter/index.js
  5. 4 2
      src/router/index.js
  6. 364 3
      src/views/Content.vue
  7. 136 131
      src/views/Home.vue
  8. 3 3
      src/views/Messages.vue
  9. 1 1
      src/views/Person.vue

+ 5 - 2
index.html

@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <html>
+
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
@@ -8,7 +9,9 @@
   <link rel="shortcut icon" href="/static/favicon.ico">
   <title>Vue.js中文社区</title>
 </head>
+
 <body>
-<div id="app"></div>
+  <div id="app"></div>
 </body>
-</html>
+
+</html>

+ 7 - 3
src/assets/style/main.css

@@ -60,6 +60,10 @@ main {
   padding: 1rem;
 }
 .vueco-btn {
-    width: 100%;
-    bottom: 0;
-  }
+  width: 100%;
+  bottom: 0;
+}
+
+a{
+  color: black;
+}

+ 51 - 44
src/components/Header.vue

@@ -1,70 +1,77 @@
 /*
  * @Author: fish119 
  * @Date: 2017-05-19 13:22:28 
- * @Last Modified by:   fish119 
- * @Last Modified time: 2017-05-22 13:22:28 
+ * @Last Modified by: fish119
+ * @Last Modified time: 2017-05-22 16:31:08
  */
 <template>
   <div>
     <mu-appbar class="title" :title="title">
-      <mu-icon-button slot="left">
+      <mu-icon-button v-if="isTopic" @click="goBack" icon="arrow_back" slot="left" />
+      <mu-icon-button v-else slot="left">
         <img class="logo" src="https://www.vue-js.com/public/images/vue.png">
       </mu-icon-button>
       <mu-icon-menu slot="right" icon="more_vert" :value="theme" @change="changeTheme">
-        <mu-menu-item title="LIGHT" value="light"/>
-        <mu-menu-item title="CARBON" value="carbon"/>
-        <mu-menu-item title="TEAL" value="teal"/>
+        <mu-menu-item title="LIGHT" value="light" />
+        <mu-menu-item title="CARBON" value="carbon" />
+        <mu-menu-item title="TEAL" value="teal" />
       </mu-icon-menu>
     </mu-appbar>
   </div>
 </template>
 
 <script>
-  import light from '!raw-loader!muse-ui/dist/theme-default.css'
-  import carbon from '!raw-loader!muse-ui/dist/theme-carbon.css'
-  import teal from '!raw-loader!muse-ui/dist/theme-teal.css'
-  export default {
-    data(){
-      return {
-        theme: 'light',
-        themes: {
-          light,
-          carbon,
-          teal
-        }
+import light from '!raw-loader!muse-ui/dist/theme-default.css'
+import carbon from '!raw-loader!muse-ui/dist/theme-carbon.css'
+import teal from '!raw-loader!muse-ui/dist/theme-teal.css'
+export default {
+  data() {
+    return {
+      theme: 'light',
+      themes: {
+        light,
+        carbon,
+        teal
       }
+    }
+  },
+  computed: {
+    title: function () {
+      return this.$store.state.titleMap.get(this.$route.path)
     },
-    computed:{
-      title: function () {
-        return this.$store.state.titleMap.get(this.$route.path)
-      }
+    isTopic:function(){
+      return this.$route.path == '/content'
+    }
+  },
+  methods: {
+    changeTheme(theme) {
+      this.theme = theme
+      const styleEl = this.getThemeStyle()
+      styleEl.innerHTML = this.themes[theme] || ''
     },
-    methods: {
-      changeTheme(theme) {
-        this.theme = theme
-        const styleEl = this.getThemeStyle()
-        styleEl.innerHTML = this.themes[theme] || ''
-      },
-      getThemeStyle() {
-        const themeId = 'muse-theme'
-        let styleEl = document.getElementById(themeId)
-        if (styleEl) return styleEl
-        styleEl = document.createElement('style')
-        styleEl.id = themeId
-        document.body.appendChild(styleEl)
-        return styleEl
-      }
+    getThemeStyle() {
+      const themeId = 'muse-theme'
+      let styleEl = document.getElementById(themeId)
+      if (styleEl) return styleEl
+      styleEl = document.createElement('style')
+      styleEl.id = themeId
+      document.body.appendChild(styleEl)
+      return styleEl
+    },
+    goBack() {
+      this.$router.go(-1)
     }
   }
+}
 </script>
 
 <style scoped>
-  .title {
-    text-align: center;
-    height: 5rem;
-  }
+.title {
+  text-align: center;
+  height: 5rem;
+}
 
-  .mu-icon-button {
-    padding: 0.4rem;
-  }
+.mu-icon-button {
+  padding: 0.4rem;
+}
 </style>

+ 12 - 3
src/filter/index.js

@@ -1,18 +1,27 @@
 /*
  * @Author: fish119 
  * @Date: 2017-05-19 13:22:49 
- * @Last Modified by:   fish119 
- * @Last Modified time: 2017-05-22 13:22:49 
+ * @Last Modified by: fish119
+ * @Last Modified time: 2017-05-22 15:28:43
  */
 
 import timeAgo from 'timeago.js'
 
-export default{
+export default {
   install: function (Vue, options) {
     Vue.filter('time_ago', function (val) {
       let time = new Date(val)
       var thisTime = timeAgo()
       return thisTime.format(time, 'zh_CN')
+    }),
+    Vue.filter('tab', function (val) {
+      if (val === 'share') {
+        return '分享'
+      } else if (val === 'ask') {
+        return '问答'
+      } else if (val === 'job') {
+        return '招聘'
+      }
     })
   }
 }

+ 4 - 2
src/router/index.js

@@ -1,8 +1,8 @@
 /*
  * @Author: fish119 
  * @Date: 2017-05-19 13:21:16 
- * @Last Modified by:   fish119 
- * @Last Modified time: 2017-05-22 13:21:16 
+ * @Last Modified by: fish119
+ * @Last Modified time: 2017-05-22 15:40:56
  */
 
 import Vue from 'vue'
@@ -11,6 +11,7 @@ import Home from '../views/Home'
 import Publish from '../views/Publish'
 import Messages from '../views/Messages'
 import Person from '../views/Person'
+import Content from '../views/Content'
 
 
 Vue.use(Router)
@@ -21,5 +22,6 @@ export default new Router({
     { path: '/publish', name: 'Publish', component: Publish },
     { path: '/messages', name: 'Messages', component: Messages },
     { path: '/person', name: 'Person', component: Person },
+    { path: '/content', name: 'Content', component: Content }
   ]
 })

+ 364 - 3
src/views/Content.vue

@@ -1,6 +1,367 @@
 /*
  * @Author: fish119 
- * @Date: 2017-05-22 13:16:31 
- * @Last Modified by:   fish119 
- * @Last Modified time: 2017-05-22 13:16:31 
+ * @Date: 2017-05-22 15:06:19 
+ * @Last Modified by: fish119
+ * @Last Modified time: 2017-05-22 17:32:44
  */
+ 
+<template>
+  <div class="content">
+    <!--标题区-->
+    <header class="md_header">
+      <h1>
+        <span class="tag" v-if="data.top">置顶</span>
+        <span class="tag" v-else-if="data.good">精华</span>
+        {{data.title}}
+      </h1>
+      <mu-checkbox v-if="accesstoken" v-model="favorite" :label="favorite_txt" class="favorite-box" uncheckIcon="favorite_border" checkedIcon="favorite" />
+      <div class="label">
+        <span>发布于 {{data.create_at | time_ago}}</span>
+        <span>作者 {{data.author.loginname}}</span>
+        <span>{{data.visit_count}} 次浏览</span>
+        <span>来自 {{data.tab | tab}}</span>
+      </div>
+    </header>
+    <!-- 内容区 -->
+    <article class="md_content" v-html="data.content"></article>
+    <!-- 评论区 -->
+    <ul v-if="data.replies.length" class="replies">
+      <li>{{data.replies.length}}条回复</li>
+      <li class="reply" v-for="(list,index) in data.replies" :key="list.id">
+        <section class="msg">
+          <div class="author">
+            <router-link :to="{path:'/vuecommunitytest/user',query:{user:list.author.loginname}}" :src="list.author.avatar_url" tag="img" alt="user">
+            </router-link>
+            <span class="name">{{list.author.loginname}}</span>
+            <span class="timer">{{index+1}}楼 • {{list.create_at | time_ago}}</span>
+          </div>
+          <!-- 未登录状态下点赞 -->
+          <div @click="open" v-if="list.ups.length && !accesstoken" class="ups">
+            <mu-icon value="thumb_up" :size="16" />
+            <span>{{list.ups.length}}</span>
+          </div>
+          <!-- 登录状态下点赞 -->
+          <div @click="open" v-if="accesstoken" class="ups">
+            <mu-icon @click="like(index)" value="thumb_up" :size="16" />
+            <span>{{list.ups.length}}</span>
+            <mu-icon @click="changeReply(index)" class="textsms" value="textsms" :size="16" />
+          </div>
+        </section>
+        <p v-html="list.content"></p>
+        <div v-if="accesstoken" class="reply_show" v-show="list.reply_show">
+          <textarea v-model="single_reply" class="reply" placeholder="请输入回复内容..." rows="5"></textarea>
+          <mu-raised-button @click="single_reply_content(index)" label="回复" class="demo-raised-button" primary/>
+          <mu-raised-button @click="exit_single_reply_content(index)" label="取消" class="demo-raised-button" primary/>
+        </div>
+      </li>
+    </ul>
+    <!-- 添加回复区-->
+    <ul v-if="accesstoken" class="replies">
+      <li>添加回复</li>
+      <li>
+        <textarea v-model="reply" class="reply" placeholder="请输入回复内容..." rows="5"></textarea>
+        <mu-raised-button @click="submit_reply" label="回复" class="vueco-btn" primary/>
+      </li>
+    </ul>
+    <!-- 提示框 -->
+    <mu-dialog :open="showReplyDialog" title="提示:" @close="close">
+      {{tips}}
+      <mu-flat-button slot="actions" @click="close" primary label="确定" />
+    </mu-dialog>
+  </div>
+</template>
+
+<<script>
+export default {
+  data() {
+    return {
+      accesstoken:'',
+      data: {
+        author:{},
+        replies:{}
+      },
+      favorite:false,
+      favorite_txt:'收藏',
+      single_reply:'',
+      reply:'',
+      tips:'',
+      showReplyDialog:false
+    } 
+  },
+  methods: {
+    getTopic(){
+      const id = this.$route.query.id;
+      let that = this;
+      let url = this.$store.state.svrUrl+'/topic/' + id;
+      this.axios.get(url).then(function (response) {
+        that.data = response.data.data;
+        that.data.replies.map(function(item) {
+            item.reply_show = false;
+        })
+      }).catch(function (err) {
+        
+      });
+    },
+    open() {
+      this.dialog = true;
+    },
+    close() {
+      this.dialog = false;
+      this.showReplyDialog = false;
+    },
+    submit_reply(){
+      if(this.reply&&this.reply.length>0){
+        // 添加评论
+        let id = this.$route.query.id;
+        let that = this;
+        this.axios.put(this.$store.state.svrUrl+'topic/'+id+'/replies',{
+          accesstoken: that.accesstoken,
+          content: that.reply})
+          .then(function(res){
+            if(res.state==200){
+              that.showReplyMsg(that,'回复成功');
+              that.getTopic();
+              that.reply = '';
+            }else{
+              that.showReplyMsg(that,'回复失败,请确认无误后再试');
+            }
+          })
+          .catch(function(err){
+            that.showReplyMsg(that,'回复失败,请确认无误后再试');
+          });
+      }else{
+        this.showReplyMsg(this,'请输入回复内容...');
+      }
+    },
+    showReplyMsg(that,msg){      
+      that.tips = msg;
+      that.showReplyDialog = true;
+      setTimeout(function() {
+          that.showReplyDialog = false;
+      }, 1500)
+    }
+  },
+  created () {
+    this.accesstoken = localStorage.getItem("accesstoken");
+    this.loginname = localStorage.getItem("loginname");
+    this.getTopic();
+  }
+}
+</script>
+
+<style>
+.favorite-box .mu-checkbox-label {
+  color: #009688;
+}
+</style>
+
+<style scoped>
+.content {
+  justify-content: flex-start;
+}
+
+.title {
+  height: 5rem;
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  z-index: 1;
+}
+
+.md_header {
+  padding: 1rem;
+}
+
+.md_header h1 {
+  font-weight: 700;
+}
+
+.md_header .label span:before {
+  content: "•";
+  padding: 0 0.5rem;
+}
+
+.md_header .label span {
+  font-size: 12px;
+  color: #838383;
+  font-weight: 400;
+  padding: 0 0.2rem;
+}
+
+.tag {
+  background-color: #009688;
+  color: #fff;
+  padding: 0.2rem 0.6rem;
+  border-radius: 0.2rem;
+}
+
+.favorite-box {
+  font-size: 20px;
+  font-weight: 700;
+}
+
+.md_content {
+  padding: 1rem;
+  border-top: 1px solid #e5e5e5;
+  margin-bottom: 2rem;
+}
+
+.md_content h1,
+.md_content h2,
+.md_content h3,
+.md_content h4,
+.md_content h5,
+.md_content h6 {
+  font-weight: 700;
+}
+
+.md_content p {
+  font-size: 15px;
+  line-height: 1.7em;
+  overflow: auto;
+}
+
+.md_content h2 {
+  font-size: 26px;
+  margin: 30px 0 15px;
+  border-bottom: 1px solid #eee;
+}
+
+.md_content h3 {
+  margin: 30px 0 15px;
+  border-bottom: 1px solid #eee;
+  font-size: 24.5px;
+}
+
+.md_content pre {
+  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
+  font-size: 14px;
+  border-radius: 0;
+  padding: 1rem;
+  border: 0;
+  margin: 1rem 0;
+  border-width: 1px 0;
+  background: #f7f7f7;
+}
+
+.md_content ul {
+  list-style-type: disc;
+  margin: 0 0 1rem 2rem;
+}
+
+.md_content ol {
+  list-style: decimal;
+  margin-left: 2em;
+}
+
+.md_content li {
+  line-height: 2.5rem;
+}
+
+.md_content a {
+  display: block;
+}
+
+.md_content img {
+  height: auto;
+  max-width: 100%;
+  vertical-align: middle;
+  border: 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*评论区样式*/
+
+.replies>li {
+  padding: 1rem;
+}
+
+.replies>li:first-child {
+  background-color: #f6f6f6;
+}
+
+.reply {
+  width: 100%;
+  border-top: 1px solid #f0f0f0;
+}
+
+.reply>.msg {
+  display: flex;
+  justify-content: space-between;
+  padding-bottom: 1rem;
+  flex-wrap: nowrap;
+}
+
+.reply>p {
+  margin-bottom: 2rem;
+}
+
+.author>img {
+  width: 3rem;
+  height: 3rem;
+  vertical-align: top;
+}
+
+.author>.name {
+  color: #666;
+  font-weight: 700;
+}
+
+.author>.timer {
+  color: #08c;
+}
+
+.msg>.ups {
+  display: flex;
+  align-items: center;
+  color: #009688;
+}
+
+.ups>span {
+  margin-left: 0.5rem;
+}
+
+
+.textsms {
+  margin-left: 1rem;
+  color: #009688;
+}
+
+.reply_show {
+  animation: reply_show 1s ease;
+}
+
+@keyframes reply_show {
+  0% {
+    opacity: 0;
+  }
+  100% {
+    opacity: 1;
+  }
+}
+</style>

+ 136 - 131
src/views/Home.vue

@@ -1,168 +1,173 @@
 /*
  * @Author: fish119 
  * @Date: 2017-05-19 13:21:06 
- * @Last Modified by:   fish119 
- * @Last Modified time: 2017-05-22 13:21:06 
+ * @Last Modified by: fish119
+ * @Last Modified time: 2017-05-22 15:48:24
  */
 
 <template>
   <div class="content" style="height: 100vh;">
-    <mu-toast style="bottom:50%;text-align: center;" v-if="toast" :message="toastMsg" @close="hideToast"/>
+    <mu-toast style="bottom:50%;text-align: center;" v-if="toast" :message="toastMsg" @close="hideToast" />
     <mu-tabs class="tabs box-shadow" :value="activeTab" @change="handleTabChange">
-      <mu-tab value="all" title="全部"/>
-      <mu-tab value="good" title="精华"/>
-      <mu-tab value="weex" title="weex"/>
-      <mu-tab value="share" title="分享"/>
-      <mu-tab value="ask" title="问答"/>
-      <mu-tab value="job" title="招聘"/>
+      <mu-tab value="all" title="全部" />
+      <mu-tab value="good" title="精华" />
+      <mu-tab value="weex" title="weex" />
+      <mu-tab value="share" title="分享" />
+      <mu-tab value="ask" title="问答" />
+      <mu-tab value="job" title="招聘" />
     </mu-tabs>
-    <div  class="tab-content" style=" position: relative;">
-      <mu-refresh-control :refreshing="refreshing" :trigger="scroller" @refresh="getTopics"/>
+    <div class="tab-content" style=" position: relative;">
+      <mu-refresh-control :refreshing="refreshing" :trigger="scroller" @refresh="getTopics" />
       <mu-list style="padding: 0;">
         <div v-if="topics" v-for="(topic,idx) in topics" :key="topic.id">
           <mu-list-item style="padding:0">
-            <mu-avatar :src="topic.author.avatar_url" slot="left" style="margin-bottom: -4px;"/>
-            <div class="mu-item-title">
-              <span v-if="topic.top"><span class="top-topic">置顶</span></span>
-              <span v-else-if="topic.good"><span class="good-topic">精华</span></span>
-              {{topic.title}}
-            </div>
-            <div class="topic-content">
-              <span>
-                {{topic.author.loginname}}&nbsp;&nbsp;&nbsp;&nbsp;
-                <i class="material-icons" style="font-size:14px;">remove_red_eye</i>&nbsp;
-                {{topic.visit_count}}&nbsp;&nbsp;/&nbsp;&nbsp;
-                <i class="material-icons" style="font-size:14px;">comment</i>&nbsp;
-                {{topic.reply_count}}
-              </span>
-              <span>{{topic.last_reply_at | time_ago}}</span>
-            </div>
+            <mu-avatar :src="topic.author.avatar_url" slot="left" style="margin-bottom: -4px;" />
+            <router-link :to="{path:'/content',query:{id:topic.id}}">
+              <div class="mu-item-title">
+                <span v-if="topic.top">
+                  <span class="top-topic">置顶</span>
+                </span>
+                <span v-else-if="topic.good">
+                  <span class="good-topic">精华</span>
+                </span>
+                {{topic.title}}
+              </div>
+              <div class="topic-content">
+                <span>
+                  {{topic.author.loginname}}&nbsp;&nbsp;&nbsp;&nbsp;
+                  <i class="material-icons" style="font-size:14px;">remove_red_eye</i>&nbsp; {{topic.visit_count}}&nbsp;&nbsp;/&nbsp;&nbsp;
+                  <i class="material-icons" style="font-size:14px;">comment</i>&nbsp; {{topic.reply_count}}
+                </span>
+                <span>{{topic.last_reply_at | time_ago}}</span>
+              </div>
+            </router-link>
           </mu-list-item>
           <mu-divider/>
         </div>
-        <mu-infinite-scroll :scroller="scroller" :loading="loading" @load="loadMore"/>
+        <mu-infinite-scroll :scroller="scroller" :loading="loading" @load="loadMore" />
       </mu-list>
-
-    </div >
+  
+    </div>
   </div>
 </template>
 
 <script>
-  import appHeader from '../components/Header'
-  import bottomNavigation from '../components/BottomNavigation'
+import appHeader from '../components/Header'
+import bottomNavigation from '../components/BottomNavigation'
 
-  export default {
-    components: {
-      appHeader,
-      bottomNavigation
+export default {
+  components: {
+    appHeader,
+    bottomNavigation
+  },
+  data() {
+    return {
+      activeTab: 'all',
+      page: 1,
+      toastMsg: '',
+      toast: false,
+      topics: null,
+      scroller: null,
+      loading: false,
+      refreshing: false
+    }
+  },
+  methods: {
+    handleTabChange(val) {
+      this.loading = false;
+      this.activeTab = val;
+      this.getTopics();
+    },
+    getTopics() {
+      this.page = 1;
+      let url = this.$store.state.svrUrl + 'topics?tab=' + this.activeTab + '&page=' + this.page;
+      const self = this;
+      self.refreshing = true;
+      this.axios.get(url).then(function (res) {
+        if (res.status == 200) {
+          self.topics = [];
+          self.topics = res.data.data;
+        } else {
+          self.showToast('获取数据失败,请稍后重试');
+        }
+        self.refreshing = false;
+      }).catch(function (err) {
+        console.log(err);
+        self.refreshing = false;
+      })
     },
-    data () {
-      return {
-        activeTab: 'all',
-        page: 1,
-        toastMsg: '',
-        toast: false,
-        topics: null,
-        scroller: null,
-        loading: false,
-        refreshing:false
-      }
+    loadMore() {
+      this.page++;
+      let url = this.$store.state.svrUrl + 'topics?tab=' + this.activeTab + '&page=' + this.page;
+      const self = this;
+      self.loading = true;
+      this.axios.get(url).then(function (res) {
+        if (res.status == 200) {
+          self.topics = self.topics.concat(res.data.data);
+        } else {
+          self.showToast('获取数据失败,请稍后重试');
+          self.page--
+        }
+        self.loading = false;
+      }).catch(function (err) {
+        self.loading = false;
+        console.log(err);
+        self.page--
+      })
     },
-    methods: {
-      handleTabChange (val) {
-        this.loading = false;
-        this.activeTab = val;
-        this.getTopics();
-      },
-      getTopics(){
-        this.page = 1;
-        let url = this.$store.state.svrUrl + 'topics?tab=' + this.activeTab + '&page=' + this.page;
-        const self = this;
-        self.refreshing = true;
-        this.axios.get(url).then(function (res) {
-          if (res.status == 200) {
-            self.topics = [];
-            self.topics = res.data.data;
-          } else {
-            self.showToast('获取数据失败,请稍后重试');
-          }
-          self.refreshing = false;
-        }).catch(function (err) {
-          console.log(err);
-          self.refreshing = false;
-        })
-      },
-      loadMore(){
-        this.page++;
-        let url = this.$store.state.svrUrl + 'topics?tab=' + this.activeTab + '&page=' + this.page;
-        const self = this;
-        self.loading = true;
-        this.axios.get(url).then(function (res) {
-          if (res.status == 200) {
-            self.topics = self.topics.concat(res.data.data);
-          } else {
-            self.showToast('获取数据失败,请稍后重试');
-            self.page --
-          }
-          self.loading = false;
-        }).catch(function (err) {
-          self.loading = false;
-          console.log(err);
-          self.page --
-        })
-      },
-      showToast(msg){
-        this.toastMsg = msg
-        this.toast = true
-        if (this.toastTimer) clearTimeout(this.toastTimer)
-        this.toastTimer = setTimeout(() => {
-          this.toast = false
-        }, 1500)
-      },
-      hideToast () {
+    showToast(msg) {
+      this.toastMsg = msg
+      this.toast = true
+      if (this.toastTimer) clearTimeout(this.toastTimer)
+      this.toastTimer = setTimeout(() => {
         this.toast = false
-        if (this.toastTimer) clearTimeout(this.toastTimer)
-      }
+      }, 1500)
     },
-    mounted: function () {
-      this.$store.dispatch('changeTabValue', '首页');
-      this.scroller = this.$el;
-      this.getTopics('all');
+    hideToast() {
+      this.toast = false
+      if (this.toastTimer) clearTimeout(this.toastTimer)
     }
+  },
+  mounted: function () {
+    this.$store.dispatch('changeTabValue', '首页');
+    this.scroller = this.$el;
+    this.getTopics('all');
   }
+}
 
 
 </script>
 
 <style scoped>
-  .tab-content {
-    padding-top: 48px;
-  }
 
-  .topic-content {
-    margin-top: 3px;
-    margin-bottom: -8px;
-    display: flex;
-    justify-content: space-between
-  }
+.tab-content {
+  padding-top: 48px;
+}
 
-  .top-topic {
-    background-color: #009688;
-    color: #fff;
-    padding: .2rem;
-    border-radius: .2rem;
-    font-size: 14px;
-  }
+.topic-content {
+  margin-top: 3px;
+  margin-bottom: -8px;
+  display: flex;
+  justify-content: space-between
+}
 
-  .good-topic {
-    background-color: darkorange;
-    color: white;
-    padding: .2rem;
-    border-radius: .2rem;
-    font-size: 14px;
-  }
+.top-topic {
+  background-color: #009688;
+  color: #fff;
+  padding: .2rem;
+  border-radius: .2rem;
+  font-size: 14px;
+}
 
-  .mu-item-title {
-    font-weight: bold;
-  }
+.good-topic {
+  background-color: darkorange;
+  color: white;
+  padding: .2rem;
+  border-radius: .2rem;
+  font-size: 14px;
+}
+
+.mu-item-title {
+  font-weight: bold;
+}
 </style>

+ 3 - 3
src/views/Messages.vue

@@ -2,7 +2,7 @@
  * @Author: fish119
  * @Date: 2017-05-20 13:20:45
  * @Last Modified by: fish119
- * @Last Modified time: 2017-05-22 14:33:33
+ * @Last Modified time: 2017-05-22 16:30:29
  */
 <template>
   <div class="content">
@@ -22,7 +22,7 @@
           <h2 v-html="markdownChange(item.reply.content)"></h2>
           <p>来自:《{{item.topic.title}}》</p>
         </div>
-        <div class="timer">
+        <div class="msg_timer">
           <span>{{item.reply.create_at | timeago}}</span>
         </div>
       </router-link>
@@ -159,7 +159,7 @@ export default {
     font-size: 12px;
 }
 
-.timer {
+.msg_timer {
     margin-left: 1rem;
     width: 5rem;
     display: flex;

+ 1 - 1
src/views/Person.vue

@@ -2,7 +2,7 @@
  * @Author: fish119
  * @Date: 2017-05-22 09:21:33
  * @Last Modified by: fish119
- * @Last Modified time: 2017-05-22 14:41:31
+ * @Last Modified time: 2017-05-22 15:43:40
  */
 /**
 <template>