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

57 lines
2.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>
</view>
<view class="fab" bindtap="addCustomer">+</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>微信号</text>
<input value="{{createForm.wechatId}}" data-field="wechatId" bindinput="onCreateInput" placeholder="选填" />
</view>
<view class="modal-field">
<text>手机号</text>
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" maxlength="11" placeholder="选填" />
</view>
</view>
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
</view>
</view>
<view wx:if="{{duplicateModalVisible}}" class="modal-mask" bindtap="closeDuplicateModal">
<view class="customer-modal duplicate-modal" catchtap="stopTap">
<view class="modal-head"><view><text class="modal-title">客户已存在</text><text class="duplicate-hint">姓名、微信号和手机号完全一致</text></view><view class="modal-close" bindtap="closeDuplicateModal">×</view></view>
<view class="duplicate-list"><view wx:for="{{duplicateCustomers}}" wx:key="id" class="duplicate-customer" data-id="{{item.id}}" bindtap="selectDuplicateCustomer"><view><text class="duplicate-name">{{item.name}}</text><text class="duplicate-phone">{{item.phone}}</text></view><text class="arrow">›</text></view></view>
<button class="secondary-btn duplicate-cancel" bindtap="closeDuplicateModal">返回修改资料</button>
</view>
</view>
</view>