Commit 8bd125b4 authored by Facius's avatar Facius

improvement: 首页UI变更

parent b3fa6588
......@@ -129,9 +129,11 @@ export default {
initData() {
var a0 = this.$u.random(0, 49)
var a1 = this.$u.random(0, 49)
if (a1 == a0) a0 = this.$u.random(0, 49)
var a2 = this.$u.random(0, 49)
if ([a0, a1].indexOf(a2) != -1) a2 = this.$u.random(0, 49)
var a3 = this.$u.random(0, 49)
console.log(a0, a1, a2, a3, this.defaultUrl)
if ([a0, a1, a2].indexOf(a3) != -1) a3 = this.$u.random(0, 49)
this.avatars = [
this.defaultUrl + (a0 > 9 ? 'a' : 'a0') + String(a0) + '.jpeg',
this.defaultUrl + (a1 > 9 ? 'a' : 'a0') + String(a1) + '.jpeg',
......
......@@ -37,12 +37,12 @@
</view>
<view class="bottom">
<view
class="bottom-button"
:class="['bottom-button', { experience: info.experience }]"
type="primary"
shape="circle"
@click="$u.throttle(answer, 500)"
><image class="button-image" :src="lianxianniuImage"></image
>每日一练</view
>{{ buttonText }}</view
>
</view>
</view>
......@@ -68,6 +68,7 @@ export default {
dynamic: [],
avatar: [],
selected: {},
experience: false,
}
},
},
......@@ -92,6 +93,9 @@ export default {
lianxianniuImage() {
return process.uniEnv.qn_base_url + 'lianxianniu.png'
},
buttonText() {
return this.info.experience ? '免费体验答题' : '每日一练'
},
},
created() {},
methods: {
......@@ -196,6 +200,9 @@ export default {
color: #2953ff;
height: 104rpx;
width: 400rpx;
&.experience {
color: #fa5a49;
}
.button-image {
width: 400rpx;
height: 104rpx;
......
......@@ -54,9 +54,12 @@
<image class="exam-image" :src="item.image"></image>
<view class="right-view">
<view>{{ item.name }}</view>
<view class="label-view" :style="{ color: item.labelColor }">{{
item.label
}}</view>
<view class="label-view"
><text class="left-label" v-if="item.leftLabel">{{
item.leftLabel
}}</text
><text>{{ item.label }}</text></view
>
</view>
</view>
<view class="line-view"></view>
......@@ -128,39 +131,40 @@ export default {
{
name: '全部试题',
label: this.examText,
labelColor: this.labelColor,
leftLabel: this.selected.count, // 已做题目数
image: process.uniEnv.qn_base_url + 'quanbushiti.png',
},
{
name: '模拟考试',
label: '真题模拟强化',
labelColor: '#9EA5BB',
label: this.simulateText,
image: process.uniEnv.qn_base_url + 'monishiti.png',
},
]
},
labelColor() {
return this.selected.state ? '#FA5A49' : '#9EA5BB'
},
examText() {
return this.selected.state
? '免费体验1次'
: this.selected.card
? this.selected.count + '/' + this.selected.all
return this.selected.cardId
? '/' + this.selected.totalExam
: '题库进阶练习'
},
simulateText() {
return this.selected.cardId
? '上次成绩' + this.selected.totalExam + '分'
: '真题模拟强化'
},
info() {
return {
id: this.selected.id,
cardId:
this.detail.questionWarehouse && this.detail.questionWarehouse.cardId,
provinceName: this.provinceName,
experience: this.selected.state,
experience:
this.selected.state && !this.detail.questionWarehouse.cardId,
pass: this.$u.random(95, 99) + '%',
days: this.detail.totalDayCount || 0,
today: this.detail.todayCount || 0,
total: this.detail.totalCount || 0,
totalExam: this.data.totalCount,
totalExam: this.data.totalCount || 0,
}
},
subItems() {
......@@ -261,23 +265,6 @@ export default {
})
this.detail = res || { questionWarehouse: {} }
this.queryQuestionWarehouseById(res.questionWarehouse.questionWarehouseId)
// this.detail = res || {
// questionWarehouse: {
// cardId: 0,
// createTime: '',
// createdBy: 0,
// echoMap: {},
// id: 0,
// institutionId: 0,
// questionWarehouseId: 0,
// studentId: 0,
// updateTime: '',
// updatedBy: 0,
// },
// todayCount: 100,
// totalCount: 100,
// totalDayCount: 100,
// }
},
handleSelect() {
......@@ -289,12 +276,18 @@ export default {
// 每日一练
handleAnswer() {
if (this.selected.cardId) {
// 练习
// ...
} else if (this.selected.id) {
this.type = 'bound'
this.show = true
if (this.info.experience) {
this.selected.state = false
// 体验
} else {
// 绑卡提示
this.type = 'bound'
this.show = true
}
} else {
// this.type = 'select'
// this.show = true
this.$u.route({
url: 'pages/learn/selectCategory',
})
......@@ -345,14 +338,10 @@ export default {
}
} else if (this.selected.id) {
// 已选题库
if (index == 0 && this.info.experience) {
// 体验
// ...
} else {
// 绑卡
this.type = 'bound'
this.show = true
}
// 绑卡
this.type = 'bound'
this.show = true
} else {
// 未选题库
this.$u.route({
......@@ -520,6 +509,9 @@ export default {
font-weight: 400;
font-size: 26rpx;
margin-top: 4rpx;
.left-label {
color: #5a6073;
}
}
}
}
......
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