zhongshujie
2024-09-05 5f52ef1659fee6858532c6a9731bd352d2f6fe6f
src/books/artAndDrama/view/components/chapter001.vue
@@ -4,8 +4,7 @@
      <div v-if="showPageList.indexOf(4) > -1">
        <h1 id="a004">
          <img class="img-0" alt="" src="../../assets/images/dy1.jpg" />
          <audio :src="auidoPathOne" controls controlslist="noplaybackrate nodownload" class="audio"
            ></audio>
          <audio :src="auidoPathOne" controls controlslist="noplaybackrate nodownload" class="audio"></audio>
        </h1>
        <div class="bodystyle">
          <div class="bk">
@@ -48,7 +47,8 @@
            ></audio> -->
          </h1>
          <!-- 连线题 -->
          <matching :rawData="rawData" :question="question" class="macthing" :primary-color="color" :bordercolor="'#fff'"></matching>
          <matching :rawData="rawData" :question="question" class="macthing" :primary-color="color"
            :bordercolor="'#fff'"></matching>
          <p class="text">小提示:加点的文字为本句话中的逻辑重音,在朗读发音时请重读。</p>
        </div>
        <p><br /></p>
@@ -64,20 +64,22 @@
        <img src="../../assets/images/page6-header-green.png" alt="" style="height: auto; width: 100%" />
        <div class="bodystyle">
          <h3 class="lefth3" id="c001"><img class="img-gn1" alt="" src="../../assets/images/czysj.jpg" /></h3>
          <choice class="choice" :questions="questions" :primaryColor="accentColor" hoverBackgroundColor="#F58200" hoverColor="white"></choice>
          <choice class="choice" :questions="questions" :primaryColor="accentColor" hoverBackgroundColor="#F58200"
            hoverColor="white"></choice>
          <p class="center openImgBox">
            <img class="img-e" alt="" src="../../assets/images/1-2蚂蚁举大树.gif" />
          </p><p class="center text">
          </p>
          <p class="center text">
            <video :src="videoPathOne" webkit-playsinline="true" x-webkit-airplay="true" playsinline="true"
              x5-video-orientation="h5" x5-video-player-fullscreen="true" x5-playsinline="" controls
              controlslist="nodownload" class="w100 video "
              controlslist="nodownload" class="w100 video"
              style="margin-top: 40px; border-radius: 10px; border: 2px solid green;"></video>
          </p>
          <p class="center videoname">
            <span>视频:我们是一家人 </span>
            <el-tooltip class="item" effect="dark" :content="chapterData.isCollectVideo ? '点击取消' : '点击收藏'"
              placement="top-start">
              <img :src="chapterData.isCollectVideo ? collectCheck : collectImg" alt="" class="collect-btn"
              <img :src="collectResourceList.findIndex(item => item.id == '691cbd2c13198d04afc7800d0f2cafb0') > -1 ? collectCheck : collectImg" alt="" class="collect-btn"
                @click="handleCollect('video')" />
            </el-tooltip>
          </p>
@@ -103,8 +105,7 @@
          <p class="text">
            <span class="hs1">◇</span>请将以下课文选段大声朗诵出来,加点的字请重读。
          </p>
          <h1><audio :src="auidoPathThree" controls controlslist="noplaybackrate nodownload" class="audio"
              ></audio></h1>
          <h1><audio :src="auidoPathThree" controls controlslist="noplaybackrate nodownload" class="audio"></audio></h1>
          <div class="bj3">
            <p class="center">
              <span class="hs">春<a id="w1"><sup>1</sup></a>(节选)</span>
@@ -153,8 +154,7 @@
          <h1 class="lefth3 openImgBox" id="c005">
            <img class="img-gn1" alt="" src="../../assets/images/1-3.gif" style="height: auto; width: 50%" />
          </h1>
          <h1><audio :src="auidoPathFour" controls controlslist="noplaybackrate nodownload" class="audio"
             ></audio></h1>
          <h1><audio :src="auidoPathFour" controls controlslist="noplaybackrate nodownload" class="audio"></audio></h1>
          <div class="bj3">
            <p class="center">
              <span class="hs">春<a id="w1"></a><sup>1</sup>(节选)</span>
