show-data.vue 2.1 KB
<template>
  <view class="show-data">
    <image class="bg" src="/static/frame.png" mode=""></image>
    <view class="show-title">数据展示</view>
    <view class="wrap">
      <view :class="['data-panel',index == 1?'right':'']" v-for="(item,index) in dataPanelList" :key="index">
        <view class="delivery-count">{{item.title}}</view>
        <view class="count">
          <text>{{item.count}}</text>
          <image :src="item.iconurl" mode=""></image>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        dataPanelList: [
          { iconurl: '/static/icon1.png', title: '今日配送数量', count: '20' },
          { iconurl: '/static/icon2.png', title: '累加派送数量', count: '200' }
        ],
      }
    },
    mounted() {
      this.dataPanelList[0].count = uni.getStorageSync('orderData').today_give_num //今天配送数量
      this.dataPanelList[1].count = uni.getStorageSync('orderData').total_give_num //累计配送数量
    }
  }
</script>

<style lang="scss">
  .show-data {
    position: relative;

    .bg {
      margin-top: 24rpx;
      width: 702rpx;
      height: 284rpx;
    }

    .show-title {
      // @include flexCj(center);
      font-size: 32rpx;
      font-weight: 700;
      position: absolute;
      padding-left: 28rpx;
      top: 24rpx;
      left: 0;
      width: 225rpx;
      height: 72rpx;
      line-height: 72rpx;
      background: url('/static/show.png') no-repeat;
      background-size: contain;
    }

    .wrap {
      @include flexCj();

      .data-panel {
        @include wrapPadding(314rpx, 24rpx, 22rpx, 18rpx, 20rpx);
        position: absolute;
        margin-left: 28rpx;
        top: 120rpx;
        height: 164rpx;
        border-radius: 16rpx;
        background: #ffffffff;

        .delivery-count {
          font-size: 28rpx;
        }

        .count {
          @include flexCj();
          font-size: 48rpx;
          font-weight: bold;

          image {
            width: 96rpx;
            height: 84rpx;
          }
        }
      }

    }

    .right {
      position: absolute;
      right: 24rpx;
    }
  }
</style>