123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>经营数据-创业帮</title>
- <meta name="keywords" content="经营数据-创业帮">
- <meta name="description" content="经营数据-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="经营数据-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="ovh bgcf7f7f7" style="padding:0;">
- <div class="management" id="app" v-cloak>
- <van-nav-bar class="mall_title bottom_line" title="经营数据" v-if="toptitleisshow"></van-nav-bar>
- <van-tabs v-model="pagetabinfo" @click="tabschange">
- <van-tab title="日">
- <div class="chosetime df bgcfff" @click="pickerisshow = true">
- <div class="f14 c333">选择时间</div>
- <div class="choseicon mr12"></div>
- <div class="f14">{{chosedata}}</div>
- </div>
- <div class="management-ovx-y">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height:0vh;height:100%;" :class="Daydata.length === 0 ? 'isnodata':''">
- <van-empty class="custom-image" image="./static/images/no-data.png" description="暂无日数据" v-if="Daydata.length === 0"> </van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
- <div class="dailypanel bgcfff" v-for="item,index in Daydata" :key="index">
- <div class="titledate c333 f16 mb">{{item.Date}}</div>
- <div class="df dataitem">
- <div class="f12 c999">实收总金额(元)</div>
- <div class="f16 c333 mb"> {{item.Amount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">微信实收</div>
- <div class="f16 c333 mb">{{item.WeChatAmount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">支付宝实收</div>
- <div class="f16 c333 mb">{{item.AlipayAmount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">订单数</div>
- <div class="f16 c333 mb">{{item.OrderCount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">新增会员</div>
- <div class="f16 c333 mb">{{item.AddCount}}</div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- <van-tab title="月">
- <div class="management-moth-ovx-y">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height:0vh;height:100%;" :class="Monthdata.length === 0 ? 'isnodata':''">
- <van-empty class="custom-image" image="./static/images/no-data.png" description="暂无月数据" v-if="Monthdata.length === 0"> </van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
- <div class="dailypanel bgcfff" v-for="item,index in Monthdata" :key="index">
- <div class="titledate c333 f16 mb">{{item.Month}}</div>
- <div class="df dataitem">
- <div class="f12 c999">实收总金额(元)</div>
- <div class="f16 c333"> {{item.Amount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">微信实收</div>
- <div class="f16 c333 mb">{{item.WeChatAmount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">支付宝实收</div>
- <div class="f16 c333 mb">{{item.AlipayAmount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">订单数</div>
- <div class="f16 c333 mb">{{item.OrderCount}}</div>
- </div>
- <div class="df dataitem">
- <div class="f12 c999">新增会员</div>
- <div class="f16 c333 mb">{{item.AddCount}}</div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-tab>
- <van-tab title="总">
- <div class="management-ovx-y">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height:0vh;height:100%;" :class="Monthdata.length === 0 ? 'isnodata':''">
- <div class="dailypanel bbln bgcfff">
- <div class="df dataitem totledataitem">
- <div class="f12 c999">统计时间</div>
- <div class="f16 c333"> {{Alldata.CreateDate}}</div>
- </div>
- <div class="df dataitem totledataitem">
- <div class="f12 c999">实收总金额(元)</div>
- <div class="f16 c333 mb">{{Alldata.TotalActual}}</div>
- </div>
- <div class="df dataitem totledataitem">
- <div class="f12 c999">微信实收(元)</div>
- <div class="f16 c333 mb">{{Alldata.WeChatTotal}}</div>
- </div>
- <div class="df dataitem totledataitem">
- <div class="f12 c999">支付宝实收(元)</div>
- <div class="f16 c333 mb">{{Alldata.AlipayTotal}}</div>
- </div>
- <div class="df dataitem totledataitem">
- <div class="f12 c999">订单总数</div>
- <div class="f16 c333 mb">{{Alldata.TotalOrder}}</div>
- </div>
- <div class="df dataitem totledataitem">
- <div class="f12 c999">会员总数</div>
- <div class="f16 c333 mb">{{Alldata.TotalCustomer}}</div>
- </div>
- </div>
- </van-pull-refresh>
- </div>
- </van-tab>
- </van-tabs>
- <van-action-sheet v-model="pickerisshow">
- <van-datetime-picker v-model="currentDate" round type="year-month" @confirm="chosedate" @cancel="pickerisshow = false" title="选择年月" :min-date="minDate" :max-date="maxDate" :formatter="formatter"></van-datetime-picker>
- </van-action-sheet>
- <van-tabbar v-model="active" active-color="#FF502A" v-cloak v-if="tabsisshow">
- <van-tabbar-item icon="home-o" @click="index">工作台
- <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="search">经营数据
- <template #icon="props"><img :src="props.active ? icon2.active : icon2.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="friends-o" @click="notice">消息
- <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="setting-o" @click="user">我的
- <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
- </van-tabbar-item>
- </van-tabbar>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- function OnStart(){
- app.getnoticecount();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- //- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- finished: false,
- refreshing: false,
- pickerisshow:false,
- pagetabinfo:0,
- active: 1,
- toptitleisshow:false,
- minDate: new Date(2021, 0, 1),
- maxDate: new Date(),
- currentDate: new Date(),
- icon1: {
- active: './static/images/tab-icon1-active.png',
- inactive: './static/images/tab-icon1-no.png',
- },
- icon2: {
- active: './static/images/tab-icon2-active.png',
- inactive: './static/images/tab-icon2-no.png',
- },
- icon3: {
- active: './static/images/tab-icon3-active.png',
- inactive: './static/images/tab-icon3-no.png',
- },
- icon4: {
- active: './static/images/tab-icon4-active.png',
- inactive: './static/images/tab-icon4-no.png',
- },
- Daydata:[],
- Monthdata:[],
- Alldata:[],
- pageinfo:{
- PageNum:1,
- PageSize:10,
- },
- chosedata:'',
- }
- },
- created() {
- this.tabsisshow = false;
- this.getmangementdaydata();
- this.chosedata = this.formatter('year',new Date().getFullYear()) + this.formatter('month',new Date().getMonth() + 1);
- },
- methods: {
- //- 时间处理函数
- formattate(){
- return this.currentDate.getFullYear() +''+ (fillzero(this.currentDate.getMonth() + 1));
- },
- //- 获取日统计数据
- async getmangementdaydata(){
- let MerchantId = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/consumerorders/bydate?t='+Math.random(6),JSON.stringify({...this.pageinfo,MerchantId,Month:this.formattate()}));
- if(res.status !== '1') return tips(res.info);
- if(res.data.length < this.pageinfo.PageSize){
- this.finished = true;
- };
- this.Daydata.push(...res.data);
- this.loading = false;
- },
- //- 获取月统计数据
- async getmangementmonthdata(){
- let MerchantId = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/consumerorders/bymonth?t='+Math.random(6),JSON.stringify({...this.pageinfo,MerchantId}));
- if(res.status !== '1') return tips(res.info);
- if(res.data.length < this.pageinfo.PageSize){
- this.finished = true;
- };
- this.Monthdata.push(...res.data);
- this.loading = false;
- },
- //- 获取总统计数据
- async getmangementalldata(){
- let Id = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/merchantinfo/statdata?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips(res.info);
- this.Alldata = res.data;
- this.Alldata.data = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}`;
- },
- tabschange(index){
- this.finished = false;
- this.pageinfo.PageNum = 0;
- switch(index){
- case 0:
- this.Daydata = [];
- this.Monthdata = [];
- this.loading = true;
- this.getmangementdaydata();
- break;
- case 1:
- this.Daydata = [];
- this.Monthdata = [];
- this.loading = true;
- this.getmangementmonthdata();
- break;
- case 2:
- this.getmangementalldata();
- break;
- }
- },
- formatter(type, val) {
- if (type === 'year') {
- return `${val}年`;
- } else if (type === 'month') {
- return `${val}月`;
- }
- return val;
- },
- chosedate(a){
- this.chosedata = this.formatter('year',new Date(a).getFullYear()) + this.formatter('month',new Date(a).getMonth() + 1);
- this.Daydata = [];
- this.getmangementdaydata();
- this.pickerisshow = false;
- },
- onLoad() {
- if(this.pagetabinfo === 0){
- if (this.refreshing) {
- this.Daydata = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- }
- this.pageinfo.PageNum++;
- this.getmangementdaydata();
- }else if(this.pagetabinfo === 1){
- if (this.refreshing) {
- this.Monthdata = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- }
- this.pageinfo.PageNum++;
- this.getmangementmonthdata();
- }else{
- if (this.refreshing) {
- this.refreshing = false;
- }
- this.getmangementalldata();
- };
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onLoad();
- },
- index(){
- PublicLib.Goto({Url:'index'});
- },
- notice(){
- PublicLib.Goto({Url:'notice-center'});
- },
- user(){
- PublicLib.Goto({Url:'user-center'});
- },
- }
- });
- </script>
- </body>
- </html>
|