vip-administration.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>会员管理-创业帮</title>
  6. <meta name="keywords" content="会员管理-创业帮">
  7. <meta name="description" content="会员管理-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="会员管理-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="pb0 ovh bgcf5f5f5">
  18. <div class="vip-administration" id="app" v-cloak>
  19. <van-nav-bar class="user_rank_explan_title user_title_normal" title="会员管理" v-if="toptitleisshow" @click-left="goback" left-arrow>
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="ovx-y ovh">
  23. <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>
  24. <div class="rel" v-if="issearch">
  25. <van-cell class="c333 title" :title="'当前会员总数:'+vipcount+'人'" :value="'近7日新增会员:'+addvipcount+'人'"> </van-cell>
  26. <van-dropdown-menu :class="dropdownclass">
  27. <van-dropdown-item v-model="value1" @change="changesort" :title="value1 === 0 ? '排序':''" :options="option1"></van-dropdown-item>
  28. <van-dropdown-item title="筛选" ref="check">
  29. <template #default>
  30. <div class="checkmain">
  31. <div class="f14 c333">会员卡</div>
  32. <div class="check df">
  33. <div class="mr12 f12" :class="CardFlag === ''? 'checkitrem':'uncheckitrem'" @click="cardflag('')">全部</div>
  34. <div class="mr12 f12" :class="CardFlag === 1? 'checkitrem':'uncheckitrem'" @click="cardflag(1)">已领取</div>
  35. <div class="f12" :class="CardFlag === 0? 'checkitrem':'uncheckitrem'" @click="cardflag(0)">未领取</div>
  36. </div>
  37. <div class="f14 c333 mt20">累计消费金额</div>
  38. <div class="check df">
  39. <div class="mr12 f12" :class="ConsumerFlag === ''? 'checkitrem':'uncheckitrem'" @click="consumerflag('')">全部</div>
  40. <div class="mr12 f12" :class="ConsumerFlag === 1? 'checkitrem':'uncheckitrem'" @click="consumerflag(1)">近7日消费</div>
  41. <div class="f12" :class="ConsumerFlag === 0? 'checkitrem':'uncheckitrem'" @click="consumerflag(0)">近7日未消费</div>
  42. </div>
  43. </div>
  44. <div class="checkbtn df">
  45. <div class="resbtn tc" @click="reset">重置</div>
  46. <div class="surebtn tc" @click="checkfn">确定</div>
  47. </div>
  48. </template>
  49. </van-dropdown-item>
  50. </van-dropdown-menu>
  51. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="viplist.length === 0 ? 'isnodata':''">
  52. <van-empty class="custom-image" image="./static/images/no-data.png" description="暂无数据" v-if="viplist.length === 0"> </van-empty>
  53. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
  54. <div class="vipcard bgcfff df" v-for="item,index in viplist" :key="index"><img class="ovh" :src="item.Consumer.HeadPhoto" alt="">
  55. <div class="infocontainer">
  56. <div class="first df">
  57. <div class="c333 f16">{{item.Consumer.NickName}}</div>
  58. <div class="more f12">会员积分:<span class="more integral">{{item.Consumer.CurIntgegral}}</span></div>
  59. </div>
  60. <div class="sec df">
  61. <div class="c333 f12 df mb alc long">加入会员时间 <span class="integral n">{{item.CreateDate}}</span></div>
  62. <div class="c333 f12 df mb alc sor">累计消费次数 <span class="integral n">{{item.Consumer.TotalConsumCount}}</span></div>
  63. </div>
  64. <div class="sec df">
  65. <div class="c333 f12 df mb alc long">累计消费金额<span class="integral n">{{item.Consumer.TotalAmount | tofixed2}}元</span></div>
  66. <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>
  67. <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>
  68. </div>
  69. <div class="dissipate c999">最近消费时间 {{item.Consumer.LastConsumDate}}</div>
  70. </div>
  71. </div>
  72. </van-list>
  73. </van-pull-refresh>
  74. <van-overlay :show="overlayisshow" @click="overlayisshow = false"> </van-overlay>
  75. </div>
  76. </div>
  77. </div>
  78. <script src="./static/js/klm-vv.min.js"></script>
  79. <script src="./static/js/klm-axios-config.js"></script>
  80. <script>
  81. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  82. // 可以通过下面的方式手动注册
  83. Vue.use(vant.Lazyload);
  84. // 在 #app 标签下渲染一个按钮组件
  85. let app = new Vue({
  86. el: '#app',
  87. data() {
  88. return {
  89. toptitleisshow:true,
  90. issearch:true,
  91. loading: false,
  92. finished: false,
  93. refreshing: false,
  94. overlayisshow:false,
  95. searconent:'',
  96. vipcount:0,
  97. addvipcount:0,
  98. value1: 0,
  99. option1: [
  100. { text: '默认排序', value: 0 },
  101. { text: '累计消费次数', value: 3 },
  102. { text: '累计消费金额', value: 4 },
  103. ],
  104. viplist:[
  105. ],
  106. pageinfo:{
  107. PageNum:1,
  108. PageSize:10,
  109. },
  110. CardFlag:'',
  111. ConsumerFlag:'',
  112. };
  113. },
  114. created() {
  115. this.toptitleisshow = toptitleisshow;
  116. this.getmangementdata();
  117. this.getvipcount();
  118. },
  119. computed: {
  120. //- 筛选状态
  121. dropdownclass(){
  122. if(this.value1 !== 0 && this.CardFlag === '' && this.ConsumerFlag === '') {
  123. return 'sptitle'
  124. }else if((this.CardFlag !== '' || this.ConsumerFlag !== '') && this.value1 === 0){
  125. return 'sp2title'
  126. }else if (this.value1 !== 0 &&( this.CardFlag !== '' || this.ConsumerFlag !== '')){
  127. return 'sptitle sp2title'
  128. };
  129. }
  130. },
  131. methods: {
  132. //- 获取统计数据
  133. async getmangementdata(){
  134. let MerchantId = PublicLib.getCookieInfo('userId')
  135. 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}));
  136. if(res.status !== '1') return tips(res.info);
  137. res.data.forEach(item=>{
  138. item.Consumer.NickName = '152415'
  139. });
  140. if(res.data.length<this.pageinfo.PageSize){
  141. this.finished = true;
  142. };
  143. this.viplist.push(...res.data);
  144. this.loading = false;
  145. },
  146. //- 获取会员数据
  147. async getvipcount(){
  148. let Id = PublicLib.getCookieInfo('userId')
  149. const res = await getRequest('/api/v1/merchantinfo/statdata?t='+Math.random(6),JSON.stringify({Id}));
  150. if(res.status !== '1') return tips(res.info);
  151. this.vipcount = res.data.TotalCustomer;
  152. this.addvipcount = res.data.SevenDayConsumer;
  153. },
  154. //- 更改排序方式
  155. changesort(){
  156. this.viplist = [];
  157. this.pageinfo.PageNum = 1;
  158. this.getmangementdata();
  159. },
  160. //- 筛选
  161. checkfn(){
  162. this.viplist = [];
  163. this.pageinfo.PageNum = 1;
  164. this.getmangementdata();
  165. this.$refs.check.toggle(false);
  166. },
  167. goback(){
  168. PublicLib.GoBack({Level:1});
  169. },
  170. inputsearch(){
  171. this.overlayisshow = true;
  172. },
  173. //- 搜索
  174. search(){
  175. //- if(this.searconent === ''){
  176. //- this.issearch = true;
  177. //- } else{
  178. //- this.issearch = false;
  179. //- }
  180. this.viplist = [];
  181. this.pageinfo.PageNum = 1;
  182. this.getmangementdata();
  183. },
  184. cardflag(flag){
  185. this.CardFlag = flag;
  186. },
  187. consumerflag(flag){
  188. this.ConsumerFlag = flag;
  189. },
  190. reset(){
  191. this.ConsumerFlag = '';
  192. this.CardFlag = '';
  193. },
  194. onLoad() {
  195. if (this.refreshing) {
  196. this.viplist = [];
  197. this.refreshing = false;
  198. this.pageinfo.PageNum = 0;
  199. };
  200. //- console.log(555)
  201. this.pageinfo.PageNum++;
  202. this.getmangementdata();
  203. },
  204. onRefresh() {
  205. // 清空列表数据
  206. this.finished = false;
  207. // 重新加载数据
  208. // 将 loading 设置为 true,表示处于加载状态
  209. this.loading = true;
  210. this.onLoad();
  211. },
  212. }
  213. });
  214. </script>
  215. </body>
  216. </html>