Files
uni-fans-score/pages/serve/bagCheck/index.vue
T
8vd8 3fecd77739 feat: 添加订单支付和成功页面,更新订单状态逻辑
新增了订单支付页面和支付成功页面,分别用于处理用户的支付流程和展示支付结果。同时,更新了订单状态的逻辑,确保在订单列表中正确显示各个状态。调整了设备租借逻辑,优化了扫码处理流程,提升用户体验。
2025-04-10 14:18:43 +08:00

73 lines
1.3 KiB
Vue

<template>
<view>
</view>
</template>
<script>
import {
wxLogin,
} from '../../../util/index'
import {
queryHasOrder
} from '@/config/user.js'
export default {
data() {
return {
}
},
async onLoad(option) {
try {
uni.showLoading({
title: '加载中...'
});
if (!uni.getStorageSync('token')) {
await wxLogin();
}
if (!option.deviceNo) {
uni.hideLoading();
uni.showToast({
title: '设备编号不能为空',
icon: 'none'
});
return;
}
// 查询用户是否有使用中(in_used)的订单
const result = await queryHasOrder(option.deviceNo);
uni.hideLoading();
if (result.data && result.data.data && result.data.data.length > 0) {
// 如果有使用中的订单,直接跳转到归还页面
uni.redirectTo({
url: `/pages/device/return?deviceNo=${option.deviceNo}`
});
} else {
// 如果没有使用中的订单,跳转到设备详情页面进行租借
uni.redirectTo({
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
});
}
} catch (error) {
uni.hideLoading();
uni.showToast({
title: '页面加载失败,请重试',
icon: 'none'
});
console.error('bagCheck onLoad error:', error);
}
},
methods: {
}
}
</script>
<style>
</style>