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 @@
<view class="u-flex statis">
<view class="u-flex top">
<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"
/></view>
</view>
<view class="notice">
<u-notice-bar
mode="vertical"
mode="horizontal"
type="none"
:list="dynamic"
font-size="24"
:list="info.dynamic"
bg-color="#fff"
color="#2953FF"
:volume-icon="false"
autoplay
padding="0 10rpx"
></u-notice-bar>
</view>
</view>
......@@ -22,7 +29,7 @@
今日做题:
<u-count-to
:start-val="0"
:end-val="today"
:end-val="info.today"
:font-size="32"
color="#191C27"
></u-count-to>
......@@ -31,7 +38,7 @@
累计做题:
<u-count-to
:start-val="0"
:end-val="total"
:end-val="info.total"
:font-size="32"
color="#191C27"
></u-count-to>
......@@ -41,7 +48,7 @@
<view class="days-lists">
<u-count-to
:start-val="0"
:end-val="days"
:end-val="info.days"
:font-size="60"
color="#191C27"
></u-count-to>
......@@ -66,25 +73,18 @@
export default {
name: 'subjectStatistics',
props: {
days: {
type: Number,
default: 0,
},
today: {
type: Number,
default: 0,
},
total: {
type: Number,
default: 0,
},
dynamic: {
type: Array,
default: [],
},
avatar: {
type: Array,
default: [],
info: {
type: Object,
default() {
return {
days: 0,
today: 0,
total: 0,
dynamic: [],
avatar: [],
selected: {},
}
},
},
},
data() {
......@@ -95,14 +95,30 @@ export default {
},
computed: {
btnStyle() {
return {
padding: '0 90rpx',
}
return this.buttonDisabled
? {
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() {},
methods: {
answer() {
if (this.buttonDisabled) return
this.$emit('answer')
},
},
......@@ -112,18 +128,16 @@ export default {
.statis {
flex-flow: column;
background: #fff;
padding: 10rpx;
border: 2rpx solid #ccc;
margin: 20rpx;
border-radius: 20rpx;
padding: 30rpx 30rpx 40rpx 30rpx;
border-radius: 24rpx;
.top {
width: 100%;
padding: 30rpx 30rpx 0 30rpx;
.avatar {
padding-right: 30rpx;
padding-right: 16rpx;
.avatar-list {
width: 40rpx;
height: 40rpx;
margin-left: -6rpx;
image {
width: 50rpx;
height: 50rpx;
......@@ -170,7 +184,7 @@ export default {
}
}
.bottom {
padding: 30rpx 10rpx;
margin-top: 54rpx;
}
}
</style>
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view>
<text class="title">{{title}}</text>
</view>
</view>
<view class="page-index">
<u-navbar
back-icon-color="#333333"
background="transparent"
title="题库平台"
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>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
import SubjectStatistics from '@/components/subject-statistics'
export default {
components: { SubjectStatistics },
data() {
return {
selected: {
key: 0,
name: '熔化焊接与热切割作业',
location: '广东省试题',
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>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin: 200rpx auto 50rpx auto;
}
<style lang="scss" scope>
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.text-area {
display: flex;
justify-content: center;
}
.page-index {
height: 100vh;
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 {
font-size: 36rpx;
color: #8f8f94;
}
.tip-card-message {
font-size: 26rpx;
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>
......@@ -188,6 +188,7 @@ export default {
this.showPop = true
},
handleClickSubmit() {
if (this.buttonDisabled) return
this.showPop = false
},
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