From 4300b5c714bb7e09f53f7d722c953dec9c809d8e Mon Sep 17 00:00:00 2001 From: queenwuli <942534046@qq.com> Date: Mon, 04 Jan 2021 17:08:59 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/jyyforjava/hive-app into master --- hive-app/pages/member/index.vue | 296 ++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 200 insertions(+), 96 deletions(-) diff --git a/hive-app/pages/member/index.vue b/hive-app/pages/member/index.vue index 4edbb8d..7fe43e2 100644 --- a/hive-app/pages/member/index.vue +++ b/hive-app/pages/member/index.vue @@ -1,44 +1,43 @@ <template> <view class="container"> - <search-bar></search-bar> + <!-- #ifndef H5 --> + <view class="status_bar"></view> + <!-- #endif --> + <search-bar @confirm="search"></search-bar> <view class="sort-wrap"> - <view @click="filterCustom(1)"> - <text>到店排序</text> - <text class="iconfont iconjiantouarrow486"></text> + <view @click="showFilterCustom(1)"> + <text>{{filterText}}</text> + <text class="iconfont iconjiantouarrow486 gray"></text> </view> - <view @click="filterCustom(2)"> - <text>卡项排序</text> - <text class="iconfont iconjiantouarrow486"></text> - </view> - <view @click="filterCustom(3)"> - <text>全部筛选</text> - <text class="iconfont iconjiantouarrow486"></text> + <view @click="showFilterCustom(2)"> + <text>筛选</text> + <text class="iconfont iconshaixuan gray"></text> </view> </view> - <filter-dropdown ref="filterDropdownEl" :list="filterList" :type="filterType"></filter-dropdown> - <view class="sort-tab"> - <text class="sort-tab-item">正式客户</text> - <text class="sort-tab-item">体验客户</text> - <text class="sort-tab-item">潜在客户</text> - <text class="sort-tab-item">潜在客户</text> - </view> - <view class="flex justify-between" @click="toDetail"> + <filter-dropdown ref="filterDropdownEl" :list="filterList" :filterKey="filterKeys" :type="filterType" @confirm="confirmFilter" @reset="resetFilter"></filter-dropdown> + <view class="flex justify-between"> <view class="flex-1 mr-10"> - <view class="member-list flex align-center" v-for="(item, index) in 15"> - <text class="first-name" :style="{background: caculateBgcolor(index)}">李</text> + <navigator :url="'./detail?id='+item.id" hover-class="none" class="member-list" v-for="(item, index) in list"> + <text class="first-name" :style="{background: caculateBgcolor(index)}">{{item.vipName | formatName}}</text> <view class="flex-1 flex align-center justify-between member-list-con"> - <view> - <text>李广</text> - <text class="ml-10">152****9645</text> + <view class="flex flex-v"> + <text>{{item.vipName}}</text> + <text class="font-13 gray mt-5">{{$utils.encryptAccount(item.phone)}}</text> </view> <view> - <text class="blue">30天未到店</text> - <text class="iconfont iconarrow-backimg gray"></text> + <text class="blue">到店{{item.arriveCnt || 0}}次</text> + <text class="iconfont iconarrow-backimg light-gray"></text> </view> </view> - </view> + </navigator> + <no-record :isShow="!list.length"></no-record> </view> <indexed-list></indexed-list> + </view> + <view class="quick-entry"> + <navigator url="./editMember" hover-class="navigator-hover"> + <text class="iconfont iconjia"></text> + </navigator> </view> </view> </template> @@ -58,60 +57,107 @@ colors: ['#CCC6B4', '#C0CCB4', '#B4C2CC', '#BEB4CC', '#B4CCBE', '#B4CCCA', '#CCB4C6', '#CCB4B4'], filterType: 1, filterList: [], - filter1: ['本月到店次数(由低到高)','本月到店次数(由高到低)','本年到店次数(由低到高)','本年到店次数(由高到低)','本月消费(由高到低)','本月消费(由低到高)','本月消耗(由高到低)','本月消耗(由低到高)'], - filter2: ['7天内卡项到期','15天内卡项到期','30天内卡项到期'], - filter3: [{ - title: '到店途径', + filterText: '首字母排序', + filter1: [{ + title: '首字母排序', + key: '', + value: '' + },{ + title: '本月到店次数(由高到低)', + key: 'monthArrived', + value: 'desc' + },{ + title: '本月到店次数(由低到高)', + key: 'monthArrived', + value: 'asc' + },{ + title: '本年到店次数(由高到低)', + key: 'yearArrived', + value: 'desc' + },{ + title: '本年到店次数(由低到高)', + key: 'yearArrived', + value: 'asc' + },{ + title: '本月消费(由高到低)', + key: 'used', + value: 'desc' + },{ + title: '本月消费(由低到高)', + key: 'used', + value: 'asc' + },{ + title: '本月消耗(由高到低)', + key: 'consume', + value: 'desc' + },{ + title: '本月消耗(由低到高)', + key: 'consume', + value: 'asc' + },{ + title: '会员级别(由高到低)', + key: 'vipLevel', + value: 'desc' + },{ + title: '会员级别(由低到高)', + key: 'vipLevel', + value: 'asc' + },{ + title: '上次到店时间(由近到远)', + key: 'arriveTime', + value: 'desc' + },{ + title: '上次到店时间(由远到近)', + key: 'arriveTime', + value: 'asc' + }], + filterKeys: {birthType: '', vipType: '', other: ''}, + filter2: [{ + title: '生日', + key: 'birthType', list: [ { - 'title': '美团预约', - 'value': '' + 'title': '三天内生日', + 'value': 1 }, { - 'title': '网络预约', - 'value': '' + 'title': '本月生日', + 'value': 2 + }, + { + 'title': '下月生日', + 'value': 3 } ] }, { - title: '会员等级', - list: [ - { - 'title': '一级会员', - 'value': '' - }, - { - 'title': '二级会员', - 'value': '' - }, - { - 'title': '三级会员', - 'value': '' - } - ] + title: '会员类型', + key: 'vipType', + list: [] }, { - title: '活跃度', + title: '其他', + key: 'other', list: [ { - 'title': '活跃', - 'value': '' + 'title': '老客户', + 'value': 1 }, { - 'title': '不活跃', - 'value': '' - }, - { - 'title': '睡眠', - 'value': '' - }, - { - 'title': '沉睡', - 'value': '' + 'title': '新客户', + 'value': 2 } ] - }] + }], + queryKey: '', + sort: '', + order: '', + list: [] }; + }, + onLoad() { + this.loadMemberType() + this.loadMemberList() }, onHide(){ this.$refs.filterDropdownEl.hide(); @@ -120,23 +166,77 @@ caculateBgcolor(index){ return this.colors[index%8]; }, - toDetail(){ - uni.navigateTo({ - url:'./detail' - }) - }, - filterCustom(type){ + showFilterCustom(type){ this.$refs.filterDropdownEl.show(); if(type===1){ this.filterList = this.filter1; this.filterType = 1; - } else if(type===2){ - this.filterList = this.filter2; - this.filterType = 1; } else { - this.filterList = this.filter3; + this.filterList = this.filter2; this.filterType = 0; } + }, + + // 搜索 + search(val){ + this.$refs.filterDropdownEl.hide(); + this.queryKey = val; + this.loadMemberList(); + }, + // 重置筛选 + resetFilter(){ + this.filterKeys = {birthType: '', vipType: '', other: ''}; + this.loadMemberList(); + }, + // 全部筛选 + confirmFilter(val){ + if(this.filterType == 1){ + this.sort = val.key; + this.order = val.value; + this.filterText = val.title; + } else { + this.filterKeys = val; + } + this.loadMemberList(); + }, + // 获取会员类型 + loadMemberType(){ + this.$httpUtils.request('/api/vip/findVipType').then((res) => { + if(res.status == 200){ + let result = res.rows.map((item) => { + return { + title: item.levelName, + value: item.id + } + }); + this.filter2[1].list = result; + } + }) + }, + loadMemberList(){ + let parma = Object.assign({ + order: this.order, + queryKey: this.queryKey, + sort: this.sort + }, this.filterKeys) + this.$httpUtils.request('/api/vip/findVipInfoList', parma, 'POST').then((res) => { + if(res.status == 200){ + this.list = res.rows; + } else { + this.list = []; + } + }).catch((err) => { + this.list = []; + }) + } + }, + filters:{ + formatName(val){ + if(!val){ + return '无' + } + val = val.trim(); + return val.substr(0, 1) } } } @@ -150,29 +250,12 @@ display: flex; justify-content: space-between; align-items: center; - font-size: 14px; + font-size: 13px; + padding: 10px 0; } .sort-wrap .iconfont{ font-size: 14px; - color: #999; - padding-left: 3px; - } - .sort-tab{ - display: flex; - justify-content: space-between; - margin: 10px 0; - } - .sort-tab-item{ - border:1px solid #EDEAF4; - font-size: 14px; - color: #ABB1CC; - padding: 3px 10px; - border-radius: 4px; - box-shadow: 3px 3px 5px #EEEEEE; - } - .sort-tab-item.active{ - border: 1px solid #518EFF; - color: #518EFF; + padding-left: 4px; } .first-name{ display: inline-block; @@ -183,12 +266,33 @@ border-radius: 50%; text-align: center; color: #FFFFFF; + font-size: 16px; } .member-list{ - font-size: 15px; + display: flex; + align-items: center; + font-size: 14px; } .member-list-con{ - padding: 20px 0 20px 5px; + padding: 15px 0 15px 5px; border-bottom: 1px solid #EDEAF4; } + .quick-entry{ + position: fixed; + bottom: 80px; + right: 15px; + width: 50px; + height: 50px; + line-height: 50px; + text-align: center; + border-radius: 50%; + background: #518EFF; + color: #FFFFFF; + } + .quick-entry .iconfont{ + font-size: 24px; + } + .navigator-hover{ + border-radius: 50%; + } </style> -- Gitblit v1.9.1