feat:
取消了订单轮询 更新押金提现及订单查询功能 归还成功之后不会有归还成功的弹窗出现 提现的判断目前判断押金状态和订单状态 修改了提现API的参数名称,从订单ID更改为订单号,并新增了根据设备号和状态查询订单列表的功能。同时,优化了用户在提现过程中的错误提示,确保用户能够获得更清晰的反馈。更新了多个页面的逻辑,提升了整体用户体验。
This commit is contained in:
+43
-3
@@ -19,10 +19,10 @@ export const getMyIndexInfo = (data) => {
|
||||
}
|
||||
|
||||
// 添加押金提现API
|
||||
export const withdrawDeposit = (orderId) => {
|
||||
console.log('调用提现API,订单ID:', orderId)
|
||||
export const withdrawDeposit = (orderNo) => {
|
||||
console.log('调用提现API,订单号:', orderNo)
|
||||
return request({
|
||||
url: `/app/withdraw/add/${orderId}`,
|
||||
url: `/app/withdraw/add/${orderNo}`,
|
||||
method: 'get',
|
||||
hideLoading: true
|
||||
})
|
||||
@@ -46,6 +46,17 @@ export const queryHasOrder = (deviceNo) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询指定设备号下,特定状态的订单列表
|
||||
export const checkOrdersByStatus = (deviceNo, statuses) => {
|
||||
// statuses 是一个包含状态字符串的数组,例如 ['in_used', 'waiting_for_payment']
|
||||
const statusQuery = statuses.join(','); // 后端需要支持逗号分隔的状态查询
|
||||
return request({
|
||||
url: `/app/order/list?deviceNo=${deviceNo}&orderStatus=${statusQuery}`,
|
||||
method: 'get',
|
||||
hideLoading: true // 隐藏加载提示,避免干扰用户
|
||||
})
|
||||
}
|
||||
|
||||
//设备查询
|
||||
export const getDeviceInfo = (deviceNo) => {
|
||||
return request({
|
||||
@@ -131,3 +142,32 @@ export const forcefOpenEmptyGrid = (deviceNo) => {
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 通过订单号获取订单信息
|
||||
export const getOrderByOrderNo = (orderNo) => {
|
||||
console.log('通过订单号获取订单信息:', orderNo)
|
||||
return request({
|
||||
url: `/app/order/byOrderNo/${orderNo}`,
|
||||
method: 'get',
|
||||
hideLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新订单套餐信息
|
||||
export const updateOrderPackage = (data) => {
|
||||
console.log('更新订单套餐信息:', data)
|
||||
return request({
|
||||
url: '/app/device/updateOrderPackage',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新用户余额
|
||||
export const updateUserBalance = (orderId) => {
|
||||
return request({
|
||||
url: `/app/user/updateBalance/${orderId}`,
|
||||
method: 'post',
|
||||
hideLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
+42
-40
@@ -40,7 +40,7 @@
|
||||
|
||||
<script>
|
||||
import { getUserInfo } from '../../util/index.js'
|
||||
import { withdrawDeposit, queryById, getOrderList } from '../../config/user.js'
|
||||
import { withdrawDeposit,queryById } from '../../config/user.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -48,8 +48,7 @@ export default {
|
||||
depositAmount: '0.00',
|
||||
orderNo: '',
|
||||
records: [],
|
||||
orderId: '',
|
||||
isLoading: false
|
||||
orderId:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -61,34 +60,15 @@ export default {
|
||||
methods: {
|
||||
async loadUserInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const res = await getUserInfo()
|
||||
console.log('loadUserInfo', res);
|
||||
console.log('loadUserInfo',res);
|
||||
if (res.code === 200) {
|
||||
this.depositAmount = res.data.balanceAmount || '0.00'
|
||||
this.orderNo = res.data.latestOrderNo || ''
|
||||
this.orderId = res.data.latestOrderId || ''
|
||||
|
||||
// 如果有余额但没有orderId,尝试查询用户订单列表获取
|
||||
if (parseFloat(this.depositAmount) > 0 && !this.orderId) {
|
||||
console.log('没有latestOrderId但有余额,尝试查询订单列表')
|
||||
const orderRes = await getOrderList({ pageNum: 1, pageSize: 10 })
|
||||
if (orderRes.code === 200 && orderRes.data && orderRes.data.records && orderRes.data.records.length > 0) {
|
||||
// 查找最近的包含押金的订单
|
||||
const depositOrder = orderRes.data.records.find(order =>
|
||||
order.depositAmount && parseFloat(order.depositAmount) > 0
|
||||
)
|
||||
|
||||
if (depositOrder) {
|
||||
console.log('找到押金订单:', depositOrder)
|
||||
this.orderId = depositOrder.orderId
|
||||
this.orderNo = depositOrder.orderNo
|
||||
}
|
||||
}
|
||||
}
|
||||
this.orderId = res.data.latestOrderId||''
|
||||
|
||||
// 如果存在余额,获取押金记录
|
||||
if (parseFloat(this.depositAmount) > 0) {
|
||||
if (parseFloat(this.depositAmount) > 0 && this.orderNo) {
|
||||
this.records = [
|
||||
{
|
||||
type: '支付',
|
||||
@@ -106,8 +86,6 @@ export default {
|
||||
title: '获取用户信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
async handleWithdraw() {
|
||||
@@ -118,14 +96,15 @@ export default {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.orderId) {
|
||||
uni.showToast({
|
||||
title: '无法找到押金订单',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
const res = await queryById(Number(this.orderNo))
|
||||
console.log(res);
|
||||
// if(this.orderNo.length!=0){
|
||||
// uni.showToast({
|
||||
// title:'当前存在进行中的订单',
|
||||
// icon:'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
uni.showModal({
|
||||
title: '确认提现',
|
||||
@@ -137,8 +116,8 @@ export default {
|
||||
})
|
||||
|
||||
try {
|
||||
console.log('发起提现请求,订单ID:', this.orderId)
|
||||
const result = await withdrawDeposit(this.orderId)
|
||||
console.log('发起提现请求,订单号:', this.orderNo)
|
||||
const result = await withdrawDeposit(this.orderNo)
|
||||
console.log('提现响应:', result)
|
||||
|
||||
if (result.code === 200) {
|
||||
@@ -166,9 +145,32 @@ export default {
|
||||
} catch (error) {
|
||||
console.error('提现失败:', error)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: error.message || '提现失败,请稍后再试',
|
||||
icon: 'none'
|
||||
|
||||
// 更详细的错误处理
|
||||
let errorMessage = '提现失败,请稍后再试';
|
||||
|
||||
// 如果有具体错误信息,使用它
|
||||
if (error.message) {
|
||||
// 常见错误消息处理
|
||||
if (error.message.includes('尚未归还')) {
|
||||
errorMessage = '当前订单尚未归还,请归还后再提现';
|
||||
} else if (error.message.includes('已退还')) {
|
||||
errorMessage = '押金已退还,无需重复提现';
|
||||
} else if (error.message.includes('处理中')) {
|
||||
errorMessage = '押金退还处理中,请耐心等待';
|
||||
} else if (error.message.includes('余额为0')) {
|
||||
errorMessage = '账户余额为0,无法提现';
|
||||
} else {
|
||||
// 使用后端返回的具体错误消息
|
||||
errorMessage = error.message;
|
||||
}
|
||||
}
|
||||
|
||||
// 显示错误提示
|
||||
uni.showModal({
|
||||
title: '提现失败',
|
||||
content: errorMessage,
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+53
-5
@@ -85,7 +85,8 @@
|
||||
<script>
|
||||
import {
|
||||
getDeviceInfo,
|
||||
rentPowerBank
|
||||
rentPowerBank,
|
||||
updateOrderPackage
|
||||
} from '@/config/user.js'
|
||||
export default {
|
||||
data() {
|
||||
@@ -123,6 +124,7 @@
|
||||
onLoad(options) {
|
||||
// console.log(options);
|
||||
this.deviceId = options.deviceNo
|
||||
this.checkOrderStatus() // 新增状态检查
|
||||
console.log(options.deviceNo);
|
||||
this.getDeviceInfo()
|
||||
},
|
||||
@@ -162,10 +164,22 @@
|
||||
const result = await this.$api.checkActiveOrder()
|
||||
|
||||
if (result.hasOrder) {
|
||||
// 如果有正在进行的订单,跳转到归还页面,带上设备ID
|
||||
uni.redirectTo({
|
||||
const order = result.order; // 假设后端返回 order 对象
|
||||
|
||||
// 检查订单状态
|
||||
if (order.status === 'waiting_for_payment') {
|
||||
// 跳转支付页面,带上订单ID
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&deviceId=${this.deviceId}`
|
||||
})
|
||||
}else if(order.status === 'in_used'){
|
||||
// 如果有正在进行的订单,跳转到归还页面,带上设备ID
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
@@ -230,12 +244,46 @@
|
||||
|
||||
// 获取后端返回的订单信息
|
||||
const order = rentResult.data
|
||||
|
||||
// --- 新增:立即更新订单套餐信息 ---
|
||||
try {
|
||||
let packageTimeMinutes = 0;
|
||||
if (selectedPkg.time.includes('小时')) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
} else if (selectedPkg.time.includes('分钟')) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time);
|
||||
} else {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60; // 默认按小时处理
|
||||
}
|
||||
|
||||
const updateRes = await updateOrderPackage({
|
||||
orderId: order.orderId,
|
||||
packageTime: packageTimeMinutes,
|
||||
packagePrice: parseFloat(selectedPkg.price)
|
||||
});
|
||||
if (updateRes.code !== 200) {
|
||||
console.warn("更新订单套餐信息失败:", updateRes.msg);
|
||||
// 这里可以选择是否提示用户或阻止流程,当前不阻止
|
||||
} else {
|
||||
console.log("订单套餐信息已提前更新");
|
||||
}
|
||||
} catch (updateError) {
|
||||
console.error("更新订单套餐信息时出错:", updateError);
|
||||
// 即使更新失败,也继续尝试跳转支付,让用户完成支付
|
||||
}
|
||||
// --- 更新结束 ---
|
||||
|
||||
// --- 新增:计算总金额 ---
|
||||
const deposit = 99.00; // 固定押金
|
||||
const packagePrice = parseFloat(selectedPkg.price);
|
||||
const totalAmount = (deposit + packagePrice).toFixed(2);
|
||||
// --- 计算结束 ---
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
// 跳转到订单支付页面,传递订单ID和套餐信息
|
||||
// 跳转到订单支付页面,传递订单ID、套餐信息和总金额
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTime=${selectedPkg.time}&packagePrice=${selectedPkg.price}`
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTime=${selectedPkg.time}&packagePrice=${selectedPkg.price}&totalAmount=${totalAmount}`
|
||||
})
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
|
||||
Binary file not shown.
@@ -9,9 +9,15 @@
|
||||
wxLogin,
|
||||
} from '../../../util/index'
|
||||
|
||||
import {
|
||||
getMyIndexInfo
|
||||
} from "../../../config/user.js";
|
||||
import {
|
||||
queryHasOrder
|
||||
} from '@/config/user.js'
|
||||
} from "../../../config/user.js";
|
||||
import {
|
||||
checkOrdersByStatus
|
||||
} from "../../../config/user.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -20,46 +26,79 @@
|
||||
}
|
||||
},
|
||||
async onLoad(option) {
|
||||
console.log('bagCheck onLoad option:', option);
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
title: '处理中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
if (!uni.getStorageSync('token')) {
|
||||
await wxLogin();
|
||||
// 检查是否传入设备编号
|
||||
if (!option || !option.deviceNo) {
|
||||
throw new Error('未识别到设备编号');
|
||||
}
|
||||
|
||||
if (!option.deviceNo) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '设备编号不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const deviceNo = option.deviceNo;
|
||||
|
||||
// 查询用户是否有使用中(in_used)的订单
|
||||
const result = await queryHasOrder(option.deviceNo);
|
||||
uni.hideLoading();
|
||||
// 检查用户是否有进行中(in_used)或待支付(waiting_for_payment)的订单
|
||||
const statusesToCheck = ['in_used', 'waiting_for_payment'];
|
||||
const res = await checkOrdersByStatus(deviceNo, statusesToCheck);
|
||||
|
||||
if (result.data && result.data.data && result.data.data.length > 0) {
|
||||
// 如果有使用中的订单,直接跳转到归还页面
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/return?deviceNo=${option.deviceNo}`
|
||||
});
|
||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||
// 找到相关订单,取最新的一条
|
||||
const latestOrder = res.data[0]; // 假设返回结果按时间倒序
|
||||
|
||||
if (latestOrder.orderStatus === 'in_used') {
|
||||
// 如果是使用中的订单,跳转到归还页面
|
||||
console.log('检测到使用中订单,跳转归还页:', latestOrder.orderId);
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/return?orderId=${latestOrder.orderId}`
|
||||
});
|
||||
} else if (latestOrder.orderStatus === 'waiting_for_payment') {
|
||||
// 如果是待支付订单,跳转到支付页面,并传递必要信息
|
||||
console.log('检测到待支付订单,跳转支付页:', latestOrder.orderId);
|
||||
const packageTime = latestOrder.packageTime ? `${latestOrder.packageTime / 60}小时` : '默认套餐'; // 示例转换
|
||||
const packagePrice = latestOrder.packagePrice || '0.00';
|
||||
const depositAmount = latestOrder.depositAmount || '99.00';
|
||||
const totalAmount = (parseFloat(depositAmount) + parseFloat(packagePrice)).toFixed(2);
|
||||
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${latestOrder.orderId}&packageTime=${packageTime}&packagePrice=${packagePrice}&totalAmount=${totalAmount}&depositAmount=${depositAmount}`
|
||||
});
|
||||
} else {
|
||||
// 其他状态(理论上不应该到这里,除非statusesToCheck配置错误),默认到详情页
|
||||
console.log('检测到其他状态订单,跳转详情页:', latestOrder.orderId);
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 如果没有使用中的订单,跳转到设备详情页面进行租借
|
||||
// 没有找到相关状态的订单,跳转到设备详情页进行租借
|
||||
console.log('未检测到相关订单,跳转详情页');
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
console.error('扫码检查订单失败:', error);
|
||||
uni.showToast({
|
||||
title: '页面加载失败,请重试',
|
||||
icon: 'none'
|
||||
title: error.message || '处理失败,请稍后重试',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
console.error('bagCheck onLoad error:', error);
|
||||
// 错误时也尝试跳转到详情页,给用户一个操作入口
|
||||
setTimeout(() => {
|
||||
if (option && option.deviceNo) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
});
|
||||
} else {
|
||||
// 如果连deviceNo都没有,则返回首页
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
}
|
||||
}, 2000);
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvZGVwb3NpdC9pbmRleC52dWU"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/deposit/index.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
{"version":3,"file":"index.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvZGVwb3NpdC9pbmRleC52dWU"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/deposit/index.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"detail.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvZGV2aWNlL2RldGFpbC52dWU"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/device/detail.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
{"version":3,"file":"detail.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvZGV2aWNlL2RldGFpbC52dWU"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/device/detail.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"payment.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvb3JkZXIvcGF5bWVudC52dWU"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/order/payment.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
{"version":3,"file":"payment.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvb3JkZXIvcGF5bWVudC52dWU"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/order/payment.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvc2VydmUvYmFnQ2hlY2svaW5kZXgudnVl"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/serve/bagCheck/index.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
{"version":3,"file":"index.js","sources":["E:/迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvc2VydmUvYmFnQ2hlY2svaW5kZXgudnVl"],"sourcesContent":["import MiniProgramPage from 'C:/Users/Administrator.DESKTOP-IRCM9I0/Desktop/locker-fans/locker-fans/uni-fans/pages/serve/bagCheck/index.vue'\nwx.createPage(MiniProgramPage)"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,GAAG,WAAW,eAAe;"}
|
||||
+1
-1
@@ -6876,7 +6876,7 @@ function initOnError() {
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "10.8.0.5,192.168.1.15,127.0.0.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_hczUPf";
|
||||
const id = "mp-weixin_V-Usyu";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
+20
-9
@@ -15,10 +15,10 @@ const getMyIndexInfo = (data) => {
|
||||
data
|
||||
});
|
||||
};
|
||||
const withdrawDeposit = (orderId) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:23", "调用提现API,订单ID:", orderId);
|
||||
const withdrawDeposit = (orderNo) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:23", "调用提现API,订单号:", orderNo);
|
||||
return config_http.request({
|
||||
url: `/app/withdraw/add/${orderId}`,
|
||||
url: `/app/withdraw/add/${orderNo}`,
|
||||
method: "get",
|
||||
hideLoading: true
|
||||
});
|
||||
@@ -31,10 +31,13 @@ const getOrderList = (data) => {
|
||||
hideLoading: true
|
||||
});
|
||||
};
|
||||
const queryHasOrder = (deviceNo) => {
|
||||
const checkOrdersByStatus = (deviceNo, statuses) => {
|
||||
const statusQuery = statuses.join(",");
|
||||
return config_http.request({
|
||||
url: `/app/order/list?deviceNo=${deviceNo}&orderStatus=in_used`,
|
||||
method: "get"
|
||||
url: `/app/order/list?deviceNo=${deviceNo}&orderStatus=${statusQuery}`,
|
||||
method: "get",
|
||||
hideLoading: true
|
||||
// 隐藏加载提示,避免干扰用户
|
||||
});
|
||||
};
|
||||
const getDeviceInfo = (deviceNo) => {
|
||||
@@ -44,7 +47,6 @@ const getDeviceInfo = (deviceNo) => {
|
||||
});
|
||||
};
|
||||
const queryById = (id) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:69", `查询订单详情, orderId: ${id}`);
|
||||
return config_http.request({
|
||||
url: `/app/order/${id}`,
|
||||
method: "get",
|
||||
@@ -59,19 +61,28 @@ const rentPowerBank = (deviceNo, phone) => {
|
||||
});
|
||||
};
|
||||
const confirmPaymentAndRent = (orderId) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:108", `确认支付并弹出充电宝, orderId: ${orderId}`);
|
||||
common_vendor.index.__f__("log", "at config/user.js:118", `确认支付并弹出充电宝, orderId: ${orderId}`);
|
||||
return config_http.request({
|
||||
url: `/app/device/confirmPaymentAndRent?orderId=${orderId}`,
|
||||
method: "post"
|
||||
});
|
||||
};
|
||||
const updateOrderPackage = (data) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:157", "更新订单套餐信息:", data);
|
||||
return config_http.request({
|
||||
url: "/app/device/updateOrderPackage",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
};
|
||||
exports.checkOrdersByStatus = checkOrdersByStatus;
|
||||
exports.confirmPaymentAndRent = confirmPaymentAndRent;
|
||||
exports.getDeviceInfo = getDeviceInfo;
|
||||
exports.getMyIndexInfo = getMyIndexInfo;
|
||||
exports.getOrderList = getOrderList;
|
||||
exports.login = login;
|
||||
exports.queryById = queryById;
|
||||
exports.queryHasOrder = queryHasOrder;
|
||||
exports.rentPowerBank = rentPowerBank;
|
||||
exports.updateOrderPackage = updateOrderPackage;
|
||||
exports.withdrawDeposit = withdrawDeposit;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/config/user.js.map
|
||||
|
||||
+30
-38
@@ -8,8 +8,7 @@ const _sfc_main = {
|
||||
depositAmount: "0.00",
|
||||
orderNo: "",
|
||||
records: [],
|
||||
orderId: "",
|
||||
isLoading: false
|
||||
orderId: ""
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
@@ -20,28 +19,13 @@ const _sfc_main = {
|
||||
methods: {
|
||||
async loadUserInfo() {
|
||||
try {
|
||||
this.isLoading = true;
|
||||
const res = await util_index.getUserInfo();
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:66", "loadUserInfo", res);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:64", "loadUserInfo", res);
|
||||
if (res.code === 200) {
|
||||
this.depositAmount = res.data.balanceAmount || "0.00";
|
||||
this.orderNo = res.data.latestOrderNo || "";
|
||||
this.orderId = res.data.latestOrderId || "";
|
||||
if (parseFloat(this.depositAmount) > 0 && !this.orderId) {
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:74", "没有latestOrderId但有余额,尝试查询订单列表");
|
||||
const orderRes = await config_user.getOrderList({ pageNum: 1, pageSize: 10 });
|
||||
if (orderRes.code === 200 && orderRes.data && orderRes.data.records && orderRes.data.records.length > 0) {
|
||||
const depositOrder = orderRes.data.records.find(
|
||||
(order) => order.depositAmount && parseFloat(order.depositAmount) > 0
|
||||
);
|
||||
if (depositOrder) {
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:83", "找到押金订单:", depositOrder);
|
||||
this.orderId = depositOrder.orderId;
|
||||
this.orderNo = depositOrder.orderNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parseFloat(this.depositAmount) > 0) {
|
||||
if (parseFloat(this.depositAmount) > 0 && this.orderNo) {
|
||||
this.records = [
|
||||
{
|
||||
type: "支付",
|
||||
@@ -54,13 +38,11 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:104", "获取用户信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:84", "获取用户信息失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "获取用户信息失败",
|
||||
icon: "none"
|
||||
});
|
||||
} finally {
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
async handleWithdraw() {
|
||||
@@ -71,25 +53,20 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.orderId) {
|
||||
common_vendor.index.showToast({
|
||||
title: "无法找到押金订单",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const res = await config_user.queryById(Number(this.orderNo));
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:100", res);
|
||||
common_vendor.index.showModal({
|
||||
title: "确认提现",
|
||||
content: "押金将原路退回,预计0-7个工作日到账",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
success: async (res2) => {
|
||||
if (res2.confirm) {
|
||||
common_vendor.index.showLoading({
|
||||
title: "提现中..."
|
||||
});
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:140", "发起提现请求,订单ID:", this.orderId);
|
||||
const result = await config_user.withdrawDeposit(this.orderId);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:142", "提现响应:", result);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:119", "发起提现请求,订单号:", this.orderNo);
|
||||
const result = await config_user.withdrawDeposit(this.orderNo);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:121", "提现响应:", result);
|
||||
if (result.code === 200) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
@@ -109,11 +86,26 @@ const _sfc_main = {
|
||||
throw new Error(result.msg || "提现失败");
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:167", "提现失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:146", "提现失败:", error);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: error.message || "提现失败,请稍后再试",
|
||||
icon: "none"
|
||||
let errorMessage = "提现失败,请稍后再试";
|
||||
if (error.message) {
|
||||
if (error.message.includes("尚未归还")) {
|
||||
errorMessage = "当前订单尚未归还,请归还后再提现";
|
||||
} else if (error.message.includes("已退还")) {
|
||||
errorMessage = "押金已退还,无需重复提现";
|
||||
} else if (error.message.includes("处理中")) {
|
||||
errorMessage = "押金退还处理中,请耐心等待";
|
||||
} else if (error.message.includes("余额为0")) {
|
||||
errorMessage = "账户余额为0,无法提现";
|
||||
} else {
|
||||
errorMessage = error.message;
|
||||
}
|
||||
}
|
||||
common_vendor.index.showModal({
|
||||
title: "提现失败",
|
||||
content: errorMessage,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+38
-5
@@ -37,7 +37,8 @@ const _sfc_main = {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.deviceId = options.deviceNo;
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:126", options.deviceNo);
|
||||
this.checkOrderStatus();
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:128", options.deviceNo);
|
||||
this.getDeviceInfo();
|
||||
},
|
||||
methods: {
|
||||
@@ -71,9 +72,16 @@ const _sfc_main = {
|
||||
try {
|
||||
const result = await this.$api.checkActiveOrder();
|
||||
if (result.hasOrder) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
});
|
||||
const order = result.order;
|
||||
if (order.status === "waiting_for_payment") {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&deviceId=${this.deviceId}`
|
||||
});
|
||||
} else if (order.status === "in_used") {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.showToast({
|
||||
@@ -125,9 +133,34 @@ const _sfc_main = {
|
||||
throw new Error(rentResult.msg || "设备租借失败");
|
||||
}
|
||||
const order = rentResult.data;
|
||||
try {
|
||||
let packageTimeMinutes = 0;
|
||||
if (selectedPkg.time.includes("小时")) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
} else if (selectedPkg.time.includes("分钟")) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time);
|
||||
} else {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
}
|
||||
const updateRes = await config_user.updateOrderPackage({
|
||||
orderId: order.orderId,
|
||||
packageTime: packageTimeMinutes,
|
||||
packagePrice: parseFloat(selectedPkg.price)
|
||||
});
|
||||
if (updateRes.code !== 200) {
|
||||
common_vendor.index.__f__("warn", "at pages/device/detail.vue:265", "更新订单套餐信息失败:", updateRes.msg);
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:268", "订单套餐信息已提前更新");
|
||||
}
|
||||
} catch (updateError) {
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:271", "更新订单套餐信息时出错:", updateError);
|
||||
}
|
||||
const deposit = 99;
|
||||
const packagePrice = parseFloat(selectedPkg.price);
|
||||
const totalAmount = (deposit + packagePrice).toFixed(2);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTime=${selectedPkg.time}&packagePrice=${selectedPkg.price}`
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTime=${selectedPkg.time}&packagePrice=${selectedPkg.price}&totalAmount=${totalAmount}`
|
||||
});
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
|
||||
+45
-52
@@ -11,6 +11,8 @@ const _sfc_main = {
|
||||
time: "",
|
||||
price: "0.00"
|
||||
},
|
||||
passedTotalAmount: null,
|
||||
passedDepositAmount: null,
|
||||
orderStatus: {
|
||||
text: "等待支付",
|
||||
desc: "请在15分钟内完成支付",
|
||||
@@ -20,6 +22,9 @@ const _sfc_main = {
|
||||
},
|
||||
computed: {
|
||||
totalAmount() {
|
||||
if (this.passedTotalAmount !== null) {
|
||||
return parseFloat(this.passedTotalAmount).toFixed(2);
|
||||
}
|
||||
const deposit = parseFloat(this.orderInfo.deposit || 99);
|
||||
const amount = parseFloat(this.orderInfo.amount || this.packageInfo.price || 0);
|
||||
return (deposit + amount).toFixed(2);
|
||||
@@ -34,6 +39,12 @@ const _sfc_main = {
|
||||
price: options.packagePrice
|
||||
};
|
||||
}
|
||||
if (options.totalAmount) {
|
||||
this.passedTotalAmount = options.totalAmount;
|
||||
}
|
||||
if (options.depositAmount) {
|
||||
this.passedDepositAmount = options.depositAmount;
|
||||
}
|
||||
this.loadOrderInfo();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
@@ -65,7 +76,6 @@ const _sfc_main = {
|
||||
formattedTime = this.formatTime(/* @__PURE__ */ new Date());
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/order/payment.vue:143", "时间格式化错误:", e);
|
||||
formattedTime = this.formatTime(/* @__PURE__ */ new Date());
|
||||
}
|
||||
this.orderInfo = {
|
||||
@@ -73,13 +83,13 @@ const _sfc_main = {
|
||||
deviceNo: orderData.deviceNo,
|
||||
createTime: formattedTime,
|
||||
phone: orderData.phone,
|
||||
deposit: "99.00",
|
||||
// 假设押金固定为99元
|
||||
amount: orderData.amount || this.packageInfo.price || "0.00"
|
||||
deposit: this.passedDepositAmount || orderData.depositAmount || "99.00",
|
||||
amount: orderData.packagePrice || this.packageInfo.price || "0.00"
|
||||
};
|
||||
if (!orderData.packageTime && this.packageInfo.time) {
|
||||
this.orderInfo.packageTime = this.packageInfo.time;
|
||||
this.orderInfo.packagePrice = this.packageInfo.price;
|
||||
if (orderData.packageTime) {
|
||||
this.packageInfo.time = `${orderData.packageTime / 60}小时`;
|
||||
this.packageInfo.price = orderData.packagePrice || "0.00";
|
||||
} else if (this.packageInfo.time) {
|
||||
}
|
||||
} else {
|
||||
throw new Error("获取订单信息失败");
|
||||
@@ -111,11 +121,18 @@ const _sfc_main = {
|
||||
const payParams = res.data.data;
|
||||
await common_vendor.index.requestPayment({
|
||||
...payParams,
|
||||
success: () => {
|
||||
this.pollOrderStatus();
|
||||
success: async () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/index?orderId=${this.orderId}`
|
||||
});
|
||||
}, 1500);
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/order/payment.vue:203", "支付失败:", err);
|
||||
throw new Error("支付失败,请重试");
|
||||
}
|
||||
});
|
||||
@@ -195,50 +212,26 @@ const _sfc_main = {
|
||||
const minute = date.getMinutes().toString().padStart(2, "0");
|
||||
return `${year}-${month}-${day} ${hour}:${minute}`;
|
||||
},
|
||||
// 轮询订单状态
|
||||
async pollOrderStatus() {
|
||||
let retryCount = 0;
|
||||
const maxRetries = 10;
|
||||
const interval = 1e3;
|
||||
const checkStatus = async () => {
|
||||
try {
|
||||
const res = await common_vendor.index.request({
|
||||
url: `${config_url.URL || "http://127.0.0.1:8080"}/app/wx-payment/status/${this.orderInfo.orderNo}`,
|
||||
method: "GET",
|
||||
header: {
|
||||
"Authorization": "Bearer " + common_vendor.index.getStorageSync("token"),
|
||||
"Clientid": common_vendor.index.getStorageSync("client_id")
|
||||
}
|
||||
});
|
||||
if (res.statusCode === 200 && res.data.code === 200) {
|
||||
const orderData = res.data.data;
|
||||
if (orderData.orderStatus === "in_used") {
|
||||
common_vendor.index.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/index?orderId=${this.orderId}`
|
||||
});
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
// 检查订单状态(单次查询,不轮询)
|
||||
async checkOrderStatus() {
|
||||
try {
|
||||
const res = await common_vendor.index.request({
|
||||
url: `${config_url.URL || "http://127.0.0.1:8080"}/app/wx-payment/status/${this.orderInfo.orderNo}`,
|
||||
method: "GET",
|
||||
header: {
|
||||
"Authorization": "Bearer " + common_vendor.index.getStorageSync("token"),
|
||||
"Clientid": common_vendor.index.getStorageSync("client_id")
|
||||
}
|
||||
if (retryCount < maxRetries) {
|
||||
retryCount++;
|
||||
setTimeout(checkStatus, interval);
|
||||
} else {
|
||||
throw new Error("订单状态查询超时");
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.showToast({
|
||||
title: error.message || "查询订单状态失败",
|
||||
icon: "none"
|
||||
});
|
||||
});
|
||||
if (res.statusCode === 200 && res.data.code === 200) {
|
||||
return res.data.data;
|
||||
} else {
|
||||
throw new Error("查询订单状态失败");
|
||||
}
|
||||
};
|
||||
checkStatus();
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/order/payment.vue:332", "查询订单状态错误:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+47
-23
@@ -1,45 +1,69 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const util_index = require("../../../util/index.js");
|
||||
const config_user = require("../../../config/user.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
async onLoad(option) {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:29", "bagCheck onLoad option:", option);
|
||||
try {
|
||||
common_vendor.index.showLoading({
|
||||
title: "加载中..."
|
||||
title: "处理中...",
|
||||
mask: true
|
||||
});
|
||||
if (!common_vendor.index.getStorageSync("token")) {
|
||||
await util_index.wxLogin();
|
||||
if (!option || !option.deviceNo) {
|
||||
throw new Error("未识别到设备编号");
|
||||
}
|
||||
if (!option.deviceNo) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "设备编号不能为空",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const result = await config_user.queryHasOrder(option.deviceNo);
|
||||
common_vendor.index.hideLoading();
|
||||
if (result.data && result.data.data && result.data.data.length > 0) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?deviceNo=${option.deviceNo}`
|
||||
});
|
||||
const deviceNo = option.deviceNo;
|
||||
const statusesToCheck = ["in_used", "waiting_for_payment"];
|
||||
const res = await config_user.checkOrdersByStatus(deviceNo, statusesToCheck);
|
||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||
const latestOrder = res.data[0];
|
||||
if (latestOrder.orderStatus === "in_used") {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:53", "检测到使用中订单,跳转归还页:", latestOrder.orderId);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?orderId=${latestOrder.orderId}`
|
||||
});
|
||||
} else if (latestOrder.orderStatus === "waiting_for_payment") {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:59", "检测到待支付订单,跳转支付页:", latestOrder.orderId);
|
||||
const packageTime = latestOrder.packageTime ? `${latestOrder.packageTime / 60}小时` : "默认套餐";
|
||||
const packagePrice = latestOrder.packagePrice || "0.00";
|
||||
const depositAmount = latestOrder.depositAmount || "99.00";
|
||||
const totalAmount = (parseFloat(depositAmount) + parseFloat(packagePrice)).toFixed(2);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${latestOrder.orderId}&packageTime=${packageTime}&packagePrice=${packagePrice}&totalAmount=${totalAmount}&depositAmount=${depositAmount}`
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:70", "检测到其他状态订单,跳转详情页:", latestOrder.orderId);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:77", "未检测到相关订单,跳转详情页");
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/serve/bagCheck/index.vue:83", "扫码检查订单失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "页面加载失败,请重试",
|
||||
icon: "none"
|
||||
title: error.message || "处理失败,请稍后重试",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
common_vendor.index.__f__("error", "at pages/serve/bagCheck/index.vue:62", "bagCheck onLoad error:", error);
|
||||
setTimeout(() => {
|
||||
if (option && option.deviceNo) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.switchTab({ url: "/pages/index/index" });
|
||||
}
|
||||
}, 2e3);
|
||||
} finally {
|
||||
common_vendor.index.hideLoading();
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
|
||||
Reference in New Issue
Block a user