fix:修复快递归还异常bug

This commit is contained in:
2025-10-10 20:25:57 +08:00
parent a67030ec43
commit 30e298d9d2
7 changed files with 239 additions and 216 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
// export const URL = "https://my.gxfs123.com/api" //正式服务器 // export const URL = "https://my.gxfs123.com/api" //正式服务器
export const URL = "https://fansdev.gxfs123.com/api" //测试服务器 export const URL = "https://fansdev.gxfs123.com/api" //测试服务器
// export const URL = "http://192.168.5.22:8080" //本地调试 // export const URL = "http://192.168.169.66:8080" //本地调试
// export const URL = "http://127.0.0.1:8080" //本地调试 // export const URL = "http://127.0.0.1:8080" //本地调试
export const appid = "wx2165f0be356ae7a9" //小程序appid export const appid = "wx2165f0be356ae7a9" //小程序appid
+3 -3
View File
@@ -109,10 +109,10 @@ export const overOrderById = (orderId) => {
//立即租借 //立即租借
export const rentPowerBank = (deviceNo, phone) => { export const rentPowerBank = (deviceNo, phone) => {
return request({ return request({
url: '/app/device/rentPowerBank', url: `/app/device/rentPowerBank?deviceNo=${deviceNo}`,
method: 'post', method: 'post',
data: { data: {
deviceNo, // deviceNo,
phone phone
} }
}) })
@@ -210,7 +210,7 @@ export const getPotionsDetail = (data) => {
export const uploadOssResource = (filePath) => { export const uploadOssResource = (filePath) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: URL + '/resource/oss/upload', url: URL + '/manager/upload',
filePath, filePath,
name: 'file', name: 'file',
header: { header: {
+1 -1
View File
@@ -195,7 +195,7 @@ const handleSubmit = async () => {
res = await fillExpressTrackingNumber({ id: Number(recordId.value), logisticsTrackingNumber: trackingNumber.value }) res = await fillExpressTrackingNumber({ id: Number(recordId.value), logisticsTrackingNumber: trackingNumber.value })
} else { } else {
res = await applyExpressReturn({ res = await applyExpressReturn({
orderId: Number(orderId.value), orderId: orderId.value,
logisticsTrackingNumber: trackingNumber.value, logisticsTrackingNumber: trackingNumber.value,
remark: '' remark: ''
}) })
+24 -11
View File
@@ -19,15 +19,16 @@
<!-- 中间内容 --> <!-- 中间内容 -->
<view class="item-content"> <view class="item-content">
<view class="item-header"> <view class="item-header">
<text class="express-company">{{ item.expressCompany }}</text> <text class="tracking-number">运单号{{ item.logisticsTrackingNumber }}</text>
<text class="tracking-number">运单号{{ item.trackingNumber }}</text> <!-- <text class="express-company">{{ item.expressCompany }}</text> -->
</view> </view>
<view class="item-details"> <view class="item-details">
<text class="return-address">归还地址{{ item.returnAddress }}</text> <text class="return-address">归还地址{{ item.returnAddress }}</text>
<text class="return-time">归还时间{{ item.returnTime }}</text> <text class="return-time">填写时间{{ item.returnTime }}</text>
</view> </view>
<view class="item-footer"> <view class="item-footer">
<text class="package-info">包裹{{ item.packageType }} | {{ item.weight }}</text> <text class="package-info">订单号{{ item.orderId }}</text>
<text class="user-phone" v-if="item.userPhone">用户电话{{ item.userPhone }}</text>
</view> </view>
</view> </view>
@@ -65,14 +66,17 @@ const loadList = async () => {
const rows = (res.data && (res.data.rows || res.data)) || [] const rows = (res.data && (res.data.rows || res.data)) || []
returnList.value = rows.map(r => ({ returnList.value = rows.map(r => ({
id: r.id, id: r.id,
expressCompany: r.expressCompany || r.company || '-', expressCompany: r.expressCompany || r.company || '待填写',
trackingNumber: r.logisticsTrackingNumber || r.trackingNumber || '-', trackingNumber: r.logisticsTrackingNumber || r.trackingNumber || '待填写',
returnAddress: r.returnAddress || r.address || '-', returnAddress: r.returnAddress || r.address || '待填写',
returnTime: r.createTime || r.returnTime || '-', returnTime: r.expressFillTime || r.createTime || r.returnTime || '待填写',
packageType: r.packageType || '-', packageType: r.packageType || '待填写',
weight: r.weight || '-', weight: r.weight || '待填写',
status: mapStatus(r.status), status: mapStatus(r.status),
rawStatus: r.status rawStatus: r.status,
userPhone: r.userPhone,
orderId: r.orderId,
remark: r.remark
})) }))
} else { } else {
throw new Error(res?.msg || '获取列表失败') throw new Error(res?.msg || '获取列表失败')
@@ -242,11 +246,20 @@ onMounted(loadList)
.item-footer { .item-footer {
margin-top: 8rpx; margin-top: 8rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
} }
.package-info { .package-info {
font-size: 24rpx; font-size: 24rpx;
color: #95a5a6; color: #95a5a6;
margin-bottom: 4rpx;
}
.user-phone {
font-size: 24rpx;
color: #95a5a6;
} }
.item-status { .item-status {
+4 -3
View File
@@ -21,7 +21,7 @@
</view> </view>
<!-- 图片上传 --> <!-- 图片上传 -->
<!-- <view class="upload-section"> <view class="upload-section">
<view class="section-title">图片上传选填</view> <view class="section-title">图片上传选填</view>
<view class="upload-grid"> <view class="upload-grid">
<view class="upload-item" v-for="(img, index) in images" :key="index"> <view class="upload-item" v-for="(img, index) in images" :key="index">
@@ -33,7 +33,7 @@
<text class="tip">上传图片</text> <text class="tip">上传图片</text>
</view> </view>
</view> </view>
</view> --> </view>
<!-- 联系方式 --> <!-- 联系方式 -->
<view class="contact-section"> <view class="contact-section">
@@ -80,6 +80,7 @@
uni.chooseImage({ uni.chooseImage({
count: 3 - images.value.length, count: 3 - images.value.length,
success: async (res) => { success: async (res) => {
console.log(res);
const toUpload = res.tempFilePaths || [] const toUpload = res.tempFilePaths || []
for (const localPath of toUpload) { for (const localPath of toUpload) {
// 先追加本地预览,再上传并替换为远程URL // 先追加本地预览,再上传并替换为远程URL
@@ -142,7 +143,7 @@
type: paramsType.value, type: paramsType.value,
content: description.value, content: description.value,
phone: contact.value, phone: contact.value,
// images: images.value picturePath: images.value
} }
uni.request({ uni.request({
+8
View File
@@ -163,6 +163,10 @@
'order_cancelled': { 'order_cancelled': {
text: '已取消', text: '已取消',
class: 'status-cancelled' class: 'status-cancelled'
},
'express_return': {
text: '快递归还',
class: 'status-express-return'
} }
}); });
@@ -501,6 +505,10 @@
&.status-cancelled { &.status-cancelled {
color: #9E9E9E; color: #9E9E9E;
} }
&.status-express-return {
color: #FF9800;
}
} }
} }
+3 -2
View File
@@ -119,7 +119,7 @@
<view v-if="orderInfo.orderStatus === 'in_used'" class="action-item secondary" @click="checkReturnStatus"> <view v-if="orderInfo.orderStatus === 'in_used'" class="action-item secondary" @click="checkReturnStatus">
刷新状态</view> 刷新状态</view>
<view v-if="orderInfo.orderStatus === 'in_used' && !showExpressAction" class="action-item primary"> <view v-if="orderInfo.orderStatus === 'in_used' && !showExpressAction" class="action-item primary">
{{ formatHms(countdownRemaining) }} 后可发起快递归还 倒计时{{ formatHms(countdownRemaining) }}
</view> </view>
<view v-if="orderInfo.orderStatus === 'in_used' && showExpressAction" class="action-item primary" @click="expressRetrunOrder"> <view v-if="orderInfo.orderStatus === 'in_used' && showExpressAction" class="action-item primary" @click="expressRetrunOrder">
暂停计费快递归还 暂停计费快递归还
@@ -178,7 +178,8 @@
statusCheckInterval: 5000, // 5秒检查一次 statusCheckInterval: 5000, // 5秒检查一次
isPageActive: false, // 跟踪页面是否活跃 isPageActive: false, // 跟踪页面是否活跃
// 倒计时与快递归还触发(默认4小时=14400秒,可被配置覆盖) // 倒计时与快递归还触发(默认4小时=14400秒,可被配置覆盖)
countdownRemaining: 14400, // countdownRemaining: 14400,
countdownRemaining: 0,
showExpressAction: false, showExpressAction: false,
countdownTimer: null countdownTimer: null
} }