natasha 1 年之前
父节点
当前提交
3f515f5f36
共有 2 个文件被更改,包括 136 次插入7 次删除
  1. 15 0
      src/icons/svg/support.svg
  2. 121 7
      src/views/bookShelf/articlePeruseDetail.vue

+ 15 - 0
src/icons/svg/support.svg

@@ -0,0 +1,15 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_3552_54397)">
+<g clip-path="url(#clip1_3552_54397)">
+<path d="M9.7345 5.3329H14.0013C14.7377 5.3329 15.3346 5.92986 15.3346 6.66622V8.06915C15.3346 8.24328 15.3005 8.41575 15.2342 8.57682L13.1713 13.5867C13.0684 13.8365 12.825 13.9995 12.5548 13.9995H1.33464C0.966449 13.9995 0.667969 13.7011 0.667969 13.3329V6.66622C0.667969 6.29804 0.966449 5.99957 1.33464 5.99957H3.65586C3.87248 5.99957 4.07559 5.89432 4.20051 5.71736L7.8361 0.566919C7.9311 0.43234 8.11017 0.387334 8.2575 0.461004L9.4669 1.06569C10.168 1.41624 10.53 2.20796 10.3367 2.96758L9.7345 5.3329ZM4.66797 7.05788V12.6662H12.1084L14.0013 8.06915V6.66622H9.7345C8.8647 6.66622 8.22784 5.84687 8.44237 5.00396L9.04457 2.63864C9.08323 2.48672 9.01083 2.32837 8.87057 2.25826L8.42984 2.03788L5.2898 6.48627C5.1232 6.72228 4.91024 6.91575 4.66797 7.05788ZM3.33464 7.33288H2.0013V12.6662H3.33464V7.33288Z" fill="currentColor"/>
+</g>
+</g>
+<defs>
+<clipPath id="clip0_3552_54397">
+<rect width="16" height="16" rx="4" fill="white"/>
+</clipPath>
+<clipPath id="clip1_3552_54397">
+<rect width="16" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 121 - 7
src/views/bookShelf/articlePeruseDetail.vue

@@ -5,7 +5,7 @@
         <div class="navBar-left">
             <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i> 第 {{peruseDetail.batch}} 期</a>
             <div class="border"></div>
-            <p class="article-title">{{peruseDetail.en_title}}</p>
+            <p class="article-title">{{peruseDetail.cn_title}}</p>
         </div>
         <div class="navBar-right">
             <el-input-number class="article-fontsize" v-model="wordFontsize" :step="2" step-strictly :min="12" :max="24" :style="{borderColor:bgColorList[activeIndex].boxBorder}"></el-input-number>
@@ -21,7 +21,7 @@
             <div class="article-top">
                 <span class="preparation" :style="{color:bgColorList[activeIndex].sourceColor}">导读</span>
                 <h3 :style="{color:bgColorList[activeIndex].contentColor}">{{peruseDetail.en_title+' '+peruseDetail.cn_title}}</h3>
-                <label v-if="peruseDetail.label" :style="{background:tagBg[Math.floor(Math.random() * 3)],color:tagColor[Math.floor(Math.random() * 3)]}">{{ '# ' + peruseDetail.label}}</label>
+                <label v-if="peruseDetail.label" :style="{background:tagBg[0],color:tagColor[0]}">{{ '# ' + peruseDetail.label}}</label>
                 <p :style="{color:bgColorList[activeIndex].sourceColor}">{{peruseDetail.introduction}}</p>
             </div>
             <div class="article-content" :style="{borderColor:bgColorList[activeIndex].boxBorder}">
@@ -34,11 +34,26 @@
                 </div>
             </div>
             <div class="article-bottom">
-
+                <div class="left">
+                    <span :class="['support',support?'active':'']" @click="changeStatus('support')"><svg-icon icon-class="support"></svg-icon>2847</span>
+                    <span :class="['oppose',oppose?'active':'']" @click="changeStatus('oppose')"><svg-icon icon-class="oppose"></svg-icon></span>
+                </div>
+                <div class="center">
+                    <el-button type="text" class="btn-left" @click="handlePage('-')"><svg-icon icon-class="arrow-left-line"></svg-icon>上一篇</el-button>
+                    <el-button type="text" class="btn-right" @click="handlePage('+')">下一篇<svg-icon icon-class="arrow-right-line"></svg-icon></el-button>
+                </div>
+                <div class="right">
+                    <template v-if="noRead">
+                        <span class="support" @click="changeStatus('noRead')"><svg-icon icon-class="no-read"></svg-icon>标记为已读</span>
+                    </template>
+                    <template v-else>
+                        <span class="support readed" @click="changeStatus('noRead')"><svg-icon icon-class="readed"></svg-icon>已读</span>
+                    </template>
+                </div>
             </div>
         </div>
     </div>
