Commit 35839925 authored by 罗超's avatar 罗超

2

parent c3e46e34
......@@ -4,17 +4,17 @@
{{cur}}/{{total}}<text style="margin-left: 6rpx;font-size: 20rpxs;">{{type==0?'':"复习"}}</text>
</view>
<view class="meaning">
{{item.ChineseMean}}
{{item.WordWrite}}
</view>
<view class="Japanese">
{{item.WordWrite}}
{{item.WordContent}}
</view>
<view class="desc">
<view class="attr">
{{item.WordType}}
</view>
<view class="hiragana">
{{item.WordContent}}
[{{item.ChineseMean}}]
</view>
</view>
<view class="listen" @click="play">
......
......@@ -75,14 +75,16 @@
}
</style>
<template>
<view class="choiceQuestion">
<view>
<view class="choiceQuestion" >
<view class="box" v-if="!isShowExplain">
<!-- <view class="dc">{{item.Title}}</view> -->
<view class="dc2">{{item.Title}}</view>
<view class="dclx">{{item.WordType}} <text @click="isShowExplain=true">查看解析</text></view>
<view class="dclx">{{item.WordType}}</view>
<view class="choicelist">
<view class="choice-item" :class="{'correct':item.Answer==x.Name&&current==item.Answer,
'error':current==x.Name&&current!==item.Answer}" v-for="(x,y) in item.QuestionContent" :key='y' @click="choice(x)">
'error':current==x.Name&&current!==item.Answer}" v-for="(x,y) in item.QuestionContent" :key='y'
@click="choice(x)">
{{x.Content}}
<view class="sign" v-if="item.Answer==x.Name&&current==item.Answer">
<van-icon name="success" color="#5DE3A6" size='40rpx' />
......@@ -93,8 +95,10 @@
</view>
</view>
</view>
<Explain v-if="isShowExplain"></Explain>
<Explain v-if="isShowExplain" :item="item" @todo="todo"></Explain>
</view>
</view>
</template>
<script>
......@@ -109,9 +113,9 @@
onMounted,
provide
} from "vue";
import Explain from '../../components/word/explain.vue'
import Explain from './explain.vue'
export default {
components:{
components: {
Explain
},
props: {
......@@ -133,15 +137,28 @@
}) {
let data = reactive({
current: '', //用户选择
isShowExplain:false,
isShowExplain: false,
})
let methods = {
choice(x) {
data.current = x.Name;
if (data.current !== props.item.Answer) {
setTimeout(() => {
data.isShowExplain = true
}, 500)
} else {
setTimeout(() => {
emit('next')
}, 500)
}
},
todo() {
emit('next')
}
}
onMounted(() => {
console.log(136, props.item)
// console.log(136, props.item)
})
let that = methods;
return {
......
......@@ -15,23 +15,24 @@
display: flex;
flex-direction: column;
align-items: center;
border-radius: 24rpx;
border-radius: 48rpx;
background: #FFF;
}
.box-top{
height: calc( 100vh - 270rpx);
overflow-y: auto;
width: 100%;
}
.box-b{
width: 292rpx;
height: calc( 100vh - 166rpx);
height: 90rpx;
background: #E4E5FB;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-size: 32rpx;
color: #4C50E7;
border-radius: 45rpx;
}
......@@ -44,7 +45,7 @@
padding:4px 6px ;
border-radius: 3px;
background: #E8E9EA;
font-size: 14px;
font-size: 28rpx;
color: #666666;
......@@ -56,16 +57,16 @@
<view class="explain">
<view class="box">
<view class="box-top">
<view class="dc">火曜日</view>
<view style="display: flex;align-items: center;flex-wrap: wrap;margin-top: 18px;">
<view class="dclx">名词</view>
<view style="font-size: 14px;color: #999999;margin:0 13px">[げつようび]</view>
<image style="width: 16px;height: auto;" mode="widthFix" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/laba2x.png"></image>
<view class="dc">{{item.WordWrite}}</view>
<view style="display: flex;align-items: center;flex-wrap: wrap;margin-top: 36rpx;">
<view class="dclx">{{item.WordType}}</view>
<view style="font-size: 28rpx;color: #999999;margin:0 26rpx">[{{item.WordContent}}]</view>
<image style="width: 32rpx;height: auto;" mode="widthFix" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/laba2x.png" @click="play"></image>
</view>
<view style="width: 100%;height: 1px;background: #333F53;margin: 20px 0;"></view>
<view style="font-size: 16px;font-weight: bold;color: #111111;">星期2</view>
<view style="width: 100%;height: 1px;background: #333F53;margin: 40rpx 0;"></view>
<view style="font-size: 32rpx;font-weight: bold;color: #111111;">{{item.ChineseMean}}</view>
</view>
<view class="box-b" @click="">继续做题</view>
<view class="box-b" @click="continueWrite">继续做题</view>
</view>
......@@ -74,18 +75,32 @@
<script>
import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide} from "vue";
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = false;
export default {
props: ['current','answer'],
props: {
item: {
type: Object,
default: () => {
return {}
}
}
},
setup(props,{attrs,slots,emit}) {
let data = reactive({
})
let methods = {
play() {
innerAudioContext.src=`https://fanyi.baidu.com/gettts?lan=jp&text=${encodeURIComponent(props.item.WordContent)}&spd=3&source=web`
innerAudioContext.play()
},
continueWrite(){
emit('todo')
}
}
onMounted(()=>{
console.log(103,props.item)
})
let that = methods;
......
......@@ -71,9 +71,8 @@
}
</style>
<template>
<view class="fillInTheBlanks">
<view class="box">
<view class="fillInTheBlanks" >
<view class="box" v-if="!isShowExplain">
<view class="dc " >
<view style="font-size:26rpx;width:100%;font-weight: 600;">{{item.Title}}</view>
<mypone :maxlength="getNum(item)" v-model="test" style="display: inline-block;" @input="input"></mypone>
......@@ -91,19 +90,19 @@
<van-icon name="cross" color="#FFF" size='40rpx' />
</view>
</view>
</view>
<Explain v-if="isShowExplain" :item="item" @todo="todo"></Explain>
</view>
</template>
<script>
import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide} from "vue";
import mypone from './myp-one.vue'
import Explain from './explain.vue'
export default {
props: ['current','answer'],
components: {
mypone
mypone,
Explain
},
props:{
item:{
......@@ -117,6 +116,7 @@
let data = reactive({
test:'',
type:0,//1是正确 2是错误
isShowExplain:false
})
let methods = {
getNum(item){
......@@ -129,10 +129,9 @@
}
},
getjieguo(){
console.log(130,data.test)
if(data.test==''){
uni.showToast({
title:'请输入',
title:'请输入答案',
icon:'none'
})
return
......@@ -140,16 +139,26 @@
//去掉接口
if(data.test==props.item.Answer||props.item.Answer.indexOf(data.test)>-1){
data.type=1
setTimeout(()=>{
emit('next')
},500)
}else{
data.type=2
console.log(data.isShowExplain)
setTimeout(()=>{
data.isShowExplain=true
},500)
}
},
input(){
data.type=0
},
todo(){
emit('next')
}
}
onMounted(()=>{
// console.log(137,props.item)
console.log(137,props.item)
})
let that = methods;
return {
......
<template>
<view class="wordTest">
<swiper class="swiper" >
<swiper class="swiper" @change="changeSwiper" :current="curTest">
<swiper-item v-for="(item,index) in reviewGroupList" :key="index" class="swiper-item">
<Choice v-if="item.QuestionTypeId==1" :item="item"></Choice>
<FillIn v-if="item.QuestionTypeId==3" :item="item"></FillIn>
<Choice v-if="item.QuestionTypeId==1" :item="item" @next="next"></Choice>
<FillIn v-if="item.QuestionTypeId==3" :item="item" @next="next"></FillIn>
</swiper-item>
<swiper-item v-for="(item,index) in prepGroupList" :key="index" class="swiper-item">
<Choice v-if="item.QuestionTypeId==1" :item="item" @next="next"></Choice>
<FillIn v-if="item.QuestionTypeId==3" :item="item" @next="next"></FillIn>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
......@@ -38,6 +39,7 @@
ChapterId: 0,
NextChapterId: 0
},
curTest:0,
reviewGroupList: [],
prepGroupList: [],
})
......@@ -47,6 +49,12 @@
data.reviewGroupList=res.Data.reviewGroupList
data.prepGroupList=res.Data.prepGroupList
})
},
changeSwiper(val){
data.curTest=val.detail.current
},
next(){
data.curTest+=1
}
}
onMounted(() => {
......
......@@ -14,15 +14,10 @@
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
provide,
} from "vue";
import Pronunciation from '../../components/word/Pronunciation.vue'
export default {
......@@ -63,10 +58,13 @@
data.StudyList = res.Data.StudyList
data.ReviewList = res.Data.ReviewList;
const total = data.StudyList.length + data.ReviewList.length;
if(res.Data.StartIndex>total||res.Data.StartIndex==total){
if (res.Data.StartIndex > total || res.Data.StartIndex == total) {
data.current = 0
}else{
} else {
data.current = res.Data.StartIndex;
if (data.current > total) {
data.current = total - 1
}
}
})
},
......@@ -79,23 +77,22 @@
}
const total = data.StudyList.length + data.ReviewList.length + 1
if (val.detail.current + 1 == total && total > 1) {
uni.navigateTo({
url: "/pages/word/test?CourseId=" + data.readMsg.CourseId + '&&ChapterId=' + data
.readMsg.ChapterId +
'&&NextChapterId=' + '0'
})
}
},
completeRead(n, type) {
if (type == 1) {
data.readMsg.PrepNum = n
} else {
data.readMsg.ReviewNum = n-data.StudyList.length;
data.readMsg.ReviewNum = n - data.StudyList.length;
}
data.readMsg.StudyType = type;
proxy.$request('/AppletWords/SetStuWordsPrep', data.readMsg).then(res => {
if(res.Data.StudyNum==res.Data.TotalNum){
uni.navigateTo({
url: "/pages/word/studyComplete?CourseId=" + data.readMsg.CourseId + '&&ChapterId=' + data.readMsg.ChapterId +
'&&NextChapterId=' + '0'
})
}
})
}
}
......@@ -108,6 +105,13 @@
...methods,
};
},
onShow() {
const total = this.StudyList.length + this.ReviewList.length;
if (this.current >= total) {
this.current = total - 1
}
console.log('onShow',this.current)
},
onLoad(options) {
console.log("options", options);
uni.setNavigationBarTitle({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment