Commit cff21a2e authored by Facius's avatar Facius

refactor: 首页ui修改

parent 8c2078a8
<template>
<view class="u-flex statis">
<view class="u-flex top">
<view class="u-flex avatar">
<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="horizontal"
type="none"
font-size="24"
:list="info.dynamic"
bg-color="#fff"
color="#2953FF"
:volume-icon="false"
autoplay
padding="0 10rpx"
></u-notice-bar>
</view>
</view>
<view class="u-flex center">
<view class="u-flex topics">
<view class="topics-lists">
今日做题:
<u-count-to
:start-val="0"
:end-val="info.today"
:font-size="32"
color="#191C27"
></u-count-to>
<view class="statis">
<image class="background-image" :src="meiriyilianImage"></image>
<view class="content-view">
<view class="u-flex top">
<view class="u-flex avatar">
<view
class="avatar-list"
v-for="(item, index) in info.avatar"
:key="index"
><image :src="item" mode="scaleToFill"
/></view>
</view>
<view class="topics-lists">
累计做题:
<u-count-to
:start-val="0"
:end-val="info.total"
:font-size="32"
color="#191C27"
></u-count-to>
<view class="notice">
<u-notice-bar
mode="horizontal"
type="none"
font-size="26"
:list="info.dynamic"
color="#FFFFFF"
:volume-icon="false"
autoplay
padding="0 10rpx"
></u-notice-bar>
</view>
</view>
<view class="u-flex days">
<view class="days-lists">
<u-count-to
:start-val="0"
:end-val="info.days"
:font-size="60"
color="#191C27"
></u-count-to>
<text class="unit">Days</text>
<view class="u-flex center">
<view v-for="(value, key) in detailLabels" :key="key" class="item-view">
<view v-if="key == 'total'" class="line-view"></view>
<view class="left-view">
<view class="count-view">{{ info[key] }}</view>
<view>{{ value }}</view>
</view>
<view v-if="key == 'total'" class="line-view"></view>
</view>
<view class="days-lists">累计坚持</view>
</view>
</view>
<view class="bottom">
<u-button
:custom-style="btnStyle"
type="primary"
shape="circle"
@click="answer"
>去练习</u-button
>
<view class="bottom">
<view
class="bottom-button"
type="primary"
shape="circle"
@click="$u.throttle(answer, 500)"
><image class="button-image" :src="lianxianniuImage"></image
>每日一练</view
>
</view>
</view>
</view>
</template>
......@@ -94,25 +73,23 @@ export default {
}
},
computed: {
btnStyle() {
return this.buttonDisabled
? {
width: '320rpx',
height: '104rpx',
fontSize: '32rpx',
fontWeight: 'bold',
backgroundColor: '#D2D5DE',
}
: {
width: '320rpx',
height: '104rpx',
fontSize: '32rpx',
fontWeight: 'bold',
backgroundColor: '#2953FF',
}
detailLabels() {
return {
today: '今日做题',
total: '累计做题',
days: '累计天数',
}
},
buttonDisabled() {
return this.$u.test.isEmpty(this.info.selected)
avatars() {
return this.info.avatar.length > 4
? this.info.avatar.slice(0, 4)
: this.info.avatar
},
meiriyilianImage() {
return process.uniEnv.qn_base_url + 'meiriyilianquyu.png'
},
lianxianniuImage() {
return process.uniEnv.qn_base_url + 'lianxianniu.png'
},
},
created() {},
......@@ -126,65 +103,104 @@ export default {
</script>
<style lang="scss" scoped>
.statis {
flex-flow: column;
background: #fff;
padding: 30rpx 30rpx 40rpx 30rpx;
// flex-flow: column;
// background: #fff;
// padding: 30rpx 30rpx 40rpx 30rpx;
border-radius: 24rpx;
.top {
width: 100%;
margin-left: 6rpx;
.avatar {
padding-right: 16rpx;
.avatar-list {
width: 40rpx;
height: 40rpx;
margin-left: -6rpx;
image {
width: 50rpx;
height: 50rpx;
border: 2rpx solid #ccc;
background: #fff;
border-radius: 50%;
margin-right: 1px;
overflow: hidden;
position: relative;
box-shadow: 0px 10px 16px rgba(29, 53, 155, 0.2);
margin-bottom: 56rpx;
z-index: 0;
height: 472rpx;
.background-image {
position: absolute;
z-index: -1;
height: 472rpx;
width: 702rpx;
}
.content-view {
padding: 40rpx 30rpx;
.top {
width: 100%;
margin-left: 15rpx;
display: flex;
align-items: center;
.avatar {
.avatar-list {
margin-left: -15rpx;
display: flex;
justify-content: flex-start;
align-items: center;
image {
width: 44rpx;
height: 44rpx;
border: 2rpx solid #ccc;
background: #fff;
border-radius: 50%;
margin-right: 1px;
}
}
}
.notice {
flex: 1;
width: 100%;
}
}
.notice {
flex: 1;
.center {
width: 100%;
}
}
.center {
width: 100%;
justify-content: space-around;
padding-top: 20rpx;
.days {
flex-flow: column;
flex: 1;
.days-lists {
color: #9ea5bb;
padding: 5rpx 0rpx;
.unit {
color: #5a6073;
font-size: 36rpx;
font-weight: bold;
padding-left: 10rpx;
justify-content: space-around;
padding-top: 56rpx;
padding-bottom: 66rpx;
.item-view {
display: flex;
align-items: center;
justify-content: center;
.left-view {
text-align: center;
color: #ffffff;
font-size: 26rpx;
width: 240rpx;
.count-view {
font-weight: bold;
font-size: 48rpx;
margin-bottom: 6rpx;
}
}
.line-view {
width: 2rpx;
background-color: #ffffff;
height: 70rpx;
}
}
}
.topics {
flex-flow: column;
flex: 1;
border-right: 2rpx solid #e8ebf3;
.topics-lists {
width: 100%;
padding: 10rpx 0rpx;
color: #9ea5bb;
.bottom {
display: flex;
justify-content: center;
align-items: center;
.bottom-button {
display: flex;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
z-index: 0;
border-radius: 52rpx;
font-size: 32rpx;
font-weight: bold;
color: #2953ff;
height: 104rpx;
width: 400rpx;
.button-image {
width: 400rpx;
height: 104rpx;
position: absolute;
z-index: -1;
}
}
}
}
.bottom {
margin-top: 54rpx;
}
}
</style>
This diff is collapsed.
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