Browse Source

优化运费计算器功能:1. 自动匹配车型优先选择高栏车和平板车 2. 修复市场参考价过高问题 3. 优化布局显示 4. 删除费用明细和预计时效

main
TraeAI 9 hours ago
parent
commit
426f56affa
  1. 394
      pages/freight-calculator/index.js
  2. 83
      pages/freight-calculator/index.wxml
  3. 4
      pages/freight-calculator/index.wxss
  4. 4
      pages/goods-detail/goods-detail.js

394
pages/freight-calculator/index.js

@ -33,7 +33,7 @@ Page({
name: '张顺玟', name: '张顺玟',
position: '物流经理', position: '物流经理',
experience: 5, experience: 5,
phone: '15528115321', phone: '19123901316',
description: '拥有5年专业物流管理经验,擅长整车运输和零担拼车方案设计,对鸡蛋的运输要求有深入了解,能够为客户提供高效、安全的物流解决方案。' description: '拥有5年专业物流管理经验,擅长整车运输和零担拼车方案设计,对鸡蛋的运输要求有深入了解,能够为客户提供高效、安全的物流解决方案。'
}, },
{ {
@ -41,7 +41,7 @@ Page({
name: '刘敏', name: '刘敏',
position: '物流经理', position: '物流经理',
experience: 5, experience: 5,
phone: '19123901316', phone: '15528115321',
description: '5年物流行业经验,专注于配送路线优化,熟悉各种车型的载重和体积限制,能够根据货物特性制定最适合的运输方案,确保货物安全准时送达。' description: '5年物流行业经验,专注于配送路线优化,熟悉各种车型的载重和体积限制,能够根据货物特性制定最适合的运输方案,确保货物安全准时送达。'
} }
], ],
@ -173,11 +173,15 @@ Page({
if (!weight && goodsInfo.netWeight && goodsInfo.quantity) { if (!weight && goodsInfo.netWeight && goodsInfo.quantity) {
// 计算总重量:净重(斤) * 件数 / 2(换算为公斤) // 计算总重量:净重(斤) * 件数 / 2(换算为公斤)
weight = (parseFloat(goodsInfo.netWeight) * parseInt(goodsInfo.quantity)) / 2; weight = (parseFloat(goodsInfo.netWeight) * parseInt(goodsInfo.quantity)) / 2;
} else if (!weight && (goodsInfo.spec || goodsInfo.specification || goodsInfo.specs) && goodsInfo.quantity) {
// 从规格中提取重量数字并计算总重量
weight = this.calculateWeightFromSpec(goodsInfo);
} }
this.setData({ this.setData({
selectedGoods: goodsInfo, selectedGoods: goodsInfo,
'goodsInfo.weight': weight, 'goodsInfo.weight': weight,
'goodsInfo.quantity': goodsInfo.quantity || 1 'goodsInfo.quantity': goodsInfo.quantity || 1,
weight: weight // 同步到运输参数的重量输入框
}); });
} catch (e) { } catch (e) {
console.error('解析货源信息失败:', e); console.error('解析货源信息失败:', e);
@ -206,12 +210,16 @@ Page({
if (!weight && goodsData.netWeight && goodsData.quantity) { if (!weight && goodsData.netWeight && goodsData.quantity) {
// 计算总重量:净重(斤) * 件数 / 2(换算为公斤) // 计算总重量:净重(斤) * 件数 / 2(换算为公斤)
weight = (parseFloat(goodsData.netWeight) * parseInt(goodsData.quantity)) / 2; weight = (parseFloat(goodsData.netWeight) * parseInt(goodsData.quantity)) / 2;
} else if (!weight && (goodsData.spec || goodsData.specification || goodsData.specs) && goodsData.quantity) {
// 从规格中提取重量数字并计算总重量
weight = this.calculateWeightFromSpec(goodsData);
} }
this.setData({ this.setData({
selectedGoods: goodsData, selectedGoods: goodsData,
'goodsInfo.weight': weight, 'goodsInfo.weight': weight,
'goodsInfo.quantity': goodsData.quantity || 1 'goodsInfo.quantity': goodsData.quantity || 1,
weight: weight // 同步到运输参数的重量输入框
}); });
// 设置出发地为商品所在地 // 设置出发地为商品所在地
@ -281,18 +289,49 @@ Page({
// 设置货物重量(如果有) // 设置货物重量(如果有)
if (goodsItem.grossWeight) { if (goodsItem.grossWeight) {
this.setData({ this.setData({
'goodsInfo.weight': goodsItem.grossWeight 'goodsInfo.weight': goodsItem.grossWeight,
weight: goodsItem.grossWeight // 同步到运输参数的重量输入框
}); });
} else if (goodsItem.netWeight && goodsItem.quantity) { } else if (goodsItem.netWeight && goodsItem.quantity) {
// 计算总重量:净重(斤) * 件数 / 2(换算为公斤) // 计算总重量:净重(斤) * 件数 / 2(换算为公斤)
const totalWeight = (parseFloat(goodsItem.netWeight) * parseInt(goodsItem.quantity)) / 2; const totalWeight = (parseFloat(goodsItem.netWeight) * parseInt(goodsItem.quantity)) / 2;
this.setData({ this.setData({
'goodsInfo.weight': totalWeight 'goodsInfo.weight': totalWeight,
weight: totalWeight // 同步到运输参数的重量输入框
});
} else if ((goodsItem.spec || goodsItem.specification || goodsItem.specs) && goodsItem.quantity) {
// 从规格中提取重量数字并计算总重量
const totalWeight = this.calculateWeightFromSpec(goodsItem);
this.setData({
'goodsInfo.weight': totalWeight,
weight: totalWeight // 同步到运输参数的重量输入框
}); });
} }
} }
}, },
// 从规格中提取重量数字并计算总重量
calculateWeightFromSpec: function (goodsData) {
// 获取规格信息
const spec = goodsData.spec || goodsData.specification || goodsData.specs || '';
const quantity = parseInt(goodsData.quantity) || 1;
console.log('从规格计算重量:', { spec, quantity });
// 从规格字符串中提取数字
const weightMatch = spec.match(/(\d+(?:\.\d+)?)/);
if (weightMatch) {
const weightPerUnit = parseFloat(weightMatch[1]);
// 计算总重量:重量(斤) * 件数 / 2(换算为公斤)
const totalWeight = (weightPerUnit * quantity) / 2;
console.log('计算得到的总重量:', totalWeight, '公斤');
return totalWeight;
}
console.log('无法从规格中提取重量');
return '';
},
// 解析地区信息 // 解析地区信息
parseRegion: function (region) { parseRegion: function (region) {
if (!region) return {}; if (!region) return {};
@ -891,10 +930,10 @@ Page({
return; return;
} }
// 检查详细地址 // 检查详细地址 - 目的地需要详细地址,出发地可以不需要
if (!this.data.origin.detail || !this.data.destination.detail) { if (!this.data.destination.detail) {
wx.showToast({ wx.showToast({
title: '请填写详细地址', title: '请填写目的地详细地址',
icon: 'none' icon: 'none'
}); });
return; return;
@ -1052,10 +1091,10 @@ Page({
return; return;
} }
// 构建出发地完整地址 // 构建出发地完整地址 - 即使没有详细地址,也可以使用省市区信息
const originAddress = `${origin.province}${origin.city}${origin.district}${origin.detail}`; const originAddress = `${origin.province}${origin.city}${origin.district}${origin.detail || ''}`;
if (!originAddress) { if (!origin.province || !origin.city || !origin.district) {
rejectOrigin(new Error('出发地地址不能为空,请输入地址或使用手动选择位置')); rejectOrigin(new Error('出发地省市区信息不能为空,请输入地址或使用手动选择位置'));
return; return;
} }
@ -1146,12 +1185,7 @@ Page({
}); });
}, },
// 切换费用明细显示/隐藏
toggleDetail: function () {
this.setData({
showDetail: !this.data.showDetail
});
},
// 运输模式选择 // 运输模式选择
bindTransportModeChange: function(e) { bindTransportModeChange: function(e) {
@ -1172,6 +1206,28 @@ Page({
const vehicleTypeIndex = e.detail.value; const vehicleTypeIndex = e.detail.value;
const vehicleType = this.data.vehicleTypes[vehicleTypeIndex]; const vehicleType = this.data.vehicleTypes[vehicleTypeIndex];
// 检查选择的车型是否适合当前重量和体积
const weightNum = parseFloat(this.data.weight) || 0;
const volumeNum = parseFloat(this.data.volume) || 0;
if (weightNum > 0 || volumeNum > 0) {
const [weightRange, volumeRange] = this.data.baseInfo[vehicleType];
const [minWeight, maxWeight] = weightRange.split('-').map(w => parseFloat(w.replace('kg', '')));
const [minVolume, maxVolume] = volumeRange.split('-').map(v => parseFloat(v.replace('m³', '')));
// 检查重量和体积是否在车型的范围内
const isWeightSuitable = weightNum === 0 || (weightNum >= minWeight && weightNum <= maxWeight);
const isVolumeSuitable = volumeNum === 0 || (volumeNum >= minVolume && volumeNum <= maxVolume);
if (!isWeightSuitable || !isVolumeSuitable) {
wx.showToast({
title: '选择的车型不适合当前重量和体积',
icon: 'none'
});
return;
}
}
// 更新车长选项 // 更新车长选项
const truckLengths = this.data.vehicleLengthMap[vehicleType]; const truckLengths = this.data.vehicleLengthMap[vehicleType];
@ -1199,11 +1255,104 @@ Page({
// 输入处理 // 输入处理
bindWeightInput: function(e) { bindWeightInput: function(e) {
this.setData({ weight: e.detail.value }); const weight = e.detail.value;
this.setData({ weight: weight });
// 自动匹配车型和车长
this.autoMatchVehicle(weight, this.data.volume);
}, },
bindVolumeInput: function(e) { bindVolumeInput: function(e) {
this.setData({ volume: e.detail.value }); const volume = e.detail.value;
this.setData({ volume: volume });
// 自动匹配车型和车长
this.autoMatchVehicle(this.data.weight, volume);
},
// 根据重量和体积自动匹配车型和车长
autoMatchVehicle: function(weight, volume) {
const weightNum = parseFloat(weight) || 0;
const volumeNum = parseFloat(volume) || 0;
if (weightNum <= 0 && volumeNum <= 0) {
return; // 没有有效输入,不进行匹配
}
// 过滤适合的车型并计算每个车型的最大载重和体积
const suitableVehicles = [];
// 使用兼容的方式遍历对象
for (const vehicleType in this.data.baseInfo) {
if (this.data.baseInfo.hasOwnProperty(vehicleType)) {
const [weightRange, volumeRange] = this.data.baseInfo[vehicleType];
const weightRangeParts = weightRange.split('-');
const volumeRangeParts = volumeRange.split('-');
if (weightRangeParts.length === 2 && volumeRangeParts.length === 2) {
const minWeight = parseFloat(weightRangeParts[0].replace('kg', ''));
const maxWeight = parseFloat(weightRangeParts[1].replace('kg', ''));
const minVolume = parseFloat(volumeRangeParts[0].replace('m³', ''));
const maxVolume = parseFloat(volumeRangeParts[1].replace('m³', ''));
// 检查重量和体积是否在车型的范围内
if ((weightNum === 0 || (weightNum >= minWeight && weightNum <= maxWeight)) &&
(volumeNum === 0 || (volumeNum >= minVolume && volumeNum <= maxVolume))) {
suitableVehicles.push({
type: vehicleType,
maxWeight: maxWeight,
maxVolume: maxVolume,
// 为鸡蛋货物添加优先级:高栏车和平板车优先
priority: (vehicleType === '高栏车' || vehicleType === '平板') ? 1 : 2
});
}
}
}
}
if (suitableVehicles.length > 0) {
// 按照优先级、最大载重和体积排序
suitableVehicles.sort((a, b) => {
// 优先按优先级排序(1 > 2)
if (a.priority !== b.priority) {
return a.priority - b.priority;
}
// 然后按最大载重排序
if (a.maxWeight !== b.maxWeight) {
return a.maxWeight - b.maxWeight;
}
// 最后按最大体积排序
return a.maxVolume - b.maxVolume;
});
// 选择第一个合适的车型
const selectedVehicle = suitableVehicles[0].type;
const vehicleIndex = this.data.vehicleTypes.indexOf(selectedVehicle);
if (vehicleIndex !== -1) {
// 更新车型
this.setData({ vehicleTypeIndex: vehicleIndex });
// 更新车长选项
const truckLengths = this.data.vehicleLengthMap[selectedVehicle];
if (truckLengths) {
// 根据重量和体积选择最合适的车长
let bestTruckLengthIndex = 0;
// 简单逻辑:如果重量或体积较大,选择较长的车
if (weightNum > 5000 || volumeNum > 20) {
// 选择较长的车
bestTruckLengthIndex = Math.min(truckLengths.length - 1, 2);
} else if (weightNum > 1000 || volumeNum > 10) {
// 选择中等长度的车
bestTruckLengthIndex = Math.min(truckLengths.length - 1, 1);
}
this.setData({
truckLengths: truckLengths,
truckLengthIndex: bestTruckLengthIndex
});
// 更新车型信息
this.updateVehicleInfo();
}
}
}
}, },
// 更新车型信息 // 更新车型信息
@ -1248,9 +1397,9 @@ Page({
return; return;
} }
// 检查详细地址 // 检查详细地址 - 目的地需要详细地址,出发地可以不需要
if (!this.data.origin.detail || !this.data.destination.detail) { if (!this.data.destination.detail) {
wx.showToast({ title: '请填写详细地址', icon: 'none' }); wx.showToast({ title: '请填写目的地详细地址', icon: 'none' });
return; return;
} }
@ -1311,7 +1460,6 @@ Page({
marketPrice: `${result.marketPrice}`, marketPrice: `${result.marketPrice}`,
complianceStatus: result.compliance.isCompliant ? '✓ 运输方案合规' : '✗ 运输方案不合规', complianceStatus: result.compliance.isCompliant ? '✓ 运输方案合规' : '✗ 运输方案不合规',
isCompliant: result.compliance.isCompliant, isCompliant: result.compliance.isCompliant,
detailText: this.generateDetailText(result, transportMode, weight, volume, packagingType, 40),
calculationResult: res.data // 保存API返回的结果 calculationResult: res.data // 保存API返回的结果
}); });
@ -1382,62 +1530,7 @@ Page({
return { weather, holiday, timePeriod }; return { weather, holiday, timePeriod };
}, },
// 生成详细文本
generateDetailText: function(result, transportMode, weight, volume, packagingType, waitTime) {
let text = `费用明细:\n`;
text += ` 最低运费: ${result.feeMin}\n`;
text += ` 最高运费: ${result.feeMax}\n`;
text += ` 平均运费: ${result.feeAvg}\n\n`;
if (result.details.breakdown) {
text += `费用组成:\n`;
for (const [key, value] of Object.entries(result.details.breakdown)) {
text += ` ${key}: ${value}\n`;
}
text += `\n`;
}
text += `运输详情:\n`;
text += ` 运输模式: ${transportMode}\n`;
text += ` 车型: ${result.details.vehicleType}\n`;
text += ` 包装类型: ${packagingType === 'standard' ? '标准包装' : '加强包装'}\n`;
text += ` 实际重量: ${weight}公斤\n`;
text += ` 体积: ${volume}立方米\n`;
if (result.details.volumeWeight) {
text += ` 体积重量: ${result.details.volumeWeight}公斤\n`;
}
if (result.details.chargeWeight) {
text += ` 计费重量: ${result.details.chargeWeight}公斤\n`;
}
text += ` 预计等候时间: ${waitTime}分钟\n`;
if (result.details.estimatedPackages) {
text += ` 估算包装数量: ${result.details.estimatedPackages}\n`;
}
// 添加运输距离信息
text += ` 运输距离: ${result.distance || 0}公里\n`;
text += `\n`;
if (result.details.marketFactor) {
text += `市场因素:\n`;
text += ` 天气状况: ${result.details.weather}\n`;
text += ` 是否节假日: ${result.details.holiday}\n`;
text += ` 时间段: ${result.details.timePeriod}\n`;
text += ` 市场因素系数: ${result.details.marketFactor}\n\n`;
}
text += `市场参考:\n`;
text += ` 市场参考价: ${result.marketPrice}\n`;
text += ` 价格合理性: ${result.priceReasonability}\n\n`;
if (!result.compliance.isCompliant) {
text += `不合规原因:\n`;
for (const issue of result.compliance.issues) {
text += ` - ${issue}\n`;
}
}
return text;
},
// 计算鸡蛋运输运费 // 计算鸡蛋运输运费
calculateEggShippingFee: function(transportMode, distance, weight, volume, packagingType, vehicleType, truckLength, waitTime, weather, holiday, timePeriod) { calculateEggShippingFee: function(transportMode, distance, weight, volume, packagingType, vehicleType, truckLength, waitTime, weather, holiday, timePeriod) {
@ -1920,7 +2013,7 @@ Page({
} }
}; };
// 整车运输收费标准 // 整车运输收费标准 - 调整为更接近运满满的实际价格
const rates = { const rates = {
'面包车': { '面包车': {
startFee: 80, startFee: 80,
@ -1935,70 +2028,70 @@ Page({
unitPriceMax: 1.8 unitPriceMax: 1.8
}, },
'平板': { '平板': {
startFee: 300, startFee: 200,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.5, unitPriceMin: 1.8,
unitPriceMax: 2.9 unitPriceMax: 2.2
}, },
'厢式': { '厢式': {
startFee: 220, startFee: 180,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.1, unitPriceMin: 1.7,
unitPriceMax: 2.4 unitPriceMax: 2.0
}, },
'高栏车': { '高栏车': {
startFee: 200, startFee: 150,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.5, unitPriceMin: 1.8,
unitPriceMax: 2.8 unitPriceMax: 2.2
}, },
'集装箱': { '集装箱': {
startFee: 300, startFee: 250,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.8, unitPriceMin: 2.0,
unitPriceMax: 3.1 unitPriceMax: 2.4
}, },
'自卸': { '自卸': {
startFee: 250, startFee: 200,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.2, unitPriceMin: 1.9,
unitPriceMax: 2.5 unitPriceMax: 2.3
}, },
'冷藏': { '冷藏': {
startFee: 300, startFee: 250,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.5, unitPriceMin: 2.0,
unitPriceMax: 2.8 unitPriceMax: 2.4
}, },
'保温': { '保温': {
startFee: 280, startFee: 220,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.3, unitPriceMin: 1.8,
unitPriceMax: 2.6 unitPriceMax: 2.2
}, },
'棉被车': { '棉被车': {
startFee: 260, startFee: 200,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.2, unitPriceMin: 1.7,
unitPriceMax: 2.5 unitPriceMax: 2.1
}, },
'爬梯车': { '爬梯车': {
startFee: 280, startFee: 220,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.3, unitPriceMin: 1.8,
unitPriceMax: 2.6 unitPriceMax: 2.2
}, },
'飞翼车': { '飞翼车': {
startFee: 270, startFee: 210,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.2, unitPriceMin: 1.7,
unitPriceMax: 2.5 unitPriceMax: 2.1
}, },
'高低板': { '高低板': {
startFee: 350, startFee: 280,
startDistance: 10, startDistance: 10,
unitPriceMin: 2.8, unitPriceMin: 2.0,
unitPriceMax: 3.1 unitPriceMax: 2.4
} }
}; };
@ -2022,10 +2115,13 @@ Page({
feeMin *= truckLengthFactor; feeMin *= truckLengthFactor;
feeMax *= truckLengthFactor; feeMax *= truckLengthFactor;
// 根据货物重量和体积调整价格 // 根据货物重量和体积调整价格 - 调整为更合理的系数
if (weight > 1000 || volume > 10) { if (weight > 3000 || volume > 15) {
feeMin *= 1.1; feeMin *= 1.05;
feeMax *= 1.1; feeMax *= 1.05;
} else if (weight > 1000 || volume > 10) {
feeMin *= 1.02;
feeMax *= 1.02;
} }
// 添加平台佣金(运费的5%左右) // 添加平台佣金(运费的5%左右)
@ -2166,7 +2262,7 @@ Page({
// 应用车长系数 // 应用车长系数
marketPrice *= truckLengthFactor; marketPrice *= truckLengthFactor;
} else if (transportMode === '整车运输') { } else if (transportMode === '整车运输') {
// 基于整车运输真实收费标准 // 基于整车运输真实收费标准 - 与 calculateYunmanmanFee 使用相同的费率
const rates = { const rates = {
'面包车': { '面包车': {
startFee: 80, startFee: 80,
@ -2179,59 +2275,59 @@ Page({
unitPrice: 1.65 unitPrice: 1.65
}, },
'平板': { '平板': {
startFee: 300, startFee: 200,
startDistance: 10, startDistance: 10,
unitPrice: 2.7 unitPrice: 2.0
}, },
'厢式': { '厢式': {
startFee: 220, startFee: 180,
startDistance: 10, startDistance: 10,
unitPrice: 2.25 unitPrice: 1.85
}, },
'高栏车': { '高栏车': {
startFee: 200, startFee: 150,
startDistance: 10, startDistance: 10,
unitPrice: 2.65 unitPrice: 2.0
}, },
'集装箱': { '集装箱': {
startFee: 300, startFee: 250,
startDistance: 10, startDistance: 10,
unitPrice: 2.95 unitPrice: 2.2
}, },
'自卸': { '自卸': {
startFee: 250, startFee: 200,
startDistance: 10, startDistance: 10,
unitPrice: 2.35 unitPrice: 2.1
}, },
'冷藏': { '冷藏': {
startFee: 300, startFee: 250,
startDistance: 10, startDistance: 10,
unitPrice: 2.65 unitPrice: 2.2
}, },
'保温': { '保温': {
startFee: 280, startFee: 220,
startDistance: 10, startDistance: 10,
unitPrice: 2.45 unitPrice: 2.0
}, },
'棉被车': { '棉被车': {
startFee: 260, startFee: 200,
startDistance: 10, startDistance: 10,
unitPrice: 2.35 unitPrice: 1.9
}, },
'爬梯车': { '爬梯车': {
startFee: 280, startFee: 220,
startDistance: 10, startDistance: 10,
unitPrice: 2.45 unitPrice: 2.0
}, },
'飞翼车': { '飞翼车': {
startFee: 270, startFee: 210,
startDistance: 10, startDistance: 10,
unitPrice: 2.35 unitPrice: 1.9
}, },
'高低板': { '高低板': {
startFee: 350, startFee: 280,
startDistance: 10, startDistance: 10,
unitPrice: 2.95 unitPrice: 2.2
} }
}; };
@ -2244,16 +2340,18 @@ Page({
marketPrice = rate.startFee + extraDistance * rate.unitPrice; marketPrice = rate.startFee + extraDistance * rate.unitPrice;
} }
// 根据货物重量和体积调整价格 // 应用车长系数
if (weight > 1000 || volume > 10) { marketPrice *= truckLengthFactor;
marketPrice *= 1.1;
// 根据货物重量和体积调整价格 - 与 calculateYunmanmanFee 使用相同的系数
if (weight > 3000 || volume > 15) {
marketPrice *= 1.05;
} else if (weight > 1000 || volume > 10) {
marketPrice *= 1.02;
} }
// 添加平台佣金 // 添加平台佣金
marketPrice *= 1.05; marketPrice *= 1.05;
// 应用车长系数
marketPrice *= truckLengthFactor;
} else { } else {
// 零担拼车市场参考价 // 零担拼车市场参考价
const chargeWeight = Math.max(weight, volume * 333); const chargeWeight = Math.max(weight, volume * 333);

83
pages/freight-calculator/index.wxml

@ -87,34 +87,34 @@
<input class="input" type="number" name="volume" placeholder="请输入货物体积" value="{{volume}}" bindinput="bindVolumeInput" /> <input class="input" type="number" name="volume" placeholder="请输入货物体积" value="{{volume}}" bindinput="bindVolumeInput" />
</view> </view>
<!-- 包装类型 --> <!-- 包装类型、车型、车长 -->
<view class="form-item"> <view style="display: flex; gap: 12rpx; margin-bottom: 20rpx;">
<text class="label">包装类型</text> <view class="form-item" style="flex: 1;">
<picker bindchange="bindPackagingChange" value="{{packagingIndex}}" range="{{packagingTypes}}"> <text class="label">包装类型</text>
<view class="picker"> <picker bindchange="bindPackagingChange" value="{{packagingIndex}}" range="{{packagingTypes}}">
{{packagingTypes[packagingIndex]}} <view class="picker">
</view> {{packagingTypes[packagingIndex]}}
</picker> </view>
</view> </picker>
</view>
<!-- 车型 -->
<view class="form-item"> <view class="form-item" style="flex: 1;">
<text class="label">车型</text> <text class="label">车型</text>
<picker bindchange="bindVehicleTypeChange" value="{{vehicleTypeIndex}}" range="{{vehicleTypes}}"> <picker bindchange="bindVehicleTypeChange" value="{{vehicleTypeIndex}}" range="{{vehicleTypes}}">
<view class="picker"> <view class="picker">
{{vehicleTypes[vehicleTypeIndex]}} {{vehicleTypes[vehicleTypeIndex]}}
</view> </view>
</picker> </picker>
</view> </view>
<!-- 车长 --> <view class="form-item" style="flex: 1;">
<view class="form-item"> <text class="label">车长</text>
<text class="label">车长</text> <picker bindchange="bindTruckLengthChange" value="{{truckLengthIndex}}" range="{{truckLengths}}">
<picker bindchange="bindTruckLengthChange" value="{{truckLengthIndex}}" range="{{truckLengths}}"> <view class="picker">
<view class="picker"> {{truckLengths[truckLengthIndex]}}
{{truckLengths[truckLengthIndex]}} </view>
</view> </picker>
</picker> </view>
</view> </view>
<!-- 车型详情提示 --> <!-- 车型详情提示 -->
@ -131,11 +131,11 @@
<!-- 计算按钮 --> <!-- 计算按钮 -->
<view class="calculate-section"> <view class="calculate-section" style="flex-direction: row; justify-content: space-between;">
<button class="calculate-btn" bindtap="calculate" loading="{{loading}}"> <button class="calculate-btn" bindtap="calculate" loading="{{loading}}" style="flex: 1; margin-right: 12rpx;">
<text>计算运费</text> <text>计算运费</text>
</button> </button>
<button class="clear-btn" bindtap="clearInput"> <button class="clear-btn" bindtap="clearInput" style="flex: 1; margin-left: 12rpx;">
<text>清空输入</text> <text>清空输入</text>
</button> </button>
</view> </view>
@ -152,10 +152,7 @@
<text class="result-label">运输距离</text> <text class="result-label">运输距离</text>
<text class="result-value">{{calculationResult ? calculationResult.distance + ' km' : ''}}</text> <text class="result-value">{{calculationResult ? calculationResult.distance + ' km' : ''}}</text>
</view> </view>
<view class="result-item">
<text class="result-label">预计时效</text>
<text class="result-value">{{calculationResult ? calculationResult.deliveryTime + ' 天' : ''}}</text>
</view>
<view class="result-item" wx:if="{{showResult}}"> <view class="result-item" wx:if="{{showResult}}">
<text class="result-label">市场参考价</text> <text class="result-label">市场参考价</text>
<text class="result-value">{{marketPrice}}</text> <text class="result-value">{{marketPrice}}</text>
@ -171,15 +168,7 @@
<text class="note-text">注:预估运费可能与实际费用存在误差,仅供参考。如需准确报价,建议联系下方专业物流老师获取详细方案。</text> <text class="note-text">注:预估运费可能与实际费用存在误差,仅供参考。如需准确报价,建议联系下方专业物流老师获取详细方案。</text>
</view> </view>
<view class="detail-section" wx:if="{{showResult && detailText}}">
<view style="display: flex; justify-content: space-between; align-items: center;">
<text class="section-title">费用明细</text>
<button class="toggle-btn" bindtap="toggleDetail">
<text>{{showDetail ? '收起' : '展开'}}</text>
</button>
</view>
<text class="detail-text" wx:if="{{showDetail}}">{{detailText}}</text>
</view>
</view> </view>
<!-- 历史记录 --> <!-- 历史记录 -->
@ -231,8 +220,10 @@
<text wx:else class="avatar-text">{{item.name.charAt(0)}}</text> <text wx:else class="avatar-text">{{item.name.charAt(0)}}</text>
</view> </view>
<view class="personnel-header-info"> <view class="personnel-header-info">
<view class="personnel-name">{{item.name}}</view> <view class="personnel-name" wx:if="{{index === 0}}">物流张经理</view>
<view class="personnel-position">{{item.position}}</view> <view class="personnel-name" wx:elif="{{index === 1}}">物流刘经理</view>
<view class="personnel-name" wx:else>{{item.name}}</view>
<view class="personnel-position" wx:if="{{index > 1}}">{{item.position}}</view>
<view class="personnel-tags"> <view class="personnel-tags">
<view class="personnel-tag">{{item.experience}}年物流经验</view> <view class="personnel-tag">{{item.experience}}年物流经验</view>
<view class="personnel-tag">认证物流师</view> <view class="personnel-tag">认证物流师</view>

4
pages/freight-calculator/index.wxss

@ -449,14 +449,16 @@
color: #666; color: #666;
font-weight: 500; font-weight: 500;
flex: 1; flex: 1;
min-width: 100rpx;
} }
.result-value { .result-value {
font-size: 24rpx; font-size: 24rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
flex: 1; flex: 0 0 auto;
text-align: right; text-align: right;
min-width: 200rpx;
} }
.result-value.freight { .result-value.freight {

4
pages/goods-detail/goods-detail.js

@ -991,7 +991,7 @@ Page({
}); });
if (bargainPrice > minPrice) { if (bargainPrice > minPrice) {
const step = bargainPrice < 20 ? 0.1 : 1; const step = 0.1;
const newPrice = formatPrice(bargainPrice - step); const newPrice = formatPrice(bargainPrice - step);
console.log('计算新价格:', newPrice); console.log('计算新价格:', newPrice);
this.updatePrice(newPrice); this.updatePrice(newPrice);
@ -1008,7 +1008,7 @@ Page({
}); });
if (bargainPrice < maxPrice) { if (bargainPrice < maxPrice) {
const step = bargainPrice < 20 ? 0.1 : 1; const step = 0.1;
const newPrice = formatPrice(bargainPrice + step); const newPrice = formatPrice(bargainPrice + step);
console.log('计算新价格:', newPrice); console.log('计算新价格:', newPrice);
this.updatePrice(newPrice); this.updatePrice(newPrice);

Loading…
Cancel
Save