Commit 500a4d8c authored by 罗超's avatar 罗超

2

parent 8a7ed781
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<view class="choiceQuestion" > <view class="choiceQuestion" >
<view class="box" v-if="!isShowExplain"> <view class="box" v-if="!isShowExplain">
<!-- <view class="dc">{{item.Title}}</view> --> <!-- <view class="dc">{{item.Title}}</view> -->
<view class="dc2">{{item.Title}}</view> <view class="dc2"><text style="color:#4756EB;">{{num}}/{{total}}</text>{{item.Title}}</view>
<view class="dclx">{{item.WordType}}</view> <view class="dclx">{{item.WordType}}</view>
<view class="choicelist"> <view class="choicelist">
<view class="choice-item" :class="{'correct':item.Answer==x.Name&&current==item.Answer, <view class="choice-item" :class="{'correct':item.Answer==x.Name&&current==item.Answer,
...@@ -124,6 +124,14 @@ ...@@ -124,6 +124,14 @@
Explain Explain
}, },
props: { props: {
num: {
type: Number,
default: 1
},
total: {
type: Number,
default: 1
},
current: { current: {
type: String, type: String,
default: '' default: ''
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<view class="fillInTheBlanks" > <view class="fillInTheBlanks" >
<view class="box" v-if="!isShowExplain"> <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;"><text style="color:#4756EB;">{{num}}/{{total}}</text>{{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>
</view> </view>
<view class="dclx">{{item.WordType}}</view> <view class="dclx">{{item.WordType}}</view>
...@@ -108,7 +108,15 @@ ...@@ -108,7 +108,15 @@
default:()=>{ default:()=>{
return{} return{}
} }
} },
num: {
type: Number,
default: 1
},
total: {
type: Number,
default: 1
},
}, },
setup(props,{attrs,slots,emit}) { setup(props,{attrs,slots,emit}) {
let data = reactive({ let data = reactive({
......
...@@ -217,8 +217,8 @@ ...@@ -217,8 +217,8 @@
if (data.pageData.LearningGardenList.length > 0) { if (data.pageData.LearningGardenList.length > 0) {
data.pageData.LearningGardenList.forEach((x, y) => { data.pageData.LearningGardenList.forEach((x, y) => {
if (x.List.length > 0) { if (x.List.length > 0) {
x.List.forEach((item, index) => { x.List.forEach( async (item, index) => {
this.getColor(item.Img, index, y).then(v => { await this.getColor(item.Img, index, y).then(v => {
data.pageData.LearningGardenList[v.y].List[ data.pageData.LearningGardenList[v.y].List[
v.index].bgcolor = v.formatres; v.index].bgcolor = v.formatres;
data.pageData.LearningGardenList[v.y].List[ data.pageData.LearningGardenList[v.y].List[
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
}, },
async getColor(src, index, y) { async getColor(src, index, y) {
let res = await getImageColor('myCanvas', 'img' + index, src) let res = await getImageColor('myCanvas', 'img' + index, src)
console.log(index, res) // console.log(index, res)
let obj = {} let obj = {}
obj.formatres = `rgba(${res.r},${res.g},${res.b},0.01)` obj.formatres = `rgba(${res.r},${res.g},${res.b},0.01)`
obj.formatres1 = `rgba(${res.r},${res.g},${res.b},0.6)` obj.formatres1 = `rgba(${res.r},${res.g},${res.b},0.6)`
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<van-empty description="暂无数据" v-if="nodata"/> <van-empty description="暂无数据" v-if="nodata"/>
<swiper class="swiper" @change="changeSwiper" :current="curTest" v-if="!loading&&!nodata"> <swiper class="swiper" @change="changeSwiper" :current="curTest" v-if="!loading&&!nodata">
<swiper-item v-for="(item, index) in reviewGroupList" :key="index" class="swiper-item" v-if="item"> <swiper-item v-for="(item, index) in reviewGroupList" :key="index" class="swiper-item" v-if="item">
<Choice v-if="item.QuestionTypeId == 1" :item="item" @next="next($event, item)"></Choice> <Choice v-if="item.QuestionTypeId == 1" :item="item" :num="index+1" :total="reviewGroupList.length+prepGroupList.length" @next="next($event, item)"></Choice>
<FillIn v-if="item.QuestionTypeId == 3" :item="item" @next="next($event, item)"></FillIn> <FillIn v-if="item.QuestionTypeId == 3" :item="item" :num="index+1" :total="reviewGroupList.length+prepGroupList.length" @next="next($event, item)"></FillIn>
</swiper-item> </swiper-item>
<swiper-item v-for="(item, index) in prepGroupList" :key="index" class="swiper-item" v-if="item"> <swiper-item v-for="(item, index) in prepGroupList" :key="index" class="swiper-item" v-if="item">
<Choice v-if="item.QuestionTypeId == 1" :item="item" @next="next($event, item)"></Choice> <Choice v-if="item.QuestionTypeId == 1" :item="item" :num="index+1+reviewGroupList.length" :total="reviewGroupList.length+prepGroupList.length" @next="next($event, item)"></Choice>
<FillIn v-if="item.QuestionTypeId == 3" :item="item" @next="next($event, item)"></FillIn> <FillIn v-if="item.QuestionTypeId == 3" :item="item" :num="index+1+reviewGroupList.length" :total="reviewGroupList.length+prepGroupList.length" @next="next($event, item)"></FillIn>
</swiper-item> </swiper-item>
<swiper-item> <swiper-item>
<van-popup :show="true" position="center" custom-style="background-color: transparent;"> <van-popup :show="true" position="center" custom-style="background-color: transparent;">
......
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