소스 검색

Merge branch 'NPC-lhd'

natasha 3 년 전
부모
커밋
4d5df74c54

BIN
src/assets/NPC/chinaTianYellow.png


BIN
src/assets/NPC/strock-play-yellow-click.png


+ 11 - 1
src/components/Adult/Preview.vue

@@ -1,6 +1,6 @@
 <!--  -->
 <template>
-  <div class="NNPE-Big-Book-preview NPC-Book-Sty">
+  <div class="NNPE-Big-Book-preview adult-book-preview-sty preview-red">
     <div class="NNPE-title">
       <h1>{{ fatherName }}</h1>
       <div class="NNPE-operate">
@@ -98,6 +98,12 @@
                 <template v-if="itemss.type == 'single_chs'">
                   <Single :curQue="itemss.data" />
                 </template>
+                <template v-if="itemss.type == 'text_problem_chs'">
+                  <TextProblem :curQue="itemss.data" />
+                </template>
+                <template v-if="itemss.type == 'newWord_preview_chs'">
+                  <NewWordShow :curQue="itemss.data" />
+                </template>
               </template>
             </div>
           </div>
@@ -124,6 +130,8 @@ import NumberSelectHasRecord from "./preview/NumberSelectHasRecord.vue" // 数
 import SelectTone from './preview/SelectTone.vue' // 选择声调
 import Soduko from './preview/Soduko.vue' // 数独
 import Single from './preview/Single.vue' // 单选
