|
@@ -26,11 +26,13 @@
|
|
|
<!-- 音标拆分区 -->
|
|
|
<view v-if="data.isPindu" class="word-block-box yb-block-box">
|
|
|
<!-- pindu -->
|
|
|
- <audioThreeVue v-for="(item,index) in activeWord.pindu" :key="index" :YItem="item" @play-audio="handlePlay"></audioThreeVue>
|
|
|
+ <audioThreeVue v-for="(item,index) in activeWord.pindu" :key="index" :YItem="item"
|
|
|
+ @play-audio="handlePlay"></audioThreeVue>
|
|
|
</view>
|
|
|
<view v-else class="yj-block-box">
|
|
|
<!-- yinjie -->
|
|
|
- <audioFourVue v-for="(item,index) in activeWord.yinjie" :key="index" :YItem="item" @play-audio="handlePlay"></audioFourVue>
|
|
|
+ <audioFourVue v-for="(item,index) in activeWord.yinjie" :key="index" :YItem="item"
|
|
|
+ @play-audio="handlePlay"></audioFourVue>
|
|
|
</view>
|
|
|
|
|
|
<!-- 音标按钮 -->
|
|
@@ -41,10 +43,12 @@
|
|
|
<!-- 词根+实用口语 -->
|
|
|
<view v-if="activeWord.cigenzhuji.length" class="details-content-box xue-details-content-box">
|
|
|
<text class="details-title">词根助记</text>
|
|
|
- <scroll-view class="cg-item-list" scroll-x @touchmove.stop >
|
|
|
- <view class="cg-item-box" v-for="(item,index) in activeWord.cigenzhuji" :key="index" >
|
|
|
+ <scroll-view class="cg-item-list" scroll-x @touchmove.stop>
|
|
|
+ <view class="cg-item-box" v-for="(item,index) in activeWord.cigenzhuji" :key="index">
|
|
|
<view class="cg-item">
|
|
|
- <view :class="{isEven: index% 2 !== 0 && index!==activeWord.cigenzhuji.length-1,isOdd: index% 2 === 0 && index!==activeWord.cigenzhuji.length-1}">{{item.en}}</view>
|
|
|
+ <view
|
|
|
+ :class="{isEven: index% 2 !== 0 && index!==activeWord.cigenzhuji.length-1,isOdd: index% 2 === 0 && index!==activeWord.cigenzhuji.length-1}">
|
|
|
+ {{item.en}}</view>
|
|
|
<view>{{item.zn}}</view>
|
|
|
</view>
|
|
|
<view class="cg-symbol" v-if="index<activeWord.cigenzhuji.length-2">+</view>
|
|
@@ -52,7 +56,7 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 实用语句 -->
|
|
|
<view class="details-content-box xue-details-content-box">
|
|
|
<text class="details-title">实用口语</text>
|
|
@@ -87,8 +91,8 @@
|
|
|
useAudioCache
|
|
|
} from './useAudio.js';
|
|
|
|
|
|
- const emits = defineEmits(['play-audio'])
|
|
|
-
|
|
|
+ const emits = defineEmits(['play-audio','goXiangjie'])
|
|
|
+ const userCode = getUserIdentity();
|
|
|
const {
|
|
|
cacheAudio,
|
|
|
clearAudioCache
|
|
@@ -96,12 +100,10 @@
|
|
|
|
|
|
|
|
|
const data = reactive({
|
|
|
- isPlaying:false,
|
|
|
- isPindu:true,
|
|
|
+ isPlaying: false,
|
|
|
+ isPindu: true,
|
|
|
})
|
|
|
|
|
|
- const userCode = getUserIdentity();
|
|
|
-
|
|
|
const props = defineProps({
|
|
|
activeWord: { // 单词数据
|
|
|
type: Object,
|
|
@@ -116,31 +118,41 @@
|
|
|
|
|
|
|
|
|
const highlightWord = (text) => {
|
|
|
- if (!text || !props.activeWord.name){return text}
|
|
|
+ if (!text || !props.activeWord.name) {
|
|
|
+ return text
|
|
|
+ }
|
|
|
const word = props.activeWord.name;
|
|
|
const regex = new RegExp(word, 'gi');
|
|
|
return text.replace(regex, (match) => {
|
|
|
return `<span style="color: #3a7fe9;">${match}</span>`;
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
async function handlePlay(opt) {
|
|
|
emits('play-audio', opt)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function handlePindu() {
|
|
|
data.isPindu = true
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function handleYinjie() {
|
|
|
data.isPindu = false
|
|
|
}
|
|
|
|
|
|
- function goXiangjie() {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/newEnglish/components/xiangjie?jieId='+props.pageData.jieId+'&wordId='+props.pageData.activeId
|
|
|
- })
|
|
|
- }
|
|
|
+ function goXiangjie() {
|
|
|
+
|
|
|
+ if (userCode !== 'Visitor') {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/newEnglish/components/xiangjie?jieId=' + props.pageData.jieId + '&wordId=' + props
|
|
|
+ .pageData.activeId
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ emits('goXiangjie')
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style>
|