123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839 |
- <template>
- <block>
- <view class="topBack" :style="'top: ' + menuButton.top + 'px'">
- {{pages > 1}}
- <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>
-
- </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>
-
- </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>
-
- </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>
- {{item.score}}
- </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>
-
- 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>
|