natasha 1 rok temu
rodzic
commit
063acc8dee

+ 11 - 3
src/views/bookShelf/articleDetail.vue

@@ -21,7 +21,7 @@
             <!-- 文章 -->
             <div class="atricle-data">
                 <normal-model :titleFontsize="wordFontsize+30" :wordFontsize="wordFontsize" :colorObj="bgColorList[activeIndex]" :articleType="articleType" :style="{'padding':'0 40px'}" v-if="menuType==='original'" :articleInfo="articleInfo"></normal-model>
-                <phrase-model :titleFontsize="wordFontsize+30" :wordFontsize="wordFontsize" :colorObj="bgColorList[activeIndex]" :articleType="articleType" :style="{'padding':'0 40px'}" v-if="menuType==='newWord'" :articleInfo="articleInfo" :likePhraseList="likePhraseList" :likeWord="likeWordList"></phrase-model>
+                <phrase-model :titleFontsize="wordFontsize+30" :wordFontsize="wordFontsize" :colorObj="bgColorList[activeIndex]" :articleType="articleType" :style="{'padding':'0 40px'}" v-if="menuType==='newWord'" :articleInfo="articleInfo" :likePhraseList="likePhraseList" :likeWord="likeWordList" @changeLike="changeLike"></phrase-model>
                 <div class="article-btn" v-if="this.$route.query.iss_id">
                     <div class="left">
                         <span :class="['support colloct-article',!noRead?'active':'']" @click="changeStatus('noRead')"><svg-icon icon-class="like-line" :style="{marginRight:articleNumber?'8px':'0px'}"></svg-icon>{{articleNumber?articleNumber:''}}</span>
@@ -51,11 +51,11 @@
                     <div v-if="showGlossary">
                         <template v-if="articleInfo.art_voc_data.length>0">
                             <h4 :style="{color:bgColorList[activeIndex].glossarySubtitle}">生词</h4>
-                            <new-word-list class="newWord-list" :list="articleInfo.art_voc_data" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]" :likeWordList="likeWordList" @changeLike="changeLike"></new-word-list>
+                            <new-word-list class="newWord-list" :list="articleInfo.art_voc_data" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]" :likeWordList="likeWordList" @changeLike="changeLike" ref="newWordList"></new-word-list>
                         </template>
                         <template v-if="articleInfo.art_phrase_data.length>0">
                             <h4 :style="{color:bgColorList[activeIndex].glossarySubtitle}">短语</h4>
-                            <phrase-list class="newWord-list" :list="articleInfo.art_phrase_data" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]" :likePhraseList="likePhraseList" @changeLike="changeLike"></phrase-list>
+                            <phrase-list class="newWord-list" :list="articleInfo.art_phrase_data" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]" :likePhraseList="likePhraseList" @changeLike="changeLike" ref="phraseList"></phrase-list>
                         </template>
                         <template v-if="articleInfo.art_explain_data.length>0">
                             <h4 :style="{color:bgColorList[activeIndex].glossarySubtitle}">注释</h4>
@@ -739,6 +739,9 @@ export default {
                         item.value = item.vocabCount
                         item = Object.assign(item, this.vocabularyType[item.vlId])
                     })
