natasha 1 рік тому
батько
коміт
6dca8b17b4

+ 15 - 15
src/views/bookShelf/articleDetail.vue

@@ -515,8 +515,8 @@ export default {
         loading: false,
         menuType: 'original',
         menuFeature: '', // 功能
-        shareSrc: 'data:image/jpeg;base64,R0lGODlhgAAwAPEAAPr6+gAAAOnp6QAAACwAAAAAgAAwAAAC/pSPqcvtD6OcDdiLs968+w+G4qgZ5Imm6jqa7AvHcubO9o17dc738+4LCk/AofG4KWICzKaoyTRCp1Toy5kUeKhP67AK9qrENG2HC0ILw2zWNLt9p+XIeHSlxigt1Tm5vkGH0ldiFpjHgQi49HdCWHammPG4yIg1FtUIsAfgdJkY0PlZyTc6mNnI6Wl6sXo3+SkYo0mCJbtpqOEaClr6askbJkM7Emu6Z8sqGqrp1QZz6/ibmmvpy6sbzGplrFxM3IV9XQiq/dt616wI7neeMiqLnL6Nra7M/oHvlz0qX+9+yZ44WO6+FZQ2EN05fwoHTqN3cFnCcBNPVfyjpJu424AQK0rE5M1gpIXVfAFjdJKfR30qPdaKKCjjw1caD8EMWS7iS5cxSy5LKYrgRGIsgbphA0aPz5o/jTYc6dJmVINIe/K7GtTpuJwIdVKtSqaIKUofVULd6VVkO2xiAd4SeJbi1HByL7RNuK5j3BBF86UFerel1MFc+eLcidZuybFwzRb2+5duYgtA9DoWutcOWHyHhfKqHFlrWcKQN+Ps7JlyNdSiiXY2HU0hyM8+Sdm2wem2bha5d/smUvu38BbBhxvXUfy4ckjLmyN3Dh1O9OmqKVi/jj27dgoFAAA7', // 分享图片
-        share_url: '123456', // 分享链接
+        shareSrc: '', // 分享图片
+        share_url: '', // 分享链接
         shareLoading: false
     }
   },
@@ -674,20 +674,20 @@ export default {
             })
             .catch(() => {
             }); 
