83 lines
3.0 KiB
Plaintext
83 lines
3.0 KiB
Plaintext
<view class="page no-tab">
|
||
<view wx:if="{{loadError}}" class="empty card">
|
||
<text>{{loadError}}</text>
|
||
<button class="secondary-btn retry-btn" bindtap="loadCustomer">重试</button>
|
||
</view>
|
||
|
||
<block wx:else>
|
||
<view class="card customer-head">
|
||
<view class="customer-identity">
|
||
<view class="avatar">{{avatarText}}</view>
|
||
<view>
|
||
<text class="customer-name">{{customer.name}}</text>
|
||
<text class="customer-phone">{{customer.phone}}</text>
|
||
</view>
|
||
</view>
|
||
<view class="customer-actions">
|
||
<button class="small-action" bindtap="openEditModal">编辑</button>
|
||
<button wx:if="{{canCreateAppointment}}" class="small-action" bindtap="createAppointment">新预约</button>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card info-card">
|
||
<view class="info-row">
|
||
<text>联系电话</text>
|
||
<text>{{customer.phone}}</text>
|
||
</view>
|
||
<view class="info-row">
|
||
<text>备注</text>
|
||
<text>{{customer.remark || '未填写'}}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="stats">
|
||
<view class="card stat">
|
||
<text class="stat-value">{{stats.orderCount}}</text>
|
||
<text class="stat-label">累计订单</text>
|
||
</view>
|
||
<view class="card stat">
|
||
<text class="stat-value">¥{{stats.amount}}</text>
|
||
<text class="stat-label">累计消费</text>
|
||
</view>
|
||
<view class="card stat">
|
||
<text class="stat-value">{{stats.lastTime}}</text>
|
||
<text class="stat-label">最近消费</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="section">
|
||
<view class="section-title">历史订单</view>
|
||
<view class="list">
|
||
<view wx:if="{{orders.length === 0}}" class="empty card">暂无历史订单</view>
|
||
<view wx:for="{{orders}}" wx:key="id" class="card list-card order-card">
|
||
<view>
|
||
<text class="order-title">{{item.project || item.productTitle || '预约作品'}}</text>
|
||
<text class="meta">{{item.date || item.appointmentDate || '-'}} · {{item.artist || item.artistName || '-'}}</text>
|
||
</view>
|
||
<text class="amount">¥{{item.amount || item.payAmount || 0}}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view wx:if="{{editModalVisible}}" class="modal-mask" bindtap="closeEditModal">
|
||
<view class="customer-modal" catchtap="stopTap">
|
||
<view class="modal-head">
|
||
<text class="modal-title">编辑客户</text>
|
||
<view class="modal-close" bindtap="closeEditModal">×</view>
|
||
</view>
|
||
<view class="form-grid">
|
||
<view class="modal-field">
|
||
<text>联系电话</text>
|
||
<input value="{{editForm.contactPhone}}" data-field="contactPhone" bindinput="onEditInput" type="text" placeholder="请输入联系电话" />
|
||
</view>
|
||
<view class="modal-field">
|
||
<text>备注</text>
|
||
<textarea value="{{editForm.remark}}" data-field="remark" bindinput="onEditInput" maxlength="200" placeholder="请输入客户备注" />
|
||
</view>
|
||
</view>
|
||
<button class="primary-btn modal-submit" loading="{{saving}}" bindtap="saveCustomer">保存客户</button>
|
||
</view>
|
||
</view>
|
||
</block>
|
||
</view>
|