Commit 93ce02c1 by liimin

feat(record): 添加异常记录恢复功能并优化样式

- 在TempRecord.js中添加recoverRecord方法处理异常记录恢复
- 修改RecordList.vue使用新的恢复方法替代直接保存
- 为createOrder.vue的按钮添加阴影效果和颜色样式
1 parent 3e88e253
...@@ -191,66 +191,66 @@ export default { ...@@ -191,66 +191,66 @@ export default {
return val return val
}, },
jumpDetail (item) { jumpDetail (item) {
item = { // item = {
"id": null, // "id": null,
"merchantId": "44210895", // "merchantId": "44210895",
customerType: 'VIP', // customerType: 'VIP',
"customerName": "1211第五", // "customerName": "1211第五",
"phoneNumber": "13512110555", // "phoneNumber": "13512110555",
"salesUuid": "77936e318e9844e4af0b099c7ccc98e4", // "salesUuid": "77936e318e9844e4af0b099c7ccc98e4",
"salesName": "叶立庆", // "salesName": "叶立庆",
"carBrandId": null, // "carBrandId": null,
"carBrand": "AITO 问界", // "carBrand": "AITO 问界",
"carModel": "问界M8", // "carModel": "问界M8",
"receptionStartTime": 1765447430000, // "receptionStartTime": 1765447430000,
"receptionEndTime": 1765449405000, // "receptionEndTime": 1765449405000,
"recordUrlList": null, // "recordUrlList": null,
"recCustomerId": null, // "recCustomerId": null,
"loginPhone": null, // "loginPhone": null,
"receptionStatus": 0, // "receptionStatus": 0,
"endReasonType": null, // "endReasonType": null,
"staffUuid": "9ec5c68f73e84357a427da9503a5ee8b", // "staffUuid": "9ec5c68f73e84357a427da9503a5ee8b",
"staffName": null, // "staffName": null,
"serviceMerchantId": null, // "serviceMerchantId": null,
"receptionCustomerPaySourceList": null, // "receptionCustomerPaySourceList": null,
"orderFlag": null, // "orderFlag": null,
"bussinessType": null, // "bussinessType": null,
"channelType": null, // "channelType": null,
"appCode": null, // "appCode": null,
"appVersion": null, // "appVersion": null,
"merchantName": "波波的单店门店", // "merchantName": "波波的单店门店",
"customerVisitId": null, // "customerVisitId": null,
"receptionCustomerMaterialPointList": null, // "receptionCustomerMaterialPointList": null,
"carPurchaseMethod": null, // "carPurchaseMethod": null,
"checkHistoryFlag": 0, // "checkHistoryFlag": 0,
"batchId": 62377, // "batchId": 62377,
"score": 35, // "score": 35,
"recordingUrl": "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/176544865331017654474319060.mp3", // "recordingUrl": "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/176544865331017654474319060.mp3",
"recordId": null, // "recordId": null,
"recordingTagRelationList": null, // "recordingTagRelationList": null,
"sfjs": null, // "sfjs": null,
"fwys": null, // "fwys": null,
"htjr": null, // "htjr": null,
"sqfx": null, // "sqfx": null,
"zyzs": null, // "zyzs": null,
"cjsz": null, // "cjsz": null,
"alzs": null, // "alzs": null,
"gfnl": null, // "gfnl": null,
"bdnl": null, // "bdnl": null,
"reviewFlag": null, // "reviewFlag": null,
"oneCarBrand": "鸿蒙智行", // "oneCarBrand": "鸿蒙智行",
"oneCarBrandId": null, // "oneCarBrandId": null,
"bussinessTypeName": null, // "bussinessTypeName": null,
"checkDate": null, // "checkDate": null,
"isOrderFinishFlagName": "0", // "isOrderFinishFlagName": "0",
"modelType": "1001", // "modelType": "1001",
"checkType": 1, // "checkType": 1,
"orderFinishFlag": false, // "orderFinishFlag": false,
"duration": "32分55秒", // "duration": "32分55秒",
"startTime": "2025.12.11 18:03:50", // "startTime": "2025.12.11 18:03:50",
"endTime": "2025.12.11 18:36:45", // "endTime": "2025.12.11 18:36:45",
"totalDuration": 1975 // "totalDuration": 1975
} // }
if (this.tabIndex == 0) { // 已上传 && 新质检 if (this.tabIndex == 0) { // 已上传 && 新质检
const { sceneType } = uni.$storage.get("userInfo"); const { sceneType } = uni.$storage.get("userInfo");
if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({ if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({
...@@ -346,7 +346,7 @@ export default { ...@@ -346,7 +346,7 @@ export default {
reviewFlag, reviewFlag,
result:orderFinishFlag===1?'完成':'未完成', result:orderFinishFlag===1?'完成':'未完成',
// bussinessType: sceneType == 0 ? 1 : 2, // bussinessType: sceneType == 0 ? 1 : 2,
}) })||{}
// 3. 数据处理 // 3. 数据处理
records.reverse().forEach(e => { records.reverse().forEach(e => {
e.duration = e.durationStr || this.formatSeconds(new Date(e.endTime).getTime() - new Date(e.startTime).getTime()) e.duration = e.durationStr || this.formatSeconds(new Date(e.endTime).getTime() - new Date(e.startTime).getTime())
...@@ -409,7 +409,7 @@ export default { ...@@ -409,7 +409,7 @@ export default {
this.flag = false this.flag = false
delete val.duration delete val.duration
// delete val.startTime // delete val.startTime
await this.recorder.save(val) await this.recorder.recoverRecord(val)
this.getRecordNum() this.getRecordNum()
await this.getPreRecordFail() await this.getPreRecordFail()
}, },
......
...@@ -234,5 +234,7 @@ export default { ...@@ -234,5 +234,7 @@ export default {
color: #fff; color: #fff;
border-radius: toRpx(48); border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
box-shadow: 0 toRpx(8) toRpx(16) rgba(44, 102, 247, 0.25);
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2025-01-02 18:49:17 * @Date: 2025-01-02 18:49:17
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2025-12-25 09:07:31 * @LastEditTime: 2025-12-30 10:06:06
* @FilePath: \simgle_app\utils\recordManager\TempRecord.js * @FilePath: \simgle_app\utils\recordManager\TempRecord.js
*/ */
import utils from '../utils' import utils from '../utils'
...@@ -95,6 +95,23 @@ class TempRecord { ...@@ -95,6 +95,23 @@ class TempRecord {
return this.path return this.path
} }
/** /**
* 恢复异常记录
* - 封装为独立方法是为了语义更清晰,明确这是"异常恢复"操作
* - 虽然目前逻辑复用了 save,但未来可以独立扩展恢复特有的逻辑(如容错处理、特殊日志等)
* @param {Object} record - 待恢复的异常记录
* @returns {Promise<void>}
*/
async recoverRecord(record) {
if (!record) return
uni.$logger.local.info('〖接待记录Record〗 == 开始恢复异常记录 ==' + record.id)
// 复用 save 逻辑进行持久化
// 专门的入口有利于后续扩展,比如在这里添加恢复失败的特殊重试机制
await this.save(record)
}
/**
* 将当前临时记录持久化到正式记录表,并清理本地数据 * 将当前临时记录持久化到正式记录表,并清理本地数据
* - 开始前会停止轮询 * - 开始前会停止轮询
* - 会对过长的录音列表进行截断 * - 会对过长的录音列表进行截断
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!