123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <!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="pb0 ovh bgcf5f5f5">
- <div class="vip-administration" id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal" title="会员管理" v-if="toptitleisshow" @click-left="goback" left-arrow>
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="ovx-y ovh">
- <van-search v-model="searconent" @focus="inputsearch" @search="search" @blur="overlayisshow = false" left-icon="" right-icon="./static/images/index-search.png" shape="round" placeholder="请输入搜索关键词"> </van-search>
- <div class="rel" v-if="issearch">
- <van-cell class="c333 title" :title="'当前会员总数:'+vipcount+'人'" :value="'近7日新增会员:'+addvipcount+'人'"> </van-cell>
- <van-dropdown-menu :class="dropdownclass">
- <van-dropdown-item v-model="value1" @change="changesort" :title="value1 === 0 ? '排序':''" :options="option1"></van-dropdown-item>
- <van-dropdown-item title="筛选" ref="check">
- <template #default>
- <div class="checkmain">
- <div class="f14 c333">会员卡</div>
- <div class="check df">
- <div class="mr12 f12" :class="CardFlag === ''? 'checkitrem':'uncheckitrem'" @click="cardflag('')">全部</div>
- <div class="mr12 f12" :class="CardFlag === 1? 'checkitrem':'uncheckitrem'" @click="cardflag(1)">已领取</div>
- <div class="f12" :class="CardFlag === 0? 'checkitrem':'uncheckitrem'" @click="cardflag(0)">未领取</div>
- </div>
- <div class="f14 c333 mt20">累计消费金额</div>
- <div class="check df">
- <div class="mr12 f12" :class="ConsumerFlag === ''? 'checkitrem':'uncheckitrem'" @click="consumerflag('')">全部</div>
- <div class="mr12 f12" :class="ConsumerFlag === 1? 'checkitrem':'uncheckitrem'" @click="consumerflag(1)">近7日消费</div>
- <div class="f12" :class="ConsumerFlag === 0? 'checkitrem':'uncheckitrem'" @click="consumerflag(0)">近7日未消费</div>
- </div>
- </div>
- <div class="checkbtn df">
- <div class="resbtn tc" @click="reset">重置</div>
- <div class="surebtn tc" @click="checkfn">确定</div>
- </div>
- </template>
- </van-dropdown-item>
- </van-dropdown-menu>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="viplist.length === 0 ? 'isnodata':''">
- <van-empty class="custom-image" image="./static/images/no-data.png" description="暂无数据" v-if="viplist.length === 0"> </van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
- <div class="vipcard bgcfff df" v-for="item,index in viplist" :key="index"><img class="ovh" :src="item.Consumer.HeadPhoto" alt="">
- <div class="infocontainer">
- <div class="first df">
- <div class="c333 f16">{{item.Consumer.NickName}}</div>
- <div class="more f12">会员积分:<span class="more integral">{{item.Consumer.CurIntgegral}}</span></div>
- </div>
- <div class="sec df">
- <div class="c333 f12 df mb alc long">加入会员时间 <span class="integral n">{{item.CreateDate}}</span></div>
- <div class="c333 f12 df mb alc sor">累计消费次数 <span class="integral n">{{item.Consumer.TotalConsumCount}}</span></div>
- </div>
- <div class="sec df">
- <div class="c333 f12 df mb alc long">累计消费金额<span class="integral n">{{item.Consumer.TotalAmount | tofixed2}}元</span></div>
- <div class="c333 f12 df mb alc sor" v-if="item.paymode === 1"><img src="./static/images/alipay-no.png" alt=""><img src="./static/images/wechat.png" alt=""></div>
- <div class="c333 f12 df mb alc sor" v-else><img src="./static/images/alipay.png" alt=""><img src="./static/images/wechat-no.png" alt=""></div>
- </div>
- <div class="dissipate c999">最近消费时间 {{item.Consumer.LastConsumDate}}</div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- <van-overlay :show="overlayisshow" @click="overlayisshow = false"> </van-overlay>
- </div>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:true,
- issearch:true,
- loading: false,
- finished: false,
- refreshing: false,
- overlayisshow:false,
- searconent:'',
- vipcount:0,
- addvipcount:0,
- value1: 0,
- option1: [
- { text: '默认排序', value: 0 },
- { text: '累计消费次数', value: 3 },
- { text: '累计消费金额', value: 4 },
- ],
- viplist:[
- ],
- pageinfo:{
- PageNum:1,
- PageSize:10,
- },
- CardFlag:'',
- ConsumerFlag:'',
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.getmangementdata();
- this.getvipcount();
- },
- computed: {
- //- 筛选状态
- dropdownclass(){
- if(this.value1 !== 0 && this.CardFlag === '' && this.ConsumerFlag === '') {
- return 'sptitle'
- }else if((this.CardFlag !== '' || this.ConsumerFlag !== '') && this.value1 === 0){
- return 'sp2title'
- }else if (this.value1 !== 0 &&( this.CardFlag !== '' || this.ConsumerFlag !== '')){
- return 'sptitle sp2title'
- };
- }
- },
- methods: {
- //- 获取统计数据
- async getmangementdata(){
- let MerchantId = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/usercardrecord/list?t='+Math.random(6),JSON.stringify({...this.pageinfo,MerchantId,SearchKey:this.searconent,Sort:this.value1,CardFlag:this.CardFlag,ConsumerFlag:this.ConsumerFlag}));
- if(res.status !== '1') return tips(res.info);
- res.data.forEach(item=>{
- item.Consumer.NickName = '152415'
- });
- if(res.data.length<this.pageinfo.PageSize){
- this.finished = true;
- };
- this.viplist.push(...res.data);
- this.loading = false;
- },
- //- 获取会员数据
- async getvipcount(){
- 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.vipcount = res.data.TotalCustomer;
- this.addvipcount = res.data.SevenDayConsumer;
- },
- //- 更改排序方式
- changesort(){
- this.viplist = [];
- this.pageinfo.PageNum = 1;
- this.getmangementdata();
- },
- //- 筛选
- checkfn(){
- this.viplist = [];
- this.pageinfo.PageNum = 1;
- this.getmangementdata();
- this.$refs.check.toggle(false);
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- inputsearch(){
- this.overlayisshow = true;
-
- },
- //- 搜索
- search(){
- //- if(this.searconent === ''){
- //- this.issearch = true;
- //- } else{
- //- this.issearch = false;
- //- }
- this.viplist = [];
- this.pageinfo.PageNum = 1;
- this.getmangementdata();
- },
- cardflag(flag){
- this.CardFlag = flag;
- },
- consumerflag(flag){
- this.ConsumerFlag = flag;
- },
- reset(){
- this.ConsumerFlag = '';
- this.CardFlag = '';
- },
- onLoad() {
- if (this.refreshing) {
- this.viplist = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- };
- //- console.log(555)
- this.pageinfo.PageNum++;
- this.getmangementdata();
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onLoad();
- },
- }
- });
- </script>
- </body>
- </html>
|