@@ -200,12 +200,17 @@
            <span
              class="hs1">◇</span>生活中,我们总会遇到各种各样的诱惑。面对诱惑时,我们的内心常常会有两个不同的声音出现:一个声音要求我们严于律己,另一个声音要求我们随心所欲。请你分析一下,当蚂蚁队长面对掉落的奶酪渣的诱惑时,他内心的两个声音会说些什么呢?
          </p>
          <p class="text">正义队长:“
            <input v-model="questionData.warnUp.one" class="input-bottom-border input-w-60"
              @change="setBookQuestion" />。”
          <p class="text t-l">正义队长:
            <textarea v-model="questionData.reading.one" placeholder="请输入内容" rows="6"
              style="margin-left: 40px; width: 92%" class="" @change="setBookQuestion"
              :class="{ 'textarea-focused': isFocused === 'one' }" @focus="handleFocus('one')"
              @blur="handleBlur('one')"></textarea>
          </p>
          <p class="text">黑暗队长:“ <input v-model="questionData.warnUp.two" class="input-bottom-border input-w-60"
              @change="setBookQuestion" />。”
          <p class="text t-l">黑暗队长:
            <textarea v-model="questionData.reading.two" placeholder="请输入内容" rows="6"
              style="margin-left: 40px; width: 92%" class="" @change="setBookQuestion"
              :class="{ 'textarea-focused': isFocused === 'two' }" @focus="handleFocus('two')"
              @blur="handleBlur('two')"></textarea>
          </p>
        </div>
        <!-- 此次为页脚部分(需要设置页码) -->
@@ -229,8 +234,7 @@
            <span class="hs1">◇</span>请将以下课文选段大声朗诵出来,加点的字请重读。
          </p>
          <h1>
            <audio :src="auidoPathFive" controls controlslist="noplaybackrate nodownload" class="audio"
             ></audio>
            <audio :src="auidoPathFive" controls controlslist="noplaybackrate nodownload" class="audio"></audio>
          </h1>
          <div class="bj3">
@@ -251,12 +255,12 @@
            <span class="hs1">◇</span>假如你是搬运奶酪的蚂蚁,你要怎么搬运不同形状、大小的奶酪呢?请先为自己设计一个剧本吧:
          </p>
          <p class="text">
            我是蚂蚁 <input v-model="questionData.warnUp.three" class="input-bottom-border fz-18" style=" width: 10%;"
            我是蚂蚁 <input v-model="questionData.warnUp.one" class="input-bottom-border fz-18" style=" width: 13%;"
              @change="setBookQuestion" />(名字),今天是
            <input v-model="questionData.warnUp.four" class="input-bottom-border fz-18" style=" width: 10%;"
              @change="setBookQuestion" />(天气),我的奶酪特别 <input v-model="questionData.warnUp.five"
              class="input-bottom-border fz-18" style=" width: 10%;" @change="setBookQuestion" />(轻/重),我感觉好 <input
              v-model="questionData.warnUp.six" class="input-bottom-border fz-18" style=" width: 10%;"
            <input v-model="questionData.warnUp.two" class="input-bottom-border fz-18" style=" width: 13%;"
              @change="setBookQuestion" />(天气),我的奶酪特别 <input v-model="questionData.warnUp.three"
              class="input-bottom-border fz-18" style=" width: 13%;" @change="setBookQuestion" />(轻/重),我感觉好 <input
              v-model="questionData.warnUp.four" class="input-bottom-border fz-18" style=" width: 13%;"
              @change="setBookQuestion" />(身体感觉)啊!
          </p>
          <hr style="margin-left: 9%; width: 20%;" />
