瀏覽代碼

教材添加主题色

natasha 3 年之前
父節點
當前提交
404a7179b0

+ 5 - 0
src/components/Adult/Preview.vue

@@ -104,6 +104,9 @@
                 <template v-if="itemss.type == 'newWord_preview_chs'">
                   <NewWordShow :curQue="itemss.data" />
                 </template>
+                <template v-if="itemss.type == 'listen_record_single_syllable_chs'">
+                  <SelectYinjie :curQue="itemss.data" />
+                </template>
               </template>
             </div>
           </div>
@@ -132,6 +135,7 @@ import Soduko from './preview/Soduko.vue' // 数独
 import Single from './preview/Single.vue' // 单选
 import TextProblem from './preview/TextProblem.vue' // 课文上方的问题 
 import NewWordShow from './preview/NewWordShow.vue' // 生字展示
+import SelectYinjie from './preview/SelectYinjie.vue' // 选择音节
 export default {
   name: "preview",
   components: {
@@ -153,6 +157,7 @@ export default {
     Single,
     TextProblem,
     NewWordShow,
+    SelectYinjie,
   },
   props: ["context", "fatherName"],
   data() {

+ 21 - 16
src/components/Adult/preview/NewWordShow.vue

@@ -6,22 +6,27 @@
               <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 v-if="item.con">
+                            <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="">111</div>
+                      </template>
                 </template>
                 <template v-else>
                     <div class="img-box" v-for="(imgItem,imgIndex) in item.img_list" :key="imgIndex">

+ 91 - 5
src/components/Adult/preview/SelectYinjie.vue

@@ -1,12 +1,16 @@
 <!--  -->
 <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 class="item-box" v-for="(item,index) in curQue" :key="index">
           <Audio
-                :mp3="
-                item.mp3_list.length > 0 ? item.mp3_list[0].url : ''"
+                :mp3="item.mp3_list.length > 0 ? item.mp3_list[0].url : ''"
                 class="audio-play"
             />
+          <b v-if="item.number">{{item.number}}</b>
+          <div class="zijie-box">
+              <p :class="[userList[index].indexOf(indexs)>-1?'active':'']" v-for="(items,indexs) in item.option" :key="indexs" @click="handleClick(index,indexs)">{{items.pinyin}}</p>
+          </div>
+          <a :class="['clear-btn',userList[index].length>0?'active':'']" @click="handleClear(index)"></a>
       </div>
   </div>
 </template>
@@ -18,17 +22,33 @@ export default {
   props: ["curQue"],
   data() {
     return {
-        
+        userList:[]
     };
   },
   computed: {},
   watch: {},
   //方法集合
   methods: {
-    
+    handleData(){
+        let _this = this
+        this.curQue.forEach(item => {
+            _this.userList.push([])
+        });
+    },
+    handleClick(index,indexs){
+        if (this.userList[index].indexOf(indexs) > -1) {
+            this.userList[index].splice(this.userList[index].indexOf(indexs), 1)
+        } else {
+            this.userList[index].push(indexs)
+        }
+    },
+    handleClear(index){
+        this.$set(this.userList,index,[])
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
+      this.handleData()
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},
@@ -43,5 +63,71 @@ export default {
 </script>
 <style lang='scss' scoped>
 //@import url(); 引入公共css类
+.SelectYinjie{
+    width: 100%;
+    background: #F7F7F7;
+    border: 1px solid rgba(0, 0, 0, 0.1);
+    box-sizing: border-box;
+    border-radius: 8px;
+    padding: 24px;
+    .item-box{
+        display: flex;
+        align-items: center;
+        background: #FFFFFF;
+        padding: 4px 8px;
+        border: 1px solid rgba(0, 0, 0, 0.1);
+        border-radius: 8px;
+        margin-bottom: 8px;
+        .audio-play{
+            width: 24px;
+            margin-right: 4px;
+        }
+        b{
+            background: #DE4444;
+            text-align: center;
+            width: 16px;
+            height: 16px;
+            color: #FFFFFF;
+            border-radius: 50%;
+            font-size: 12px;
+            font-family: 'robot';
+            line-height: 16px;
+        }
+        .zijie-box{
+            flex: 1;
+            display: flex;
+            padding: 0 4px;
+            flex-flow: wrap;
+            p{
+                margin: 4px;
+                font-size: 14px;
+                line-height: 22px;
+                color: rgba(0, 0, 0, 0.85);
+                min-width: 56px;
+                padding: 4px 12px;
+                border-radius: 4px;
+                border: 1px solid rgba(0, 0, 0, 0.1);
+                text-align: center;
+                cursor: pointer;
+                font-family: 'GB-PINYINOK-B';
+                &.active{
+                   background: #DE4444; 
+                   color: #FFFFFF;
+                }
+            }
+        }
+        .clear-btn{
+            width: 16px;
+            height: 16px;
+            background: url('../../../assets/icon/Undofill-16-disable-Black.png') center no-repeat;
+            background-size: 100%;
+            &.active{
+                background: url('../../../assets/icon/Undofill-16-normal-Black.png') center no-repeat;
+                background-size: 100%;
+            }
+        }
+    }
+
+}
 
 </style>

+ 14 - 0
src/views/courseList.vue

@@ -292,6 +292,17 @@
             >所有用户可见</el-radio
           >
         </el-form-item>
+        <el-form-item label="主题颜色" label-width="90px" prop="theme_color">
+          <el-radio label="red" v-model="formDialog.theme_color"
+            >红色</el-radio
+          >
+          <el-radio label="yellow" v-model="formDialog.theme_color"
+            >黄色</el-radio
+          >
+          <el-radio label="blue" v-model="formDialog.theme_color"
+            >蓝色</el-radio
+          >
+        </el-form-item>
         <el-form-item label="教材图片" label-width="90px" prop="fileList">
           <el-upload
             :action="url"
@@ -383,6 +394,7 @@ export default {
         picture_id: "",
         id: "",
         publisher: "",
+        theme_color:''
       },
       agencyList: [
         {
@@ -548,6 +560,7 @@ export default {
         picture_id: "",
         id: "",
         publisher: "",
+        theme_color:''
       };
       this.agency = "";
       this.fileList = [];
@@ -779,6 +792,7 @@ export default {
             name_english: res.name_english,
             publish_number: res.publish_number,
             publisher: res.publisher,
+            theme_color: res.theme_color,
             edition: res.edition,
           };
           if (res.picture_url) {