From 79f11f34546a394ab1c16ba427c31e9b59d05523 Mon Sep 17 00:00:00 2001 From: queenwuli <942534046@qq.com> Date: Sat, 09 Jan 2021 10:40:57 +0800 Subject: [PATCH] gx --- hive-app/pages/member/index.vue | 35 +++++++++++++++++++++++++++++++---- 1 files changed, 31 insertions(+), 4 deletions(-) diff --git a/hive-app/pages/member/index.vue b/hive-app/pages/member/index.vue index e397c34..799300f 100644 --- a/hive-app/pages/member/index.vue +++ b/hive-app/pages/member/index.vue @@ -3,7 +3,7 @@ <!-- #ifndef H5 --> <view class="status_bar"></view> <!-- #endif --> - <search-bar @confirm="search"></search-bar> + <search-bar @confirm="search" :focus="isFocus"></search-bar> <view class="sort-wrap"> <view @click="showFilterCustom(1)"> <text>{{filterText}}</text> @@ -18,11 +18,17 @@ <view class="flex justify-between"> <view class="flex-1 mr-10"> <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> + <template> + <image v-if="item.photo" src="item.photo" class="avatar"></image> + <text v-else class="first-name" :style="{background: caculateBgcolor(index)}">{{item.vipName | formatName}}</text> + </template> <view class="flex-1 flex align-center justify-between member-list-con"> <view class="flex flex-v"> - <text>{{item.vipName}}</text> - <text class="font-13 gray mt-5">{{$utils.encryptAccount(item.phone)}}</text> + <text class="mb-10"> + <text>{{item.vipName}}</text> + <text class="vip-level" v-if="item.vipLevel">{{item.vipLevel}}</text> + </text> + <text class="font-13 gray">{{$utils.encryptAccount(item.phone)}}</text> </view> <view> <text class="blue">到店{{item.arriveCnt || 0}}次</text> @@ -30,6 +36,7 @@ </view> </view> </navigator> + <no-record :isShow="!list.length"></no-record> </view> <indexed-list></indexed-list> </view> @@ -53,6 +60,7 @@ }, data() { return { + isFocus: false, colors: ['#CCC6B4', '#C0CCB4', '#B4C2CC', '#BEB4CC', '#B4CCBE', '#B4CCCA', '#CCB4C6', '#CCB4B4'], filterType: 1, filterList: [], @@ -158,8 +166,12 @@ this.loadMemberType() this.loadMemberList() }, + onShow() { + this.isFocus = getApp().globalData.isFocus + }, onHide(){ this.$refs.filterDropdownEl.hide(); + getApp().globalData.isFocus = false; }, methods:{ caculateBgcolor(index){ @@ -178,6 +190,7 @@ // 搜索 search(val){ + this.$refs.filterDropdownEl.hide(); this.queryKey = val; this.loadMemberList(); }, @@ -255,6 +268,12 @@ font-size: 14px; padding-left: 4px; } + .avatar{ + display: inline-block; + width: 38px; + height: 38px; + border-radius: 50%; + } .first-name{ display: inline-block; width: 38px; @@ -275,6 +294,14 @@ padding: 15px 0 15px 5px; border-bottom: 1px solid #EDEAF4; } + .member-list .vip-level{ + border: 1px solid #666; + margin-left: 10px; + font-size: 12px; + border-radius: 12px; + padding: 2px 12px; + color: #666666; + } .quick-entry{ position: fixed; bottom: 80px; -- Gitblit v1.9.1