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

45 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<view class="page">
<view class="customer-toolbar">
<view class="search-card card">
<input value="{{keyword}}" bindinput="onSearchInput" placeholder="搜索客户姓名或手机号" />
</view>
<button class="compact-btn" bindtap="addCustomer">新增</button>
</view>
<view class="list section">
<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>
<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>
<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>
</view>