Pārlūkot izejas kodu

Merge branch 'NPC-lhd'

natasha 3 gadi atpakaļ
vecāks
revīzija
5047099b5d

BIN
src/assets/NPC/tone0.png


BIN
src/assets/NPC/tone1.png


BIN
src/assets/NPC/tone2.png


BIN
src/assets/NPC/tone3.png


BIN
src/assets/NPC/tone4.png


+ 24 - 15
src/components/Adult/Preview.vue

@@ -29,28 +29,28 @@
               :key="indexss"
             >
               <template v-if="itemss.data">
-                <template v-if="itemss.data.type == 'ligature'">
+                <template v-if="itemss.type == 'ligature'">
                   <Ligature :curQue="itemss.que" />
                 </template>
-                <template v-if="itemss.data.type == 'image_chs'">
+                <template v-if="itemss.type == 'image_chs'">
                   <Picture :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'record_chs'">
+                <template v-if="itemss.type == 'record_chs'">
                   <Record :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'phrase_chs'">
+                <template v-if="itemss.type == 'phrase_chs'">
                   <WordPhrase :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'NewWord_chs'">
+                <template v-if="itemss.type == 'NewWord_chs'">
                   <WordPhrase :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'annotation_chs'">
+                <template v-if="itemss.type == 'annotation_chs'">
                   <WordPhrase :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'notes_chs'">
+                <template v-if="itemss.type == 'notes_chs'">
                   <Notes :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'article_chs'">
+                <template v-if="itemss.type == 'article_chs'">
                   <ArticleTemChs
                     :curQue="itemss.data"
                     :NNPENewWordList="NNPENewWordList"
@@ -58,21 +58,27 @@
                     :NNPEAnnotationList="NNPEAnnotationList"
                   />
                 </template>
-                <template v-if="itemss.data.type == 'sentence_segword_chs'">
+                <template v-if="itemss.type == 'sentence_segword_chs'">
                   <SentenceSegWordViewChs :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'input_record_chs'">
+                <template v-if="itemss.type == 'input_record_chs'">
                   <InputHasRecord :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'recordHZ_inputPY_chs'">
+                <template v-if="itemss.type == 'recordHZ_inputPY_chs'">
                   <TextInputRecord :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'inputItem_chs'">
+                <template v-if="itemss.type == 'inputItem_chs'||itemss.type == 'sentence_input_chs'||itemss.type == 'sentence_judge_chs'">
                   <SentenceInput :curQue="itemss.data" />
                 </template>
-                <template v-if="itemss.data.type == 'NumberCombination_chs'">
+                <template v-if="itemss.type == 'NumberCombination_chs'">
                   <NumberSelectHasRecord :curQue="itemss.data" />
                 </template>
+                <template v-if="itemss.type == 'toneSelect_chs'">
+                  <SelectTone :curQue="itemss.data" />
+                </template>
+                <template v-if="itemss.type == 'sudoku_chs'">
+                  <Soduko :curQue="itemss.data" />
+                </template>
               </template>
             </div>
           </div>
@@ -95,6 +101,8 @@ import InputHasRecord from "./preview/InputHasRecord.vue"; // 输入加录音
 import TextInputRecord from "./preview/TextInputRecord.vue"; // 文本+输入+录音
 import SentenceInput from "./preview/SentenceInput.vue"; // 输入选项
 import NumberSelectHasRecord from "./preview/NumberSelectHasRecord.vue" // 数字组合
