56 lines
1.9 KiB
Plaintext
56 lines
1.9 KiB
Plaintext
<view class="gift-detail-container">
|
|
<view wx:if="{{gift}}" class="detail-content">
|
|
<!-- 礼品图片 -->
|
|
<view class="image-section" bindtap="previewImage">
|
|
<image src="{{gift.image || gift.image_url}}" class="gift-image" mode="aspectFill"></image>
|
|
</view>
|
|
|
|
<!-- 礼品信息 -->
|
|
<view class="info-section">
|
|
<view class="gift-header">
|
|
<text class="gift-name">{{gift.name}}</text>
|
|
<view class="gift-price">
|
|
<image src="/images/icon-heart.png" class="heart-icon" mode="aspectFit"></image>
|
|
<text class="price-text">{{gift.love_cost}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="gift-meta">
|
|
<view class="meta-item">
|
|
<text class="meta-label">分类:</text>
|
|
<text class="meta-value">{{gift.category}}</text>
|
|
</view>
|
|
<view class="meta-item">
|
|
<text class="meta-label">库存:</text>
|
|
<text class="meta-value">{{gift.stock}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="gift-description">
|
|
<text class="description-title">商品详情</text>
|
|
<text class="description-text">{{gift.description}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 底部操作栏 -->
|
|
<view class="bottom-bar">
|
|
<view class="balance-info">
|
|
<text class="balance-label">我的爱心值</text>
|
|
<text class="balance-value">{{userLovePoints}}</text>
|
|
</view>
|
|
<button
|
|
class="exchange-btn {{gift.stock <= 0 || userLovePoints < gift.love_cost ? 'disabled' : ''}}"
|
|
bindtap="exchangeGift"
|
|
disabled="{{gift.stock <= 0 || userLovePoints < gift.love_cost}}"
|
|
>
|
|
{{gift.stock <= 0 ? '已售罄' : (userLovePoints < gift.love_cost ? '爱心值不足' : '立即兑换')}}
|
|
</button>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 加载中 -->
|
|
<view wx:if="{{loading}}" class="loading-state">
|
|
<text class="loading-text">加载中...</text>
|
|
</view>
|
|
</view>
|