feat: 添加归还成功页面及相关功能

在 `pages.json` 中新增归还成功页面的配置,并在 `order/success.vue` 中实现设备状态提示和加载动画。同时,更新了订单支付逻辑,确保在支付成功后能够正确弹出充电宝。优化了订单状态查询和处理逻辑,提升用户体验。
This commit is contained in:
8vd8
2025-04-11 18:03:32 +08:00
parent 2da6ef8f41
commit f96ff2b030
33 changed files with 1505 additions and 536 deletions
+17 -4
View File
@@ -48,7 +48,7 @@
</template>
<script>
import {getQueryString }from '@/util/index.js'
import {getQueryString, wxLogin }from '@/util/index.js'
export default {
methods: {
async handleScan() {
@@ -64,6 +64,19 @@
console.log('扫码路径:', scanResult.path)
console.log('解析到的设备号:', deviceNo)
if (!deviceNo) {
uni.showToast({
title: '无效的设备二维码',
icon: 'none'
})
return
}
// 直接在当前页面查询是否有使用中的订单,避免跳转到中间页面
if (!uni.getStorageSync('token')) {
await wxLogin()
}
// 检查是否有使用中的订单
const inUseRes = await uni.request({
url: `${uni.getStorageSync('baseUrl') || 'http://127.0.0.1:8080'}/app/order/inUse`,
@@ -109,10 +122,10 @@
url: `/pages/order/payment?orderId=${unpaidOrder.orderId}`
})
} else {
// 无待支付订单,正常跳转到设备检查页面
console.log('无待支付订单,跳转到设备检查页面, deviceNo:', deviceNo)
// 查询设备信息并直接跳转到设备详情页面
console.log('无待支付订单,直接跳转到设备详情页面, deviceNo:', deviceNo)
uni.navigateTo({
url: `/pages/serve/bagCheck/index?deviceNo=${deviceNo}`
url: `/pages/device/detail?deviceNo=${deviceNo}`
})
}
} catch (error) {