160 lines
7.4 KiB
Plaintext
160 lines
7.4 KiB
Plaintext
<navigation-bar title="购物车" showBack="{{false}}" isTabPage="{{true}}" color="#2d2430" background="#fff7f8"></navigation-bar>
|
|
|
|
<view class="page-shell cart-page">
|
|
<view class="page-content cart-content">
|
|
<view wx:if="{{!isLoggedIn}}" class="page-card empty-card">
|
|
<text class="empty-title">登录后查看购物车</text>
|
|
<text class="empty-desc">登录后管理预约内容。</text>
|
|
<view class="ghost-btn" bindtap="handleOpenAuth">去登录</view>
|
|
</view>
|
|
|
|
<block wx:elif="{{cartItems.length}}">
|
|
<view class="page-hero cart-hero">
|
|
<text class="hero-kicker">结算准备</text>
|
|
<text class="hero-title">已选 {{selectedCount}} 个预约项目</text>
|
|
<text class="hero-desc">确认美甲师和时间后再下单。</text>
|
|
|
|
<view class="summary-strip">
|
|
<view class="summary-metric">
|
|
<text class="summary-label">选中项目</text>
|
|
<text class="summary-value">{{selectedCount}} 项</text>
|
|
<text class="summary-note">可分批结算</text>
|
|
</view>
|
|
<view class="summary-metric">
|
|
<text class="summary-label">数量合计</text>
|
|
<text class="summary-value">{{totalQuantity}} 件</text>
|
|
<text class="summary-note">可改数量</text>
|
|
</view>
|
|
<view class="summary-metric">
|
|
<text class="summary-label">待支付</text>
|
|
<text class="summary-value">{{totalAmountText}}</text>
|
|
<text class="summary-note">已算优惠</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{checkoutIssues.length}}" class="issue-card">
|
|
<view class="issue-title">下单前还需要完善</view>
|
|
<view wx:for="{{checkoutIssues}}" wx:key="*this" class="issue-item">{{index + 1}}. {{item}}</view>
|
|
</view>
|
|
|
|
<view wx:for="{{cartItems}}" wx:key="id" class="page-card cart-item-card">
|
|
<view class="cart-item-top">
|
|
<view class="select-dot {{item.selected ? 'active' : ''}}" data-index="{{index}}" bindtap="handleToggleSelect"></view>
|
|
<image class="cart-thumb" src="{{item.productImageUrl}}" mode="aspectFill" data-product-id="{{item.productId}}" bindtap="handleOpenProduct" lazy-load="{{true}}"></image>
|
|
<view class="cart-main">
|
|
<view class="cart-title-row">
|
|
<view class="cart-title" data-product-id="{{item.productId}}" bindtap="handleOpenProduct">{{item.productTitle}}</view>
|
|
<view class="cart-price">{{item.priceText}}</view>
|
|
</view>
|
|
<view class="cart-meta-row">
|
|
<text class="meta-chip">{{item.selected ? '已选中' : '未选中'}}</text>
|
|
<text wx:if="{{item.approximateDuration}}" class="cart-meta">预计时长 {{item.approximateDuration}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="selector-group">
|
|
<view class="selector-row {{item.selected && !item.artistId ? 'issue' : ''}}" data-index="{{index}}" bindtap="handleChooseArtist">
|
|
<text class="selector-label">美甲师</text>
|
|
<text class="selector-value">{{item.artistName || '请选择美甲师'}}</text>
|
|
</view>
|
|
|
|
<view class="time-grid">
|
|
<picker mode="date" value="{{item.appointmentDate}}" start="{{minDate}}" data-index="{{index}}" bindchange="handleDateChange">
|
|
<view class="selector-row compact {{item.selected && !item.appointmentDate ? 'issue' : ''}}">
|
|
<text class="selector-label">日期</text>
|
|
<text class="selector-value">{{item.appointmentDate || '选择日期'}}</text>
|
|
</view>
|
|
</picker>
|
|
|
|
<picker mode="time" value="{{item.appointmentClock}}" data-index="{{index}}" bindchange="handleTimeChange">
|
|
<view class="selector-row compact {{item.selected && !item.appointmentClock ? 'issue' : ''}}">
|
|
<text class="selector-label">时间</text>
|
|
<text class="selector-value">{{item.appointmentClock || '选择时间'}}</text>
|
|
</view>
|
|
</picker>
|
|
</view>
|
|
|
|
<view wx:if="{{item.appointmentValue}}" class="appointment-preview">
|
|
当前预约:{{item.appointmentValue}}
|
|
</view>
|
|
</view>
|
|
|
|
<view class="cart-item-foot">
|
|
<view class="qty-box">
|
|
<view class="qty-btn" data-index="{{index}}" data-delta="-1" bindtap="handleChangeQuantity">-</view>
|
|
<text class="qty-value">{{item.quantity}}</text>
|
|
<view class="qty-btn" data-index="{{index}}" data-delta="1" bindtap="handleChangeQuantity">+</view>
|
|
</view>
|
|
<view class="remove-btn" data-index="{{index}}" bindtap="handleRemoveItem">移除</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{selectedCount}}" class="page-card coupon-card">
|
|
<view class="section-title">优惠方式</view>
|
|
<view class="section-subtitle">系统会优先匹配 VIP 优惠。</view>
|
|
|
|
<radio-group bindchange="handleCouponChange">
|
|
<label class="coupon-option">
|
|
<radio value="NONE" checked="{{selectedCouponKey === 'NONE'}}" color="#c6597d"></radio>
|
|
<view class="coupon-texts">
|
|
<view class="coupon-name">不使用优惠</view>
|
|
</view>
|
|
</label>
|
|
|
|
<label wx:for="{{availableCoupons}}" wx:key="key" wx:for-item="coupon" class="coupon-option {{selectedCouponKey === coupon.key ? 'active' : ''}}">
|
|
<radio value="{{coupon.key}}" checked="{{selectedCouponKey === coupon.key}}" color="#c6597d"></radio>
|
|
<view class="coupon-texts">
|
|
<view class="coupon-name">{{coupon.displayText}}</view>
|
|
<view class="coupon-desc">{{coupon.sourceType === 'SYSTEM_VIP' ? 'VIP 自动折扣' : '用户优惠券'}}</view>
|
|
</view>
|
|
<view class="coupon-tag">{{coupon.sourceType === 'SYSTEM_VIP' ? '推荐' : '手动选择'}}</view>
|
|
</label>
|
|
</radio-group>
|
|
</view>
|
|
|
|
<view class="page-card summary-card">
|
|
<view class="summary-row">
|
|
<text>选中项目</text>
|
|
<text>{{selectedCount}} 项</text>
|
|
</view>
|
|
<view class="summary-row">
|
|
<text>作品数量</text>
|
|
<text>{{totalQuantity}} 件</text>
|
|
</view>
|
|
<view class="summary-row">
|
|
<text>小计</text>
|
|
<text>{{subtotalText}}</text>
|
|
</view>
|
|
<view class="summary-row">
|
|
<text>优惠</text>
|
|
<text>-{{discountAmountText}}</text>
|
|
</view>
|
|
<view class="summary-row total">
|
|
<text>合计</text>
|
|
<text>{{totalAmountText}}</text>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
|
|
<view wx:elif="{{loading}}" class="page-card empty-card">
|
|
<text class="empty-title">正在加载购物车</text>
|
|
</view>
|
|
|
|
<view wx:else class="page-card empty-card">
|
|
<text class="empty-title">购物车还是空的</text>
|
|
<text class="empty-desc">先加购,再预约。</text>
|
|
<view class="ghost-btn" bindtap="handleBrowseProducts">去逛作品</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{isLoggedIn && cartItems.length}}" class="checkout-bar">
|
|
<view class="checkout-copy">
|
|
<view class="checkout-total">{{totalAmountText}}</view>
|
|
<view class="checkout-meta">已选 {{selectedCount}} 项</view>
|
|
</view>
|
|
<view class="checkout-btn" bindtap="handleCheckout">提交订单</view>
|
|
</view>
|
|
</view>
|