Browse Source

修改新闻部分

lrf402788946 5 năm trước cách đây
mục cha
commit
a8df41008a
4 tập tin đã thay đổi với 10 bổ sung10 xóa
  1. 2 1
      src/store.js
  2. 2 2
      src/views/index/index.vue
  3. 1 1
      src/views/index/request.vue
  4. 5 6
      src/views/info/detail.vue

+ 2 - 1
src/store.js

@@ -300,7 +300,8 @@ export default new Vuex.Store({
       let result;
       if (type === 'list') {
         let { site, column } = data;
-        result = await this.$axios.$get(api.query, { site: site, column: column, skip: skip, limit: limit });
+        console.log(data);
+        result = await this.$axios.$get(api.query, {}, { site: site, column: column, skip: skip, limit: limit });
       }
       if (type === 'search') {
         let { id } = data;

+ 2 - 2
src/views/index/index.vue

@@ -37,14 +37,14 @@
                   <div class="block" style="width: 460px;float: left;">
                     <el-carousel style="width:460px;height:250px;overflow-y: hidden;" ref="shubiao">
                       <el-carousel-item v-for="(item, index) in newList" :key="index" :name="`${index}`">
-                        <img :src="item.url" class="newList" />
+                        <img :src="item.picurl" class="newList" />
                       </el-carousel-item>
                     </el-carousel>
                   </div>
                   <el-col style="width:308px;float:right;" class="newListLi">
                     <ul>
                       <li v-for="(tag, index) in newList" :key="index" :type="tag.type" @mouseover="shuYi(index)" :class="newListActive(tag)">
-                        <el-link :underline="false">{{ tag.name }}</el-link>
+                        <el-link :underline="false" @click="$router.push({ path: '/info/detail', query: { id: tag.id } })">{{ tag.title }}</el-link>
                       </li>
                     </ul>
                   </el-col>

+ 1 - 1
src/views/index/request.vue

@@ -114,7 +114,7 @@ export default {
       } else {
         this.$message.error(result.errmsg ? result.errmsg : 'error');
       }
-      result = await this.newsOperation({ type: 'list', data: { site: this.$site, limit: this.limit, skip: 0 } });
+      result = await this.newsOperation({ type: 'list', data: { site: this.$site, limit: 6, skip: 0 } });
       if (`${result.errcode}` === '0') {
         //给this=>vue的实例下在中的list属性,赋予result。data的值
         this.$set(this, 'newList', result.data);

+ 5 - 6
src/views/info/detail.vue

@@ -13,15 +13,14 @@
       </el-col>
       <!-- <el-col :span="24" align="right" style="font-size: 0.8rem;">插件</el-col> -->
       <el-col :span="24" align="center" style="font-size: 1.5rem; padding-top: 1rem;">{{ info.title }}</el-col>
-      <el-col :span="24" align="center" class="date">
-        {{ info.meta && info.meta.createdAt ? new Date(info.meta.createdAt).toLocaleDateString() : '' || '' }}
+      <el-col :span="24" align="right" class="date">
+        发布时间:{{ info.meta && info.meta.createdAt ? new Date(info.meta.createdAt).toLocaleDateString() : '' || '' }}
         <!-- 点击人次:26125 -->
       </el-col>
-      <el-col :span="24" style="padding-top: 1rem;">
-        <el-card class="box-card" shadow="never" style="padding-top: 1.5rem;">
-          <el-card shadow="never" v-html="info.content"> </el-card>
-        </el-card>
+      <el-col :span="24">
+        <el-image :src="info.picurl" width="100%"></el-image>
       </el-col>
+      <el-col :span="24" style="padding-top: 1rem;" v-html="info.content"> </el-col>
     </el-row>
   </div>
 </template>