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

74 lines
3.1 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 customer-page">
<view class="customer-header">
<text class="customer-title">客户</text>
</view>
<view class="search-card card">
<text class="search-icon">⌕</text>
<input value="{{keyword}}" bindinput="onSearchInput" placeholder="搜索客户姓名或手机号" />
</view>
<view class="customer-stats card">
<view class="customer-stat">
<text class="customer-stat-value">{{customerStats.todayArrival}}</text>
<text class="customer-stat-label">今日到店</text>
</view>
<view class="customer-stat">
<text class="customer-stat-value">¥{{customerStats.monthAmount}}</text>
<text class="customer-stat-label">本月消费</text>
</view>
<view class="customer-stat">
<text class="customer-stat-value">{{customerStats.memberCount}}</text>
<text class="customer-stat-label">会员人数</text>
</view>
</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 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>
</view>
<view class="customer-detail-row">
<text class="meta-label">最近消费</text>
<text class="amount">¥{{item.amountText}}</text>
</view>
<text class="meta">最近到店 {{item.lastDateText}}</text>
</view>
<text class="arrow">›</text>
</view>
</view>
<button class="fab customer-fab" bindtap="addCustomer" aria-label="新增客户">+</button>
<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.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>