diff --git a/config/url.js b/config/url.js index e8c67f0..a352eb3 100644 --- a/config/url.js +++ b/config/url.js @@ -1,6 +1,6 @@ // export const URL = "https://my.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 appid = "wx2165f0be356ae7a9" //小程序appid \ No newline at end of file diff --git a/config/user.js b/config/user.js index e526597..e38b921 100644 --- a/config/user.js +++ b/config/user.js @@ -109,10 +109,10 @@ export const overOrderById = (orderId) => { //立即租借 export const rentPowerBank = (deviceNo, phone) => { return request({ - url: '/app/device/rentPowerBank', + url: `/app/device/rentPowerBank?deviceNo=${deviceNo}`, method: 'post', data: { - deviceNo, + // deviceNo, phone } }) @@ -210,7 +210,7 @@ export const getPotionsDetail = (data) => { export const uploadOssResource = (filePath) => { return new Promise((resolve, reject) => { uni.uploadFile({ - url: URL + '/resource/oss/upload', + url: URL + '/manager/upload', filePath, name: 'file', header: { diff --git a/pages/expressReturn/addExpressReturn.vue b/pages/expressReturn/addExpressReturn.vue index 3278deb..bb86b40 100644 --- a/pages/expressReturn/addExpressReturn.vue +++ b/pages/expressReturn/addExpressReturn.vue @@ -195,7 +195,7 @@ const handleSubmit = async () => { res = await fillExpressTrackingNumber({ id: Number(recordId.value), logisticsTrackingNumber: trackingNumber.value }) } else { res = await applyExpressReturn({ - orderId: Number(orderId.value), + orderId: orderId.value, logisticsTrackingNumber: trackingNumber.value, remark: '' }) diff --git a/pages/expressReturn/index.vue b/pages/expressReturn/index.vue index 6b9b429..b121c89 100644 --- a/pages/expressReturn/index.vue +++ b/pages/expressReturn/index.vue @@ -19,15 +19,16 @@ - {{ item.expressCompany }} - 运单号:{{ item.trackingNumber }} + 运单号:{{ item.logisticsTrackingNumber }} + 归还地址:{{ item.returnAddress }} - 归还时间:{{ item.returnTime }} + 填写时间:{{ item.returnTime }} - 包裹:{{ item.packageType }} | {{ item.weight }} + 订单号:{{ item.orderId }} + 用户电话:{{ item.userPhone }} @@ -57,242 +58,254 @@ const loading = ref(false) const query = ref({ pageNum: 1, pageSize: 20 }) const loadList = async () => { - try { - loading.value = true - const res = await getExpressReturnList(query.value) - if (res && res.code === 200) { - // 将后端字段映射到前端展示字段 - const rows = (res.data && (res.data.rows || res.data)) || [] - returnList.value = rows.map(r => ({ - id: r.id, - expressCompany: r.expressCompany || r.company || '-', - trackingNumber: r.logisticsTrackingNumber || r.trackingNumber || '-', - returnAddress: r.returnAddress || r.address || '-', - returnTime: r.createTime || r.returnTime || '-', - packageType: r.packageType || '-', - weight: r.weight || '-', - status: mapStatus(r.status), - rawStatus: r.status - })) - } else { - throw new Error(res?.msg || '获取列表失败') - } - } catch (e) { - uni.showToast({ title: e.message || '加载失败', icon: 'none' }) - } finally { - loading.value = false - } + try { + loading.value = true + const res = await getExpressReturnList(query.value) + if (res && res.code === 200) { + // 将后端字段映射到前端展示字段 + const rows = (res.data && (res.data.rows || res.data)) || [] + returnList.value = rows.map(r => ({ + id: r.id, + expressCompany: r.expressCompany || r.company || '待填写', + trackingNumber: r.logisticsTrackingNumber || r.trackingNumber || '待填写', + returnAddress: r.returnAddress || r.address || '待填写', + returnTime: r.expressFillTime || r.createTime || r.returnTime || '待填写', + packageType: r.packageType || '待填写', + weight: r.weight || '待填写', + status: mapStatus(r.status), + rawStatus: r.status, + userPhone: r.userPhone, + orderId: r.orderId, + remark: r.remark + })) + } else { + throw new Error(res?.msg || '获取列表失败') + } + } catch (e) { + uni.showToast({ title: e.message || '加载失败', icon: 'none' }) + } finally { + loading.value = false + } } // 状态映射 const mapStatus = (status) => { - // 文档:0-未填写 1-已填写 2-已取消 3-审批通过 4-审批拒绝 5-订单完成 - if (status === 5) return 'completed' - if (status === 3 || status === 1) return 'processing' - if (status === 4 || status === 2 || status === 0) return 'pending' - return 'pending' + // 文档:0-未填写 1-已填写 2-已取消 3-审批通过 4-审批拒绝 5-订单完成 + if (status === 5) return 'completed' + if (status === 3 || status === 1) return 'processing' + if (status === 4 || status === 2 || status === 0) return 'pending' + return 'pending' } const getStatusClass = (status) => ({ - 'completed': 'status-completed', - 'processing': 'status-processing', - 'pending': 'status-pending' + 'completed': 'status-completed', + 'processing': 'status-processing', + 'pending': 'status-pending' }[status] || 'status-pending') const getStatusIcon = (status) => ({ - 'completed': '✓', - 'processing': '⏳', - 'pending': '⏸' + 'completed': '✓', + 'processing': '⏳', + 'pending': '⏸' }[status] || '⏸') const getStatusText = (status) => ({ - 'completed': '已完成', - 'processing': '处理中', - 'pending': '待处理' + 'completed': '已完成', + 'processing': '处理中', + 'pending': '待处理' }[status] || '待处理') // 点击列表项 const handleItemClick = (item) => { - console.log('点击了归还记录:', item) - // 未填写(status=0 -> mapped 'pending')时跳转到补填页,其它跳详情 - if (item && item.rawStatus === 0) { - uni.navigateTo({ url: `/pages/expressReturn/addExpressReturn?id=${item.id}` }) - } else { - uni.navigateTo({ url: `/pages/expressReturn/detail?id=${item.id}` }) - } + console.log('点击了归还记录:', item) + // 未填写(status=0 -> mapped 'pending')时跳转到补填页,其它跳详情 + if (item && item.rawStatus === 0) { + uni.navigateTo({ url: `/pages/expressReturn/addExpressReturn?id=${item.id}` }) + } else { + uni.navigateTo({ url: `/pages/expressReturn/detail?id=${item.id}` }) } +} onMounted(loadList) \ No newline at end of file diff --git a/pages/feedback/index.vue b/pages/feedback/index.vue index 8dbe01a..12df3cc 100644 --- a/pages/feedback/index.vue +++ b/pages/feedback/index.vue @@ -21,7 +21,7 @@ - + @@ -80,6 +80,7 @@ uni.chooseImage({ count: 3 - images.value.length, success: async (res) => { + console.log(res); const toUpload = res.tempFilePaths || [] for (const localPath of toUpload) { // 先追加本地预览,再上传并替换为远程URL @@ -142,7 +143,7 @@ type: paramsType.value, content: description.value, phone: contact.value, - // images: images.value + picturePath: images.value } uni.request({ diff --git a/pages/order/index.vue b/pages/order/index.vue index 35a5076..080b0d0 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -163,6 +163,10 @@ 'order_cancelled': { text: '已取消', class: 'status-cancelled' + }, + 'express_return': { + text: '快递归还', + class: 'status-express-return' } }); @@ -501,6 +505,10 @@ &.status-cancelled { color: #9E9E9E; } + + &.status-express-return { + color: #FF9800; + } } } diff --git a/pages/return/index.vue b/pages/return/index.vue index 38c4b9a..ef938e1 100644 --- a/pages/return/index.vue +++ b/pages/return/index.vue @@ -119,7 +119,7 @@ 刷新状态 - {{ formatHms(countdownRemaining) }} 后可发起快递归还 + 倒计时{{ formatHms(countdownRemaining) }} 暂停计费,快递归还 @@ -178,7 +178,8 @@ statusCheckInterval: 5000, // 5秒检查一次 isPageActive: false, // 跟踪页面是否活跃 // 倒计时与快递归还触发(默认4小时=14400秒,可被配置覆盖) - countdownRemaining: 14400, + // countdownRemaining: 14400, + countdownRemaining: 0, showExpressAction: false, countdownTimer: null }