|
|
|
@ -54,74 +54,58 @@ |
|
|
|
|
|
|
|
<block wx:if="{{isPublishedExpanded}}"> |
|
|
|
<block wx:if="{{publishedSupplies.length > 0}}"> |
|
|
|
<view wx:for="{{publishedSupplies}}" wx:key="id" class="supply-card"> |
|
|
|
<!-- 垂直布局:图片在上,信息在下 --> |
|
|
|
<view class="card-image-section"> |
|
|
|
<!-- 图片展示区域 --> |
|
|
|
<view class="image-container"> |
|
|
|
<!-- 图片轮播 --> |
|
|
|
<view wx:for="{{publishedSupplies}}" wx:key="id" class="card" style="width: 100%;"> |
|
|
|
<!-- 图片和信息1:1比例并排显示 --> |
|
|
|
<view style="display: flex; width: 100%; border-radius: 8rpx; overflow: hidden; background-color: #f5f5f5;"> |
|
|
|
<!-- 左侧图片区域 50%宽度 --> |
|
|
|
<view style="width: 50%; position: relative;"> |
|
|
|
<!-- 第一张图片 --> |
|
|
|
<view wx:if="{{item.imageUrls && item.imageUrls.length > 0}}" style="width: 100%; height: 100%;"> |
|
|
|
<image src="{{item.imageUrls[0]}}" mode="aspectFill" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="0"></image> |
|
|
|
</view> |
|
|
|
<view wx:else style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #999;"> |
|
|
|
<text>暂无图片</text> |
|
|
|
</view> |
|
|
|
<!-- 剩余图片可滑动区域 --> |
|
|
|
<view wx:if="{{item.imageUrls && item.imageUrls.length > 1}}" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"> |
|
|
|
<swiper |
|
|
|
class="image-swiper" |
|
|
|
style="width: 100%; height: 100%;" |
|
|
|
current="{{item.currentImageIndex || 0}}" |
|
|
|
bindchange="swiperChange" |
|
|
|
data-id="{{item.id}}"> |
|
|
|
<block wx:for="{{item.imageUrls}}" wx:for-item="img" wx:for-index="idx" wx:key="idx"> |
|
|
|
<swiper-item> |
|
|
|
<image src="{{img}}" mode="aspectFill" class="supply-image" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="{{idx}}" |
|
|
|
loading="lazy" |
|
|
|
fallback-src="../../images/logo.svg"></image> |
|
|
|
<image src="{{img}}" mode="aspectFill" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="{{idx}}"></image> |
|
|
|
</swiper-item> |
|
|
|
</block> |
|
|
|
</swiper> |
|
|
|
<!-- 无图片占位 --> |
|
|
|
<view wx:if="{{!item.imageUrls || item.imageUrls.length === 0}}" class="no-image"> |
|
|
|
<text>暂无图片</text> |
|
|
|
</view> |
|
|
|
<!-- 显示页码指示器 --> |
|
|
|
<view wx:if="{{item.imageUrls && item.imageUrls.length > 1}}" class="swiper-pagination"> |
|
|
|
<view style="position: absolute; bottom: 10rpx; right: 10rpx; background-color: rgba(0,0,0,0.5); color: white; padding: 5rpx 10rpx; border-radius: 15rpx; font-size: 20rpx;"> |
|
|
|
{{(item.currentImageIndex || 0) + 1}}/{{item.imageUrls.length}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 信息区域 --> |
|
|
|
<view class="card-info-section" bindtap="showGoodsDetail" data-item="{{item}}"> |
|
|
|
<view class="supply-name-row"> |
|
|
|
<view class="supply-name">{{item.name}}</view> |
|
|
|
<view class="supply-status published">已上架</view> |
|
|
|
</view> |
|
|
|
<view class="supply-details"> |
|
|
|
<view class="detail-item"> |
|
|
|
<text class="detail-label">蛋黄:</text> |
|
|
|
<text class="detail-value">{{item.yolk || '无'}}</text> |
|
|
|
</view> |
|
|
|
<view class="detail-item"> |
|
|
|
<text class="detail-label">规格:</text> |
|
|
|
<text class="detail-value">{{item.spec || '无'}}</text> |
|
|
|
</view> |
|
|
|
<view class="detail-item"> |
|
|
|
<text class="detail-label">件数:</text> |
|
|
|
<text class="detail-value">{{item.minOrder}}件</text> |
|
|
|
</view> |
|
|
|
<view class="detail-item"> |
|
|
|
<text class="detail-label">斤重:</text> |
|
|
|
<text class="detail-value">{{item.grossWeight || ''}}斤</text> |
|
|
|
</view> |
|
|
|
<view class="detail-item"> |
|
|
|
<text class="detail-label">地区:</text> |
|
|
|
<text class="detail-value">{{item.region || '未设置'}}</text> |
|
|
|
</view> |
|
|
|
<view class="detail-item"> |
|
|
|
<text class="detail-label">创建时间:</text> |
|
|
|
<text class="detail-value">{{item.formattedCreatedAt}}</text> |
|
|
|
<!-- 右侧信息区域 50%宽度 --> |
|
|
|
<view style="width: 50%; padding: 15rpx; display: flex; flex-direction: column; justify-content: space-between; background-color: white; border-left: 1rpx solid #f0f0f0;"> |
|
|
|
<view bindtap="showGoodsDetail" data-item="{{item}}"> |
|
|
|
<view style="font-size: 28rpx; font-weight: bold; word-break: break-word;">{{item.name}} |
|
|
|
<view style="display: inline-block; margin-left: 10rpx; font-size: 18rpx; color: #fff; background-color: #52c41a; padding: 2rpx 8rpx; border-radius: 10rpx;">已上架</view> |
|
|
|
</view> |
|
|
|
<view style="font-size: 24rpx; color: #666; margin-top: 8rpx;">蛋黄: {{item.yolk || '无'}}</view> |
|
|
|
<view style="font-size: 24rpx; color: #666; margin-top: 8rpx;">规格: {{item.spec || '无'}}</view> |
|
|
|
<view style="color: #f5222d; font-size: 24rpx; margin-top: 8rpx;">件数: {{item.minOrder}}件</view> |
|
|
|
<view style="color: #1677ff; font-size: 24rpx; margin-top: 8rpx;">斤重: {{item.grossWeight || ''}}斤</view> |
|
|
|
<view style="color: #722ed1; font-size: 24rpx; margin-top: 8rpx;">地区: {{item.region || '未设置'}}</view> |
|
|
|
<view style="font-size: 22rpx; color: #999; margin-top: 8rpx;">创建时间: {{item.formattedCreatedAt}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 按钮区域 --> |
|
|
|
<view class="card-actions"> |
|
|
|
<view style="display: flex; justify-content: space-around; margin-top: 10rpx; gap: 10rpx;"> |
|
|
|
<button |
|
|
|
class="action-btn unpublish-btn" |
|
|
|
catchtap="unpublishSupply" |
|
|
|
style="background-color: #1677ff; color: white; font-size: 22rpx; padding: 0 15rpx; line-height: 60rpx;" |
|
|
|
bindtap="unpublishSupply" |
|
|
|
data-id="{{item.id}}" |
|
|
|
> |
|
|
|
下架 |
|
|
|
@ -129,6 +113,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 已上架货源加载更多 --> |
|
|
|
<view class="load-more" wx:if="{{pagination.published.hasMore}}"> |
|
|
|
|