+import TextProblem from './preview/TextProblem.vue' // 课文上方的问题 
+import NewWordShow from './preview/NewWordShow.vue' // 生字展示
 export default {
   name: "preview",
   components: {
@@ -143,6 +151,8 @@ export default {
     SelectTone,
     Soduko,
     Single,
+    TextProblem,
+    NewWordShow,
   },
   props: ["context", "fatherName"],
   data() {

+ 155 - 0
src/components/Adult/preview/NewWordShow.vue

@@ -0,0 +1,155 @@
+<!--  -->
+<template>
+  <div class="Big-Book-prev-Textdes NewWordShow" v-if="curQue">
+      <div class="item-box">
+          <div class="item" v-for="(item,index) in curQue.option" :key="index">
+              <p v-if="item.pinyin">{{item.pinyin}}</p>
+              <div class="con-box">
+                  <template v-if="item.imgOrText=='text'">
+                    <div
+                        :key="conindex"
+                        class="strockplay"
+                        v-for="(conItem, conindex) in item.con"
+                        @click="handleShow(conItem)"
+                    >
+                        <Strockplayredline
+                            :Book_text="conItem"
+                            :playStorkes="true"
+                            :targetDiv="'bwcHanziIntp' + conItem + conindex"
+                        />
+                        <div
+                            class="bwc-line"
+                            v-if="conindex < item.con.length - 1"
+                        ></div>
+                    </div>
+                </template>
+                <template v-else>
+                    <div class="img-box" v-for="(imgItem,imgIndex) in item.img_list" :key="imgIndex">
+                        <el-image
+                            :src="imgItem.url"
+                            fit="scale-down"
+                            class="img_url"
+                        >
+                            <div slot="placeholder" class="image-slot">
+                                <img src="../../../assets/common/icon-imgloading.png" />
+                            </div>
+                        </el-image>
+                    </div>
+                </template>
+              </div>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+import Strockplayredline from "../preview/components/Strockplayredline.vue";
+export default {
+  components: {Strockplayredline},
+  props: ["curQue"],
+  data() {
+    return {
+        
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {
+    // 处理数据
+    handleData(){
+        let _this = this
+        
+    },
+    handleShow(item){
+        alert('11')
+    }
+    
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scoped>
+//@import url(); 引入公共css类
+.NewWordShow{
+    width: 100%;
+    padding: 0 4px;
+    background: #F7F7F7;
+    border: 1px solid rgba(0, 0, 0, 0.1);
+    border-radius: 8px;
+    .item-box{
+        display: flex;
+        flex-flow: wrap;
+        padding-bottom: 8px;
+        .item{
+            display: flex;
+            align-items: flex-end;
+            justify-content: center;
+            flex-flow: wrap;
+            margin: 9px 20px;
+            >p{
+                color: #2C2C2C;
+                font-size: 14px;
+                line-height: 130%;
+                font-family: 'GB-PINYINOK-B';
+                width: 100%;
+                text-align: center;
+                margin: 0 0 8px 0;
+            }
+            .strockplay {
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                position: relative;
+                width: 64px;
+                height: 64px;
+            }
+            .strockplayRedInner{
+                width: 64px;
+                height: 64px;
+            }
+            .bwc-line {
+                width: 1px;
+                height: 62px;
+                background: #BF875E;
+            }
+        }
+        .con-box{
+            display: flex;
+            border: 1px solid #BF875E;
+            border-radius: 8px;
+            overflow: hidden;
+            .img-box{
+                background: url('../../../assets/NPC/chinaTianYellow.png') center no-repeat;
+                background-size: cover;
+                .img_url{
+                    width: 64px;
+                    height: 64px;
+                }
+            }
+        }
+    }
+}
+</style>
+<style lang="scss">
+.NewWordShow{
+    .strock-play-box{
+        width: 16px;
+        height: 16px;
+        right: -1px;
+        background: url('../../../assets/NPC/strock-play-yellow-click.png') center no-repeat;
+        background-size: cover;
+    }
+}
+</style>

+ 42 - 0
src/components/Adult/preview/SelectYinjie.vue

@@ -0,0 +1,42 @@
+<!--  -->
+<template>
+  <div class="Big-Book-prev-Textdes SelectYinjie" v-if="curQue">
+      <div class="item-box" v-for="(item,index) in curQue.option" :key="index">
+          
+      </div>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: ["curQue"],
+  data() {
+    return {
+        
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {
+    
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scoped>
+//@import url(); 引入公共css类
+
+</style>

+ 1 - 6
src/components/Adult/preview/SentenceInput.vue

@@ -13,7 +13,7 @@
               <!-- 如果不是填空题 不替换 -->
               <template v-if="dataType.indexOf('sentence_input_chs')==-1">
                   <template v-if="items.detail.wordsList.length==0">
-                      <p :class="['content-con',items.en?'':'content-con-small']" v-if="items.detail.sentence">{{items.detail.sentence}}</p>
+                      <p :class="['content-con']" v-if="items.detail.sentence">{{items.detail.sentence}}</p>
                   </template>
                   <template v-else>
                       <div class="con-box">
@@ -64,11 +64,6 @@
           </template>
       </li>
     </ul>
-
-                <Soundrecord @handleWav="handleWav" type="mini" class="luyin-box" style="width:64px;border: 1px solid rgba(0, 0, 0, 0.1);border-radius: 8px;padding:0 12px;"/>
-                <Soundrecord @handleWav="handleWav" type="normal" class="luyin-box" style="width:129px;border: 1px solid rgba(0, 0, 0, 0.1);border-radius: 8px;padding:0 12px;"/>
-                <Soundrecord @handleWav="handleWav" type="pro" class="luyin-box" style="width:200px;border: 1px solid rgba(0, 0, 0, 0.1);border-radius: 8px;padding:0 12px;"/>
-                <Soundrecord @handleWav="handleWav" type="promax" class="luyin-box" style="width:280px;border: 1px solid rgba(0, 0, 0, 0.1);border-radius: 8px;padding:0 12px;"/>
   </div>
 </template>
 

+ 182 - 0
src/components/Adult/preview/TextProblem.vue

@@ -0,0 +1,182 @@
+<!--  -->
+<template>
+  <div class="Big-Book-prev-Textdes Textproblem" v-if="curQue">
+      <h2 v-if="curQue.title">{{curQue.title}}</h2>
+      <ul>
+          <li v-for="(item,index) in curQue.option" :key="index">
+              <b v-if="item.number">{{item.number}}.</b>
+              <div class="content-right">
+                  <template v-if="item.detail.wordsList.length>0">
+                      <div class="con-box">
+                          <div :class="['con-item',indexCon===0?'con-item-0':'']" v-for="(itemCon,indexCon) in item.detail.resArr" :key="indexCon" v-show="itemCon.isShow">
+                              <template v-if="item.detail.wordsList[indexCon + 1] && item.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(item.detail.wordsList[indexCon + 1].chs) > -1">
+                                  <div class="synthesis-box">
+                                      <div>
+                                            <span class="pinyin" v-if="item.detail.pyPosition=='top'">{{itemCon.pinyin}}</span>
+                                            <span class="hanzi content-con">{{itemCon.chs}}</span>
+                                            <span class="pinyin" v-if="item.detail.pyPosition=='bottom'">{{itemCon.pinyin}}</span>
+                                        </div>
+                                        <div style="text-align: left">
+                                            <span class="pinyin" v-if="item.detail.pyPosition=='top'">{{item.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                            <span class="hanzi content-con">{{item.detail.wordsList[indexCon + 1].chs}}</span>
+                                            <span class="pinyin" v-if="item.detail.pyPosition=='bottom'">{{item.detail.wordsList[indexCon + 1].pinyin}}</span>
+                                        </div>
+                                  </div>
+                                  
+                              </template>
+                              <template v-else>
+                                    <span class="pinyin" v-if="item.detail.pyPosition=='top'">{{itemCon.pinyin}}</span>
+                                    <span class="hanzi content-con">{{itemCon.chs}}</span>
+                                    <span class="pinyin" v-if="item.detail.pyPosition=='bottom'">{{itemCon.pinyin}}</span>
+                              </template>
+                          </div>
+                      </div>
+                  </template>
+                  <template v-else>
+                      <p class="hanzi content-con">
+                          {{item.detail.sentence}}
+                      </p>
+                  </template>
+                  <span class="english" v-if="item.en">{{item.en}}</span>
+              </div>
+          </li>
+      </ul>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: ["curQue"],
+  data() {
+    return {
+        chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {
+    // 处理数据
+    handleData(){
+        let _this = this
+        let curQue = JSON.parse(JSON.stringify(this.curQue));
+        curQue.option.forEach((dItem, dIndex) => {
+            let paraArr = []
+            dItem.detail.wordsList.forEach((sItem, sIndex) => {
+                this.mergeWordSymbol(dItem.detail.wordsList, sItem, sIndex);
+                let obj = {
+                    pinyin: sItem.pinyin,
+                    chs: sItem.chs,
+                    isShow: sItem.isShow,
+                };
+                paraArr.push(obj);
+            })
+            this.$set(_this.curQue.option[dIndex].detail,'resArr',paraArr)
+        })
+    },
+    //词和标点合一起
+    mergeWordSymbol(sItem, wItem, curIndex) {
+        let leg = sItem.length;
+        if (curIndex < leg - 1) {
+            if (this.chsFhList.indexOf(wItem.chs) > -1) {
+                wItem.isShow = false;
+            } else {
+                wItem.isShow = true;
+            }
+        }
+    },
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+      this.handleData()
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scoped>
+//@import url(); 引入公共css类
+.Textproblem{
+    width: 100%;
+    padding: 8px 24px;
+    background: #F7F7F7;
+    border: 1px solid rgba(0, 0, 0, 0.1);
+    border-radius: 8px;
+    h2{
+        margin: 16px 0 0;
+        font-weight: 500;
+        font-size: 16px;
+        line-height: 24px;
+        color: #000000;
+    }
+    ul{
+        padding-top: 16px;
+        li{
+            display: flex;
+            margin-bottom: 16px;
+            b{
+                color: rgba(0, 0, 0, 0.85);
+                font-size: 16px;
+                line-height: 24px;
+                font-family: 'FZJCGFKTK';
+                margin-right: 4px;
+                font-weight: normal;
+            }
+            .content-right{
+                flex: 1;
+                .content-con{
+                    font-size: 16px;
+                    line-height: 24px;
+                    color: #000000;
+                    font-family: 'FZJCGFKTK';
+                    margin: 0;
+                    &.content-con-small{
+                        font-size: 16px;
+                    }
+                }
+                .con-box{
+                    display: flex;
+                    flex-flow: wrap;
+                    .con-item{
+                        text-align: center;
+                        padding: 0 1px;
+                        &.con-item-0{
+                            text-align: left;
+                            padding-left: 0;
+                        }
+                    }
+                    span{
+                        display: block;
+                    }
+                    .pinyin{
+                        font-family: 'GB-PINYINOK-B';
+                        font-size: 12px;
+                        line-height: 20px;
+                        color: #000000;
+                        height: 20px;
+                    }
+                    .synthesis-box{
+                        display: flex;
+                    }
+                }
+                .english{
+                    color: rgba(0, 0, 0, 0.85);
+                    font-size: 14px;
+                    line-height: 150%;
+                    font-family: 'robot';
+                    display: block;
+                    word-break: break-word;
+                }
+            }
+        }
+    }
+}
+</style>

+ 2 - 1
src/components/Adult/preview/components/Strockplayredline.vue

@@ -48,9 +48,10 @@ export default {
         }
       );
     },
-    playHanzi() {
+    playHanzi(event) {
       let _this = this;
       _this.writer.animateCharacter();
+      event.stopPropagation();
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)