restore: 恢复橙色逍遥梦UI版本(2ea2860)到主分支
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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,7 +146,64 @@ 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();
|
||||
},
|
||||
|
||||
clearSearch() {
|
||||
this.setData({ searchKeyword: '' });
|
||||
this.applySearchFilter();
|
||||
},
|
||||
|
||||
goStaffOrders(e) {
|
||||
const id = e.currentTarget.dataset.id;
|
||||
const label = e.currentTarget.dataset.label || '';
|
||||
wx.redirectTo({
|
||||
url: `/pages/merchant-orders/merchant-orders?staff_member_id=${id}&staff_label=${encodeURIComponent(label)}`,
|
||||
});
|
||||
},
|
||||
|
||||
onEditRemark(e) {
|
||||
const id = e.currentTarget.dataset.id;
|
||||
const oldRemark = e.currentTarget.dataset.remark || '';
|
||||
wx.showModal({
|
||||
title: '客服备注',
|
||||
editable: true,
|
||||
placeholderText: '如:晚班小李、财务小王',
|
||||
content: oldRemark,
|
||||
success: async (r) => {
|
||||
if (!r.confirm) return;
|
||||
const remark = (r.content || '').trim();
|
||||
const res = await request({
|
||||
url: STAFF_API.memberUpdateRemark,
|
||||
method: 'POST',
|
||||
data: { member_id: id, merchant_remark: remark },
|
||||
});
|
||||
wx.showToast({
|
||||
title: (res.data && res.data.code === 0) ? '已保存' : (res.data.msg || '失败'),
|
||||
icon: 'none',
|
||||
});
|
||||
this.loadList();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
copyUid(e) {
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -41,12 +47,10 @@
|
||||
</view>
|
||||
|
||||
<view class="uid-row flex">
|
||||
|
||||
<text class="kefu-uid">ID: {{item.uid}}</text>
|
||||
|
||||
<text class="copy-link" bindtap="copyUid" data-uid="{{item.uid}}">复制</text>
|
||||
|
||||
</view>
|
||||
<view wx:if="{{item.merchant_remark}}" class="remark-row">备注:{{item.merchant_remark}}</view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -132,7 +136,12 @@
|
||||
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!item.isSelf}}" class="kefu-actions flexa">
|
||||
<view class="kefu-actions flexa">
|
||||
<text class="act" bindtap="onEditRemark" data-id="{{item.id}}" data-remark="{{item.merchant_remark}}">备注</text>
|
||||
<text class="act" bindtap="goStaffOrders" data-id="{{item.id}}" data-label="{{item.nickname}}">查看订单</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!item.isSelf}}" class="kefu-actions flexa kefu-actions--sub">
|
||||
|
||||
<text class="act" bindtap="onAllocate" data-id="{{item.id}}">划额度</text>
|
||||
|
||||
@@ -150,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>
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
.quota-label { font-size: 24rpx; color: #888; }
|
||||
.quota-val { font-size: 30rpx; color: #9333ea; font-weight: 600; }
|
||||
.quota-val { font-size: 30rpx; color: #C9A962; font-weight: 600; }
|
||||
|
||||
.kefu-av {
|
||||
width: 88rpx;
|
||||
@@ -81,7 +81,7 @@
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.badge-chief { background: #9333ea; }
|
||||
.badge-chief { background: #ffb508; }
|
||||
.badge-finance { background: #1b6ef3; }
|
||||
.badge-self { background: #9e9e9e; }
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user