123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <template>
- <view class="homework-container">
- <!-- 头部区域 -->
- <top-box :timeStamp="timeStamp"></top-box>
- <view class="module-container">
- <u-tabs :list="list" :current="current" @change="changeModule"
- :activeStyle="{color: '#5b7cff',fontWeight: 'bold',transform: 'scale(1.04)',}"
- :inactiveStyle="{fontWeight: 'bold',transform: 'scale(1)'}" lineColor="#5b7cff" lineWidth="60"></u-tabs>
- <!-- 详情头部卡片 -->
- <view class="module-box" v-for="(item,index) in card" :key="index" v-if="current == index">
- <view class="card" :style="{backgroundColor: `${item.color}`}">
- <view style="display: flex; flex-direction: column;">
- <text class="card-title">{{item.title}}{{item.num}}</text>
- <text class="card-subtitle">{{item.subtitle}}{{item.finish}}</text>
- </view>
- <view class="image" :style="{backgroundImage:`url(${item.image})`}"></view>
- </view>
- <view style="display: flex; align-items: center;">
- <view class="cut-off">{{item.detail.nav}}</view>
- <!-- <u-button text="获得报表" :plain="true" :hairline="true" shape="circle" size="small"></u-button> -->
- </view>
- <view class="detail-box">
-
- <view class="detail-box-item">
- <view class="item-info">
- <view class="t-icon t-icon-ceping"></view>
- <view class="item-text">评测完成率</view>
- </view>
- </view>
-
- <view class="detail-box-item"></view>
- <view class="detail-box-item" style="height: 100%;"></view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex'
- export default {
- computed:{
- ...mapState('m_chart', ['todayData']),
- },
- data() {
- return {
- //模块名
- list: [{
- name: '评测详情'
- }, {
- name: '作业详情'
- }, {
- name: '活动详情'
- }],
- //当前模块
- current: 0,
- //时间戳
- timeStamp: '',
- //卡片内容
- card: [{
- title: '今日评测数:' + '\xa0\xa0\xa0',
- num: 5,
- subtitle: '评测已完成:' + '\xa0\xa0\xa0',
- finish: 3,
- color: '#0080ff;',
- image: 'https://ouch-cdn2.icons8.com/T8L5Wxx8kgo2JxDuk2xDweDxuU8WaImv6jndeuNsyVs/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNTI3/LzA5ZWEzOGY3LTFh/NTMtNGEyOC05ZGQ2/LTE0ODQ0YTc0NzM2/MC5wbmc.png',
- detail: {
- nav: '评测信息'
- }
- }, {
- title: '今日作业数:' + '\xa0\xa0\xa0',
- num: 3,
- subtitle: '作业已完成:' + '\xa0\xa0\xa0',
- finish: 3,
- color: '#ff8caf;',
- image: 'https://ouch-cdn2.icons8.com/BYU619A_iHObQVrS3QMw03-pLb9GS_IiJwZ1w1p5B44/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNzAy/L2M5ZWU1M2JmLWQ5/ZWEtNDc2Yi1hZDc0/LTM0MmViZjcwMzU2/ZC5wbmc.png',
- detail: {
- nav: '作业信息'
- }
- }, {
- title: '今日活动数:' + '\xa0\xa0\xa0',
- num: 6,
- subtitle: '活动已完成:' + '\xa0\xa0\xa0',
- finish: 5,
- color: '#f9c752;',
- image: 'https://ouch-cdn2.icons8.com/i0qqxE6yUmy-zGPwKqmTGiaxmA2amq9prgLg-LJ75Ow/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvMjIy/L2Y2N2Q4MjRjLTY1/ZWEtNDNkMS1iZmY2/LTY0NDQwMGVmYTI0/My5wbmc.png',
- detail: {
- nav: '活动信息'
- }
- }]
- };
- },
- onLoad() {
- this.$getTimeStamp()
- },
- //刷新页面
- onPullDownRefresh() {
- this.$getTimeStamp()
- console.log('refresh');
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- methods: {
- //更改模块
- changeModule(index) {
- this.current = index.index
- },
- }
- }
- </script>
- <style lang="scss">
- .homework-container {
- .home-topinfo {
- background: linear-gradient($color-green, $page-background-color) !important;
- }
- }
- .module-container {
- margin: -70rpx 20rpx 0 20rpx;
- .card {
- display: flex;
- justify-content: space-around;
- margin: 20rpx auto 20rpx auto;
- height: 260rpx;
- width: 96%;
- // background: linear-gradient(to right, #ff95007a,#ff8419);
- border-radius: $card-border-radius;
- .card-title {
- margin: 40rpx 0 0 30rpx;
- font-size: 45rpx;
- font-weight: bold;
- color: #FFF;
- }
- .card-subtitle {
- margin: 20rpx 30rpx;
- font-size: 35rpx;
- font-weight: bold;
- color: #FFF;
- }
- .image {
- position: relative;
- top: -40rpx;
- right: -30rpx;
- height: 300rpx;
- width: 300rpx;
- background-size: contain;
- background-repeat: no-repeat;
- z-index: 2;
- }
- }
- .cut-off {
- font-size: 35rpx;
- font-weight: bold;
- color: #606266;
- margin-left: 20rpx;
- }
- .detail-box {
- display: flex;
- flex-flow: column wrap;
- justify-content: space-between;
- margin: 20rpx auto 20rpx auto;
- height: 47vh;
- width: 100%;
- .detail-box-item {
- margin: 0 2%;
- height: 48%;
- width: auto;
- background-color: #FFF;
- border-radius: $card-border-radius;
- .item-info {
- display: flex;
- align-items: center;
- padding: 20rpx;
- .t-icon {
- width: 40rpx;
- height: 40rpx;
- }
- .item-text {
- font-size: 30rpx;
- font-weight: bold;
- color: #3B4144;
- margin-left: 10rpx;
- }
- }
- }
- }
- }
- .t-icon {
- margin: 20rpx;
- width: 110rpx;
- height: 110rpx;
- }
- </style>
|