Browse Source

完善编辑货源页面功能,包括文本左对齐和右侧留白调整

pull/1/head
徐飞洋 3 months ago
parent
commit
224c0df14f
  1. 2
      pages/buyer/index.js
  2. 64
      pages/goods-detail/goods-detail.js
  3. 37
      pages/goods-detail/goods-detail.wxml
  4. 23
      pages/seller/index.js
  5. 64
      pages/seller/index.wxml

2
pages/buyer/index.js

@ -645,6 +645,8 @@ Page({
imageUrls: product.imageUrls || [], imageUrls: product.imageUrls || [],
reservedCount: reservedCount, reservedCount: reservedCount,
createdAt: product.created_at || product.createTime || null, createdAt: product.created_at || product.createTime || null,
product_contact: product.product_contact || '',
contact_phone: product.contact_phone || '',
isReserved: reservedGoodsIds.some(id => isReserved: reservedGoodsIds.some(id =>
String(id) === String(product.id) || String(id) === String(product.id) ||
String(id) === String(product.productId) String(id) === String(product.productId)

64
pages/goods-detail/goods-detail.js

@ -30,6 +30,7 @@ Page({
showImagePreview: false, // 控制图片预览弹窗显示 showImagePreview: false, // 控制图片预览弹窗显示
previewImageUrls: [], // 预览的图片URL列表 previewImageUrls: [], // 预览的图片URL列表
previewImageIndex: 0, // 当前预览图片的索引 previewImageIndex: 0, // 当前预览图片的索引
fromSeller: false, // 是否来自seller页面
// 图片缩放相关状态 // 图片缩放相关状态
scale: 1, // 当前缩放比例 scale: 1, // 当前缩放比例
lastScale: 1, // 上一次缩放比例 lastScale: 1, // 上一次缩放比例
@ -45,6 +46,9 @@ Page({
onLoad(options) { onLoad(options) {
console.log('商品详情页面加载,参数:', options); console.log('商品详情页面加载,参数:', options);
// 检查是否来自seller页面
const fromSeller = options.fromSeller === '1' ? true : false;
// 支持两种参数传递方式:直接传递商品数据或仅传递商品ID // 支持两种参数传递方式:直接传递商品数据或仅传递商品ID
if (options.goodsData) { if (options.goodsData) {
try { try {
@ -52,9 +56,50 @@ Page({
const goodsData = JSON.parse(decodeURIComponent(options.goodsData)); const goodsData = JSON.parse(decodeURIComponent(options.goodsData));
console.log('解析后的商品数据:', goodsData); console.log('解析后的商品数据:', goodsData);
// 设置商品详情数据 // 从本地存储获取已预约商品ID列表
const reservedGoodsIds = wx.getStorageSync('reservedGoodsIds') || [];
const product = goodsData;
// 确保商品ID的一致性
const productIdStr = String(product.productId || product.id);
// 增强的预约人数计算逻辑
const selectedValue = product.selected;
const reservedCountValue = product.reservedCount;
const reservationCountValue = product.reservationCount;
const finalReservationCount = selectedValue !== undefined && selectedValue !== null ? selectedValue :
(reservedCountValue !== undefined && reservedCountValue !== null ? reservedCountValue :
(reservationCountValue || 0));
// 处理grossWeight为null或无效的情况,返回空字符串以支持文字输入
const grossWeightValue = product.grossWeight !== null && product.grossWeight !== undefined ? product.grossWeight : '';
// 转换商品数据格式,与loadGoodsDetail保持一致
const formattedGoods = {
id: productIdStr,
productId: productIdStr,
name: product.productName,
price: product.price,
minOrder: product.quantity,
yolk: product.yolk,
spec: product.specification,
region: product.region,
contact_phone: product.contact_phone || product.contactPhone,
product_contact: product.product_contact || product.contactName,
imageUrls: product.imageUrls || product.images || [],
displayGrossWeight: formatGrossWeight(grossWeightValue, product.weight),
isReserved: reservedGoodsIds.some(itemId => String(itemId) === productIdStr),
reservedCount: finalReservationCount,
created_at: product.created_at || product.createdAt,
updated_at: product.updated_at || product.updatedAt,
status: product.status || 'published'
};
// 设置商品详情数据和来源标识
this.setData({ this.setData({
goodsDetail: goodsData goodsDetail: formattedGoods,
fromSeller: fromSeller
}); });
} catch (error) { } catch (error) {
console.error('解析商品数据失败:', error); console.error('解析商品数据失败:', error);
@ -71,6 +116,11 @@ Page({
} else if (options.id) { } else if (options.id) {
// 如果只传递了商品ID,则从服务器加载商品详情 // 如果只传递了商品ID,则从服务器加载商品详情
this.loadGoodsDetail(options.id); this.loadGoodsDetail(options.id);
// 设置来源标识
this.setData({
fromSeller: fromSeller
});
} else { } else {
wx.showToast({ wx.showToast({
title: '参数错误', title: '参数错误',
@ -123,14 +173,14 @@ Page({
yolk: product.yolk, yolk: product.yolk,
spec: product.specification, spec: product.specification,
region: product.region, region: product.region,
contact_phone: product.contactPhone, contact_phone: product.contact_phone || product.contactPhone,
product_contact: product.contactName, product_contact: product.product_contact || product.contactName,
imageUrls: product.images || [], imageUrls: product.imageUrls || product.images || [],
displayGrossWeight: formatGrossWeight(grossWeightValue, product.weight), displayGrossWeight: formatGrossWeight(grossWeightValue, product.weight),
isReserved: reservedGoodsIds.some(itemId => String(itemId) === productIdStr), isReserved: reservedGoodsIds.some(itemId => String(itemId) === productIdStr),
reservedCount: finalReservationCount, reservedCount: finalReservationCount,
created_at: product.createdAt, created_at: product.created_at || product.createdAt,
updated_at: product.updatedAt updated_at: product.updated_at || product.updatedAt
}; };
this.setData({ this.setData({

37
pages/goods-detail/goods-detail.wxml

@ -1,30 +1,28 @@
<!-- pages/goods-detail/goods-detail.wxml --> <!-- pages/goods-detail/goods-detail.wxml -->
<view class="goods-detail-page"> <view class="goods-detail-page">
<!-- 页面头部 -->
<view class="page-header">
<view class="header-left"></view>
<view class="header-center">
<text class="header-title">商品详情</text>
</view>
<view class="header-right" bindtap="goBack">
<text class="close-icon">×</text>
</view>
</view>
<!-- 商品详情内容 --> <!-- 商品详情内容 -->
<view class="goods-detail-content"> <view class="goods-detail-content">
<!-- 商品图片轮播 --> <!-- 商品图片轮播 -->
<view class="goods-image-slider"> <view class="goods-image-slider">
<swiper indicator-dots="{{true}}" autoplay="{{true}}" interval="3000" duration="500"> <swiper
indicator-dots="{{true}}"
autoplay="{{true}}"
interval="3000"
duration="500"
indicator-color="rgba(255, 255, 255, 0.5)"
indicator-active-color="#ffffff"
circular="{{true}}"
>
<block wx:for="{{goodsDetail.imageUrls}}" wx:key="index"> <block wx:for="{{goodsDetail.imageUrls}}" wx:key="index">
<swiper-item> <swiper-item>
<image <image
src="{{item}}" src="{{item}}"
mode="scaleToFill" mode="aspectFill"
class="slider-image" class="slider-image"
bindtap="previewImage" bindtap="previewImage"
data-urls="{{goodsDetail.imageUrls}}" data-urls="{{goodsDetail.imageUrls}}"
data-index="{{index}}" data-index="{{index}}"
loading="lazy"
/> />
</swiper-item> </swiper-item>
</block> </block>
@ -99,7 +97,7 @@
</view> </view>
<!-- 联系信息 --> <!-- 联系信息 -->
<view class="contact-info"> <view class="contact-info" wx:if="{{goodsDetail.status === 'published'}}">
<text class="contact-label">联系信息</text> <text class="contact-label">联系信息</text>
<view class="contact-content"> <view class="contact-content">
<view class="contact-item"> <view class="contact-item">
@ -119,7 +117,7 @@
</view> </view>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<view class="action-buttons"> <view class="action-buttons" wx:if="{{goodsDetail.status === 'published'}}">
<button <button
class="call-button bottom-button" class="call-button bottom-button"
bindtap="makePhoneCall" bindtap="makePhoneCall"
@ -136,6 +134,15 @@
{{goodsDetail.isReserved ? '已预约' : '我想要'}} {{goodsDetail.isReserved ? '已预约' : '我想要'}}
</button> </button>
</view> </view>
<!-- 返回按钮区域(仅在seller页面查看时显示) -->
<view class="action-buttons" wx:if="{{fromSeller}}">
<button
class="back-button bottom-button"
bindtap="goBack"
>
返回
</button>
</view>
<!-- 图片预览弹窗 --> <!-- 图片预览弹窗 -->
<view class="image-preview-container" wx:if="{{showImagePreview}}"> <view class="image-preview-container" wx:if="{{showImagePreview}}">

23
pages/seller/index.js

@ -1917,6 +1917,7 @@ Page({
console.log(`从服务器获取到${type}类型商品数据,共`, res.products.length, '条'); console.log(`从服务器获取到${type}类型商品数据,共`, res.products.length, '条');
// 处理服务器返回的商品数据 // 处理服务器返回的商品数据
console.log('【调试】服务器返回的商品数据:', res.products);
const serverSupplies = res.products const serverSupplies = res.products
.filter(product => product.status !== 'hidden') .filter(product => product.status !== 'hidden')
.map(serverProduct => { .map(serverProduct => {
@ -1933,6 +1934,7 @@ Page({
return { return {
id: serverProduct.productId, id: serverProduct.productId,
name: serverProduct.productName, name: serverProduct.productName,
productName: serverProduct.productName, // 【新增】同时设置productName字段
price: serverProduct.price, price: serverProduct.price,
minOrder: serverProduct.quantity, minOrder: serverProduct.quantity,
grossWeight: serverProduct.grossWeight, grossWeight: serverProduct.grossWeight,
@ -1945,7 +1947,10 @@ Page({
imageUrls: imageUrls, imageUrls: imageUrls,
created_at: createdAt, created_at: createdAt,
formattedCreatedAt: formattedCreatedAt, formattedCreatedAt: formattedCreatedAt,
currentImageIndex: 0 currentImageIndex: 0,
// 添加联系信息字段,确保与买蛋页面一致
product_contact: serverProduct.product_contact || '',
contact_phone: serverProduct.contact_phone || ''
}; };
}); });
@ -2603,11 +2608,6 @@ Page({
pageScrollLock: true pageScrollLock: true
}) })
} }
// iOS设备特殊处理:阻止触摸事件
if (this.isIOS()) {
this.blockTouchMove()
}
}, },
// 启用页面滚动 // 启用页面滚动
@ -2620,11 +2620,6 @@ Page({
pageScrollLock: false pageScrollLock: false
}) })
} }
// iOS设备特殊处理:恢复触摸事件
if (this.isIOS()) {
this.unblockTouchMove()
}
}, },
// 输入内容处理 // 输入内容处理
@ -3298,9 +3293,9 @@ Page({
} }
const goodsItem = e.currentTarget.dataset.item; const goodsItem = e.currentTarget.dataset.item;
// 跳转到商品详情页面,并传递商品数据,使用encodeURIComponent编码JSON字符串 // 跳转到商品详情页面,并传递商品数据和来源标识,使用encodeURIComponent编码JSON字符串
wx.navigateTo({ wx.navigateTo({
url: '/pages/goods-detail/goods-detail?goodsData=' + encodeURIComponent(JSON.stringify(goodsItem)) url: '/pages/goods-detail/goods-detail?goodsData=' + encodeURIComponent(JSON.stringify(goodsItem)) + '&fromSeller=1'
}); });
}, },
@ -3587,6 +3582,7 @@ Page({
editSupplyRegionArray = supply.region.split(' ').filter(item => item.trim() !== ''); editSupplyRegionArray = supply.region.split(' ').filter(item => item.trim() !== '');
} }
console.log('【调试】supply对象完整结构:', supply);
console.log('【调试】编辑弹窗数据设置:', { console.log('【调试】编辑弹窗数据设置:', {
supplyRegion: supply.region, supplyRegion: supply.region,
editSupplyRegion: supplyWithFormattedTime.region, editSupplyRegion: supplyWithFormattedTime.region,
@ -4280,6 +4276,7 @@ Page({
showRejectReasonModal: false showRejectReasonModal: false
// 注意:这里不立即清空 currentRejectSupply,确保后续操作能使用 // 注意:这里不立即清空 currentRejectSupply,确保后续操作能使用
}); });
// 恢复页面滚动 // 恢复页面滚动
this.enablePageScroll(); this.enablePageScroll();
}, },

64
pages/seller/index.wxml

@ -121,7 +121,7 @@
<view class="card-actions"> <view class="card-actions">
<button <button
class="action-btn unpublish-btn" class="action-btn unpublish-btn"
bindtap="unpublishSupply" catchtap="unpublishSupply"
data-id="{{item.id}}" data-id="{{item.id}}"
> >
下架 下架
@ -196,8 +196,8 @@
</view> </view>
<!-- 右侧信息区域 50%宽度 --> <!-- 右侧信息区域 50%宽度 -->
<view style="width: 50%; padding: 15rpx; display: flex; flex-direction: column; justify-content: space-between; background-color: white; border-left: 1rpx solid #f0f0f0;" bindtap="showGoodsDetail" data-item="{{item}}"> <view style="width: 50%; padding: 15rpx; display: flex; flex-direction: column; justify-content: space-between; background-color: white; border-left: 1rpx solid #f0f0f0;">
<view> <view bindtap="showGoodsDetail" data-item="{{item}}">
<view style="font-size: 28rpx; font-weight: bold; word-break: break-word;">{{item.name}} <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 style="display: inline-block; margin-left: 10rpx; font-size: 18rpx; color: #fff; background-color: #1677ff; padding: 2rpx 8rpx; border-radius: 10rpx;">审核中</view>
</view> </view>
@ -297,8 +297,8 @@
</view> </view>
<!-- 右侧信息区域 50%宽度 --> <!-- 右侧信息区域 50%宽度 -->
<view style="width: 50%; padding: 15rpx; display: flex; flex-direction: column; justify-content: space-between; background-color: white; border-left: 1rpx solid #f0f0f0;" bindtap="showGoodsDetail" data-item="{{item}}"> <view style="width: 50%; padding: 15rpx; display: flex; flex-direction: column; justify-content: space-between; background-color: white; border-left: 1rpx solid #f0f0f0;">
<view> <view bindtap="showGoodsDetail" data-item="{{item}}">
<view style="font-size: 28rpx; font-weight: bold; word-break: break-word;">{{item.name}} <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 style="display: inline-block; margin-left: 10rpx; font-size: 18rpx; color: #fff; background-color: #f5222d; padding: 2rpx 8rpx; border-radius: 10rpx;">审核失败</view>
</view> </view>
@ -309,7 +309,7 @@
<view style="color: #722ed1; font-size: 24rpx; margin-top: 8rpx;">地区: {{item.region || '未设置'}}</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="font-size: 22rpx; color: #999; margin-top: 8rpx;">创建时间: {{item.formattedCreatedAt}}</view>
<!-- 点击查看审核失败原因 --> <!-- 点击查看审核失败原因 -->
<view style="color: #f5222d; font-size: 24rpx; margin-top: 8rpx; text-decoration: underline;" bindtap="showRejectReason" data-id="{{item.id}}"> <view style="color: #f5222d; font-size: 24rpx; margin-top: 8rpx; text-decoration: underline;" catchtap="showRejectReason" data-id="{{item.id}}">
审核失败原因:点击查看 审核失败原因:点击查看
</view> </view>
</view> </view>
@ -403,7 +403,7 @@
<!-- 右侧信息区域 50%宽度 --> <!-- 右侧信息区域 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 style="width: 50%; padding: 15rpx; display: flex; flex-direction: column; justify-content: space-between; background-color: white; border-left: 1rpx solid #f0f0f0;">
<view> <view bindtap="showGoodsDetail" data-item="{{item}}">
<view style="font-size: 28rpx; font-weight: bold; word-break: break-word;">{{item.name}} <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: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: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>
@ -551,14 +551,17 @@
</view> </view>
</view> </view>
<!-- 编辑货源弹窗 --> <!-- 编辑货源弹窗(全屏) -->
<view class="modal" wx:if="{{showEditModal}}" 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" wx:if="{{showEditModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: white; z-index: 999;">
<view class="modal-content" style="width: 92%; max-width: 600rpx; background: white; padding: 40rpx; border-radius: 20rpx; max-height: 85vh; position: relative; box-shadow: 0 10rpx 40rpx rgba(0,0,0,0.15); transform: translateZ(0); -webkit-transform: translateZ(0);"> <!-- 顶部导航栏 -->
<!-- 固定的关闭按钮 --> <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 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="hideEditModal">×</view> <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: 950rpx; 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: calc(100vh - 90rpx); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 40rpx 60rpx; box-sizing: border-box;">
<view class="title" style="text-align: center; font-size: 36rpx; font-weight: bold; color: #333; margin-bottom: 30rpx; margin-top: 10rpx;">编辑货源</view> <view>
<!-- 照片上传区域 --> <!-- 照片上传区域 -->
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-top: 10rpx;">商品图片</view> <view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-top: 10rpx;">商品图片</view>
@ -577,19 +580,21 @@
<view style="font-size: 22rpx; color: #999; margin-top: 16rpx; text-align: center;">最多上传5张图片</view> <view style="font-size: 22rpx; color: #999; margin-top: 16rpx; text-align: center;">最多上传5张图片</view>
</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>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">商品名称</view> <view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">商品名称</view>
<view <view
bindtap="openNameSelectModal" 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;"> 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;"> <view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{editSupply.name || '请选择商品名称'}}</text> <text style="text-align: left;">{{editSupply.productName || editSupply.name || '请选择商品名称'}}</text>
<text style="color: #999;">▼</text> <text style="color: #999;">▼</text>
</view> </view>
</view> </view>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">蛋黄</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 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;"> <view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{editSupply.yolk || '请选择蛋黄类型'}}</text> <text style="text-align: left;">{{editSupply.yolk || '请选择蛋黄类型'}}</text>
<text style="color: #999;">▼</text> <text style="color: #999;">▼</text>
</view> </view>
</view> </view>
@ -598,7 +603,7 @@
<!-- 修改为可点击的视图,点击后打开自定义弹窗 --> <!-- 修改为可点击的视图,点击后打开自定义弹窗 -->
<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 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;"> <view style="display: flex; justify-content: space-between; align-items: center;">
<text>{{editSupply.spec || '请选择规格'}}</text> <text style="text-align: left;">{{editSupply.spec || '请选择规格'}}</text>
<text style="color: #999;">▼</text> <text style="color: #999;">▼</text>
</view> </view>
</view> </view>
@ -606,13 +611,13 @@
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">价格</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;" catchtouchmove="true" bindtouchstart="onInputTouchStart" bindtouchmove="onInputTouchMove"></input> <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>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">件数</view> <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;" catchtouchmove="true" bindtouchstart="onInputTouchStart" bindtouchmove="onInputTouchMove"></input> <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>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">斤重</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="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;" catchtouchmove="true" bindtouchstart="onInputTouchStart" bindtouchmove="onInputTouchMove"></input> <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>
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">地区</view> <view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">地区</view>
@ -621,15 +626,13 @@
bindtap="openEditRegionModal" 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;" 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>{{editSupply.region || '请选择省市区'}}</text> <text style="text-align: left;">{{editSupply.region || '请选择省市区'}}</text>
</view> </view>
<view style="display: flex; justify-content: space-between; margin-top: 20rpx; margin-bottom: 20rpx; gap: 20rpx;"> <!-- 添加底部空白区域 -->
<button bindtap="hideEditModal" 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> <view style="height: 20vh; background: transparent;"></view>
<button bindtap="saveEdit" 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>
</view> </scroll-view>
</scroll-view>
</view>
</view> </view>
<!-- 图片预览弹窗 --> <!-- 图片预览弹窗 -->
@ -674,13 +677,12 @@
<!-- 失败原因内容 --> <!-- 失败原因内容 -->
<view style="padding: 30rpx;"> <view style="padding: 30rpx;">
<view style="min-height: 200rpx; font-size: 28rpx; line-height: 48rpx; color: #666; white-space: pre-wrap; word-break: break-word;">{{rejectReason}}</view> <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>
</view> </view>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view style="display: flex; border-top: 1rpx solid #eee;"> <view style="display: flex; padding: 0 30rpx 30rpx; gap: 20rpx;">
<!-- <button style="flex: 1; background-color: #faad14; color: white; font-size: 28rpx; margin: 0; border-radius: 0; border-right: 1rpx solid #eee;" bindtap="editRejectedSupply">编辑</button> --> <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>
<button style="flex: 1; background-color: #52c41a; color: white; font-size: 28rpx; margin: 0; border-radius: 0;" bindtap="resubmitRejectedSupply">重新提交</button>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save