@@ -307,25 +311,25 @@
          </h3>
          <p class="text ends">
            <span><span class="hs1">◇</span>放大缩小</span>
            <span> <audio :src="auidoPathSex" controls controlslist="noplaybackrate nodownload" class="audio"
           ></audio> </span>
          </p>
            <span> <audio :src="auidoPathSex" controls controlslist="noplaybackrate nodownload" class="audio"></audio>
            </span>
          </p>
          <p class="text">
            请你交替“放大”和“缩小”五官。在“放大”时,想象五官要飞到外太空;在“缩小”时,想象五官全部缩小到了鼻尖上。
          </p>
          <p class="text ends">
            <span><span class="hs1">◇</span>提升苹果肌</span>
            <span><audio :src="auidoPathSeven" controls controlslist="noplaybackrate nodownload" class="audio"
              ></audio> </span>
            <span><audio :src="auidoPathSeven" controls controlslist="noplaybackrate nodownload" class="audio"></audio>
            </span>
          </p>
          <p class="text">
            想象你在一个陌生的地方,谁都不认识,突然遇见了好朋友,你很高兴,上前和他/她打招呼。做一做你此时的表情吧。
          </p>
          <p class="text ends">
            <span><span class="hs1">◇</span>微笑说“ang”</span>
            <span><audio :src="auidoPathEight" controls controlslist="noplaybackrate nodownload" class="audio"
             ></audio></span>
            <span><audio :src="auidoPathEight" controls controlslist="noplaybackrate nodownload"
                class="audio"></audio></span>
          </p>
          <p class="text">
            请你试一试在提升苹果肌的基础上,发出“ang”的音。声音要尽可能拉长、保持稳定,并向远送。
@@ -333,9 +337,9 @@
          <p class="text ends">
            <span style="text-wrap: nowrap"><span class="hs1">◇</span>向远山喊“阿毛”</span>
            <span style="margin-left: -4%;"><audio :src="auidoPathNine" controls controlslist="noplaybackrate nodownload" class="audio"
              ></audio></span>
            <span style="margin-left: -4%;"><audio :src="auidoPathNine" controls
                controlslist="noplaybackrate nodownload" class="audio"></audio></span>
          </p>
          <p class="text">
            想象自己站在一座高山上,好朋友“阿毛”站在对面的高山上,你要如何喊他呢?
@@ -365,14 +369,14 @@
          <p class="center text">
            <video :src="videoPathOne" webkit-playsinline="true" x-webkit-airplay="true" playsinline="true"
              x5-video-orientation="h5" x5-video-player-fullscreen="true" x5-playsinline="" controls
              controlslist="nodownload" class="w100 video"
              controlslist="nodownload" class="w100 video"
              style="margin-top: 40px; border-radius: 10px; border: 2px solid green;"></video>
          </p>
          <p class="center videoname">
            <span>视频:我们是一家人 </span>
            <el-tooltip class="item" effect="dark" :content="chapterData.isCollectVideo ? '点击取消' : '点击收藏'"
              placement="top-start">
              <img :src="chapterData.isCollectVideo ? collectCheck : collectImg" alt="" class="collect-btn"
              <img :src="collectResourceList.findIndex(item => item.id == '691cbd2c13198d04afc7800d0f2cafb0') > -1 ? collectCheck : collectImg" alt="" class="collect-btn"
                @click="handleCollect('video')" />
            </el-tooltip>
          </p>
