国际版独立
This commit is contained in:
+31
-3
@@ -34,12 +34,12 @@
|
||||
|
||||
<view class="pricing-banner">
|
||||
<view class="pricing-main">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price">{{ deviceFeeConfig.maxHourPrice || '5.00' }}</text>
|
||||
<text class="price-symbol">{{ displayCurrencySymbol }}</text>
|
||||
<text class="price">{{ displayHourlyPrice }}</text>
|
||||
<text class="unit">/{{ getPriceUnit() }}</text>
|
||||
</view>
|
||||
<view class="cap-badge">
|
||||
<text class="cap-text">{{ deviceInfo.depositAmount || '99' }}{{ $t('device.capLimit') }}</text>
|
||||
<text class="cap-text">{{ displayDepositCap }}{{ $t('device.capLimit') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
computed,
|
||||
onMounted
|
||||
} from 'vue'
|
||||
import {
|
||||
@@ -178,6 +179,8 @@
|
||||
const isWechatMiniProgram = ref(false)
|
||||
const isAlipayMiniProgram = ref(false)
|
||||
const isH5 = ref(false)
|
||||
const IDR_DEPOSIT_DISPLAY = 99000
|
||||
const IDR_HOUR_PRICE_DISPLAY = 6000
|
||||
|
||||
// 生命周期 onLoad 钩子
|
||||
onLoad(async (options) => {
|
||||
@@ -499,6 +502,7 @@
|
||||
|
||||
// 获取价格单位文本
|
||||
const getPriceUnit = () => {
|
||||
if (isIdrCurrency.value) return t('time.hour')
|
||||
console.log(deviceInfo.value);
|
||||
// 按分钟计费
|
||||
if (deviceInfo.value && deviceInfo.value.feeType === 'minute') {
|
||||
@@ -547,6 +551,9 @@
|
||||
|
||||
// 生成计费说明文本
|
||||
const getPricingInfoText = () => {
|
||||
if (isIdrCurrency.value) {
|
||||
return `${displayCurrencySymbol.value}${displayHourlyPrice.value}/${t('time.hour')}`
|
||||
}
|
||||
const unitPrice = getBillingUnitPrice()
|
||||
const maxHourPrice = deviceFeeConfig.value.maxHourPrice || '5'
|
||||
|
||||
@@ -562,6 +569,9 @@
|
||||
|
||||
// 生成详细说明文本
|
||||
const getDetailInfoText = () => {
|
||||
if (isIdrCurrency.value) {
|
||||
return `不足1${t('time.hour')}按1${t('time.hour')}计费,封顶${displayCurrencySymbol.value}${displayDepositCap.value},持续计费至${displayCurrencySymbol.value}${displayDepositCap.value}视为买断`
|
||||
}
|
||||
const freeMinutes = getFreeMinutes()
|
||||
const unitMinutes = getBillingUnitMinutes()
|
||||
const depositAmount = deviceInfo.value.depositAmount || '99'
|
||||
@@ -584,6 +594,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
const currencyCode = computed(() => {
|
||||
return (positionInfo.value?.currency || '').toUpperCase()
|
||||
})
|
||||
|
||||
const isIdrCurrency = computed(() => currencyCode.value === 'IDR')
|
||||
|
||||
const displayCurrencySymbol = computed(() => (isIdrCurrency.value ? 'Rp ' : '¥'))
|
||||
|
||||
const displayHourlyPrice = computed(() => {
|
||||
if (isIdrCurrency.value) return `${IDR_HOUR_PRICE_DISPLAY}`
|
||||
return deviceFeeConfig.value.maxHourPrice || '5.00'
|
||||
})
|
||||
|
||||
const displayDepositCap = computed(() => {
|
||||
if (isIdrCurrency.value) return `${IDR_DEPOSIT_DISPLAY}`
|
||||
return deviceInfo.value.depositAmount || '99'
|
||||
})
|
||||
|
||||
// 提交租借订单
|
||||
const submitRentOrder = async (payWay) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user