-    <a class="translate" :class="[translateFlag?'active':'']"><svg-icon icon-class="translate" class="wrapper"></svg-icon></a>
+    <a class="translate" :class="[translateFlag?'active':'']" @click="translateFlag=!translateFlag"><svg-icon icon-class="translate" class="wrapper"></svg-icon></a>
   </div>
 </template>
 
@@ -222,9 +237,12 @@ export default {
         peruseId: this.$route.query.peruseId?this.$route.query.peruseId:'',
         peruseDetail: null,
         loading: false,
-        tagBg:['#C9EBFF','#FFFAC9','#D7C9FF'], // 标签背景色
-        tagColor:['#006DAA','#AA8500','#7849C4'], // 标签字体颜色
-        translateFlag: true
+        tagBg:['#C9EBFF'], // 标签背景色
+        tagColor:['#006DAA'], // 标签字体颜色
+        translateFlag: false,
+        noRead: true, // 未读
+        support: false, // 点赞
+        oppose: false, // 不支持
     }
   },
   methods: {
@@ -249,6 +267,16 @@ export default {
         .catch(() => {
             this.loading = false
         }); 
+    },
+    handlePage(type){
+        if(type==='-'){
+            
+        }else{
+            
+        }
+    },
+    changeStatus(flag){
+        this[flag] = !this[flag]
     }
   },
   created(){
@@ -376,11 +404,97 @@ export default {
         .article-bottom{
             padding: 16px;
             background: #F7F8FA;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            .right{
+                width: 145px;
+                margin-right: -8px;
+                text-align: right;
+            }
+            .support{
+                padding: 8px 16px;
+                border-radius: 20px;
+                background: #E5E6EB;
+                margin-right: 8px;
+                color:rgba(0, 0, 0, 0.88);
+                font-size: 16px;
+                font-weight: 400;
+                line-height: 24px;
+                cursor: pointer;
+                .svg-icon{
+                    margin-right: 8px;
+                    color: rgba(23, 93, 255, 1);
+                }
+                &.active{
+                    background: rgba(48, 110, 255, 1);
+                    color: #fff;
+                    .svg-icon{
+                        color: #fff;
+                    }
+                }
+            }
+            .oppose{
+                padding: 12px;
+                border-radius: 20px;
+                background: #E5E6EB;
+                height: 40px;
+                font-size: 16px;
+                line-height: 16px;
+                display: inline-block;
+                cursor: pointer;
+                .svg-icon{
+                    width: 16px;
+                    height: 16px;
+                }
+                &.active{
+                    background: rgba(48, 110, 255, 1);
+                    .svg-icon{
+                        color: #fff;
+                    }
+                }
+            }
+            .btn-left,.btn-right{
+                color: #3459D2;
+                font-size: 16px;
+                line-height: 24px;
+                padding: 0;
+                .svg-icon{
+                    margin-right: 12px;
+                }
+            }
+            .btn-right{
+                .svg-icon{
+                    margin-right: 0;
+                    margin-left: 12px;
+                }
+            }
+            .readed{
+                background: rgba(231, 238, 255, 1);
+                color: rgba(23, 93, 255, 1);
+            }
         }
     }
 }
 .translate{
     position: fixed;
+    z-index: 1;
+    bottom: 200px;
+    left: 50%;
+    margin-left: 400px;
+    padding: 12px;
+    border-radius: 8px;
+    background: #4F4F4F;
+    box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.10), 0px 8px 10px 1px rgba(0, 0, 0, 0.06), 0px 3px 14px 2px rgba(0, 0, 0, 0.05);
+    .svg-icon{
+        width: 24px;
+        height: 24px;
+        color: #fff;
+    }
+    &.active{
+        background: #175DFF;
+        box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.12), 0px 4px 5px 0px rgba(0, 0, 0, 0.08), 0px 1px 10px 0px rgba(0, 0, 0, 0.05);
+    }
 }
 </style>
 <style lang="scss">