You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

948 lines
56 KiB

3 months ago
<view class="container {{pageScrollLock ? 'page-scroll-lock' : ''}}"
style="align-items: flex-start; padding: 0; width: 100%; max-width: 100vw; overflow-x: hidden; position: relative; box-sizing: border-box;"
3 months ago
catchtouchmove="{{touchMoveBlocked ? 'preventTouchMove' : ''}}">
<view class="title">我的货源</view>
<!-- 标题栏 -->
<view class="title-bar">
<view class="title-bar-actions">
<button
bindtap="contactCustomerService"
class="customer-service-btn"
>
联系客服
</button>
<button
bindtap="applyForSettlement"
class="apply-settlement-btn {{partnerstatus !== 'approved' ? 'not-approved' : ''}}"
>
{{partnerstatus === 'approved' ? '已入驻' : '未入驻'}}
</button>
</view>
3 months ago
</view>
<!-- 搜索框 -->
<view class="search-container">
<view class="search-box">
3 months ago
<input
class="search-input"
3 months ago
placeholder="搜索货源名称或品种"
bindinput="onSearchInput"
bindconfirm="searchSupplies"
3 months ago
value="{{searchKeyword}}"
/>
<view wx:if="searchKeyword" class="clear-icon" bindtap="clearSearch">✘</view>
3 months ago
</view>
</view>
<button
class="glass-btn primary-glass-btn"
bindtap="showAddSupply"
style="width: 90%;"
>
创建新货源
</button>
<!-- 已上架货源 -->
<view style="margin-top: 30rpx; width: 100%;">
<view style="font-size: 28rpx; font-weight: bold; color: #52c41a; margin-bottom: 15rpx; display: flex; justify-content: space-between; align-items: center;">
<text>已上架货源 ({{publishedSupplies.length}})</text>
<view bindtap="togglePublishedExpand" style="width: 40rpx; height: 40rpx; display: flex; align-items: center; justify-content: center;">
<text wx:if="{{isPublishedExpanded}}" style="color: #52c41a; font-size: 28rpx;">▼</text>
<text wx:else style="color: #52c41a; font-size: 28rpx;">▲</text>
</view>
</view>
<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">
<!-- 图片轮播 -->
<swiper
class="image-swiper"
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>
</swiper-item>
</block>
</swiper>
<!-- 无图片占位 -->
<view wx:if="{{!item.imageUrls || item.imageUrls.length === 0}}" class="no-image">
3 months ago
<text>暂无图片</text>
</view>
<!-- 显示页码指示器 -->
<view wx:if="{{item.imageUrls && item.imageUrls.length > 1}}" class="swiper-pagination">
{{(item.currentImageIndex || 0) + 1}}/{{item.imageUrls.length}}
3 months ago
</view>
</view>
</view>
3 months ago
<!-- 信息区域 -->
<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>
3 months ago
</view>
</view>
<!-- 按钮区域 -->
<view class="card-actions">
3 months ago
<button
class="action-btn unpublish-btn"
catchtap="unpublishSupply"
3 months ago
data-id="{{item.id}}"
>
下架
</button>
</view>
</view>
</view>
<!-- 已上架货源加载更多 -->
<view class="load-more" wx:if="{{pagination.published.hasMore}}">
<view class="loading-text" wx:if="{{pagination.published.loading}}">
加载中...
</view>
<view class="load-more-text" wx:else bindtap="onReachPublishedBottom">
点击加载更多已上架货源
</view>
</view>
<view class="no-more" wx:if="{{!pagination.published.hasMore && publishedSupplies.length > 0}}">
没有更多已上架货源了
</view>
</block>
<view wx:else style="text-align: center; color: #999; font-size: 24rpx; padding: 30rpx 0;">
暂无已上架的货源
</view>
</block>
</view>
<!-- 审核中的货源 -->
<view style="margin-top: 30rpx; width: 100%;">
<view style="font-size: 28rpx; font-weight: bold; color: #1677ff; margin-bottom: 15rpx; display: flex; justify-content: space-between; align-items: center;">
<text>审核中的货源 ({{pendingSupplies.length}})</text>
<view bindtap="togglePendingExpand" style="width: 40rpx; height: 40rpx; display: flex; align-items: center; justify-content: center;">
<text wx:if="{{isPendingExpanded}}" style="color: #1677ff; font-size: 28rpx;">▼</text>
<text wx:else style="color: #1677ff; font-size: 28rpx;">▲</text>
</view>
</view>
<block wx:if="{{isPendingExpanded}}">
<block wx:if="{{pendingSupplies.length > 0}}">
<view wx:for="{{pendingSupplies}}" 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%;"
3 months ago
current="{{item.currentImageIndex || 0}}"
bindchange="swiperChange"
data-id="{{item.id}}">
3 months ago
<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>
</swiper-item>
</block>
</swiper>
<!-- 显示页码指示器 -->
<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>
<!-- 右侧信息区域 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}}">
3 months ago
<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: #1677ff; 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 style="display: flex; justify-content: space-around; margin-top: 10rpx; gap: 10rpx;">
<button
style="background-color: #faad14; color: white; font-size: 22rpx; padding: 0 15rpx; line-height: 60rpx;"
bindtap="showEditSupply"
data-id="{{item.id}}"
>
编辑
</button>
<button
style="background-color: #f5222d; color: white; font-size: 22rpx; padding: 0 15rpx; line-height: 60rpx;"
bindtap="deleteSupply"
data-id="{{item.id}}"
>
删除
</button>
</view>
</view>
</view>
</view>
<!-- 审核中货源加载更多 -->
<view class="load-more" wx:if="{{pagination.pending.hasMore}}">
<view class="loading-text" wx:if="{{pagination.pending.loading}}">
加载中...
</view>
<view class="load-more-text" wx:else bindtap="onReachPendingBottom">
点击加载更多审核中货源
</view>
</view>
<view class="no-more" wx:if="{{!pagination.pending.hasMore && pendingSupplies.length > 0}}">
没有更多审核中货源了
</view>
</block>
<view wx:else style="text-align: center; color: #999; font-size: 24rpx; padding: 30rpx 0;">
暂无审核中的货源
</view>
</block>
</view>
<!-- 审核失败的货源 -->
<view style="margin-top: 30rpx; width: 100%;">
<view style="font-size: 28rpx; font-weight: bold; color: #f5222d; margin-bottom: 15rpx; display: flex; justify-content: space-between; align-items: center;">
<text>审核失败的货源 ({{rejectedSupplies.length}})</text>
<view bindtap="toggleRejectedExpand" style="width: 40rpx; height: 40rpx; display: flex; align-items: center; justify-content: center;">
<text wx:if="{{isRejectedExpanded}}" style="color: #f5222d; font-size: 28rpx;">▼</text>
<text wx:else style="color: #f5222d; font-size: 28rpx;">▲</text>
</view>
</view>
<block wx:if="{{isRejectedExpanded}}">
<block wx:if="{{rejectedSupplies.length > 0}}">
<view wx:for="{{rejectedSupplies}}" 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%;"
3 months ago
current="{{item.currentImageIndex || 0}}"
bindchange="swiperChange"
data-id="{{item.id}}">
3 months ago
<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>
</swiper-item>
</block>
</swiper>
<!-- 显示页码指示器 -->
<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>
<!-- 右侧信息区域 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}}">
3 months ago
<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: #f5222d; 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 style="color: #f5222d; font-size: 24rpx; margin-top: 8rpx; text-decoration: underline;" catchtap="showRejectReason" data-id="{{item.id}}">
3 months ago
审核失败原因:点击查看
</view>
</view>
<!-- 按钮区域 -->
<view style="display: flex; justify-content: space-around; margin-top: 10rpx; gap: 10rpx;">
<button
style="background-color: #52c41a; color: white; font-size: 22rpx; padding: 0 15rpx; line-height: 60rpx;"
bindtap="preparePublishSupply"
data-id="{{item.id}}"
>
上架
</button>
<button
style="background-color: #f5222d; color: white; font-size: 22rpx; padding: 0 15rpx; line-height: 60rpx;"
bindtap="deleteSupply"
data-id="{{item.id}}"
>
删除
</button>
</view>
</view>
</view>
</view>
<!-- 审核失败货源加载更多 -->
<view class="load-more" wx:if="{{pagination.rejected.hasMore}}">
<view class="loading-text" wx:if="{{pagination.rejected.loading}}">
加载中...
</view>
<view class="load-more-text" wx:else bindtap="onReachRejectedBottom">
点击加载更多审核失败货源
</view>
</view>
<view class="no-more" wx:if="{{!pagination.rejected.hasMore && rejectedSupplies.length > 0}}">
没有更多审核失败货源了
</view>
</block>
<view wx:else style="text-align: center; color: #999; font-size: 24rpx; padding: 30rpx 0;">
暂无审核失败的货源
</view>
</block>
</view>
<!-- 草稿状态货源 -->
<view style="margin-top: 30rpx; width: 100%;">
<view style="font-size: 28rpx; font-weight: bold; color: #999; margin-bottom: 15rpx; display: flex; justify-content: space-between; align-items: center;">
<text>下架状态货源 ({{draftSupplies.length}})</text>
<view bindtap="toggleDraftExpand" style="width: 40rpx; height: 40rpx; display: flex; align-items: center; justify-content: center;">
<text wx:if="{{isDraftExpanded}}" style="color: #999; font-size: 28rpx;">▼</text>
<text wx:else style="color: #999; font-size: 28rpx;">▲</text>
</view>
</view>
<block wx:if="{{isDraftExpanded}}">
<block wx:if="{{draftSupplies.length > 0}}">
<view wx:for="{{draftSupplies}}" 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%;"
3 months ago
current="{{item.currentImageIndex || 0}}"
bindchange="swiperChange"
data-id="{{item.id}}">
3 months ago
<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>
</swiper-item>
</block>
</swiper>
<!-- 显示页码指示器 -->
<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>
<!-- 右侧信息区域 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}}">
3 months ago
<view style="font-size: 28rpx; font-weight: bold; word-break: break-word;">{{item.name}}
<view wx:if="{{item.status === 'hidden'}}" style="display: inline-block; margin-left: 10rpx; font-size: 18rpx; color: #fff; background-color: #8c8c8c; padding: 2rpx 8rpx; border-radius: 10rpx;">已隐藏</view>
<view wx:elif="{{item.status === 'sold_out' || item.status === 'Undercarriage'}}" style="display: inline-block; margin-left: 10rpx; font-size: 18rpx; color: #fff; background-color: #d9d9d9; padding: 2rpx 8rpx; border-radius: 10rpx;">已下架</view>
<view wx:else style="display: inline-block; margin-left: 10rpx; font-size: 18rpx; color: #fff; background-color: #999; 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 style="display: flex; justify-content: space-around; margin-top: 10rpx; gap: 10rpx; flex-wrap: wrap;">
<button
style="background-color: #1677ff; color: white; font-size: 22rpx; padding: 0 12rpx; line-height: 56rpx;"
bindtap="preparePublishSupply"
data-id="{{item.id}}"
>
上架
</button>
<!-- <button
style="background-color: #faad14; color: white; font-size: 22rpx; padding: 0 12rpx; line-height: 56rpx;"
bindtap="showEditSupply"
data-id="{{item.id}}"
>
编辑
</button> -->
<button
style="background-color: #f5222d; color: white; font-size: 22rpx; padding: 0 12rpx; line-height: 56rpx;"
bindtap="deleteSupply"
data-id="{{item.id}}"
>
删除
</button>
</view>
</view>
</view>
</view>
<!-- 下架状态货源加载更多 -->
<view class="load-more" wx:if="{{pagination.draft.hasMore}}">
<view class="loading-text" wx:if="{{pagination.draft.loading}}">
加载中...
</view>
<view class="load-more-text" wx:else bindtap="onReachDraftBottom">
点击加载更多下架状态货源
</view>
</view>
<view class="no-more" wx:if="{{!pagination.draft.hasMore && draftSupplies.length > 0}}">
没有更多下架状态货源了
</view>
</block>
<view wx:else style="text-align: center; color: #999; font-size: 24rpx; padding: 30rpx 0;">
暂无下架状态的货源
</view>
</block>
<!-- 半页空白页 -->
<view class="half-page-blank"></view>
3 months ago
</view>
<!-- 创建货源弹窗 -->
<view class="modal" wx:if="{{showModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 999;" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove">
<view class="modal-content" style="width: 100%; height: 100%; background: white; border-radius: 0; position: relative; box-shadow: none; transform: translateZ(0); -webkit-transform: translateZ(0);">
3 months ago
<!-- 固定的关闭按钮 -->
<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" 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">
3 months ago
<view class="title" style="text-align: center; font-size: 36rpx; font-weight: bold; color: #333; margin-bottom: 30rpx; margin-top: 10rpx;">创建货源</view>
<!-- 照片上传区域 -->
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-top: 10rpx;">商品图片</view>
<view class="upload-area" style="width: 100%; margin: 0 auto; margin-bottom: 30rpx; border: 1rpx dashed #ddd; border-radius: 12rpx; padding: 24rpx;">
<view style="display: flex; flex-wrap: wrap;">
<!-- 已上传的图片 -->
<view wx:for="{{newSupply.imageUrls}}" wx:key="index" style="position: relative; width: 160rpx; height: 160rpx; margin: 10rpx; border-radius: 12rpx; overflow: hidden; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);">
<image src="{{item}}" mode="aspectFill" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{newSupply.imageUrls}}" data-index="{{index}}"></image>
<view class="delete-icon" style="position: absolute; top: 8rpx; right: 8rpx; background-color: rgba(0,0,0,0.6); color: white; width: 44rpx; height: 44rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28rpx;" bindtap="deleteImage" data-index="{{index}}" data-type="new">×</view>
</view>
<!-- 上传按钮 -->
<view wx:if="{{newSupply.imageUrls.length < 5}}" style="width: 160rpx; height: 160rpx; margin: 10rpx; border: 2rpx dashed #1677ff; border-radius: 12rpx; display: flex; align-items: center; justify-content: center; background-color: #f0f8ff;" bindtap="chooseImage" data-type="new">
<text style="font-size: 60rpx; color: #1677ff;">+</text>
</view>
</view>
<view style="font-size: 22rpx; color: #999; margin-top: 16rpx; text-align: center;">最多上传5张图片</view>
</view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">商品名称</view>
<view
bindtap="openNameSelectModal"
style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{newSupply.name || '请选择商品名称'}}</text>
<text style="color: #999;">▼</text>
</view>
</view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">蛋黄</view>
<view bindtap="openYolkSelectModal" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{newSupply.yolk || '请选择蛋黄类型'}}</text>
<text style="color: #999;">▼</text>
</view>
</view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">规格</view>
<!-- 修改为可点击的视图,点击后打开自定义弹窗 -->
<view bindtap="onSpecChange" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative; z-index: 1;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{newSupply.spec || '请选择规格'}}</text>
<text style="color: #999;">▼</text>
</view>
</view>
<!-- 搜索功能已移至弹窗内 -->
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">价格</view>
<input class="input" type="text" placeholder="请输入价格" bindinput="onInput" data-field="price" value="{{newSupply.price}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;" catchtouchmove="true" bindtouchstart="onInputTouchStart" bindtouchmove="onInputTouchMove"></input>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">件数</view>
<input class="input" type="number" placeholder="请输入件数" bindinput="onInput" data-field="minOrder" value="{{newSupply.minOrder}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;" catchtouchmove="true" bindtouchstart="onInputTouchStart" bindtouchmove="onInputTouchMove"></input>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">斤重</view>
<input class="input" type="text" placeholder="请输入斤重" bindinput="onInput" data-field="grossWeight" value="{{newSupply.grossWeight || ''}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;" catchtouchmove="true" bindtouchstart="onInputTouchStart" bindtouchmove="onInputTouchMove"></input>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">地区</view>
<view bindtap="openCreateRegionModal" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative; z-index: 1;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{newSupply.region || '请选择省市区'}}</text>
<text style="color: #999;">▼</text>
</view>
</view>
3 months ago
<view style="display: flex; justify-content: space-between; margin-top: 20rpx; margin-bottom: 20rpx; gap: 20rpx;">
<button bindtap="hideModal" style="flex: 1; height: 90rpx; line-height: 90rpx; background-color: #f5f5f5; color: #666; font-size: 30rpx; border-radius: 12rpx; margin: 0; display: flex; align-items: center; justify-content: center;">取消</button>
<button bindtap="addSupply" style="flex: 1; height: 90rpx; line-height: 90rpx; background-color: #07c160; color: white; font-size: 30rpx; border-radius: 12rpx; margin: 0; display: flex; align-items: center; justify-content: center;">创建</button>
</view>
<!-- 增加1/7屏幕高度的空白页,防止按钮被遮挡 -->
<view style="height: 14.28vh;"></view>
3 months ago
</scroll-view>
</view>
</view>
<!-- 编辑货源弹窗(全屏) -->
<view class="modal" wx:if="{{showEditModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: white; z-index: 999;">
<!-- 顶部导航栏 -->
<view style="display: flex; justify-content: space-between; align-items: center; padding: 30rpx; border-bottom: 1rpx solid #eee; background-color: #fafafa; position: sticky; top: 0; z-index: 10;">
<view bindtap="hideEditModal" style="font-size: 32rpx; color: #666;">取消</view>
<view style="font-size: 32rpx; font-weight: bold; color: #333;">编辑货源</view>
<view bindtap="saveEdit" style="font-size: 32rpx; color: #07c160;">提交</view>
</view>
<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>
3 months ago
<!-- 照片上传区域 -->
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-top: 10rpx;">商品图片</view>
<view class="upload-area" style="width: 100%; margin: 0 auto; margin-bottom: 30rpx; border: 1rpx dashed #ddd; border-radius: 12rpx; padding: 24rpx;">
<view style="display: flex; flex-wrap: wrap;">
<!-- 已上传的图片 -->
<view wx:for="{{editSupply.imageUrls}}" wx:key="index" style="position: relative; width: 160rpx; height: 160rpx; margin: 10rpx; border-radius: 12rpx; overflow: hidden; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);">
<image src="{{item}}" mode="aspectFill" style="width: 100%; height: 100%;" bindtap="previewImage" data-urls="{{editSupply.imageUrls}}" data-index="{{index}}"></image>
<view class="delete-icon" style="position: absolute; top: 8rpx; right: 8rpx; background-color: rgba(0,0,0,0.6); color: white; width: 44rpx; height: 44rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28rpx;" bindtap="deleteImage" data-index="{{index}}" data-type="edit">×</view>
</view>
<!-- 上传按钮 -->
<view wx:if="{{editSupply.imageUrls.length < 5}}" style="width: 160rpx; height: 160rpx; margin: 10rpx; border: 2rpx dashed #1677ff; border-radius: 12rpx; display: flex; align-items: center; justify-content: center; background-color: #f0f8ff;" bindtap="chooseImage" data-type="edit">
<text style="font-size: 60rpx; color: #1677ff;">+</text>
</view>
</view>
<view style="font-size: 22rpx; color: #999; margin-top: 16rpx; text-align: center;">最多上传5张图片</view>
</view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">品种</view>
<input class="input" type="text" placeholder="请输入品种" bindinput="onEditInput" data-field="name" value="{{editSupply.name}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;"></input>
3 months ago
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">商品名称</view>
<view
bindtap="openNameSelectModal"
style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text style="text-align: left;">{{editSupply.productName || editSupply.name || '请选择商品名称'}}</text>
3 months ago
<text style="color: #999;">▼</text>
</view>
</view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">蛋黄</view>
<view bindtap="openYolkSelectModal" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text style="text-align: left;">{{editSupply.yolk || '请选择蛋黄类型'}}</text>
3 months ago
<text style="color: #999;">▼</text>
</view>
</view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">规格</view>
<!-- 修改为可点击的视图,点击后打开自定义弹窗 -->
<view bindtap="onEditSpecChange" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative; z-index: 1;">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text style="text-align: left;">{{editSupply.spec || '请选择规格'}}</text>
3 months ago
<text style="color: #999;">▼</text>
</view>
</view>
<!-- 搜索功能已移至弹窗内 -->
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">价格</view>
<input class="input" type="text" placeholder="请输入价格" bindinput="onEditInput" data-field="price" value="{{editSupply.price}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;"></input>
3 months ago
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">件数</view>
<input class="input" type="number" placeholder="请输入件数" bindinput="onEditInput" data-field="minOrder" value="{{editSupply.minOrder}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;"></input>
3 months ago
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">斤重</view>
<input class="input" type="text" placeholder="请输入斤重" bindinput="onEditInput" data-field="grossWeight" value="{{editSupply.grossWeight || ''}}" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" placeholder-style="font-size: 24rpx; color: #999; text-align: left;"></input>
3 months ago
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">地区</view>
<view
class="region-picker input"
bindtap="openEditRegionModal"
style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;"
>
<text style="text-align: left;">{{editSupply.region || '请选择省市区'}}</text>
</view>
3 months ago
<!-- 添加底部空白区域 -->
<view style="height: 20vh; background: transparent;"></view>
</view>
</scroll-view>
3 months ago
</view>
<!-- 图片预览弹窗 -->
<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%;"
3 months ago
current="{{previewImageIndex}}"
bindchange="onPreviewImageChange"
indicator-dots="true"
indicator-color="rgba(255,255,255,0.5)"
indicator-active-color="#fff">
3 months ago
<block wx:for="{{previewImageUrls}}" wx:key="*this">
<swiper-item>
<image
src="{{item}}"
mode="aspectFit"
style="width: 100%; height: 100%; transform: scale({{scale}}) translate({{offsetX}}px, {{offsetY}}px); transform-origin: center; transition: transform 0.1s;"
bindtap="handleImageTap"
bindtouchstart="handleTouchStart"
bindtouchmove="handleTouchMove"
bindtouchend="handleTouchEnd"
bindload="onPreviewImageLoad"
></image>
</swiper-item>
</block>
</swiper>
<view style="position: absolute; top: 40rpx; right: 40rpx; color: white; font-size: 40rpx;">
<text bindtap="closeImagePreview" style="background: rgba(0,0,0,0.5); padding: 10rpx 20rpx; border-radius: 50%;">×</text>
</view>
</view>
</view>
<!-- 审核失败原因弹窗 -->
<view class="reject-reason-modal" wx:if="{{showRejectReasonModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 9999;" catchtouchmove="true">
<view style="width: 80%; background: white; border-radius: 16rpx; overflow: hidden;">
<!-- 弹窗标题和关闭按钮 -->
<view style="padding: 30rpx; border-bottom: 1rpx solid #eee; display: flex; justify-content: space-between; align-items: center;">
<text style="font-size: 32rpx; font-weight: bold;">审核失败原因</text>
<view style="width: 60rpx; height: 60rpx; display: flex; align-items: center; justify-content: center; font-size: 40rpx; color: #999;" bindtap="closeRejectReasonModal">×</view>
</view>
<!-- 失败原因内容 -->
<view style="padding: 30rpx;">
<view style="min-height: 200rpx; font-size: 28rpx; line-height: 48rpx; color: #333; white-space: pre-wrap; word-break: break-word; background-color: #f8f9fa; border: 1rpx solid #e9ecef; border-radius: 8rpx; padding: 24rpx; box-shadow: inset 0 1rpx 3rpx rgba(0,0,0,0.05); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;">{{rejectReason}}</view>
3 months ago
</view>
<!-- 操作按钮 -->
<view style="display: flex; padding: 0 30rpx 30rpx; gap: 20rpx;">
<button style="flex: 1; background-color: #52c41a; color: white; font-size: 28rpx; margin: 0; border-radius: 8rpx; border: none; height: 80rpx; line-height: 80rpx; box-shadow: 0 2rpx 8rpx rgba(82, 196, 26, 0.3);" bindtap="resubmitRejectedSupply">重新提交</button>
3 months ago
</view>
</view>
</view>
<!-- 蛋黄选择弹窗 - 白色样式 -->
<view class="custom-select-modal" wx:if="{{showYolkSelectModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; z-index: 9999;" catchtouchmove="true">
<view style="position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 20rpx 20rpx 0 0; max-height: 80vh;">
<!-- 顶部操作栏:取消和确定按钮 -->
<view style="padding: 20rpx; display: flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #eee;">
<view bindtap="closeYolkSelectModal" style="font-size: 32rpx; color: #333; padding: 10rpx 20rpx;">取消</view>
<view bindtap="confirmYolkSelection" style="font-size: 32rpx; color: #07c160; padding: 10rpx 20rpx;">确定</view>
</view>
<!-- 蛋黄列表 -->
<scroll-view
scroll-y="true"
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none;"
3 months ago
enable-back-to-top="false"
>
<view
wx:for="{{yolkOptions}}"
wx:key="index"
class="select-item {{selectedYolkIndex === index ? 'selected' : ''}}"
bindtap="onYolkSelect"
data-index="{{index}}"
style="padding: 32rpx 40rpx; border-bottom: 1rpx solid #f0f0f0; font-size: 32rpx; color: {{selectedYolkIndex === index ? '#07c160' : '#131413'}}; text-align: center;"
>
{{item}}
</view>
</scroll-view>
</view>
</view>
<!-- 商品名称选择弹窗 - 白色样式 -->
<view class="custom-select-modal" wx:if="{{showNameSelectModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; z-index: 9999;" catchtouchmove="true">
<view style="position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 20rpx 20rpx 0 0; max-height: 80vh;">
<!-- 顶部操作栏:取消和确定按钮 -->
<view style="padding: 20rpx; display: flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #eee;">
<view bindtap="closeNameSelectModal" style="font-size: 32rpx; color: #333; padding: 10rpx 20rpx;">取消</view>
<view bindtap="confirmNameSelection" style="font-size: 32rpx; color: #07c160; padding: 10rpx 20rpx;">确定</view>
</view>
<!-- 商品名称列表 -->
<scroll-view
scroll-y="true"
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;"
3 months ago
enable-back-to-top="false"
>
<view
wx:for="{{productNameOptions}}"
wx:key="index"
class="select-item {{selectedNameIndex === index ? 'selected' : ''}}"
bindtap="onNameSelect"
data-index="{{index}}"
style="padding: 32rpx 40rpx; border-bottom: 1rpx solid #f0f0f0; font-size: 32rpx; color: {{selectedNameIndex === index ? '#07c160' : '#131413'}}; text-align: center;"
>
{{item}}
</view>
</scroll-view>
</view>
</view>
<!-- 自定义规格选择弹窗 - 适配原生风格 -->
<view class="spec-select-modal" wx:if="{{showSpecSelectModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; z-index: 9999;" catchtouchmove="true">
<view style="position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 20rpx 20rpx 0 0; max-height: 80vh;">
<!-- 顶部操作栏:取消和确定按钮 -->
<view style="padding: 20rpx; display: flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #eee;">
<view bindtap="closeSpecSelectModal" style="font-size: 32rpx; color: #333; padding: 10rpx 20rpx;">取消</view>
<view bindtap="confirmSpecSelection" style="font-size: 32rpx; color: #07c160; padding: 10rpx 20rpx;">确定</view>
</view>
<!-- 搜索框区域 -->
<view style="padding: 20rpx;">
<view style="position: relative; background: #f5f5f5; border-radius: 40rpx; padding: 0 30rpx;">
<input
type="text"
placeholder="搜索规格"
value="{{modalSpecSearchKeyword}}"
bindinput="onModalSpecSearchInput"
confirm-type="search"
style="width: 100%; height: 70rpx; line-height: 70rpx; font-size: 28rpx; background: transparent;"
/>
<view
wx:if="{{modalSpecSearchKeyword}}"
bindtap="clearModalSpecSearch"
style="position: absolute; right: 30rpx; top: 50%; transform: translateY(-50%); color: #999;"
>
</view>
</view>
</view>
<!-- 规格列表 -->
<scroll-view
scroll-y="true"
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;"
3 months ago
enable-back-to-top="false"
>
<view
wx:for="{{filteredModalSpecOptions}}"
wx:key="index"
class="spec-item {{selectedModalSpecIndex === index ? 'selected' : ''}}"
bindtap="onModalSpecSelect"
data-index="{{index}}"
style="padding: 32rpx 40rpx; border-bottom: 1rpx solid #f0f0f0; font-size: 32rpx; color: {{selectedModalSpecIndex === index ? '#07c160' : '#131413'}}; text-align: center;"
>
{{item}}
</view>
</scroll-view>
</view>
</view>
<!-- 未授权登录提示弹窗 -->
<view wx:if="{{showAuthModal}}" class="auth-modal-overlay">
<view class="auth-modal-container">
<view class="auth-modal-title">提示</view>
<view class="auth-modal-content">请先登录后再操作</view>
3 months ago
<view class="auth-modal-buttons">
<button class="auth-primary-button" bindtap="showOneKeyLogin">一键登录</button>
3 months ago
<button class="auth-cancel-button" bindtap="closeAuthModal">取消</button>
</view>
</view>
</view>
<!-- 一键登录弹窗 -->
<view wx:if="{{showOneKeyLoginModal}}" class="auth-modal-overlay">
<view class="auth-modal-container">
<view class="auth-modal-title">
<text>授权登录</text>
</view>
<view class="auth-modal-content">
<text>请授权获取您的手机号用于登录</text>
</view>
<view class="auth-modal-buttons">
<button class="auth-primary-button" open-type="getPhoneNumber" bind:getphonenumber="onGetPhoneNumber">
授权获取手机号
</button>
<button class="auth-cancel-button" bindtap="closeOneKeyLoginModal">取消</button>
</view>
</view>
</view>
<!-- 用户信息填写弹窗 -->
<view wx:if="{{showUserInfoForm}}" class="auth-modal-overlay">
<view class="auth-modal-container">
<view class="auth-modal-title">
<text>完善个人信息</text>
</view>
<!-- 头像选择 -->
<view class="auth-avatar-section">
<button class="auth-avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="auth-avatar" src="{{avatarUrl}}"></image>
</button>
</view>
<!-- 昵称输入 -->
<form bindsubmit="getUserName">
<view class="auth-form-group">
<view class="auth-form-label">昵称</view>
<input placeholder="请输入昵称" type="nickname" name="nickname" maxlength="32" class="auth-form-input"></input>
</view>
<!-- 提交按钮 -->
<view class="auth-form-actions">
<button form-type="submit" class="auth-confirm-button">确定</button>
</view>
</form>
<!-- 取消按钮 -->
<view class="auth-modal-buttons">
<button class="auth-cancel-button" bindtap="cancelUserInfoForm">取消</button>
</view>
</view>
</view>
<!-- 地区选择弹窗 -->
<view class="region-select-modal" wx:if="{{showRegionSelectModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; z-index: 9999;">
<view style="position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 20rpx 20rpx 0 0; max-height: 80vh;">
<!-- 顶部操作栏:取消和确定按钮 -->
<view style="padding: 20rpx; display: flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #eee;">
<view bindtap="closeRegionModal" style="font-size: 32rpx; color: #333; padding: 10rpx 20rpx;">取消</view>
<view bindtap="confirmRegionSelection" style="font-size: 32rpx; color: #07c160; padding: 10rpx 20rpx;">确定</view>
</view>
<!-- 搜索框 -->
<view style="padding: 12rpx 20rpx; border-bottom: 1rpx solid #eee;">
<view class="search-box-compact">
<text class="search-icon-text">🔍</text>
<input
class="search-input-compact"
placeholder="搜索地区"
value="{{currentRegionMode === 'create' ? regionSearchKeyword : editRegionSearchKeyword}}"
bindinput="onRegionSearchInput"
bindfocus="onRegionSearchFocus"
/>
<image
class="clear-icon-compact"
wx:if="{{(currentRegionMode === 'create' && regionSearchKeyword) || (currentRegionMode === 'edit' && editRegionSearchKeyword)}}"
src="/images/close.png"
mode="aspectFit"
bindtap="clearRegionSearch"
></image>
</view>
</view>
<!-- 显示当前选择的地区 -->
<view style="padding: 20rpx; text-align: center; color: #666; font-size: 28rpx; border-bottom: 1rpx solid #f0f0f0;">
当前选择: {{regionOptions[selectedProvinceIndex].name}} {{currentCities[selectedCityIndex].name}} {{currentDistricts[selectedDistrictIndex]}}
</view>
<!-- 搜索结果区域 -->
<scroll-view
wx:if="{{showSearchResults}}"
style="max-height: 200rpx; border-bottom: 1rpx solid #eee; -webkit-scrollbar: none; scrollbar-width: none;"
scroll-y
>
<view
wx:for="{{filteredRegionOptions}}"
wx:key="item"
class="search-result-item"
bindtap="selectSearchRegion"
data-region="{{item.region}}"
data-province-index="{{item.provinceIndex}}"
data-city-index="{{item.cityIndex}}"
data-district-index="{{item.districtIndex}}"
>
{{item.region}}
</view>
<view wx:if="{{filteredRegionOptions.length === 0}}" style="padding: 20rpx; text-align: center; color: #999;">
未找到匹配的地区
</view>
</scroll-view>
<!-- 三级联动地区选择器 -->
<view style="height: 400rpx; padding: 20rpx 0;">
<picker-view
indicator-style="height: 60rpx; background-color: rgba(245, 245, 245, 0.8);"
style="width: 100%; height: 100%;"
value="{{[selectedProvinceIndex, selectedCityIndex, selectedDistrictIndex]}}"
bindchange="onRegionChange"
>
<picker-view-column>
<view wx:for="{{regionOptions}}" wx:key="index" style="line-height: 60rpx; text-align: center; font-size: 32rpx;">
{{item.name}}
</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{currentCities}}" wx:key="index" style="line-height: 60rpx; text-align: center; font-size: 32rpx;">
{{item.name}}
</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{currentDistricts}}" wx:key="index" style="line-height: 60rpx; text-align: center; font-size: 32rpx;">
{{item}}
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</view>
3 months ago
</view>