|
|
|
@ -55,58 +55,72 @@ |
|
|
|
<block wx:if="{{isPublishedExpanded}}"> |
|
|
|
<block wx:if="{{publishedSupplies.length > 0}}"> |
|
|
|
<view wx:for="{{publishedSupplies}}" wx:key="id" class="supply-card"> |
|
|
|
<!-- 图片和信息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%;"> |
|
|
|
<!-- 垂直布局:图片在上,信息在下 --> |
|
|
|
<view class="card-image-section"> |
|
|
|
<!-- 图片展示区域 --> |
|
|
|
<view class="image-container"> |
|
|
|
<!-- 图片轮播 --> |
|
|
|
<swiper |
|
|
|
class="image-swiper" |
|
|
|
style="width: 100%; height: 100%; --swiper-navigation-size: 0;" |
|
|
|
current="{{item.currentImageIndex || 0}}" |
|
|
|
bindchange="swiperChange" |
|
|
|
data-id="{{item.id}}" |
|
|
|
indicator-dots="false" |
|
|
|
show-indicators="false"> |
|
|
|
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" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="{{idx}}"></image> |
|
|
|
<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> |
|
|
|
</swiper-item> |
|
|
|
</block> |
|
|
|
</swiper> |
|
|
|
<!-- 无图片占位 --> |
|
|
|
<view wx:if="{{!item.imageUrls || item.imageUrls.length === 0}}" class="no-image"> |
|
|
|
<text>暂无图片</text> |
|
|
|
</view> |
|
|
|
<!-- 显示页码指示器 --> |
|
|
|
<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;"> |
|
|
|
<view wx:if="{{item.imageUrls && item.imageUrls.length > 1}}" class="swiper-pagination"> |
|
|
|
{{(item.currentImageIndex || 0) + 1}}/{{item.imageUrls.length}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 右侧信息区域 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 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> |
|
|
|
</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 style="display: flex; justify-content: space-around; margin-top: 10rpx; gap: 10rpx;"> |
|
|
|
<view class="card-actions"> |
|
|
|
<button |
|
|
|
style="background-color: #f5222d; color: white; font-size: 22rpx; padding: 0 15rpx; line-height: 60rpx;" |
|
|
|
class="action-btn unpublish-btn" |
|
|
|
catchtap="unpublishSupply" |
|
|
|
data-id="{{item.id}}" |
|
|
|
> |
|
|
|
@ -115,7 +129,6 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 已上架货源加载更多 --> |
|
|
|
<view class="load-more" wx:if="{{pagination.published.hasMore}}"> |
|
|
|
@ -165,12 +178,10 @@ |
|
|
|
<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%; --swiper-navigation-size: 0;" |
|
|
|
style="width: 100%; height: 100%;" |
|
|
|
current="{{item.currentImageIndex || 0}}" |
|
|
|
bindchange="swiperChange" |
|
|
|
data-id="{{item.id}}" |
|
|
|
indicator-dots="false" |
|
|
|
show-indicators="false"> |
|
|
|
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" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="{{idx}}"></image> |
|
|
|
@ -268,12 +279,10 @@ |
|
|
|
<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%; --swiper-navigation-size: 0;" |
|
|
|
style="width: 100%; height: 100%;" |
|
|
|
current="{{item.currentImageIndex || 0}}" |
|
|
|
bindchange="swiperChange" |
|
|
|
data-id="{{item.id}}" |
|
|
|
indicator-dots="false" |
|
|
|
show-indicators="false"> |
|
|
|
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" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="{{idx}}"></image> |
|
|
|
@ -375,12 +384,10 @@ |
|
|
|
<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%; --swiper-navigation-size: 0;" |
|
|
|
style="width: 100%; height: 100%;" |
|
|
|
current="{{item.currentImageIndex || 0}}" |
|
|
|
bindchange="swiperChange" |
|
|
|
data-id="{{item.id}}" |
|
|
|
indicator-dots="false" |
|
|
|
show-indicators="false"> |
|
|
|
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" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{item.imageUrls}}" data-index="{{idx}}"></image> |
|
|
|
@ -469,7 +476,7 @@ |
|
|
|
<!-- 固定的关闭按钮 --> |
|
|
|
<view style="position: absolute; top: 20rpx; right: 20rpx; background-color: #f5f5f5; color: #666; width: 60rpx; height: 60rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36rpx; z-index: 10;" bindtap="hideModal">×</view> |
|
|
|
|
|
|
|
<scroll-view scroll-y="true" scrollbar-style="none" style="height: 100vh; padding: 40rpx; box-sizing: border-box; overflow-y: scroll; -webkit-overflow-scrolling: touch; transform: translateZ(0); -webkit-transform: translateZ(0); -webkit-scrollbar: none; scrollbar-width: none;" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove"> |
|
|
|
<scroll-view scroll-y="true" style="height: 100vh; padding: 40rpx; box-sizing: border-box; overflow-y: scroll; -webkit-overflow-scrolling: touch; transform: translateZ(0); -webkit-transform: translateZ(0); -webkit-scrollbar: none; scrollbar-width: none;" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove"> |
|
|
|
<view class="title" style="text-align: center; font-size: 36rpx; font-weight: bold; color: #333; margin-bottom: 30rpx; margin-top: 10rpx;">创建货源</view> |
|
|
|
|
|
|
|
<!-- 照片上传区域 --> |
|
|
|
@ -553,7 +560,7 @@ |
|
|
|
<view bindtap="saveEdit" style="font-size: 32rpx; color: #07c160;">提交</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<scroll-view scroll-y="true" scrollbar-style="none" style="height: calc(100vh - 90rpx); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 40rpx 60rpx; box-sizing: border-box; -webkit-scrollbar: none; scrollbar-width: none; transform: translateZ(0); -webkit-transform: translateZ(0);"> |
|
|
|
<scroll-view scroll-y="true" style="height: calc(100vh - 90rpx); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 40rpx 60rpx; box-sizing: border-box;"> |
|
|
|
<view> |
|
|
|
|
|
|
|
<!-- 照片上传区域 --> |
|
|
|
@ -632,13 +639,12 @@ |
|
|
|
<view class="image-preview-mask" wx:if="{{showImagePreview}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; z-index: 9999;" catchtouchmove="true" bindtap="closeImagePreview"> |
|
|
|
<view style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;"> |
|
|
|
<swiper |
|
|
|
style="width: 100%; height: 100%; --swiper-navigation-size: 0;" |
|
|
|
style="width: 100%; height: 100%;" |
|
|
|
current="{{previewImageIndex}}" |
|
|
|
bindchange="onPreviewImageChange" |
|
|
|
indicator-dots="true" |
|
|
|
indicator-color="rgba(255,255,255,0.5)" |
|
|
|
indicator-active-color="#fff" |
|
|
|
show-indicators="false"> |
|
|
|
indicator-active-color="#fff"> |
|
|
|
<block wx:for="{{previewImageUrls}}" wx:key="*this"> |
|
|
|
<swiper-item> |
|
|
|
<image |
|
|
|
@ -693,8 +699,7 @@ |
|
|
|
<!-- 蛋黄列表 --> |
|
|
|
<scroll-view |
|
|
|
scroll-y="true" |
|
|
|
scrollbar-style="none" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none; transform: translateZ(0); -webkit-transform: translateZ(0);" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none;" |
|
|
|
enable-back-to-top="false" |
|
|
|
> |
|
|
|
<view |
|
|
|
@ -723,8 +728,7 @@ |
|
|
|
<!-- 商品名称列表 --> |
|
|
|
<scroll-view |
|
|
|
scroll-y="true" |
|
|
|
scrollbar-style="none" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none; transform: translateZ(0); -webkit-transform: translateZ(0);" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;" |
|
|
|
enable-back-to-top="false" |
|
|
|
> |
|
|
|
<view |
|
|
|
@ -774,8 +778,7 @@ |
|
|
|
<!-- 规格列表 --> |
|
|
|
<scroll-view |
|
|
|
scroll-y="true" |
|
|
|
scrollbar-style="none" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none; transform: translateZ(0); -webkit-transform: translateZ(0);" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;" |
|
|
|
enable-back-to-top="false" |
|
|
|
> |
|
|
|
<view |
|
|
|
@ -894,9 +897,8 @@ |
|
|
|
<!-- 搜索结果区域 --> |
|
|
|
<scroll-view |
|
|
|
wx:if="{{showSearchResults}}" |
|
|
|
style="max-height: 200rpx; border-bottom: 1rpx solid #eee; -webkit-scrollbar: none; scrollbar-width: none; transform: translateZ(0); -webkit-transform: translateZ(0);" |
|
|
|
style="max-height: 200rpx; border-bottom: 1rpx solid #eee; -webkit-scrollbar: none; scrollbar-width: none;" |
|
|
|
scroll-y |
|
|
|
scrollbar-style="none" |
|
|
|
> |
|
|
|
<view |
|
|
|
wx:for="{{filteredRegionOptions}}" |
|
|
|
|