123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <!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="bgc-back merchant_personal_active pb0 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" @click-right="mymerchant">
- <template #left>
- <van-icon name="arrow-left" color="#333"></van-icon>
- </template>
- <template #right>
- <div class="c333 f12">我的商户</div>
- </template>
- </van-nav-bar>
- <div class="merchant_achievement_topblock"></div>
- <van-tabs class="toptab" v-model="active" animated swipeable @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 ovh rel" v-if="active === 0">
- <van-col class="infobox infobox_personal merchant_active">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height: 100%!important; min-height:70vh">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <div class="panel bgcfff" v-for="obj in activeinfo">
- <div class="toppanel df">
- <div class="block"></div>
- <div class="f14 c333 b">{{obj.Date}}</div>
- </div>
- <div class="mainpanel">
- <div class="title df c333 f16 flexsb">
- <div>总激活</div>
- <div>{{obj.ActTotal}}户</div>
- </div>
- <div class="df c666 f12 flexsb" v-for="item in obj.TypeList">
- <div class="type">{{item.Brand}}</div>
- <div class="num_personal df cm"><span>{{item.Count}}户</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 rel" v-if="active === 1">
- <van-col class="infobox infobox_personal">
- <div class="panel bgcfff" v-for="obj in activeinfo">
- <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.ActTotal}}户</div>
- </div>
- <div class="df c666 f12 flexsb" v-for="item in obj.TypeList">
- <div class="type">{{item.Brand}}</div>
- <div class="num_personal df cm"><span>{{item.Count}}户</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>
- // 通过 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,
- loading: false,
- finished: false,
- refreshing: false,
- activeinfo:[
- ],
- showDate: false,
- minDate: new Date(2020, 0, 1),
- maxDate: new Date(),
- currentDate: new Date(),
- nowdate:'',
- pageinfo:{
- PageSize:20,
- PageNum:1
- },
- ismonth:false,
- };
- },
- created() {
- this.nowdate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1);
- this.gethalfyearinfo();
- },
- methods: {
- onLoad() {
- if (this.refreshing) {
- this.activeinfo = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- }
- this.pageinfo.PageNum++;
- this.getmonthinfo();
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onLoad();
- },
- changetab(){
- if(this.active === 0 && !this.ismonth) {
- this.activeinfo = []
- this.getmonthinfo();
- this.ismonth = true;
- }
- if(this.active === 1){
- this.activeinfo = []
- this.gethalfyearinfo();
- this.ismonth = false;
- };
- },
- choosetime(){
- 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);
- },
- onConfirmDate() {
- this.activeinfo = [];
- this.showDate = false;
- this.nowdate = this.currentDate.getFullYear() + '-' + (this.currentDate.getMonth() + 1);
- this.getmonthinfo();
- },
- async getmonthinfo(){
- //- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/pos/ActiveReward/ActMerchantForMonth?t='+Math.random(6),JSON.stringify({...this.pageinfo,TradeMonth:this.onConformateDate(),UserId}));
- if(res.status !== '1')return tips('月个人交易获取失败!');
- //- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo.PageSize - 1) {
- this.finished = true;
- };
- this.activeinfo.push(...res.data);
- this.loading = false;
- },
- async gethalfyearinfo(){
- //- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/pos/ActiveReward/ActMerchantForHalfYear?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId}));
- if(res.status !== '1')return tips('半年个人交易获取失败!');
- //- PublicLib.HideLoading();
- this.activeinfo = res.data;
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- mymerchant(){
- PublicLib.Goto({Url:'merchant-list'});
- },
- detail(id){
- PublicLib.putCookieInfo('producttypeId', id);
- PublicLib.Goto({Url:'merchant-personal-detail'});
- }
- }
- });
- </script>
- </body>
- </html>
|