移除系统配置获取金额

This commit is contained in:
2026-05-12 15:35:50 +08:00
parent 2f0479ea05
commit ec05584bb7
7 changed files with 99 additions and 234 deletions
-31
View File
@@ -155,12 +155,6 @@
import {
useI18n
} from '@/utils/i18n.js'
import {
fetchAndCacheDanaPaymentConfig,
DANA_TOTAL_STORAGE_KEY,
DANA_SINGLE_STORAGE_KEY,
parseDanaStorageNumber
} from '@/utils/danaPaymentConfig.js'
import DeviceDetailSkeleton from '@/components/DeviceDetailSkeleton.vue'
const {
@@ -185,32 +179,9 @@
const isWechatMiniProgram = ref(false)
const isAlipayMiniProgram = ref(false)
const isH5 = ref(false)
const IDR_DEPOSIT_DISPLAY = ref(99000)
const IDR_HOUR_PRICE_DISPLAY = ref(6000)
const loadDanaPricingCache = () => {
try {
const totalCached = parseDanaStorageNumber(uni.getStorageSync(DANA_TOTAL_STORAGE_KEY))
const singleCached = parseDanaStorageNumber(uni.getStorageSync(DANA_SINGLE_STORAGE_KEY))
if (totalCached !== null && totalCached > 0) {
IDR_DEPOSIT_DISPLAY.value = totalCached
}
if (singleCached !== null && singleCached > 0) {
IDR_HOUR_PRICE_DISPLAY.value = singleCached
}
} catch (e) {
console.warn('读取 DANA 金额缓存失败,使用默认值:', e)
}
}
// 生命周期 onLoad 钩子
onLoad(async (options) => {
loadDanaPricingCache()
void fetchAndCacheDanaPaymentConfig()
.then(() => loadDanaPricingCache())
.catch((e) => console.warn('DANA 配置刷新失败:', e))
// 普通链接二维码进入时,参数通常在 options.q(且为编码后的完整 URL
if (!options.deviceNo && options.q) {
const fullUrl = decodeURIComponent(options.q)
@@ -629,12 +600,10 @@
const displayCurrencySymbol = computed(() => (isIdrCurrency.value ? 'Rp ' : '¥'))
const displayHourlyPrice = computed(() => {
if (isIdrCurrency.value) return `${IDR_HOUR_PRICE_DISPLAY.value}`
return deviceFeeConfig.value.maxHourPrice || '5.00'
})
const displayDepositCap = computed(() => {
if (isIdrCurrency.value) return `${IDR_DEPOSIT_DISPLAY.value}`
return deviceInfo.value.depositAmount || '99'
})