fix:修复订单详情页解析计费配置异常的bug
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
export const URL = "https://my.gxfs123.com/api" //正式服务器
|
export const URL = "https://my.gxfs123.com/api" //正式服务器
|
||||||
// export const URL = "https://fansdev.gxfs123.com/api" //测试服务器
|
// export const URL = "https://fansdev.gxfs123.com/api" //测试服务器
|
||||||
// export const URL = "http://192.168.5.120:8080" //本地调试
|
// export const URL = "http://192.168.5.149:8080" //本地调试
|
||||||
// export const URL = "http://127.0.0.1:8080" //本地调试
|
// export const URL = "http://127.0.0.1:8080" //本地调试
|
||||||
|
|
||||||
export const appid = "wx2165f0be356ae7a9" //小程序appid
|
export const appid = "wx2165f0be356ae7a9" //小程序appid
|
||||||
+31
-17
@@ -133,9 +133,13 @@
|
|||||||
getUserInfo,
|
getUserInfo,
|
||||||
getUserPhoneNumber
|
getUserPhoneNumber
|
||||||
} from '@/util/index.js'
|
} from '@/util/index.js'
|
||||||
import { useI18n } from '@/utils/i18n.js'
|
import {
|
||||||
|
useI18n
|
||||||
|
} from '@/utils/i18n.js'
|
||||||
|
|
||||||
const { t: $t } = useI18n()
|
const {
|
||||||
|
t: $t
|
||||||
|
} = useI18n()
|
||||||
|
|
||||||
// 响应式状态
|
// 响应式状态
|
||||||
const deviceInfo = ref({})
|
const deviceInfo = ref({})
|
||||||
@@ -146,7 +150,7 @@
|
|||||||
const batteryLevel = ref(95)
|
const batteryLevel = ref(95)
|
||||||
const hasActiveOrder = ref(false)
|
const hasActiveOrder = ref(false)
|
||||||
const deviceStatus = reactive({
|
const deviceStatus = reactive({
|
||||||
get text() { return $t('device.available') },
|
text: $t('device.available'),
|
||||||
class: 'available'
|
class: 'available'
|
||||||
})
|
})
|
||||||
const isLoggedIn = ref(true)
|
const isLoggedIn = ref(true)
|
||||||
@@ -302,18 +306,21 @@
|
|||||||
deviceLocation.value = res.data.position.name
|
deviceLocation.value = res.data.position.name
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新设备状态
|
|
||||||
if (deviceInfo.value.status) {
|
// 更新设备状态
|
||||||
if (deviceInfo.value.status === 'online') {
|
if (deviceInfo.value.status) {
|
||||||
deviceStatus.text = $t('device.available')
|
if (deviceInfo.value.status === 'online') {
|
||||||
deviceStatus.class = 'available'
|
deviceStatus.text = $t('device.available')
|
||||||
} else if (deviceInfo.value.status === 'offline') {
|
deviceStatus.class = 'available'
|
||||||
deviceStatus.text = $t('device.offline')
|
} else if (deviceInfo.value.status === 'offline') {
|
||||||
deviceStatus.class = 'offline'
|
deviceStatus.text = $t('device.offline')
|
||||||
|
deviceStatus.class = 'offline'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (deviceInfo.value.feeConfig) {
|
if (deviceInfo.value.feeConfig) {
|
||||||
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {}
|
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {}
|
||||||
|
console.log('deviceFeeConfig', deviceFeeConfig.value);
|
||||||
} else {
|
} else {
|
||||||
deviceFeeConfig.value = {
|
deviceFeeConfig.value = {
|
||||||
maxHourPrice: '5.00',
|
maxHourPrice: '5.00',
|
||||||
@@ -321,6 +328,7 @@
|
|||||||
discount.value = '99.00'
|
discount.value = '99.00'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +427,8 @@
|
|||||||
|
|
||||||
// 计算24小时封顶价格
|
// 计算24小时封顶价格
|
||||||
const get24HourCapPrice = () => {
|
const get24HourCapPrice = () => {
|
||||||
if (!deviceFeeConfig.value || !deviceFeeConfig.value.maxHourPrice || !deviceFeeConfig.value.maxHour) return '45.00'
|
if (!deviceFeeConfig.value || !deviceFeeConfig.value.maxHourPrice || !deviceFeeConfig.value.maxHour)
|
||||||
|
return '45.00'
|
||||||
const maxHourPrice = parseFloat(deviceFeeConfig.value.maxHourPrice)
|
const maxHourPrice = parseFloat(deviceFeeConfig.value.maxHourPrice)
|
||||||
const maxHour = parseFloat(deviceFeeConfig.value.maxHour)
|
const maxHour = parseFloat(deviceFeeConfig.value.maxHour)
|
||||||
return (maxHourPrice * maxHour).toFixed(2)
|
return (maxHourPrice * maxHour).toFixed(2)
|
||||||
@@ -462,7 +471,7 @@
|
|||||||
tmplIds: ['o7OMTIcHnFBR7mvsggxFtdt8FfIgSl-v0swVUefGx6w'],
|
tmplIds: ['o7OMTIcHnFBR7mvsggxFtdt8FfIgSl-v0swVUefGx6w'],
|
||||||
success: (subscribeRes) => {
|
success: (subscribeRes) => {
|
||||||
console.log('订阅消息success回调,时间:', new Date()
|
console.log('订阅消息success回调,时间:', new Date()
|
||||||
.toLocaleTimeString(), subscribeRes);
|
.toLocaleTimeString(), subscribeRes);
|
||||||
resolve(subscribeRes);
|
resolve(subscribeRes);
|
||||||
},
|
},
|
||||||
fail: (subscribeErr) => {
|
fail: (subscribeErr) => {
|
||||||
@@ -550,7 +559,8 @@
|
|||||||
const payResult = await initiateWeChatScorePayment(res);
|
const payResult = await initiateWeChatScorePayment(res);
|
||||||
console.log('支付分调用结果', payResult);
|
console.log('支付分调用结果', payResult);
|
||||||
// 成功则跳转到等待页面
|
// 成功则跳转到等待页面
|
||||||
if (payResult.errCode == '0' && payResult.extraData && Object.keys(payResult.extraData).length > 0) {
|
if (payResult.errCode == '0' && payResult.extraData && Object.keys(payResult.extraData)
|
||||||
|
.length > 0) {
|
||||||
console.log('支付分授权成功,准备跳转到等待页,时间:', new Date().toLocaleTimeString());
|
console.log('支付分授权成功,准备跳转到等待页,时间:', new Date().toLocaleTimeString());
|
||||||
// 跳转到等待页面(订阅消息已经在前面完成了)
|
// 跳转到等待页面(订阅消息已经在前面完成了)
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
@@ -564,7 +574,9 @@
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: $t('order.cancelling')
|
title: $t('order.cancelling')
|
||||||
});
|
});
|
||||||
const cancelRes = await cancelOrder({ orderId: order.orderNo });
|
const cancelRes = await cancelOrder({
|
||||||
|
orderId: order.orderNo
|
||||||
|
});
|
||||||
console.log('订单取消结果:', cancelRes);
|
console.log('订单取消结果:', cancelRes);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
@@ -597,7 +609,9 @@
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: $t('order.cancelling')
|
title: $t('order.cancelling')
|
||||||
});
|
});
|
||||||
const cancelRes = await cancelOrder({ orderId: order.orderNo });
|
const cancelRes = await cancelOrder({
|
||||||
|
orderId: order.orderNo
|
||||||
|
});
|
||||||
console.log('订单取消结果:', cancelRes);
|
console.log('订单取消结果:', cancelRes);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
} catch (cancelError) {
|
} catch (cancelError) {
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
<!-- 自定义导航栏 -->
|
<!-- 自定义导航栏 -->
|
||||||
<view class="custom-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
|
<view class="custom-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||||
<view class="navbar-content" :style="{ height: navBarHeight + 'px' }">
|
<view class="navbar-content" :style="{ height: navBarHeight + 'px' }">
|
||||||
<!-- <text class="navbar-title">{{ $t('home.title') }}</text> -->
|
<text class="navbar-title">{{ $t('home.title') }}</text>
|
||||||
<text class="navbar-title">风电者共享风扇</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user