|
@@ -1,64 +1,65 @@
|
|
<!-- 单词区 && 音标区:最多15位,超过隐藏-->
|
|
<!-- 单词区 && 音标区:最多15位,超过隐藏-->
|
|
<!-- 单音节最长:swimming 多音节最长:transportation -->
|
|
<!-- 单音节最长:swimming 多音节最长:transportation -->
|
|
<template>
|
|
<template>
|
|
-<view class="ezy-tab-border">
|
|
|
|
- <!-- 显示区 -->
|
|
|
|
- <selectTypesVue activeSelect="5"></selectTypesVue>
|
|
|
|
- <view class="ezy-border-body">
|
|
|
|
- <view class="words-bei-box">
|
|
|
|
- <!-- 输入区 -->
|
|
|
|
- <input class="words-answer-box" placeholder="请输入答案" v-model.trim="data.answer" readonly :class="{'words-answer-right-box': data.result&&data.result!=null, 'words-answer-error-box': !data.result&&data.result!=null}" />
|
|
|
|
- <!-- 清空按钮 -->
|
|
|
|
- <view class="clean-btn" @click="handleReset('all')" v-if="data.answer.length"></view>
|
|
|
|
- <view class="bei-body-box">
|
|
|
|
- <!-- 解释区 -->
|
|
|
|
- <view class="pin-words-explain-box">
|
|
|
|
- <view class="words-explain-item" v-for="item in activeWord.jianyi" :key="item">{{item}}</view>
|
|
|
|
|
|
+ <view class="ezy-tab-border">
|
|
|
|
+ <!-- 显示区 -->
|
|
|
|
+ <selectTypesVue activeSelect="5"></selectTypesVue>
|
|
|
|
+ <view class="ezy-border-body">
|
|
|
|
+ <view class="words-bei-box">
|
|
|
|
+ <!-- 输入区 -->
|
|
|
|
+ <input class="words-answer-box" placeholder="请输入答案" v-model.trim="data.answer" readonly
|
|
|
|
+ :class="{'words-answer-right-box': data.result&&data.result!=null, 'words-answer-error-box': !data.result&&data.result!=null}" />
|
|
|
|
+ <!-- 清空按钮 -->
|
|
|
|
+ <view class="clean-btn" @click="handleReset('all')" v-if="data.answer.length"></view>
|
|
|
|
+ <view class="bei-body-box">
|
|
|
|
+ <!-- 解释区 -->
|
|
|
|
+ <view class="pin-words-explain-box">
|
|
|
|
+ <view class="words-explain-item" v-for="item in activeWord.jianyi" :key="item">{{item}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- 播放和待播 -->
|
|
|
|
+ <audioOneVue :active-word="activeWord" @play-audio="handlePlay"></audioOneVue>
|
|
</view>
|
|
</view>
|
|
- <!-- 播放和待播 -->
|
|
|
|
- <audioOneVue :active-word="activeWord" @play-audio="handlePlay"></audioOneVue>
|
|
|
|
- </view>
|
|
|
|
- <!-- 浮层输入区 -->
|
|
|
|
- <view class="words-keyboard-box">
|
|
|
|
- <view class="keyboard-row">
|
|
|
|
- <btnTxtVue @text-select="handleSelect('a')">a</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('b')">b</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('c')">c</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('d')">d</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('e')">e</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('f')">f</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('g')">g</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('h')">h</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('i')">i</btnTxtVue>
|
|
|
|
|
|
+ <!-- 浮层输入区 -->
|
|
|
|
+ <view class="words-keyboard-box">
|
|
|
|
+ <view class="keyboard-row">
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('a')">a</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('b')">b</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('c')">c</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('d')">d</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('e')">e</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('f')">f</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('g')">g</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('h')">h</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('i')">i</btnTxtVue>
|
|
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view class="keyboard-row">
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('j')">j</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('k')">k</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('l')">l</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('m')">m</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('n')">n</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('o')">o</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('p')">p</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('q')">q</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('r')">r</btnTxtVue>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="keyboard-row">
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('s')">s</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('t')">t</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('u')">u</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('v')">v</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('w')">w</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('x')">x</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('y')">y</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleSelect('z')">z</btnTxtVue>
|
|
|
|
+ <btnTxtVue @text-select="handleReset" class="del-btn"></btnTxtVue>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="bei-confirm-btn" @click="checkIsRight"></view>
|
|
</view>
|
|
</view>
|
|
- <view class="keyboard-row">
|
|
|
|
- <btnTxtVue @text-select="handleSelect('j')">j</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('k')">k</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('l')">l</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('m')">m</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('n')">n</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('o')">o</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('p')">p</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('q')">q</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('r')">r</btnTxtVue>
|
|
|
|
- </view>
|
|
|
|
- <view class="keyboard-row">
|
|
|
|
- <btnTxtVue @text-select="handleSelect('s')">s</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('t')">t</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('u')">u</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('v')">v</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('w')">w</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('x')">x</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('y')">y</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleSelect('z')">z</btnTxtVue>
|
|
|
|
- <btnTxtVue @text-select="handleReset" class="del-btn"></btnTxtVue>
|
|
|
|
- </view>
|
|
|
|
- <view class="bei-confirm-btn" @click="checkIsRight"></view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-</view>
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -80,12 +81,14 @@
|
|
onLoad
|
|
onLoad
|
|
} from "@dcloudio/uni-app"
|
|
} from "@dcloudio/uni-app"
|
|
import cacheManager from '@/utils/cacheManager';
|
|
import cacheManager from '@/utils/cacheManager';
|
|
- import {resultAudioPlayer} from "./useAudioRightWrong"
|
|
|
|
|
|
+ import {
|
|
|
|
+ resultAudioPlayer
|
|
|
|
+ } from "./useAudioRightWrong"
|
|
|
|
|
|
- const resultAudioPlayerD = new resultAudioPlayer();
|
|
|
|
|
|
+ const resultAudioPlayerD = new resultAudioPlayer();
|
|
|
|
|
|
const userCode = getUserIdentity();
|
|
const userCode = getUserIdentity();
|
|
-
|
|
|
|
|
|
+
|
|
const emits = defineEmits(['play-audio'])
|
|
const emits = defineEmits(['play-audio'])
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -96,7 +99,7 @@
|
|
type: Array
|
|
type: Array
|
|
},
|
|
},
|
|
pageData: {
|
|
pageData: {
|
|
- type:Object
|
|
|
|
|
|
+ type: Object
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -117,25 +120,25 @@
|
|
function checkIsRight() {
|
|
function checkIsRight() {
|
|
if (data.answer == props.activeWord.name) {
|
|
if (data.answer == props.activeWord.name) {
|
|
data.result = true;
|
|
data.result = true;
|
|
- resultAudioPlayerD.play('right','bei')
|
|
|
|
|
|
+ resultAudioPlayerD.play('right', 'bei')
|
|
noticeBackDb()
|
|
noticeBackDb()
|
|
} else {
|
|
} else {
|
|
data.result = false;
|
|
data.result = false;
|
|
- resultAudioPlayerD.play('wrong','bei')
|
|
|
|
|
|
+ resultAudioPlayerD.play('wrong', 'bei')
|
|
}
|
|
}
|
|
noticeBackComplete()
|
|
noticeBackComplete()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
function noticeBackComplete() {
|
|
function noticeBackComplete() {
|
|
// 通知后台已学完当前单词
|
|
// 通知后台已学完当前单词
|
|
if (userCode == 'Visitor') {
|
|
if (userCode == 'Visitor') {
|
|
// 游客不更新后台
|
|
// 游客不更新后台
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (props.pageData.jieId == 0) {
|
|
|
|
- // 已掌握不需要调用接口通知完成
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ if (props.pageData.jieId == 0) {
|
|
|
|
+ // 已掌握不需要调用接口通知完成
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
httpApi.getWordWancheng({
|
|
httpApi.getWordWancheng({
|
|
jieId: props.pageData.jieId,
|
|
jieId: props.pageData.jieId,
|
|
wordId: props.activeWord.id
|
|
wordId: props.activeWord.id
|
|
@@ -152,11 +155,13 @@
|
|
type: 3,
|
|
type: 3,
|
|
wordId: props.activeWord.id
|
|
wordId: props.activeWord.id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- const { wanchangflag } = res.data;
|
|
|
|
- if (wanchangflag == 1) {
|
|
|
|
- // 通知岛重新调用接口
|
|
|
|
- cacheManager.remove('zhangInfo')
|
|
|
|
- }
|
|
|
|
|
|
+ const {
|
|
|
|
+ wanchangflag
|
|
|
|
+ } = res.data;
|
|
|
|
+ if (wanchangflag == 1) {
|
|
|
|
+ // 通知岛重新调用接口
|
|
|
|
+ cacheManager.remove('zhangInfo')
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|