Files
uni-fans-score/pages/serve/bagCheck/index.vue
T
fuck aebd6c0459 refactor: 更新设备检查逻辑并调整错误日志位置
在 `bagCheck/index.vue` 中添加了注释以明确未完成订单的处理逻辑,确保代码更易读。同时,更新了 `vendor.js` 中的主机配置和 ID,以适配新的网络环境。错误日志的位置也从第58行调整到第60行,保持与代码变更同步。
2025-04-08 15:48:09 +08:00

71 lines
1.2 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();
}
const result = await queryHasOrder(option.deviceNo);
uni.hideLoading();
if (!option.deviceNo) {
uni.showToast({
title: '设备编号不能为空',
icon: 'none'
});
return;
}
if (result.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>