Commit 35839925 authored by 罗超's avatar 罗超

2

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