-            // let datas = {
-            //     sentence_id: this.articleInfo.art_sound_srt_data.sents[1].id,
-            //     audio_file_id: this.articleInfo.art_sound_srt_data.mp3,
-            //     audio_begin_time: this.articleInfo.art_sound_srt_data.sents[1].s,
-            //     audio_end_time: this.articleInfo.art_sound_srt_data.sents[1].e
-            // }
-            // getLogin('/ShopServer/Client/CollectManager/AddCollect_Sentence', datas)
-            // .then((res) => {
-            //     if(res.status===1){
+            let datas = {
+                sentence_id: this.articleInfo.art_sound_srt_data?this.articleInfo.art_sound_srt_data.sents[1].id:this.articleInfo.art_corpus_data.sentList[1].id,
+                audio_file_id: this.articleInfo.art_sound_srt_data?this.articleInfo.art_sound_srt_data.mp3:'',
+                audio_begin_time: this.articleInfo.art_sound_srt_data?this.articleInfo.art_sound_srt_data.sents[1].s:null,
+                audio_end_time: this.articleInfo.art_sound_srt_data?this.articleInfo.art_sound_srt_data.sents[1].e:null
+            }
+            getLogin('/ShopServer/Client/CollectManager/AddCollect_Sentence', datas)
+            .then((res) => {
+                if(res.status===1){
                     
-            //     }
-            // })
-            // .catch(() => {
-            // }); 
+                }
+            })
+            .catch(() => {
+            }); 
         }
     },
     changeArticleType(type,e){

+ 22 - 8
src/views/bookShelf/components/NewWordList.vue

@@ -80,22 +80,35 @@ export default {
     // 收藏
     handleCollect(item){
         if(item.collect){
-            item.collect = false
-            this.$forceUpdate()
-            this.$message({
-                message: "取消收藏",
-                type: "success",
+            let MethodName = "/ShopServer/Client/CollectManager/CancelCollect_Word";
+            let data = {
+                word: item.word,
+            }
+            getLogin(MethodName, data)
+            .then((res) => {
+                this.loading = false
+                if(res.status===1){
+                    item.collect = false
+                    this.$forceUpdate()
+                    this.$message({
+                        message: "取消收藏",
+                        type: "success",
+                    });
+                }
+            })
+            .catch(() => {
             });
         }else{
             let MethodName = "/ShopServer/Client/CollectManager/AddCollect_Word";
             let data = {
                 word: item.word,
                 pinyin: item.symbol,
-                definition_list: item.paraList,
+                explain: JSON.stringify(item.paraList),
                 is_new: "true",
                 audio_file_id: item.word_explain&&item.word_explain.ph_mp3_id?item.word_explain.ph_mp3_id:'',
                 audio_file_url: item.word_explain&&item.word_explain.ph_file_url?item.word_explain.ph_file_url:'',
-                article_id: this.$route.query.id
+                article_id: this.$route.query.id,
+                word_id: item.id
             }
             getLogin(MethodName, data)
             .then((res) => {
@@ -162,7 +175,8 @@ export default {
                 typeCn: items.word_explain.vl_level_name?items.word_explain.vl_level_name:'',
                 rate: items.word_explain.star?items.word_explain.star:null,
                 originalObj: items,
-                hasVoice: items.word_explain.ph_mp3_id||items.word_explain.ph_file_url?true:false
+                hasVoice: items.word_explain.ph_mp3_id||items.word_explain.ph_file_url?true:false,
+                id: items.id
             }
             this.wordList.push(obj)
         });

+ 19 - 5
src/views/bookShelf/components/PhraseList.vue

@@ -44,16 +44,30 @@ export default {
     // 收藏
     handleCollect(item){
         if(item.collect){
-            item.collect = false
-            this.$message({
-                message: "取消收藏",
-                type: "success",
+            let MethodName = "/ShopServer/Client/CollectManager/CancelCollect_Phrase";
+            let data = {
+                phrase: item.exp_title,
+            }
+            getLogin(MethodName, data)
+            .then((res) => {
+                this.loading = false
+                if(res.status===1){
+                    item.collect = false
+                    this.$message({
+                        message: "取消收藏",
+                        type: "success",
+                    });
+                }
+            })
+            .catch(() => {
             });
         }else{
             let MethodName = "/ShopServer/Client/CollectManager/AddCollect_Phrase";
             let data = {
                 phrase: item.exp_title,
-                article_id: this.$route.query.id
+                explain: item.exp_content,
+                article_id: this.$route.query.id,
+                phrase_id: item.id
             }
             getLogin(MethodName, data)
             .then((res) => {

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

@@ -580,7 +580,8 @@ export default {
         this.createOrderLoading = true
         let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
         let data = {
-            goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
+            is_reservation: 'true',
+            goods_type: 2,
             goods_id_list: [this.id],
             pay_type: this.payWay==='wei'?3:this.payWay==='zhi'?4:null
         }

+ 94 - 11
src/views/personalCenter/components/Collect.vue

@@ -12,10 +12,11 @@
             <el-button slot="append">搜索</el-button>
         </el-input> -->
     </div>
-    <p class="tabs-title" v-if="tabsIndex===0">共收藏了 {{wordList.length}} 条记录,{{differentNumber}}个不同词汇</p>
-    <p class="tabs-title" v-else-if="tabsIndex===1">共收藏了 {{phraseList.length}} 条记录,{{differentNumber}}个不同短语</p>
-    <p class="tabs-title" v-else-if="tabsIndex===2">共收藏了 {{sentenceList.length}} 个句子</p>
-    <p class="tabs-title" v-else-if="tabsIndex===3">共收藏了 {{articleList.length}} 篇文章</p>
+    <!-- ,{{differentNumber}}个不同词汇 ,{{differentNumber}}个不同短语-->
+    <p class="tabs-title" v-if="tabsIndex===0">共收藏了 {{total_count}} 条记录</p>
+    <p class="tabs-title" v-else-if="tabsIndex===1">共收藏了 {{total_count_p}} 条记录</p>
+    <p class="tabs-title" v-else-if="tabsIndex===2">共收藏了 {{total_count_s}} 个句子</p>
+    <p class="tabs-title" v-else-if="tabsIndex===3">共收藏了 {{total_count_a}} 篇文章</p>
     <div class="search-box">
         <div class="search-item" style="width:auto;padding-right:8px;">
             <label>排序</label>
@@ -68,9 +69,9 @@
                         <b class="word" @click="showWord(itemW)">{{itemW.word}}</b>
                         <span class="symbol">{{itemW.pinyin}}</span>
                         <div class="para-list">
-                            <div class="para" v-for="(itemP,indexP) in itemW.definition_list" :key="indexP">
+                            <div class="para" v-for="(itemP,indexP) in JSON.parse(itemW.explain)" :key="indexP">
                                 <span class="cixing">{{itemP.cixing}}</span>
-                                <span class="shiyi">{{itemP.shiyi}}</span>
+                                <span class="shiyi">{{itemP.para}}</span>
                             </div>
                         </div>
                     </div>
@@ -79,7 +80,7 @@
                         <span>收藏于:{{itemW.create_time}}</span>
                     </div>
                 </div>
-                <svg-icon icon-class="like" className="icon-like"></svg-icon>
+                <svg-icon icon-class="like" className="icon-like" @click="cancleCollectWord(itemW.word)"></svg-icon>
                 <!-- <i class="el-icon-arrow-right"></i> -->
             </li>
         </ul>
@@ -116,7 +117,7 @@
                         <span>收藏于:{{itemW.create_time}}</span>
                     </div>
                 </div>
-                <svg-icon icon-class="like" className="icon-like"></svg-icon>
+                <svg-icon icon-class="like" className="icon-like" @click="cancleCollectPhrase(itemW.phrase)"></svg-icon>
                 <!-- <i class="el-icon-arrow-right"></i> -->
             </li>
         </ul>
@@ -150,7 +151,7 @@
                         <span>收藏于:{{itemW.create_time}}</span>
                     </div>
                 </div>
-                <svg-icon icon-class="like" className="icon-like"></svg-icon>
+                <svg-icon icon-class="like" className="icon-like" @click="cancleCollectSentence(itemW.sentence_id)"></svg-icon>
                 <!-- <i class="el-icon-arrow-right"></i> -->
             </li>
         </ul>
@@ -176,13 +177,13 @@
                 <span class="xuhao">{{(pageNumberA-1)*pageNumberA+indexW+1+'.'}}</span>
                 <div class="word-info">
                     <h4>{{itemW.article_title}}</h4>
-                    <span class="sentence">{{itemW.article_content_section}}</span>
+                    <span class="sentence sentence_article">{{itemW.article_content_section}}</span>
                     <div class="word-info-bottom">
                         <span style="cursor: pointer;" @click="handleLink(itemW)">{{itemW.article_author}}  {{itemW.issue_study_phase_name}} / {{itemW.issue_iss_no_name}} / {{itemW.article_title}}</span>
                         <span>收藏于:{{itemW.create_time}}</span>
                     </div>
                 </div>
-                <svg-icon icon-class="like" className="icon-like"></svg-icon>
+                <svg-icon icon-class="like" className="icon-like" @click="cancleCollectArticle(itemW.article_id)"></svg-icon>
                 <!-- <i class="el-icon-arrow-right"></i> -->
             </li>
         </ul>
@@ -517,6 +518,80 @@ export default {
         _this.activeIndex = index
       }
     },
+    // 取消收藏文章
+    cancleCollectArticle(id){
+        let MethodName = "/ShopServer/Client/CollectManager/CancelCollect_Article"
+        getLogin(MethodName, {
+            article_id: id
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.$message({
+                    message: "取消收藏",
+                    type: "success",
+                });
+                this.getList()
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    },
+    // 取消句子收藏
+    cancleCollectSentence(id){
+        let MethodName = "/ShopServer/Client/CollectManager/CancelCollect_Sentence"
+        getLogin(MethodName, {
+            sentence_id: id
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.$message({
+                    message: "取消收藏",
+                    type: "success",
+                });
+                this.getList()
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    },
+    // 取消单词收藏
+    cancleCollectWord(word){
+        let MethodName = "/ShopServer/Client/CollectManager/CancelCollect_Word";
+        let data = {
+            word: word,
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.$message({
+                    message: "取消收藏",
+                    type: "success",
+                });
+                this.getList()
+            }
+        })
+        .catch(() => {
+        });
+    },
+    // 取消短语收藏
+    cancleCollectPhrase(word){
+        let MethodName = "/ShopServer/Client/CollectManager/CancelCollect_Phrase";
+        let data = {
+            phrase: word,
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.$message({
+                    message: "取消收藏",
+                    type: "success",
+                });
+                this.getList()
+            }
+        })
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -683,6 +758,14 @@ export default {
                 font-size: 14px;
                 line-height: 22px;
                 color: #2F3742;
+                &.sentence_article{
+                    word-break: break-word;
+                    display: -webkit-box;
+                    -webkit-box-orient: vertical;
+                    -webkit-line-clamp: 2;
+                    text-overflow: ellipsis;
+                    overflow: hidden;
+                }
             }
             .icon-like{
                 color: #F2555A;