fix:修复bug

This commit is contained in:
2026-02-06 18:09:23 +08:00
parent f476cee76d
commit bb5a6dd100
51 changed files with 4491 additions and 2630 deletions
+25 -7
View File
@@ -81,11 +81,12 @@
<!-- 底部操作区 -->
<view class="footer">
<button class="rent-button" :class="{ 'return-button': hasActiveOrder }"
@click="handleRent('wx-pay')">
<text>{{ hasActiveOrder ? $t('order.returnDevice') : $t('device.rentDepositFree') }}</text>
</button>
<view class="wechat-credit">
<view class="rent-button" :class="{ 'return-button': hasActiveOrder }"
@click="handleRent(isWechatMiniProgram ? 'wx-score-pay' : 'wx-pay')">
<text>{{ hasActiveOrder ? $t('order.returnDevice') : getRentButtonText() }}</text>
</view>
<!-- 微信支付分标识仅在微信小程序环境显示 -->
<view class="wechat-credit" v-if="isWechatMiniProgram">
<image src="/static/images/wxpayflag.png" mode="aspectFit" class="wx-icon"></image>
<text class="credit-text">{{ $t('device.wxPayScoreDesc') }}</text>
</view>
@@ -162,6 +163,7 @@
const isLoggedIn = ref(true)
const phoneNumber = ref('')
const showPhoneAuthPopup = ref(false)
const isWechatMiniProgram = ref(false)
// 生命周期 onLoad 钩子
onLoad(async (options) => {
@@ -179,6 +181,13 @@
uni.setNavigationBarTitle({
title: t('device.deviceInfo')
})
// 检测当前运行环境
// #ifdef MP-WEIXIN
isWechatMiniProgram.value = true
// #endif
// #ifdef H5
isWechatMiniProgram.value = false
// #endif
await checkUserPhone()
await fetchDeviceInfo()
})
@@ -368,7 +377,7 @@
const goToPurchase = () => {
const positionId = positionInfo.value?.positionId || positionInfo.value?.id
uni.navigateTo({
url: `/pages/purchase/index?positionId=${positionId}`
url: `/subPackages/business/purchase/index?positionId=${positionId}`
})
}
@@ -381,7 +390,7 @@
const order = inUseRes.data
// 如果有正在进行的订单,跳转到归还页面,带上设备ID
uni.redirectTo({
url: `/pages/device/return?deviceId=${deviceId.value}`
url: `/subPackages/service/return/index?deviceId=${deviceId.value}`
})
return
}
@@ -499,6 +508,15 @@
return `不足${unitMinutes}分钟按${unitMinutes}分钟计费,封顶${depositAmount}元,持续计费至${depositAmount}元视为买断`
}
// 获取租借按钮文本
const getRentButtonText = () => {
if (isWechatMiniProgram.value) {
return t('device.rentDepositFree')
} else {
return '立即租借'
}
}
// 提交租借订单
const submitRentOrder = async (payWay) => {
try {