guhongwei 4 年之前
父節點
當前提交
4bba4e7a2a
共有 3 個文件被更改,包括 20 次插入24 次删除
  1. 4 2
      src/store/service.js
  2. 1 16
      src/views/community/index.vue
  3. 15 6
      src/views/community/parts/list.vue

+ 4 - 2
src/store/service.js

@@ -17,8 +17,10 @@ const actions = {
     const res = await this.$axios.$post(`${api.service}`, payload);
     return res;
   },
-  async fetch({ commit }, payload) {
-    const res = await this.$axios.$get(`${api.service}/${payload}`);
+  async fetch({ commit, rootState }, payload) {
+    const res = await this.$axios.$get(`${api.service}/${payload}`, {
+      openid: rootState.user.openid,
+    });
     return res;
   },
   async update({ commit }, { id, ...info } = {}) {

+ 1 - 16
src/views/community/index.vue

@@ -33,22 +33,7 @@ export default {
   data: function() {
     return {
       clientHeight: '',
-      communityList: [
-        {
-          content:
-            '文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容',
-          origin: '文章来源',
-          renew_time: '2021-02-01 10:00:00',
-          type: '0',
-          imgUrl: [
-            { name: '图片名称', url: require('@a/news1.jpg') },
-            { name: '图片名称1', url: require('@a/news1.jpg') },
-          ],
-          fileUrl: require('@a/video1.mp4'),
-          website: 'http://broadcast.waityou24.cn/platlive/home.html',
-          read: 10,
-        },
-      ],
+      communityList: [],
       total: 0,
     };
   },

+ 15 - 6
src/views/community/parts/list.vue

@@ -31,10 +31,14 @@
             </video>
           </el-col>
           <el-col :span="24" class="btn">
-            <el-col :span="6" class="button"><i class="el-icon-position"></i>分享</el-col>
-            <el-col :span="6" class="button" @click.native="detailBtn(item)"><i class="el-icon-chat-line-round"></i>评论</el-col>
-            <el-col :span="6" class="button"><i class="el-icon-thumb"></i>点赞</el-col>
-            <el-col :span="6" class="button textOver"><i class="el-icon-view"></i>{{ item.read >= 10000 ? '1万+' : item.read }}</el-col>
+            <el-col :span="6" class="button"><i class="el-icon-position"></i></el-col>
+            <el-col :span="6" class="button" @click.native="detailBtn(item)"><i class="el-icon-chat-line-round"></i></el-col>
+            <el-col :span="6" class="button"
+              ><i class="el-icon-thumb"></i><span>{{ item.thumbs >= 10000 ? '1万+' : item.thumbs }}</span></el-col
+            >
+            <el-col :span="6" class="button"
+              ><i class="el-icon-view"></i><span>{{ item.read >= 10000 ? '1万+' : item.read }}</span></el-col
+            >
           </el-col>
         </el-col>
       </el-col>
@@ -120,8 +124,13 @@ export default {
       height: 35px;
       line-height: 35px;
       border-top: 1px solid #f1f1f1;
-      // border-right: 1px solid #f1f1f1;
-      font-size: 12px;
+      font-size: 16px;
+      i {
+        font-size: 16px;
+      }
+      span {
+        padding: 0 0 0 5px;
+      }
     }
     .button:nth-child(4) {
       border-right: none;