Commit 29803e64 by chenwq1

fix:报价

1 parent 8e360111
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3
const index = 1
/**
*
0本地
......
......@@ -10,7 +10,7 @@ class SQLite {
this.size = size || 50 * 1024 * 1024 // 50MB
this.db = null
//注意:
this.dbPath = null // 存储数据库的完整路径
this.dbPath = `_doc/${name}.db` // 存储数据库的完整路径
// 初始化该数据库的队列(如果不存在)
if (!SQLite._queues[name]) {
SQLite._queues[name] = new TaskQueue(`SQLite:${name}`)
......@@ -29,11 +29,11 @@ class SQLite {
uni.$logger?.local?.info(`[SQLite] 使用已有路径: ${this.dbPath}`)
return this.openDatabase()
}
// 获取当前文档目录路径
const rootPath = await PathUtils.getFilePath()
this.dbPath = `${rootPath}${this.name}.db`
uni.$logger?.local?.info(`[SQLite] 数据库路径已确定: ${this.dbPath}`)
return this.openDatabase()
// // 获取当前文档目录路径
// const rootPath = await PathUtils.getFilePath()
// this.dbPath = `${rootPath}${this.name}.db`
// uni.$logger?.local?.info(`[SQLite] 数据库路径已确定: ${this.dbPath}`)
// return this.openDatabase()
}
/**
......
......@@ -841,17 +841,11 @@ export default {
// priceHistory 字段废弃:统一使用 priceHistoryByRound(按轮分组)
if (!Array.isArray(data.priceHistoryByRound)) data.priceHistoryByRound = []
// 规范化每轮数据:保证 priceHistoryList 为数组,且按 quoteTime 倒序(同一轮最新在前)
// 不再改变后端轮次顺序,保持后端返回的倒序(最新轮在最上方)
// 规范化每轮数据:保证 priceHistoryList 为数组,并保持接口返回的原始顺序
// 如需按时间排序,请在后端/调用方显式处理;这里不做二次排序,避免影响展示顺序
data.priceHistoryByRound = data.priceHistoryByRound.map(r => {
const list = Array.isArray(r?.priceHistoryList) ? r.priceHistoryList.filter(Boolean) : []
list.sort((a, b) => {
const ta = a?.quoteTime || ''
const tb = b?.quoteTime || ''
if (ta === tb) return 0
return ta < tb ? 1 : -1
})
const quoteTime = list[0]?.quoteTime || r?.quoteTime || ''
const quoteTime = r?.quoteTime || list[list.length - 1]?.quoteTime || ''
return {
...r,
roundNo: r?.roundNo,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!