<template> <block> <view class="topBack" :style="'top: ' + menuButton.top + 'px'"> <!-- <text class="ico-moon icon-leftarrow" wx:if="{{pages > 1}}" bindtap="toPage" data-mold="back"></text> --> <image v-if="pages > 1" @tap="toback" src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f566738e424f33a415dea22dc4e11eec.png" class="ico-moon"></image> <image mode="heightFix" :style="'height: ' + menuButton.height * 2 + 'rpx'" @tap="toPage" data-url="/pages/index/index" class="h-backBtn" v-else src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2847/41c5f36528b8f4204130c4977c1ec2c5.png"> </image> <view class="userName">后台管理</view> </view> <view class="tpBg"></view> <view class="content"> <view class="box"> <view class="totalAllTitle">今日营业额(元)</view> <view class="total"> <view class="totalNum">{{ info.today }}</view> </view> <view class="datas"> <view class="dataItem"> <view>昨日营业额</view> <view>{{ info.yesterday }}</view> <!-- <image src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/0a57e6af52d6001a69c585478c71f8b6.png" mode="widthFix" class="iicon"></image> --> </view> <view class="dataItem"> <view>当月营业额</view> <view>{{ info.month }}</view> </view> <view class="dataItem"> <view>总营业额</view> <view>{{ info.total }}</view> </view> </view> </view> <view class="box1"> <view class="iItem" @tap="toPage" :data-url="item.url" v-for="(item, index) in list2" :key="index"> <view class="iLeft"> <image :src="item.icon" mode="widthFix"></image> <view>{{ item.name }}</view> </view> <image src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/9badd173c236af20edc6f800111d24c3.png" mode="widthFix" class="iRight"></image> </view> </view> <view class="box" style="padding-bottom: 30rpx;"> <view class="shopname">八十一坊1935(元)</view> <view class="datas" style="padding-top: 30rpx;"> <view class="dataItem"> <view>今日营业额</view> <view>{{ info2.bsyToday }}</view> <!-- <image src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/0a57e6af52d6001a69c585478c71f8b6.png" mode="widthFix" class="iicon"></image> --> </view> <view class="dataItem"> <view>本月营业额</view> <view>{{ info2.bsyMonth }}</view> </view> <view class="dataItem"> <view>总营业额</view> <view>{{ info2.bsyTotal }}</view> </view> </view> </view> <view class="box" style="padding-bottom: 30rpx;"> <view class="shopname">成义酒坊</view> <view class="datas" style="padding-top: 30rpx;"> <view class="dataItem"> <view>今日营业额</view> <view>{{ info2.cyToday }}</view> <!-- <image src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/0a57e6af52d6001a69c585478c71f8b6.png" mode="widthFix" class="iicon"></image> --> </view> <view class="dataItem"> <view>本月营业额</view> <view>{{ info2.cyMonth }}</view> </view> <view class="dataItem"> <view>总营业额</view> <view>{{ info2.cyTotal }}</view> </view> </view> </view> <view class="timeSelect"> <view class="pickwrap"> <picker class="aaaa" @change="bindPickerChange" :value="index" :range="array"> <view class="uni-input">{{array[index]}} <view class="arow"> › </view> </view> </picker> </view> <view> 收入:¥{{income}} </view> </view> <block v-for="(item, index) in list" :key="index"> <view class="orderItem"> <view class="info1"> <view>{{item.have_paid }}</view> <view>{{item.status}} </view> </view> <view class="orderinfo"> <image :src="item.image"> </image> <view class="orderdesc"> <view class="desctop"> <view>{{item.title}}</view> <!-- <view>+{{item.score}}积分</view> --> </view> <view class="descbot"> <view>购买人:{{item.buyer||''}}</view> <view>实付:¥{{item.total_price}}</view> </view> </view> </view> <block v-for="(item2,index2) in item.share" :key="index2"> <view class="ordertip" v-if="item2.lv !=-1"> <view>{{item2.lv}}级分销:{{item2.username}} </view> <view>+{{item2.num}}</view> </view> </block> </view> </block> <view v-if="!list.length" style='color:#999;text-align:center;margin:100rpx 0;'>暂无数据</view> </view> </block> </template> <script module="parse" lang="wxs"> module.exports = { filterTime: function(time) { console.log(time) var nowDate = getDate(time * 1000); var year = nowDate.getFullYear(); var month = nowDate.getMonth() + 1; var date = nowDate.getDate(); var hours = nowDate.getHours(); var minutes = nowDate.getMinutes(); var seconds = nowDate.getSeconds(); month = month > 9 ? month : '0' + month; date = date > 9 ? date : '0' + date; hours = hours > 9 ? hours : '0' + hours; minutes = minutes > 9 ? minutes : '0' + minutes; seconds = seconds > 9 ? seconds : '0' + seconds; return year + '-' + month + '-' + date + " " + hours + ":" + minutes + ":" + seconds; } } </script> <script> // pages/backstage/index/index.js var app = getApp(); export default { data() { return { list2: [{ name: '团队管理', icon: 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/612dcfbf599a0be79cab31e7e9ceb651.png', url: '/pages/term/manage' }, ], info: { }, info2: { }, pages: '', menuButton: { top: '', height: 0 }, Page: 0, index: 0, array: ['2022年1月', '2022年2月', '2022年3月', '2022年4月', '2022年5月', '2022年6月', '2022年7月', '2022年8月', '2022年9月', '2022年10月', '2022年11月', '2022年12月' ], array2: ['2022-01', '2022-02', '2022-03', '2022-04', '2022-05', '2022-06', '2022-07', '2022-08', '2022-09', '2022-10', '2022-11', '2022-12', ], page: 1, pageSize: 10, list: [], loaded: false, income:0 }; } /** * 生命周期函数--监听页面加载 */ , onLoad: function(options) { let page = getCurrentPages(); var menuButton = uni.getMenuButtonBoundingClientRect(); console.log(menuButton); this.pages = page.length; this.menuButton = menuButton; var nowdate = new Date(); var mounth = nowdate.getMonth(); console.log(mounth) this.index = mounth this.getinfo(); //获取统计营业额 this.getinfo1();//获取指定类型营业额 this.getlist(); //获取订单列表 }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() {}, /** * 生命周期函数--监听页面显示 */ onShow: function() {}, /** * 生命周期函数--监听页面隐藏 */ onHide: function() {}, /** * 生命周期函数--监听页面卸载 */ onUnload: function() {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { this.init(); this.getlist(); uni.stopPullDownRefresh(); }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function() { this.loaded || this.getlist(); }, /** * 用户点击右上角分享 */ onShareAppMessage: function() {}, methods: { bindPickerChange: function(e) { console.log('picker发送选择改变,携带值为', e.detail.value) this.index = e.detail.value }, async getinfo() { let data = await this.$api.request('/stats/getByDateStats'); console.log(data) this.info = data; }, async getinfo1() { let data = await this.$api.request('/stats/getByTypeStats'); console.log(data) this.info2 = data; }, async getlist() { var that = this; let res = await this.$api.request('/stats/getByDateOrder', 'GET', { page: this.page, count: this.pageSize, date:this.array2[this.index] }); console.log(res) if (res) { this.income = res.income if (res.rows.length > 0) { this.list = this.list.concat(res.rows); this.page++; } else { this.loaded = true this.$api.msg('没有更多数据'); } } }, init() { this.page = 1 this.loaded = false this.list = [] }, toPage(e) { app.globalData.toPage(e); }, toback() { uni.navigateBack({ delta: 1 }); }, } }; </script> <style> page { background: #F4F5F9; } .topBack { position: absolute; top: 0; left: 0; z-index: 1; margin-top: 2rpx; display: flex; align-items: center; } .topBack .ico-moon { padding: 0 0rpx 0 30rpx; width: 70rpx; height: 40rpx; } .h-backBtn { margin-left: 30rpx; } .homeImg { height: 40rpx; width: 40rpx; margin-right: 10rpx; } .userName { font-size: 28rpx; color: #fff; margin-left: 20rpx; font-size: 36rpx; } .tpBg { background: #FE5879; background-size: 100% 100%; width: 100%; height: 380rpx; } .content { margin: -180rpx 30rpx 25rpx; } .box { border-radius: 12rpx; background: #fff; padding: 50rpx 20rpx 40rpx; margin-bottom: 25rpx; } .totalAllTitle { color: #9194A6; margin-bottom: 28rpx; text-align: center; } .total { display: flex; align-items: center; justify-content: center; padding-bottom: 20rpx; } .totalNum { font-size: 50rpx; } .totalJump { display: flex; align-items: center; width: 220rpx; height: 70rpx; justify-content: center; background: #FB4C6F; border-radius: 12rpx; border-radius: 12rpx; } .totalJump>view { font-size: 28rpx; color: #fff; } .totalJump>image { width: 14rpx; margin-left: 14rpx; margin-top: 5rpx; } .tip { font-size: 30rpx; padding-bottom: 10rpx; } .iItem { display: flex; align-items: center; justify-content: space-between; padding: 32rpx 0; border-bottom: 1px solid #E4E5EE; } .iItem:last-child { border-bottom: none; padding-bottom: 0; } .iLeft { display: flex; align-items: center; } .iLeft>image { width: 40rpx; } .iLeft>view { font-size: 28rpx; margin-left: 32rpx; } .iRight { width: 12rpx; } .datas { padding-top: 50rpx; display: flex; align-items: center; justify-content: space-between; padding-bottom: 16rpx; } .dataItem { display: flex; flex-direction: column; align-items: center; position: relative; } .dataItem>view:nth-child(1) { color: #9194A6; } .dataItem>view:nth-child(2) { margin-top: 15rpx; font-size: 30rpx; } .iicon { width: 28rpx; position: absolute; top: 4rpx; right: -38rpx; } .btns { display: flex; align-items: center; justify-content: space-around; } .btn1 { background: #fff; border: 1px solid #9194A6; color: #011B33 !important; } .btn1>view { color: #011B33 !important; } .box1 { border-radius: 12rpx; background: #fff; padding: 50rpx; margin-bottom: 25rpx; padding-top: 0; } .iItem { display: flex; align-items: center; justify-content: space-between; padding: 32rpx 0; border-bottom: 1px solid #e4e5ee; } .iItem:last-child { border-bottom: none; padding-bottom: 0; } .iLeft { display: flex; align-items: center; } .iLeft>image { width: 40rpx; } .iLeft>view { font-size: 28rpx; margin-left: 32rpx; } .iRight { width: 12rpx; } view { font-size: 24rpx; } .rWrap { display: flex; align-items: center; } .intergal { color: #000000; font-size: 30rpx; margin-right: 12rpx; } .shopname { color: #010101; font-size: 28rpx; } .timeSelect { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20rpx; margin-top: 40rpx; } .aaaa { display: flex; align-items: center; } .uni-input { font-size: 30rpx; color: #000000; } .arow { margin-left: 10rpx; transform: rotate(90deg); display: inline-block; color: #000000; font-size: 30rpx; } .timeSelect>view:nth-child(2) { color: #8E8E8E; font-size: 26rpx; } .orderItem { background: #fff; padding: 30rpx 20rpx; box-sizing: border-box; border-radius: 12rpx; margin-bottom: 24rpx; } .info1 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; } .info1>view:nth-child(1) { font-size: 24rpx; color: #8E8E8E; } .info1>view:nth-child(2) { font-size: 24rpx; color: #7B9D3E; } .orderinfo { display: flex; align-items: center; padding-bottom: 36rpx; border-bottom: 1px solid #F0EDF1; } .orderinfo1 { display: flex; align-items: center; margin-top: 20rpx; } .orderinfo1>image { width: 100rpx; height: 100rpx; } .orderinfo>image { width: 100rpx; height: 100rpx; } .orderdesc { margin-left: 15rpx; flex: 1; } .desctop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10rpx; } .desctop>view:nth-child(1) { color: #010101; font-size: 28rpx; width: 280rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .desctop>view:nth-child(2) { font-size: 26rpx; font-weight: 700; color: #FB4C6F; } .descbot { display: flex; align-items: center; justify-content: space-between; } .descbot>view:nth-child(1) { color: #8E8E8E; font-size: 28rpx; width: 302rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .descbot>view:nth-child(2) { color: #8E8E8E; font-size: 24rpx; } .ordertip { margin: 20rpx 0 0; padding-left: 136rpx; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; } .ordertip>view:nth-child(1) { font-size: 24rpx; color: #8E8E8E; width: 350rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ordertip>view:nth-child(2) { font-size: 26rpx; font-weight: 700; color: #FB4C6F; } </style>