123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- <template>
- <view class="center">
- <view class="top">
- <image src="../../static/img/sybg.png" mode="" class="sybg"></image>
- <picker mode="date" :value="now_date" @change="bindDateChange" :fields="'month'" :end="date">
- <view class="uni-input choose-time">{{ now_date }} ></view>
- </picker>
- <view class="top-card">
- <view class="card-tit">
- <view class="tit-point"></view>
- 营业额总览
- </view>
- <view class="card-icon"><image src="../../static/icon/moneyget.png" mode=""></image></view>
- <view class="now-tit">本月营业额</view>
- <view class="now-money">{{ month_momey }}</view>
- <view class="card-btm flex">
- <view class="card-info flex">
- <image src="../../static/icon/dayget.png" mode=""></image>
- <view class="info-wrap">
- <view class="info-tit">今日营业额</view>
- <view class="info-val">¥{{ today_momey || 0 }}</view>
- </view>
- </view>
- <view class="card-info flex">
- <image src="../../static/icon/daydd.png" mode=""></image>
- <view class="info-wrap">
- <view class="info-tit">今日订单</view>
- <view class="info-val dan">{{ today_count }}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="mid-tit flex">
- <view class="mid-left flex">
- <image src="../../static/icon/time.png" mode=""></image>
- <view class="left-tit">本月订单数</view>
- </view>
- <view class="mid-right">{{ month_count }}单</view>
- </view>
- <view class="btm-tab">
- <view class="tab-tit flex">
- <view class="tab-top-left tab-content">订单类型</view>
- <view class="tab-top-center tab-content">订单数</view>
- <view class="tab-top-right tab-content">金额</view>
- </view>
- <scroll-view scroll-y="true" class="list-wrapper" :style="{ height: height }">
- <!-- 空白页 -->
- <empty v-if="loaded && monthList.length == 0"></empty>
- <view v-for="item in monthList" class="flex list" :key="item.time">
- <view class="tab-top-left tab-content ">{{ item.order_type }}</view>
- <view class="tab-top-center tab-content">{{ item.count || 0 }}单</view>
- <view class="tab-top-right tab-content money">¥{{ item.price || 0 }}</view>
- </view>
- <uni-load-more :status="loadingType" v-if="loadingType == 'loading'"></uni-load-more>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { shop_data } from '@/api/merchant.js';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- export default {
- components: {
- empty,
- uniLoadMore
- },
- data() {
- let start = new Date(new Date().toLocaleDateString()).getTime();
- let a = new Date();
- let month = a.getMonth() + 1;
- let year = a.getFullYear() + '';
- if (month < 10) {
- month = '0' + month;
- } else {
- month = month + '';
- }
- return {
- height: '',
- loadingType: 'more',
- page: 1,
- limit: 10,
- monthList: {},
- loaded: false,
- month_momey: 0, //月营业额
- month_count: 0,//月订单数
- today_momey: '', //日营业额
- today_count: '', //今日订单数
- now_date: year + '-' + month,
- date: year + '-' + month //选择的日期不能超过今天
- };
- },
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.list-wrapper').boundingClientRect();
- query.exec(function(res) {
- console.log(res, 'ddddddddddddd');
- _this.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- onLoad() {
- console.log(this.tiday_start, 'start');
- console.log(this.now_date);
- this.loadData();
- },
- methods: {
- // 切换月份
- bindDateChange(e) {
- console.log(e.detail, 'dddddddddddd');
- this.now_date = e.detail.value;
- this.month_momey = 0;
- this.month_count = 0;
- this.loadData()
- },
- loadData() {
- const obj = this;
- shop_data({ month: this.now_date }).then(data => {
- console.log(data);
- obj.monthList = data.data.data;
- data.data.data.forEach(e => {
- console.log(e);
- obj.month_count += e.count;
- if (e.price != null) {
- obj.month_momey += (e.price)*1;
- }
- });
- obj.today_count = data.data.day.count;
- if(data.data.day.price != null){
- obj.today_momey = data.data.day.price;
- }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .top {
- height: 585rpx;
- // background-color: #f6f7f8;
- position: relative;
- .sybg {
- position: absolute;
- width: 100%;
- height: 265rpx;
- }
- .top-card {
- width: 688rpx;
- height: 398rpx;
- padding: 32rpx;
- background: #ffffff;
- box-shadow: -2rpx 4rpx 18rpx 0px rgba(0, 110, 238, 0.2);
- border-radius: 24rpx;
- position: absolute;
- right: 0;
- left: 0;
- bottom: 40rpx;
- margin: 0 auto;
- .now-tit {
- text-align: right;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .now-money {
- padding-top: 10rpx;
- text-align: right;
- font-size: 72rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #52c696;
- &::before {
- content: '¥';
- font-size: 44rpx;
- position: relative;
- bottom: 5rpx;
- }
- }
- .card-icon {
- position: absolute;
- top: 100rpx;
- left: 48rpx;
- width: 224rpx;
- height: 122rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .card-tit {
- display: flex;
- align-items: center;
- .tit-point {
- display: inline-block;
- width: 12rpx;
- height: 32rpx;
- background: #52c696;
- border-radius: 3rpx;
- margin-right: 17rpx;
- }
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .card-btm {
- position: absolute;
- bottom: 32rpx;
- width: 624rpx;
- height: 122rpx;
- background: linear-gradient(180deg, rgba(220, 184, 118, 0.12) 0%, rgba(220, 184, 118, 0) 100%);
- border-radius: 12rpx;
- .card-info {
- width: 50%;
- flex-shrink: 0;
- padding-left: 30rpx;
- justify-content: flex-start;
- align-items: center;
- image {
- width: 48rpx;
- height: 48rpx;
- }
- .info-wrap {
- padding-left: 20rpx;
- .info-tit {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .info-val {
- // padding-top: 15rpx;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #dcb876;
- text-align: center;
- }
- .dan {
- &::after {
- content: '单';
- font-size: 32rpx;
- position: relative;
- bottom: 3rpx;
- }
- }
- }
- }
- }
- }
- }
- .mid-tit {
- background-color: #fff;
- height: 80rpx;
- padding: 0 30rpx 0 33rpx;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 12rpx;
- .mid-left {
- image {
- margin-right: 13rpx;
- width: 33rpx;
- height: 33rpx;
- }
- }
- }
- .btm-tab {
- background-color: #fff;
- // padding: 0 30rpx 0 35rpx;
- .tab-top-left {
- text-align: left;
- padding-left: 35rpx;
- }
- .tab-top-center {
- text-align: center;
- }
- .tab-top-right {
- text-align: right;
- padding-right: 30rpx;
- }
- .tab-tit {
- height: 72rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- .tab-content {
- width: 33%;
- }
- }
- }
- .list-wrapper {
- background-color: #fff;
- .list {
- height: 70rpx;
- view {
- width: 33.3%;
- flex-shrink: 0;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .money {
- color: #52c696;
- }
- }
- }
- .choose-time {
- position: absolute;
- top: 90rpx;
- line-height: 1.5;
- padding-left: 32rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- </style>
|