2026-07-25 18:12:02 +08:00
|
|
|
|
<view class="page customer-page">
|
|
|
|
|
|
<view class="search-card card">
|
|
|
|
|
|
<text class="search-icon">⌕</text>
|
|
|
|
|
|
<input value="{{keyword}}" bindinput="onSearchInput" placeholder="搜索客户姓名或手机号" />
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
2026-06-04 16:39:06 +08:00
|
|
|
|
<view class="list section">
|
2026-06-26 11:07:54 +08:00
|
|
|
|
<view wx:if="{{loadError}}" class="empty card">
|
|
|
|
|
|
<text>{{loadError}}</text>
|
|
|
|
|
|
<button class="secondary-btn retry-btn" bindtap="loadCustomers">重试</button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view wx:elif="{{customers.length === 0}}" class="empty card">暂无客户</view>
|
2026-06-04 16:39:06 +08:00
|
|
|
|
<view wx:for="{{customers}}" wx:key="id" class="card list-card customer-card" data-id="{{item.id}}" bindtap="openDetail">
|
2026-07-25 18:12:02 +08:00
|
|
|
|
<view class="customer-avatar-wrap">
|
|
|
|
|
|
<image class="customer-avatar-image" src="{{item.avatar}}" mode="aspectFill"></image>
|
|
|
|
|
|
<view class="customer-online-dot"></view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="customer-copy">
|
|
|
|
|
|
<view class="customer-name-row">
|
|
|
|
|
|
<text class="name">{{item.name}}</text>
|
|
|
|
|
|
<text class="customer-status">{{item.tagText}}</text>
|
2026-07-25 16:47:12 +08:00
|
|
|
|
</view>
|
2026-07-25 18:12:02 +08:00
|
|
|
|
<view class="customer-detail-row">
|
|
|
|
|
|
<text class="meta-label">最近消费</text>
|
|
|
|
|
|
<text class="amount">¥{{item.amountText}}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<text class="meta">最近到店 {{item.lastDateText}}</text>
|
2026-06-04 16:39:06 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<text class="arrow">›</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2026-06-26 11:07:54 +08:00
|
|
|
|
|
2026-07-25 18:27:28 +08:00
|
|
|
|
<button class="fab customer-fab" bindtap="addCustomer" aria-label="新增客户">+</button>
|
|
|
|
|
|
|
2026-06-26 11:07:54 +08:00
|
|
|
|
<view wx:if="{{createModalVisible}}" class="modal-mask" bindtap="closeCreateModal">
|
|
|
|
|
|
<view class="customer-modal" catchtap="stopTap">
|
|
|
|
|
|
<view class="modal-head">
|
|
|
|
|
|
<text class="modal-title">新增客户</text>
|
2026-07-25 18:12:02 +08:00
|
|
|
|
<view class="modal-close" bindtap="closeCreateModal"></view>
|
2026-06-26 11:07:54 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view class="form-grid">
|
|
|
|
|
|
<view class="modal-field">
|
|
|
|
|
|
<text class="required-label">客户姓名</text>
|
|
|
|
|
|
<input value="{{createForm.nickname}}" data-field="nickname" bindinput="onCreateInput" placeholder="请输入客户姓名" />
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="modal-field">
|
2026-07-25 18:43:58 +08:00
|
|
|
|
<text>手机号</text>
|
2026-06-26 11:07:54 +08:00
|
|
|
|
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
|
|
|
|
|
|
</view>
|
2026-07-25 19:12:37 +08:00
|
|
|
|
<view class="modal-field modal-textarea-field">
|
|
|
|
|
|
<text>备注</text>
|
|
|
|
|
|
<textarea value="{{createForm.remark}}" data-field="remark" bindinput="onCreateInput" maxlength="200" placeholder="请输入客户备注"></textarea>
|
|
|
|
|
|
</view>
|
2026-06-26 11:07:54 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2026-06-04 16:39:06 +08:00
|
|
|
|
</view>
|