本地备份:商家UI调整前当前完整版本(未推送)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-06-27 06:04:45 +08:00
parent 5e50f6a486
commit fc0ee9a4d1
28 changed files with 3190 additions and 3264 deletions

View File

@@ -34,6 +34,10 @@ Page({
list: [],
displayList: [],
searchKeyword: '',
isOwner: false,
},
@@ -124,7 +128,9 @@ Page({
const raw = (res.data.data && res.data.data.list) || [];
this.setData({ list: this.formatList(raw) });
this._allList = this.formatList(raw);
this.applySearchFilter();
}
@@ -140,9 +146,31 @@ Page({
goBack() { wx.navigateBack(); },
applySearchFilter() {
const kw = (this.data.searchKeyword || '').trim().toLowerCase();
const all = this._allList || [];
if (!kw) {
this.setData({ list: all, displayList: all });
return;
}
const filtered = all.filter((item) => {
const uid = String(item.uid || '').toLowerCase();
const remark = String(item.merchant_remark || '').toLowerCase();
const nick = String(item.nickname || '').toLowerCase();
return uid.includes(kw) || remark.includes(kw) || nick.includes(kw);
});
this.setData({ list: all, displayList: filtered });
},
onSearchInput(e) {
this.setData({ searchKeyword: e.detail.value || '' });
this.applySearchFilter();
},
goBack() { wx.navigateBack(); },
clearSearch() {
this.setData({ searchKeyword: '' });
this.applySearchFilter();
},
goStaffOrders(e) {
const id = e.currentTarget.dataset.id;

View File

@@ -12,11 +12,17 @@
</view>
<view class="filter-row sj-mx20">
<view class="search-box">
<image class="search-icon" src="/images/icon_search.svg" mode="aspectFit"/>
<input class="search-input" placeholder="搜索用户ID或备注" value="{{searchKeyword}}" bindinput="onSearchInput" confirm-type="search"/>
<view class="search-clear" wx:if="{{searchKeyword}}" bindtap="clearSearch"><text>✕</text></view>
</view>
</view>
<scroll-view scroll-y class="sub-scroll" enhanced show-scrollbar="{{false}}">
<view wx:for="{{list}}" wx:key="id" class="kefu-card sj-mx20 {{item.isDisabled ? 'disabled-card' : ''}}">
<view wx:for="{{displayList}}" wx:key="id" class="kefu-card sj-mx20 {{item.isDisabled ? 'disabled-card' : ''}}">
<view class="kefu-head flex">
@@ -153,7 +159,7 @@
</view>
<view wx:if="{{!list.length}}" class="load-tip">暂无客服成员</view>
<view wx:if="{{!displayList.length}}" class="load-tip">暂无客服成员</view>
<view class="load-tip link-tip" bindtap="goAudit">操作日志 </view>

View File

@@ -155,3 +155,16 @@
font-size: 22rpx;
color: #bbb;
}
.filter-row { margin-bottom: 8rpx; }
.search-box {
display: flex;
align-items: center;
background: #fff;
border-radius: 32rpx;
padding: 12rpx 20rpx;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
}
.search-icon { width: 32rpx; height: 32rpx; margin-right: 12rpx; }
.search-input { flex: 1; font-size: 26rpx; }
.search-clear { padding: 8rpx; color: #999; font-size: 24rpx; }