+import SelectTone from './preview/SelectTone.vue' // 选择声调
+import Soduko from './preview/Soduko.vue' // 数独
 export default {
   name: "preview",
   components: {
@@ -110,6 +118,8 @@ export default {
     TextInputRecord,
     SentenceInput,
     NumberSelectHasRecord,
+    SelectTone,
+    Soduko,
   },
   props: ["context", "fatherName"],
   data() {
@@ -281,10 +291,9 @@ export default {
     .NNPE-tableList {
       background: #fff;
       border-radius: 8px;
-      padding: 0;
+      padding: 12px 8px;
       &.NNPE-tableList-hasBg {
         background: #f3f3f3;
-        padding: 12px 8px;
       }
       .NNPE-tableList-tr {
         display: flex;

+ 1 - 1
src/components/Adult/preview/Picture.vue

@@ -17,7 +17,7 @@
                 <template v-if="curQue.ChildType!='image_gdcy'">
                     <p v-if="items.hanzi">{{items.hanzi}}</p>
                 </template>
-                <template v-if="curQue.ChildType=='image_input'||curQue.ChildType=='image_input_three'">
+                <template v-if="curQue.ChildType=='image_input'||curQue.ChildType=='image_input_three'||curQue.ChildType=='image_wordInput'">
                     <input class="singleInput" v-model="userAnswer.input" placeholder="输入" @blur="handleInput('input')">
                 </template>
                 <!-- <input class="singleInput" placeholder="输入" @blur="handleInput(index,indexs)" v-if="fn_list_obj[index]&&fn_list_obj[index].indexOf('input')>-1"> -->

+ 122 - 0
src/components/Adult/preview/SelectTone.vue

@@ -0,0 +1,122 @@
+<!--  -->
+<template>
+  <div class="Big-Book-prev-Textdes SelectTone" v-if="curQue">
+      <ul>
+          <li v-for="(item,index) in curQue.option" :key="index">
+              <Audio
+                    :mp3="
+                    item.mp3_list.length > 0 ? item.mp3_list[0].url : ''"
+                    class="audio-play"
+                />
+                <div v-html="item.con" class="con"></div>
+                <a v-for="(itmes,indexs) in toneList" :key="indexs" :class="['tone-item',userSelect[index]===indexs?'active':'']" @click="handleClick(index,indexs)">
+                    <img :src="itmes">
+                </a>
+          </li>
+      </ul>
+  </div>
+</template>
+
+<script>
+import Audio from "../preview/components/AudioRed.vue"; // 音频播放
+export default {
+  components: {Audio},
+  props: ["curQue"],
+  data() {
+    return {
+        toneList: [
+            require('../../../assets/NPC/tone1.png'),
+            require('../../../assets/NPC/tone2.png'),
+            require('../../../assets/NPC/tone3.png'),
+            require('../../../assets/NPC/tone4.png'),
+            require('../../../assets/NPC/tone0.png')
+        ],
+        userSelect:[]
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {
+      // 处理数据
+      handleData(){
+          let _this = this
+          _this.userSelect = []
+          _this.curQue.option.forEach(item => {
+              _this.userSelect.push('')
+          });
+      },
+      handleClick(index,indexs){
+          this.$set(this.userSelect,index,indexs)
+      }
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scoped>
+//@import url(); 引入公共css类
+.Big-Book-prev-Textdes{
+    ul{
+        display: flex;
+        flex-flow: wrap;
+        justify-content: space-between;
+        align-items: flex-start;
+        li{
+            width: 363px;
+            background: #FFFFFF;
+            border: 1px solid rgba(0, 0, 0, 0.1);
+            box-sizing: border-box;
+            border-radius: 8px;
+            display: flex;
+            align-items: center;
+            padding: 8px 12px;
+            margin: 8px 0;
+            .audio-play{
+                width: 24px;
+                margin-right: 8px;
+            }
+            >div.con{
+                font-size: 16px;
+                line-height: 1.5;
+                flex: 1;
+                margin: 0;
+            }
+            a{
+                margin-left: 8px;
+                &.active{
+                    background: #98D1EB;
+                    border-radius: 4px;
+                }
+                img{
+                    width: 24px;
+                }
+            }
+        }
+    }
+}
+</style>
+<style lang="scss">
+.SelectTone.Big-Book-prev-Textdes{
+    ul{
+        li{
+            div.con{
+                margin: 0 ;
+                >p{
+                    margin: 0;
+                }
+            }
+        }
+    }
+}
+</style>

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

@@ -133,7 +133,7 @@ export default {
             box-sizing: border-box;
             border-radius: 8px;
             display: flex;
-            align-items: flex-start;
+            align-items: center;
             padding: 8px 12px;
             margin-bottom: 8px;
             >b{

+ 123 - 0
src/components/Adult/preview/Soduko.vue

@@ -0,0 +1,123 @@
+<!--  -->
+<template>
+  <div class="Big-Book-prev-Textdes Sudoku" v-if="curQue">
+      <div class="item-box">
+          <div :class="['item']" v-for="(item,index) in curQue.option" :key="index">
+              <div v-for="(items,indexs) in item" :key="indexs" :class="[indexs%3==2?'noBorder':'',indexs>5?'noBorder-bottom':'']">
+                  <span v-if="items.isHint">
+                      {{items.value}}
+                  </span>
+                  <input v-else v-model="soduko[index][indexs]" maxlength="1" @input="changeNumber(soduko[index][indexs],index,indexs)" @blur="handleCheck(index,indexs)">
+              </div>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: ["curQue"],
+  data() {
+    return {
+        soduko:[]
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {
+      // 处理数据
+      handleData(){
+          let _this = this
+          _this.soduko = []
+          _this.curQue.option.forEach(item => {
+              let arr = []
+              item.forEach(items=>{
+                  if(items.isHint){
+                      arr.push(items.value)
+                  }else{
+                      arr.push('')
+                  }
+              })
+              _this.soduko.push(arr)
+          });
+      },
+      changeNumber(item,index,indexs) {
+          let value = item.replace(/[^\d]/g, "")
+          this.$set(this.soduko[index],indexs,value)
+      },
+      // 校验输入内容是否已有
+      handleCheck(index,indexs){
+          
+      },
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+      this.handleData()
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scoped>
+//@import url(); 引入公共css类
+.Big-Book-prev-Textdes{
+    .item-box{
+        display: flex;
+        flex-flow: wrap;
+        width: 544px;
+        border-bottom: 1px solid #484848;
+        border-right: 1px solid #484848;
+        .item{
+            display: flex;
+            flex-flow: wrap;
+            width: 181px;
+            height: 181px;
+            border-top: 1px solid #484848;
+            border-left: 1px solid #484848;
+            box-sizing: border-box;
+            div{
+                width: 60px;
+                height: 60px;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                border-bottom: 1px solid #D1D1D1;
+                border-right: 1px solid #D1D1D1;
+                box-sizing: border-box;
+                &.noBorder{
+                    border-right: none;
+                }
+                &.noBorder-bottom{
+                    border-bottom: none;
+                }
+                span{
+                    font-size: 20px;
+                    line-height: 150%;
+                    color: #32A5D8;
+                    font-family: 'robot';
+                }
+                input{
+                    width: 100%;
+                    height: 100%;
+                    border: none;
+                    outline: none;
+                    text-align: center;
+                    color: #000000;
+                    font-size: 20px;
+                    font-weight: 500;
+                    font-family: 'robot';
+                }
+            }
+        }
+    }
+}
+</style>

+ 1 - 1
src/components/Adult/preview/Soundrecord.vue

@@ -383,7 +383,7 @@ export default {
   .record-delete {
     width: 24px;
     height: 24px;
-    margin-left: 4px;
+    // margin-left: 4px;
     background: url("../../../assets/newImage/common/luyin-delete.png") center
       no-repeat;
     background-size: 100%;

+ 1 - 0
src/components/Adult/preview/TextInputRecord.vue

@@ -115,6 +115,7 @@ export default {
             }
             input{
                 flex: 1;
+                min-width: 150px;
                 border: 1px solid rgba(0, 0, 0, 0.15);
                 box-sizing: border-box;
                 border-radius: 8px;