Commit 6bb6b52b authored by Damon's avatar Damon

Merge branch 'dev-v1.0.0' of git.banshouhui.com:wuzhenzhe/study into dev-v1.0.0

parents 0008c12c fc58922f
...@@ -2,17 +2,24 @@ ...@@ -2,17 +2,24 @@
<view class="u-flex statis"> <view class="u-flex statis">
<view class="u-flex top"> <view class="u-flex top">
<view class="u-flex avatar"> <view class="u-flex avatar">
<view class="avatar-list" v-for="(item, index) in avatar" :key="index" <view
class="avatar-list"
v-for="(item, index) in info.avatar"
:key="index"
><image :src="item" mode="scaleToFill" ><image :src="item" mode="scaleToFill"
/></view> /></view>
</view> </view>
<view class="notice"> <view class="notice">
<u-notice-bar <u-notice-bar
mode="vertical" mode="horizontal"
type="none" type="none"
:list="dynamic" font-size="24"
:list="info.dynamic"
bg-color="#fff" bg-color="#fff"
color="#2953FF" color="#2953FF"
:volume-icon="false"
autoplay
padding="0 10rpx"
></u-notice-bar> ></u-notice-bar>
</view> </view>
</view> </view>
...@@ -22,7 +29,7 @@ ...@@ -22,7 +29,7 @@
今日做题: 今日做题:
<u-count-to <u-count-to
:start-val="0" :start-val="0"
:end-val="today" :end-val="info.today"
:font-size="32" :font-size="32"
color="#191C27" color="#191C27"
></u-count-to> ></u-count-to>
...@@ -31,7 +38,7 @@ ...@@ -31,7 +38,7 @@
累计做题: 累计做题:
<u-count-to <u-count-to
:start-val="0" :start-val="0"
:end-val="total" :end-val="info.total"
:font-size="32" :font-size="32"
color="#191C27" color="#191C27"
></u-count-to> ></u-count-to>
...@@ -41,7 +48,7 @@ ...@@ -41,7 +48,7 @@
<view class="days-lists"> <view class="days-lists">
<u-count-to <u-count-to
:start-val="0" :start-val="0"
:end-val="days" :end-val="info.days"
:font-size="60" :font-size="60"
color="#191C27" color="#191C27"
></u-count-to> ></u-count-to>
...@@ -66,25 +73,18 @@ ...@@ -66,25 +73,18 @@
export default { export default {
name: 'subjectStatistics', name: 'subjectStatistics',
props: { props: {
days: { info: {
type: Number, type: Object,
default: 0, default() {
}, return {
today: { days: 0,
type: Number, today: 0,
default: 0, total: 0,
}, dynamic: [],
total: { avatar: [],
type: Number, selected: {},
default: 0, }
}, },
dynamic: {
type: Array,
default: [],
},
avatar: {
type: Array,
default: [],
}, },
}, },
data() { data() {
...@@ -95,14 +95,30 @@ export default { ...@@ -95,14 +95,30 @@ export default {
}, },
computed: { computed: {
btnStyle() { btnStyle() {
return { return this.buttonDisabled
padding: '0 90rpx', ? {
} width: '320rpx',
height: '104rpx',
fontSize: '32rpx',
fontWeight: 'bold',
backgroundColor: '#D2D5DE',
}
: {
width: '320rpx',
height: '104rpx',
fontSize: '32rpx',
fontWeight: 'bold',
backgroundColor: '#2953FF',
}
},
buttonDisabled() {
return this.$u.test.isEmpty(this.info.selected)
}, },
}, },
created() {}, created() {},
methods: { methods: {
answer() { answer() {
if (this.buttonDisabled) return
this.$emit('answer') this.$emit('answer')
}, },
}, },
...@@ -112,18 +128,16 @@ export default { ...@@ -112,18 +128,16 @@ export default {
.statis { .statis {
flex-flow: column; flex-flow: column;
background: #fff; background: #fff;
padding: 10rpx; padding: 30rpx 30rpx 40rpx 30rpx;
border: 2rpx solid #ccc; border-radius: 24rpx;
margin: 20rpx;
border-radius: 20rpx;
.top { .top {
width: 100%; width: 100%;
padding: 30rpx 30rpx 0 30rpx;
.avatar { .avatar {
padding-right: 30rpx; padding-right: 16rpx;
.avatar-list { .avatar-list {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-left: -6rpx;
image { image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
...@@ -170,7 +184,7 @@ export default { ...@@ -170,7 +184,7 @@ export default {
} }
} }
.bottom { .bottom {
padding: 30rpx 10rpx; margin-top: 54rpx;
} }
} }
</style> </style>
<template> <template>
<view class="content"> <view class="page-index">
<image class="logo" src="/static/logo.png"></image> <u-navbar
<view> back-icon-color="#333333"
<text class="title">{{title}}</text> background="transparent"
</view> title="题库平台"
</view> titleColor="#191C27"
:border-bottom="false"
title-bold
:is-back="false"
></u-navbar>
<view class="content">
<view class="exam-title-view">
<image class="titleImage" :src="imageUrl"></image>
<text>{{ title }}</text>
<u-icon class="icon-view" name="arrow-up-fill"></u-icon>
</view>
<view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text>
</view>
<view v-else class="detail-view">
<view class="detail-item"
><image class="detail-image" :src="imageUrl"></image
><text>{{ selected.location }}</text></view
>
<view class="detail-item"
><image class="detail-image" :src="imageUrl"></image>通过率:<text
class="pass-text"
>{{ selected.pass }}</text
></view
>
</view>
<view class="tip-card-view">
<view class="tip-card-message">
<image class="tip-image" :src="imageUrl"></image
><text>绑卡或者购买该题库后,即可刷题或模拟考试</text>
</view>
</view>
<view class="exam-mark">
<view v-for="(item, index) in marks" :key="index">
<image class="exam-image" :src="item.image"></image>
<view>{{ item.name }}</view>
<view class="exam-count"
><view>{{
item.allValue ? item.value + '/' + item.allValue : item.value
}}</view
><view class="exam-fen" v-if="index == 1">分</view></view
>
</view>
<view class="line-view"></view>
</view>
<view class="sub-content">
<view
v-for="(item, index) in subItems"
:key="index"
class="sub-content-item"
@click="handleClick(item.pathName)"
>
<view class="sub-image">
<image :src="item.icon" :style="item.imageStyle"></image>
</view>
<view>{{ item.title }}</view>
</view>
</view>
<view class="daily-practice" @click="$u.throttle(handleClickFile, 500)">
<view class="daily-practice-left">
<image :src="imageUrl" class="file-image"></image>
<text>每日一练</text>
</view>
<view class="daily-practice-right">
<text>累计打卡{{ info.days }}天</text>
<u-icon class="arrow-right" name="arrow-right"></u-icon>
</view>
</view>
<SubjectStatistics :info="info"></SubjectStatistics>
</view>
</view>
</template> </template>
<script> <script>
export default { import SubjectStatistics from '@/components/subject-statistics'
data() { export default {
return { components: { SubjectStatistics },
title: 'Hello' data() {
} return {
}, selected: {
onLoad() { key: 0,
name: '熔化焊接与热切割作业',
}, location: '广东省试题',
methods: { pass: '96%',
},
} }
} },
computed: {
title() {
return this.selected.name || '请选择题库'
},
imageUrl() {
return '/static/logo.png'
},
noExam() {
return this.$u.test.isEmpty(this.selected.name)
},
marks() {
return [
{
key: 'all',
name: '全部试题',
value: 0,
allValue: 999,
image: this.imageUrl,
},
{
key: 'moni',
name: '模拟',
value: 999,
image: this.imageUrl,
},
]
},
info() {
return {
days: 9,
today: 0,
total: 0,
dynamic: ['2分钟前 李**完成了“高空作业习题”练习'],
avatar: [this.imageUrl, this.imageUrl, this.imageUrl],
selected: this.selected,
}
},
subItems() {
return [
{
pathName: 'warehouse/index',
title: '专项练习',
value: '',
icon: this.imageUrl,
imageStyle: 'width:60rpx;height:60rpx',
},
{
pathName: 'warehouse/spare',
title: '我的错题',
value: '',
icon: this.imageUrl,
imageStyle: 'width:60rpx;height:60rpx',
},
{
pathName: 'warehouse/return',
title: '收藏的题',
value: '',
icon: this.imageUrl,
imageStyle: 'width:60rpx;height:60rpx',
},
{
pathName: 'warehouse/records',
title: '我的成绩',
value: '',
icon: this.imageUrl,
imageStyle: 'width:60rpx;height:60rpx',
},
{
pathName: 'warehouse/records',
title: '搜索试题',
value: '',
icon: this.imageUrl,
imageStyle: 'width:60rpx;height:60rpx',
},
]
},
},
onLoad() {},
methods: {},
}
</script> </script>
<style> <style lang="scss" scope>
.content { ::-webkit-scrollbar {
display: flex; width: 0;
flex-direction: column; height: 0;
align-items: center; color: transparent;
justify-content: center; display: none;
} }
.logo {
height: 200rpx;
width: 200rpx;
margin: 200rpx auto 50rpx auto;
}
.text-area { .page-index {
display: flex; height: 100vh;
justify-content: center; display: flex;
} flex-direction: column;
background-color: #f8fafd;
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
background-size: 100% 520rpx;
background-repeat: no-repeat;
.content {
height: 100%;
overflow: auto;
padding: 16rpx 24rpx;
.exam-title-view {
color: #191c27;
font-weight: bold;
font-size: 40rpx;
display: flex;
align-items: center;
.titleImage {
width: 40rpx;
height: 40rpx;
margin-right: 14rpx;
}
.icon-view {
font-size: 24rpx;
color: #2953ff;
margin-left: 10rpx;
transform: rotate(90deg);
}
}
.tip-view {
color: #9ea5bb;
font-size: 28rpx;
margin-top: 22rpx;
margin-bottom: 40rpx;
}
.tip-card-view {
display: flex;
justify-content: center;
align-items: center;
.title { .tip-card-message {
font-size: 36rpx; font-size: 26rpx;
color: #8f8f94; color: #2953ff;
} border-radius: 12rpx 12rpx 0 0;
border-width: 2rpx 2rpx 0 2rpx;
border-style: solid;
border-color: #2953ff;
width: 640rpx;
line-height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
.tip-image {
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
}
}
.detail-view {
display: flex;
align-items: center;
margin-top: 22rpx;
margin-bottom: 40rpx;
.detail-item {
color: #9ea5bb;
font-size: 28rpx;
margin-right: 40rpx;
display: flex;
align-items: center;
.detail-image {
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.pass-text {
color: #2953ff;
}
}
}
.sub-content {
display: flex;
justify-content: space-around;
align-items: center;
margin: 60rpx 0;
.sub-content-item {
color: #5a6073;
font-size: 26rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.sub-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 14rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
.exam-mark {
height: 280rpx;
border-radius: 24rpx;
background-image: linear-gradient(to top right, #2953ff 0%, #2272ff 50%);
box-shadow: 0px 10px 16px rgba(29, 53, 155, 0.2);
font-size: 28rpx;
text-align: center;
position: relative;
display: flex;
justify-content: space-around;
align-items: center;
color: #ffffff;
padding-top: 14rpx;
.exam-image {
width: 50rpx;
height: 54rpx;
margin-bottom: 10rpx;
}
.exam-count {
display: flex;
align-items: flex-end;
font-weight: bold;
margin-top: 24rpx;
font-size: 52rpx;
.exam-fen {
font-size: 28rpx;
font-weight: 400;
padding-bottom: 10rpx;
padding-left: 10rpx;
}
}
.line-view {
position: absolute;
left: auto;
right: auto;
top: auto;
bottom: auto;
height: 160rpx;
width: 2rpx;
background-color: #ffffff;
}
}
.daily-practice {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
.daily-practice-left {
color: #191c27;
font-weight: bold;
font-size: 32rpx;
display: flex;
align-items: center;
.file-image {
width: 34rpx;
height: 34rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
}
.daily-practice-right {
color: #191c27;
font-size: 26rpx;
.arrow-right {
color: #9ea5bb;
font-size: 28rpx;
margin-left: 2rpx;
}
}
}
}
}
</style> </style>
...@@ -188,6 +188,7 @@ export default { ...@@ -188,6 +188,7 @@ export default {
this.showPop = true this.showPop = true
}, },
handleClickSubmit() { handleClickSubmit() {
if (this.buttonDisabled) return
this.showPop = false this.showPop = false
}, },
baiduLocation(long, lat) { baiduLocation(long, lat) {
......
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