Files
JayuCloud/JC-Salon-WeChat/pages/customers/index.wxml
T

45 lines
1.9 KiB
Plaintext
Raw Normal View History

2026-06-04 16:39:06 +08:00
<view class="page">
2026-06-26 11:07:54 +08:00
<view class="customer-toolbar">
<view class="search-card card">
<input value="{{keyword}}" bindinput="onSearchInput" placeholder="搜索客户姓名或手机号" />
</view>
<button class="compact-btn" bindtap="addCustomer">新增</button>
2026-06-04 16:39:06 +08:00
</view>
<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">
<view>
<text class="name">{{item.name}}</text>
<text class="meta">{{item.phone}}</text>
<text class="meta">最近消费 {{item.lastTime}}</text>
</view>
<text class="arrow">›</text>
</view>
</view>
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>
<view class="modal-close" bindtap="closeCreateModal">×</view>
</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">
<text class="required-label">手机号</text>
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
</view>
</view>
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
</view>
</view>
2026-06-04 16:39:06 +08:00
</view>