@@ -391,6 +395,7 @@
import matching from "@/components/matching/matching.vue";
import choice from "@/components/choice/choice.vue"
import { getResourcePath } from "@/assets/methods/resources";
import { getCollectResource, setCollectResource } from "@/assets/methods/resources";
export default {
  name: "chapterOne",
  components: {
@@ -403,12 +408,18 @@
    },
  },
  //在这里对调用的方法进行挂载
  mounted() {
    this.getVidoePath();
  async mounted() {
    const bookQuestion = localStorage.getItem("artAndDrama-book-question-one");
    if (bookQuestion) {
      this.questionData = JSON.parse(bookQuestion);
    }
    this.getVidoePath();
    const data = localStorage.getItem("artAndDrama-chapter01-Data");
    if (data) {
      this.chapterData = JSON.parse(data);
    }
    this.collectResourceList = await getCollectResource(this.config.activeBook.bookId)
  },
  data() {
    return {
@@ -417,15 +428,17 @@
      videoPathOne: "",
      auidoPathOne: "",
      auidoPathTwo: "",
      auidoPathThree:"",
      auidoPathThree: "",
      auidoPathFour: "",
      auidoPathFive: "",
      auidoPathSex: "",
      auidoPathSeven: "",
      auidoPathEight: "",
      auidoPathNine: "",
      accentColor:"",
      color:"#fff",
      accentColor: "",
      color: "#fff",
      isFocused: null, // 用于跟踪textarea的聚焦状态
      collectResourceList:[],
      chapterData: {
        isCollectImg: false,
        isCollectVideo: false,
@@ -549,7 +562,7 @@
      questions: [
        {
          analysisCon: "undefined",
          answer: ['A','B'],
          answer: ['A', 'B'],
          difficulty: 0,
          id: 1,
          isCollect: false,
@@ -680,10 +693,6 @@
          two: "",
          three: "",
          four: "",
          five: "",
          six: "",
          seven: "",
          enight: "",
        },
        reading: {
          one: "",
@@ -729,7 +738,7 @@
      );
      this.auidoPathSeven = await getResourcePath(
        "27fcd83f77a10ecbf97970863e2653c3"
      );
      );
      this.auidoPathEight = await getResourcePath(
        "3d7f52cc80f8ed8994a046b418399116"
      );
@@ -737,8 +746,13 @@
        "3729175530def1b0baca68e0bd344862"
      );
    },
    handleFocus(id) {
      this.isFocused = id; // 当textarea聚焦时,设置为true
    },
    handleBlur(id) {
      this.isFocused = null; // 当textarea失去焦点时,设置为false
    },
    setBookQuestion() {
      console.log("保存");
      localStorage.setItem(
        "artAndDrama-book-question-one",
        JSON.stringify(this.questionData)
@@ -746,18 +760,34 @@
    },
    handleChapterData() {
      localStorage.setItem(
        "math-chapterData",
        "artAndDrama-chapter01-Data",
        JSON.stringify(this.chapterData)
      );
    },
    handleCollect(type) {
      if (type == "img") {
        this.chapterData.isCollectImg = !this.chapterData.isCollectImg;
      } else if (type == "video") {
        this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo;
      }
      if (type == "video") {
        this.handleCollectResource("691cbd2c13198d04afc7800d0f2cafb0","691cbd2c13198d04afc7800d0f2cafb0",'',"视频","bits",'视频:我们是一家人')
      }
      this.handleChapterData();
    },
    //资源收藏事件
    handleCollectResource(id, md5, resourcePath, resourceType, source, resourceName) {
      let list = this.collectResourceList
      if (list.findIndex(item => item.id == id) > -1) {
        list = list.filter(item => item.id != id)
      } else {
        list.push({
          id,
          md5,
          resourcePath,
          resourceType,
          source,
          resourceName,
        })
      }
      this.collectResourceList = list
      setCollectResource(this.config.activeBook.bookId, this.collectResourceList)
    }
  },
};
</script>
@@ -766,7 +796,8 @@
.w70 {
  width: 78%;
}
.choice{
.choice {
  border: 1px solid green;
  border-radius: 10px;
  padding: 0 10px;
@@ -774,6 +805,7 @@
  font-family: "STkaiti";
  font-size: 19px;
}
.fw-400 {
  font-weight: 400 !important;
}