Commit eb03ed87 by 李伟康

fix(database): 修复数据库路径配置问题

- 修正了sqlite数据库路径设置,使用_doc作为存储目录
- 更新了数据库文件路径格式为_doc/{name}.db
- 注释了原有的路径获取逻辑避免重复初始化
- 移除了冗余的路径配置代码
1 parent 0820532f
...@@ -10,7 +10,7 @@ class SQLite { ...@@ -10,7 +10,7 @@ class SQLite {
this.size = size || 50 * 1024 * 1024 // 50MB this.size = size || 50 * 1024 * 1024 // 50MB
this.db = null this.db = null
//注意: //注意:
this.dbPath = null // 存储数据库的完整路径 this.dbPath = `_doc/${name}.db` // 存储数据库的完整路径
// 初始化该数据库的队列(如果不存在) // 初始化该数据库的队列(如果不存在)
if (!SQLite._queues[name]) { if (!SQLite._queues[name]) {
SQLite._queues[name] = new TaskQueue(`SQLite:${name}`) SQLite._queues[name] = new TaskQueue(`SQLite:${name}`)
...@@ -25,15 +25,15 @@ class SQLite { ...@@ -25,15 +25,15 @@ class SQLite {
async init() { async init() {
// 如果已经有路径,直接使用 // 如果已经有路径,直接使用
if (this.dbPath) { // if (this.dbPath) {
uni.$logger?.local?.info(`[SQLite] 使用已有路径: ${this.dbPath}`) uni.$logger?.local?.info(`[SQLite] 使用已有路径: ${this.dbPath}`)
return this.openDatabase() return this.openDatabase()
} // }
// 获取当前文档目录路径 // 获取当前文档目录路径
const rootPath = await PathUtils.getFilePath() // const rootPath = await PathUtils.getFilePath()
this.dbPath = `${rootPath}${this.name}.db` // this.dbPath = `${rootPath}${this.name}.db`
uni.$logger?.local?.info(`[SQLite] 数据库路径已确定: ${this.dbPath}`) // uni.$logger?.local?.info(`[SQLite] 数据库路径已确定: ${this.dbPath}`)
return this.openDatabase() // return this.openDatabase()
} }
/** /**
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.22.1", "versionName" : "2.22.2",
"versionCode" : 2221, "versionCode" : 2222,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
......
...@@ -40,6 +40,9 @@ export default { ...@@ -40,6 +40,9 @@ export default {
// 代理权限检查 // 代理权限检查
async isPermission(hintText) { async isPermission(hintText) {
return await this.recordService.isPermission(hintText) return await this.recordService.isPermission(hintText)
},
updateCustomerInfo(data){
this.recordService.updateCustomerInfo(data)
} }
} }
} }
...@@ -273,11 +273,11 @@ export default { ...@@ -273,11 +273,11 @@ export default {
this.customerInfo = Object.assign(this.customerInfo, newval) this.customerInfo = Object.assign(this.customerInfo, newval)
if (newval.carModel) { if (newval.carModel) {
this.pageParams.carInfo = { this.pageParams.carInfo = {
carChildsBrandId: newval.carChildsBrandId, carChildsBrandId: newval.carBrandId,
carChildsBrandName: newval.carChildsBrandName, carChildsBrandName: newval.carBrand,
carBrandId: newval.carBrandId, carBrandId: newval.oneCarBrandId,
carBrand: newval.carBrand, carBrand: newval.oneCarBrand,
id: newval.carSeriesId, id: newval.carModelId,
name: newval.carModel name: newval.carModel
} }
} }
......
...@@ -340,6 +340,7 @@ export default { ...@@ -340,6 +340,7 @@ export default {
this.customerType = -1 this.customerType = -1
this.clearHistory(); this.clearHistory();
this.recording = false this.recording = false
this.setReceptionStatus(-1);
this.$refs.home.$refs.leftBox.getMessageInfo() this.$refs.home.$refs.leftBox.getMessageInfo()
if (this.requested) this.$refs.home.updateApp() if (this.requested) this.$refs.home.updateApp()
this.getBoutiquePackageList() //套餐列表 this.getBoutiquePackageList() //套餐列表
...@@ -381,10 +382,13 @@ export default { ...@@ -381,10 +382,13 @@ export default {
this.jumpPage(id) this.jumpPage(id)
} }
else this.jumpPage() else this.jumpPage()
setTimeout(() => {
this.setReceptionStatus(1);
}, 1000);
}, },
done (e) { async done (e) {
this.$refs.home.finishRef.close(); this.$refs.home.finishRef.close();
if (this.recording) this.$refs.home.stopAudio(); if (this.recording) await this.$refs.home.stopAudio();
this.recording = false this.recording = false
setTimeout(() => { setTimeout(() => {
this.id = ""; this.id = "";
...@@ -392,10 +396,10 @@ export default { ...@@ -392,10 +396,10 @@ export default {
this.currentCarId = '' this.currentCarId = ''
this.bannerAutoplay = true this.bannerAutoplay = true
this.customerType = -1 this.customerType = -1
this.setReceptionStatus(e);
this.$store.dispatch("clearHistory") this.$store.dispatch("clearHistory")
this.$store.dispatch('clearReceptionTrack') this.$store.dispatch('clearReceptionTrack')
this.getBoutiquePackageList() //套餐列表 this.getBoutiquePackageList() //套餐列表
this.setReceptionStatus(-1);
}, 1500); }, 1500);
}, },
/**客户邀约接待 */ /**客户邀约接待 */
...@@ -409,6 +413,8 @@ export default { ...@@ -409,6 +413,8 @@ export default {
} //开始接待 } //开始接待
this.customerType = 0 this.customerType = 0
this.jumpPage() this.jumpPage()
uni.$logger.local.info('index-reception:回店客户〗 == ' + JSON.stringify(customer))
this.$refs.home.updateCustomerInfo(customer)
this.$nextTick(() => this.$store.dispatch('setCustomerInfo', customer)) this.$nextTick(() => this.$store.dispatch('setCustomerInfo', customer))
let { carBannerList } = this, let { carBannerList } = this,
currentCarId = '', currentCarId = '',
......
...@@ -37,6 +37,7 @@ export default { ...@@ -37,6 +37,7 @@ export default {
state.audioInfo = Object.assign(state.audioInfo, data) state.audioInfo = Object.assign(state.audioInfo, data)
}, },
setReceptionStatus(state, data) { setReceptionStatus(state, data) {
console.log(data,'===')
state.receptionStatus = data state.receptionStatus = data
}, },
setAudioList(state, data) { setAudioList(state, data) {
......
...@@ -337,7 +337,7 @@ class RecordSaveService { ...@@ -337,7 +337,7 @@ class RecordSaveService {
async _saveOrUpdate(data) { async _saveOrUpdate(data) {
uni.$logger.local.info(`【接待记录保存服务】 == 开始保存或更新接待记录!!`) uni.$logger.local.info(`【接待记录保存服务】 == 开始保存或更新接待记录!!`)
const { status, tempFilePath, receptionStatus, ...record } = data const { status, tempFilePath, recordStatus, ...record } = data
const fileList = Array.isArray(record.recordUrlList) ? record.recordUrlList : [] const fileList = Array.isArray(record.recordUrlList) ? record.recordUrlList : []
const isAllCompleted = status === FileStatus.NoFile || fileList.every(i => [FileStatus.Uploaded, FileStatus.Completed].includes(i.status)) const isAllCompleted = status === FileStatus.NoFile || fileList.every(i => [FileStatus.Uploaded, FileStatus.Completed].includes(i.status))
if (isAllCompleted) { if (isAllCompleted) {
......
...@@ -333,6 +333,7 @@ class RecordService { ...@@ -333,6 +333,7 @@ class RecordService {
} }
updateReceptionStatus(status) { updateReceptionStatus(status) {
console.log('updateReceptionStatus', status)
this.record.updatePreRecords({ receptionStatus: status }) this.record.updatePreRecords({ receptionStatus: status })
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @FilePath: \gl_tape\utils\recordManager\TimeoutService.js * @FilePath: \gl_tape\utils\recordManager\TimeoutService.js
*/ */
class TimeoutService { class TimeoutService {
TIMEOUT = 720000// 40分钟 TIMEOUT = 40// 40分钟
Miniute = 60 * 1000 Miniute = 60 * 1000
TIMER_DURATION = this.TIMEOUT * this.Miniute TIMER_DURATION = this.TIMEOUT * this.Miniute
CHECK_INTERVAL = 1 * this.Miniute // 1分钟检查一次 CHECK_INTERVAL = 1 * this.Miniute // 1分钟检查一次
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!