+                    this.articleInfo.art_voc_data.forEach(item=>{
+                        item.collect = false
+                    })
                 }
                 setTimeout(() => {
                     this_.inityuan()
@@ -933,6 +936,11 @@ export default {
     },
     changeLike(type,list){
         this[type] = list
+        if(type==='likePhraseList'){
+            this.$refs.phraseList.handleData()
+        }else if(type==='likeWordList'){
+            this.$refs.newWordList.handleData()
+        }
     },
     // 报刊信息
     getIssueDetail(){

+ 1 - 1
src/views/bookShelf/components/NewWordList.vue

@@ -98,7 +98,7 @@ export default {
                         type: "success",
                     });
                     this.likeWord.splice(this.likeWord.indexOf(item.word),1)
-                    this.$emit('changeLike','likeWordList',this.likeWord)
+                    this.$emit('changeLike','likePhraseList',this.likeWord)
                 }
             })
             .catch(() => {

+ 31 - 21
src/views/bookShelf/components/PhraseCard.vue

@@ -4,7 +4,10 @@
         <span class="progress" v-if="wordList&&wordList.length>0">{{(phraseActiveIndex+1)+' / '+wordList.length}}</span>
         <template v-else>
             <ul>
-                <li class="active">本文释义</li>
+                <li class="active">
+                    <label>本文释义</label>
+                    <span></span>
+                </li>
             </ul>
         </template>
         <div class="btn-box">
@@ -17,15 +20,9 @@
     </div>
     <div class="word-card-center">
         <h3 class="word">{{data.exp_title}}</h3>
-        <div class="symbol-box">
-            <svg-icon v-if="data.hasVoice&&!voiceSrc" icon-class="voice" className="icon-voice" @click="handlePlayVoice(data)"></svg-icon>
-            <img v-if="data.hasVoice&&voiceSrc" :src="voiceSrc" class="icon-voice" />
-            <svg-icon v-if="!data.hasVoice" icon-class="voice" className="icon-voice" style="color:rgba(78, 89, 105, 0.3)"></svg-icon>
-        </div>
         <div class="para-list">
-            <div class="para" v-for="(itemP,indexP) in data.paraList" :key="indexP">
-                <span class="cixing">{{itemP.cixing}}</span>
-                <span class="shiyi">{{itemP.para}}</span>
+            <div class="para">
+                <span class="shiyi">{{data.exp_content}}</span>
             </div>
         </div>
         <el-divider content-position="left">例句</el-divider>
@@ -117,7 +114,7 @@ import { getLogin } from "@/api/ajax";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { },
-  props: ["dataObj","wordList","activeObjIndex"],
+  props: ["dataObj","wordList","activeObjIndex","likePhrase"],
   data() {
     //这里存放数据
     return {
@@ -207,6 +204,7 @@ export default {
                 this.loading = false
                 if(res.status===1){
                     item.collect = false
+                    this.$forceUpdate()
                     this.$message({
                         message: "取消收藏",
                         type: "success",
@@ -230,6 +228,7 @@ export default {
                 this.loading = false
                 if(res.status===1){
                     item.collect = true
+                    this.$forceUpdate()
                     this.$message({
                         message: "收藏成功",
                         type: "success",
@@ -338,8 +337,25 @@ export default {
             li{
                 color:#929CA8;
                 font-size: 16px;
-                font-weight: 400;
                 line-height: 24px;
+                label{
+                    font-weight: 400;
+                }
+                span{
+                   width: 15px;
+                   height: 2px; 
+                   display: block;
+                   margin: 2px auto;
+                }
+                &.active{
+                    color: #3459D2;
+                    label{
+                        font-weight: 600;
+                    }
+                    span{
+                        background: #3459D2;
+                    }
+                }
             }
         }
     }
@@ -366,8 +382,8 @@ export default {
             font-weight: 700;
             font-size: 40px;
             line-height: 48px;
-            color: #175DFF;
-            margin: 16px 0;
+            color: rgba(237, 95, 0, 1);
+            margin: 0 0 16px 0;
             font-family: "Arial";
         }
         .symbol-box{
@@ -390,16 +406,10 @@ export default {
             flex: 1;
             margin: 16px 0 35px 0;
             .para{
-                display: flex;
-                font-weight: 500;
+                color: #2F3742;
                 font-size: 16px;
+                font-weight: 500;
                 line-height: 24px;
-                margin: 8px 0;
-                .cixing{
-                    margin-right: 4px;
-                    min-width: 35px;
-                    text-align: right;
-                }
             }
         }
     }

+ 71 - 24
src/views/bookShelf/components/PhraseList.vue

@@ -1,40 +1,55 @@
 <template>
-    <ul>
-        <li v-for="(itemW,indexW) in phraseList" :key="indexW">
-            <div class="word-info">
-                <div class="word-info-top">
-                    <b class="phrase" :style="{color:colorObj.phraseColor}">{{itemW.exp_title}}</b>
-                    <div class="para-list">
-                        <div class="para">
-                            <span class="shiyi" :style="{color:colorObj.phraseOhterColor}">{{itemW.exp_content}}</span>
+    <div v-if="phraseList">
+        <ul>
+            <li v-for="(itemW,indexW) in phraseList" :key="indexW">
+                <div class="word-info">
+                    <div class="word-info-top">
+                        <b class="phrase" :style="{color:colorObj.phraseColor}" @click="showItem(itemW,indexW)">{{itemW.exp_title}}</b>
+                        <div class="para-list">
+                            <div class="para">
+                                <span class="shiyi" :style="{color:colorObj.phraseOhterColor}">{{itemW.exp_content}}</span>
+                            </div>
                         </div>
                     </div>
                 </div>
-            </div>
-            <template v-if="!noLike">
-                <svg-icon icon-class="like-line" className="icon-like" v-if="!itemW.collect" @click="handleCollect(itemW)"></svg-icon>
-                <svg-icon icon-class="like" className="icon-like active" v-else @click="handleCollect(itemW)"></svg-icon>
-            </template>
-            <!-- <i class="el-icon-arrow-right"></i> -->
-        </li>
-    </ul>
+                <template v-if="!noLike">
+                    <svg-icon icon-class="like-line" className="icon-like" v-if="!itemW.collect" @click="handleCollect(itemW)"></svg-icon>
+                    <svg-icon icon-class="like" className="icon-like active" v-else @click="handleCollect(itemW)"></svg-icon>
+                </template>
+                <!-- <i class="el-icon-arrow-right"></i> -->
+            </li>
+        </ul>
+        <el-dialog
+            :visible.sync="showPhraseFlag"
+            :show-close="false"
+            :close-on-click-modal="false"
+            width="580px"
+            :modal="false"
+            class="login-dialog phrase-box"
+            v-if="showPhraseFlag&&showObj">
+            <phrase-card :dataObj="showObj" @closeWord="closeExplain" :wordList="phraseList" :activeObjIndex="activeObjIndex" @changeLike="changeLike" :likePhrase="likePhrase"></phrase-card>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
 import { getLogin } from "@/api/ajax";
-import WordCard from "../../personalCenter/components/WordCard.vue"
+import PhraseCard from "./PhraseCard.vue"
 export default {
   //import引入的组件需要注入到对象中才能使用
-  components: {WordCard},
+  components: {PhraseCard},
   props: ["list","colorObj","likePhraseList","noLike"],
   data() {
     //这里存放数据
     return {
         wordcardShow: false, // 词汇卡片flag
         likePhrase: JSON.parse(JSON.stringify(this.likePhraseList)),
-        phraseList: []
+        phraseList: [],
+        showObj:null,
+        activeObjIndex: null,
+        showPhraseFlag: false,
     }
   },
   //计算属性 类似于data概念
@@ -65,13 +80,13 @@ export default {
             .then((res) => {
                 this.loading = false
                 if(res.status===1){
+                    this.likePhrase.splice(this.likePhrase.indexOf(item.exp_title),1)
+                    this.$emit('changeLike','likePhraseList',this.likePhrase)
                     item.collect = false
                     this.$message({
                         message: "取消收藏",
                         type: "success",
                     });
-                    this.likePhrase.splice(this.likePhrase.indexOf(item.exp_title),1)
-                    this.$emit('changeLike','likePhraseList',this.likePhrase)
                 }
             })
             .catch(() => {
@@ -88,18 +103,24 @@ export default {
             .then((res) => {
                 this.loading = false
                 if(res.status===1){
+                    this.likePhrase.push(item.exp_title)
+                    this.$emit('changeLike','likePhraseList',this.likePhrase)
                     item.collect = true
                     this.$message({
                         message: "收藏成功",
                         type: "success",
                     });
-                    this.likePhrase.push(item.exp_title)
-                    this.$emit('changeLike','likePhraseList',this.likePhrase)
                 }
             })
             .catch(() => {
             }); 
         }
+        this.$forceUpdate()
+    },
+    showItem(item,indexi){
+        this.showObj = item
+        this.activeObjIndex = indexi   
+        this.showPhraseFlag = true
     },
     handleData(){
         this.phraseList = []
@@ -109,10 +130,17 @@ export default {
                 exp_title: items.exp_title,
                 exp_content: items.exp_content,
                 id: items.id,
-                collect: this.likePhraseList.indexOf(items.exp_title)>-1?true:false
+                collect: this.likePhrase.indexOf(items.exp_title)>-1?true:false
             }
             this.phraseList.push(obj)
         });
+    },
+    closeExplain(){
+        this.showPhraseFlag = false
+        this.showObj = null
+    },
+    changeLike(obj,list){
+        this.$emit('changeLike',obj,list)
     }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -147,6 +175,24 @@ ul{
         display: flex;
         margin: 1px 0;
         border-radius: 4px;
+        &:hover{
+            background: #FFFFFF;
+        }
+        &.li-darkGreen{
+            &:hover{
+                background: #ECEFED;
+            }
+        }
+        &.li-darkBlue{
+            &:hover{
+                background: #4E5969;
+            }
+        }
+        &.li-armyGreen{
+            &:hover{
+                background: #66736D;
+            }
+        }
         .xuhao{
             min-width: 22px;
             display: block;
@@ -206,6 +252,7 @@ ul{
                 line-height: 22px;
                 color: #ED5F00;
                 margin-right: 8px;
+                cursor: pointer;
             }
             .symbol{
                 font-size: 14px;

+ 4 - 2
src/views/bookShelf/components/PhraseModel.vue

@@ -140,7 +140,7 @@
         :modal="false"
         class="login-dialog phrase-box"
         v-if="showPhraseFlag&&showObj">
-        <phrase-card :dataObj="showObj" @closeWord="closeExplain" :wordList="phraseList" :activeObjIndex="activeObjIndex"></phrase-card>
+        <phrase-card :dataObj="showObj" @closeWord="closeExplain" @changeLike="changeLike" :likePhrase="likePhraseList"></phrase-card>
     </el-dialog>
   </div>
 </template>
@@ -335,7 +335,6 @@ export default {
                     if(item.word_id===itemi.id){
                         this.showObj = itemi
                         this.activeObjIndex = indexi
-                        console.log(itemi)
                     }
                 })
                 this.showPhraseFlag = true
@@ -353,6 +352,9 @@ export default {
         this.showWordFlag = false
         this.showSearchWordFlag = false
         this.showObj = null
+    },
+    changeLike(obj,list){
+        this.$emit('changeLike',obj,list)
     }
   },
   //生命周期 - 创建完成(可以访问当前this实例)

+ 2 - 1
src/views/bookStore/all.vue

@@ -335,7 +335,8 @@ export default {
             MethodName = "/ShopServer/Client/ShopHomeQuery/PageQueryIssueList"
             data.year_label = this.baozhiForm.yearValue
             data.study_phase = this.baozhiForm.studyValue
-            data.comb_flag = this.baozhiForm.typeValue
+            data.comb_flag = this.baozhiForm.typeValue==1?null:this.baozhiForm.typeValue
+            data.album_flag = this.baozhiForm.typeValue==0?null:this.baozhiForm.typeValue
             getLogin(MethodName, data)
             .then((res) => {
                 if(res.status===1){