123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382 |
- <!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">
- <style>
- .infobox::-webkit-scrollbar {
- display: none;
- }
- .infobox{
- height:calc(100vh - 4.3333rem) !important;
- }
- .main .strong_colorroll .van-pull-refresh{
- height:calc(100vh - 4.3333rem) !important;
- }
- .main .peoname{
- height:calc(100vh - 4.3333rem) !important;
- }
- </style>
- </head>
- <body class="bgc-back pb0 h100p ovh">
- <div class="iphonetitle"> </div>
- <div class="merchant_achievement" id="app" v-cloak>
- <van-nav-bar class="camp_title user_title_normal titlef16 left_icon_cfff" left-arrow title="计奖交易" v-if="toptitleisshow" @click-left="goback">
- <template #left>
- <van-icon name="arrow-left" color="#333"> </van-icon>
- </template>
- </van-nav-bar>
- <div class="merchant_achievement_topblock"></div>
- <van-tabs class="toptab" v-model="active" swipeable animated @change="changetab" title-active-color="#FF5A32" title-inactive-color="#333" line-width="32" line-height="2">
- <van-tab>
- <template #title>
- <div @click="choosetime"><span>{{nowdate}}</span>
- <van-icon name="arrow"></van-icon>
- </div>
- </template>
- <van-row class="main rel" v-if="active === 0">
- <van-col class="bgcfff peoname abs">
- <van-sidebar v-model="activeKey" @change="onChange">
- <div class="merchant_active">
- <van-pull-refresh v-model="refreshing2" @refresh="onRefresh2" style="min-height: 50vh;">
- <van-list v-model="loading2" :finished="finished2" finished-text="" @load="onLoad2" :immediate-check="false">
- <van-sidebar-item v-for="item in nameList" :title="item.RealName"></van-sidebar-item>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-sidebar>
- </van-col>
- <van-col class="infobox">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height: 100%;">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <div class="panel bgcfff" v-for="obj,index in data" :key="index">
- <div class="toppanel df">
- <div class="block"></div>
- <div class="f14 c333 b">{{obj.TradeDate}}</div>
- </div>
- <div class="mainpanel">
- <div class="title df c333 f16 flexsb">
- <div>总交易额(元)</div>
- <div>{{obj.TradeAmount | tofixed2}}</div>
- </div>
- <div class="type_panel df flexsb">
- <div style="flex:1">
- <div class="type c999">POS机刷卡交易额</div>
- <div class="money f12">{{obj.TotalPosAmount | tofixed2}}</div>
- </div>
- <div style="flex:.2">
- <div class="line"></div>
- </div>
- <div style="flex:1">
- <div class="type c999">云闪付小额交易额</div>
- <div class="money f12">{{obj.TotalCloudPayAmount | tofixed2}}</div>
- </div>
- </div>
- <div class="type_panel df flexsb">
- <div style="flex:1">
- <div class="type c999">码牌活动交易</div>
- <div class="money f12">{{obj.TotalActiveAmount | tofixed2}}</div>
- </div>
- <div style="flex:.2">
- <div class="line"></div>
- </div>
- <div style="flex:1">
- <div class="type c999">码牌非活动交易</div>
- <div class="money f12">{{obj.TotalUnActiveAmount | tofixed2}}</div>
- </div>
- </div>
- <div class="df c666 f12 flexsb" v-for="item in obj.ProductList">
- <div class="type">{{item.Name}}</div>
- <div class="num_personal df cm"><span>{{item.Amount}}元</span></div>
- </div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </van-col>
- </van-row>
- </van-tab>
- <van-tab>
- <template #title><span>近半年</span></template>
- <van-row class="main ovh rel" v-if="active === 1">
- <van-col class="bgcfff peoname abs">
- <van-sidebar v-model="activeKey" @change="onChange">
- <div class="merchant_active">
- <van-pull-refresh v-model="refreshing2" @refresh="onRefresh2" style="min-height: 50vh;">
- <van-list v-model="loading2" :finished="finished2" finished-text="" @load="onLoad2">
- <van-sidebar-item v-for="item in nameList" :title="item.RealName"></van-sidebar-item>
- </van-list>
- </van-pull-refresh>
- </div>
- </van-sidebar>
- </van-col>
- <van-col class="infobox marginleft">
- <div class="panel bgcfff" v-for="obj,index in data" :key="index">
- <div class="toppanel df">
- <div class="block"></div>
- <div class="f14 c333 b">{{obj.TradeMonth}}</div>
- </div>
- <div class="mainpanel">
- <div class="title df c333 f16 flexsb">
- <div>总交易额(元)</div>
- <div>{{obj.TradeAmount | tofixed2}}</div>
- </div>
- <div class="type_panel df flexsb">
- <div style="flex:1">
- <div class="type c999">POS机刷卡交易额</div>
- <div class="money f12">{{obj.TotalPosAmount | tofixed2}}</div>
- </div>
- <div style="flex:.2">
- <div class="line"></div>
- </div>
- <div style="flex:1">
- <div class="type c999">云闪付小额交易额</div>
- <div class="money f12">{{obj.TotalCloudPayAmount | tofixed2}}</div>
- </div>
- </div>
- <div class="type_panel df flexsb">
- <div style="flex:1">
- <div class="type c999">码牌活动交易</div>
- <div class="money f12">{{obj.TotalActiveAmount | tofixed2}}</div>
- </div>
- <div style="flex:.2">
- <div class="line"></div>
- </div>
- <div style="flex:1">
- <div class="type c999">码牌非活动交易</div>
- <div class="money f12">{{obj.TotalUnActiveAmount | tofixed2}}</div>
- </div>
- </div>
- <div class="df c666 f12 flexsb" v-for="item in obj.ProductList">
- <div class="type">{{item.Name}}</div>
- <div class="num_personal df cm"><span>{{item.Amount}}元</span></div>
- </div>
- </div>
- </div>
- </van-col>
- </van-row>
- </van-tab>
- </van-tabs>
- <van-popup class="product_mymerchant_transaction" v-model="showDate" position="bottom" :style="{ height: '50%' }" v-cloak>
- <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" @cancel="showDate = false" :formatter="formatter" @confirm="onConfirmDate"></van-datetime-picker>
- </van-popup>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:true,
- active:1,
- activeKey: 0,
- loading: false,
- finished: false,
- loading2: false,
- refreshing2: false,
- finished2: false,
- refreshing:false,
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- pageinfo2:{
- PageSize:20,
- PageNum:1
- },
- minDate: new Date(2020, 0, 1),
- maxDate: new Date(),
- currentDate: new Date(),
- nowdate:'',
- showDate: false,
- nameList:[
- {RealName:'总业绩',Id:''}
- ],
- data:[
- ],
- ismonth:false,
- merchantId:'',
- Id:'',
- };
- },
- created() {
- this.onConfirmDate();
- this.getmerchantlist();
- },
- methods: {
- onChange(index) {
- const people = this.nameList.find((item,ind)=>ind === index);
- //- this.data = [];
- this.merchantId = people.Id;
- if(this.active === 0) {
- this.pageinfo.PageNum = 1;
- this.getmonthinfo('refresh',this.merchantId);
- }else{
- this.gethalfyearinfo(people.Id);
- };
- },
- onLoad() {
- if(this.refreshing){
- this.refreshing = false;
- };
- this.pageinfo.PageNum++;
- this.getmonthinfo('onload',this.Id);
- },
- onLoad2() {
- if(this.refreshing2){
- this.refreshing2 = false;
- }
- this.pageinfo2.PageNum++;
- this.getmerchantlist();
- },
- changetab(){
- this.pageinfo.PageNum = 1;
- this.pageinfo2.PageNum = 1;
- //- this.activeKey = 0;
- //- this.nameList = [{RealName:'全部',Id:''}];
- //- this.getmerchantlist();
- console.log(this.active,'active')
- console.log(this.activeKey,'activeKey')
- if(this.active === 0 && !this.ismonth) {
- //- this.data = []
- this.getmonthinfo('refresh',this.Id);
- this.ismonth = true;
- };
- if(this.active === 1){
- //- this.data = []
- this.gethalfyearinfo(this.Id);
- this.ismonth = false;
- };
- },
- onRefresh() {
- this.pageinfo.PageNum = 1;
- // 清空列表数据
- this.finished = false;
- this.getmonthinfo('refresh',this.Id);
- //- this.data = [];
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- //- this.onLoad();
- },
- onRefresh2(){
- this.pageinfo2.PageNum = 0;
- // 清空列表数据
- this.finished = false;
- //- this.nameList = [];
-
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.onLoad2();
- this.loading2 = true;
- },
- choosetime(e){
- if(this.active === 0) {
- e.stopPropagation();
- }
- if(this.active !== 0) return;
- this.showDate = true;
- },
- formatter(type, val) {
- if (type === 'year') {
- return `${val}年`;
- } else if (type === 'month') {
- return `${val}月`;
- } else if (type === 'day') {
- return `${val}日`;
- }
- return val;
- },
- onConformateDate(){
- return formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
- },
- onParamsDate(date){
- return formatDate(new Date(date).getFullYear(),new Date(date).getMonth() + 1);
- },
- onConfirmDate() {
- //- this.data = [];
- this.showDate = false;
- this.nowdate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1);
- this.ismonth = false;
- this.changetab();
- },
- async getmonthinfo(type,UserId){
- this.finished = false;
- //- const UserId = PublicLib.getCookieInfo('userId');
- const MerchantId = this.nameList[this.activeKey].Id
- this.Id = UserId ? UserId : PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/usertradedaysummary/teamperformanceforday?t='+Math.random(6),JSON.stringify({...this.pageinfo,TradeMonth:this.onConformateDate(),UserId:this.Id,MerchantId}));
- if(res.status !== '1')return tips('月计奖交易获取失败!');
- if(res.data.length < this.pageinfo.PageSize - 1) {
- this.finished = true;
- };
- if(type === 'refresh'){
- this.data = res.data
- this.refreshing = false;
- }else{
- this.data.push(...res.data);
- }
- this.loading = false;
- },
- async gethalfyearinfo(UserId){
- this.Id = UserId ? UserId : PublicLib.getCookieInfo('userId');
- const MerchantId = this.nameList[this.activeKey].Id
- console.log(this.nameList[this.activeKey].Id,'xxxxxxxxxxxxxxxxxx')
- const res = await getRequest('api/v1/usertradedaysummary/teamperformancehalfyear?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId:this.Id,MerchantId}));
- if(res.status !== '1')return tips('半年计奖交易获取失败!');
- this.data = res.data;
- },
- async getmerchantlist(){
- //- PublicLib.ShowLoading({Message:''});
- this.finished2 = false;
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/users/mymakerlist?t='+Math.random(6),JSON.stringify({...this.pageinfo2,UserLevel:'',RealName:'',UserId,Sort:1}));
- if(res.status !== '1')return tips('创客列表获取失败!');
- //- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo2.PageSize) {
- this.finished2 = true;
- };
- if(this.pageinfo2.PageNum === 1){
- this.nameList = [
- {RealName:'总业绩',Id:''},
- ];
- };
- this.nameList.push(...res.data);
- this.loading2 = false;
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- gotransactiondetail(date,item){
- PublicLib.putCookieInfo('paramstime', this.onParamsDate(date));
- PublicLib.putCookieInfo('transactiontype', '计奖交易');
- PublicLib.putCookieInfo('topshowtimetime', date);
- PublicLib.putCookieInfo('merchantName', item.Name);
- PublicLib.putCookieInfo('merchantTypeId', item.Id);
- PublicLib.Goto({Url:'transaction-detail'});
- }
- }
- });
- </script>
- </body>
- </html>
|