Commit 9120ea1f by 前端

合并

1 parent c5339ea4
<template>
<view class="record-box">
<view
class="record-content"
v-if="showRecord"
>
<view class="record-content" v-if="showRecord">
<view class="data-box">
<template v-for="(i, index) in dataList">
<view
:class="['data-item', i.type]"
:key="index"
>
<image
:src="i.icon"
class="data-item-bg"
/>
<view :class="['data-item', i.type]" :key="index">
<image :src="i.icon" class="data-item-bg" />
<view class="title">{{ dateList[index].text }}</view>
<view class="content">
<view class="total">
......@@ -37,74 +28,35 @@
</view>
<view class="data-container">
<view :class="['type-box']">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="changeType(index, 'firstIndex')"
>
<view
class="sprite-icon"
:class="[firstIndex == index ? `icon-${firstClass[index]} active` : '', firstLeft[index]]"
></view>
<view
class="text"
:class="[firstIndex == index ? `active` : '']"
>
<view class="tab-item" v-for="(i, index) in typeList" :key="index" @click="changeType(index, 'firstIndex')">
<view class="sprite-icon" :class="[firstIndex == index ? `icon-${firstClass[index]} active` : '', firstLeft[index]]"></view>
<view class="text" :class="[firstIndex == index ? `active` : '']">
{{ i.tabName }}
<template v-if="index == 1 && i.num && recordFailList.length > 0">({{ recordFailList.length }})</template>
<template v-if="index == 2 && i.num && preRecordFailList.length > 0">({{ preRecordFailList.length }})</template>
<div
class="dot"
v-if="index == 2 && i.num && preRecordFailList.length > 0"
></div>
<div class="dot" v-if="index == 2 && i.num && preRecordFailList.length > 0"></div>
</view>
</view>
</view>
<view class="tabs-bottom"></view>
<view
v-if="firstIndex == 0"
class="data-tabs-box"
>
<view v-if="firstIndex == 0" class="data-tabs-box">
<view class="data-tabs">
<template v-for="(i, index) in dateList">
<view
:class="['tab flex', { active: dateIndex == index }]"
:key="index"
@click="changeIndex(index)"
>{{ i.text }}</view>
<view :class="['tab flex', { active: dateIndex == index }]" :key="index" @click="changeIndex(index)">{{ i.text }}</view>
</template>
<view :class="['active-btn', `active-btn-${dateIndex}`]"></view>
</view>
</view>
<scroll-view
:class="['record-list', { 'type-1': firstIndex == 1 }]"
scroll-y
@scrolltolower="pageonReachBottom"
@scroll="scroll"
>
<div
class="record-tips"
v-if="firstIndex == 2 && list.length && list[0] && list[0].length"
>以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。</div>
<scroll-view :class="['record-list', { 'type-1': firstIndex == 1 }]" scroll-y @scrolltolower="pageonReachBottom" @scroll="scroll">
<div class="record-tips" v-if="firstIndex == 2 && list.length && list[0] && list[0].length">以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。</div>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template v-for="item in i">
<view
class="item"
:key="item.id"
@click="jumpDetail(item)"
>
<view
class="status flex disabled"
v-if="item.receptionStatus === '' || item.receptionStatus === undefined"
>未知</view>
<view
:class="['status flex', { deal: item.receptionStatus == 1 }]"
v-else
>
<view class="item" :key="item.id" @click="jumpDetail(item)">
<view class="status flex disabled" v-if="item.receptionStatus === '' || item.receptionStatus === undefined">未知</view>
<view :class="['status flex', { deal: item.receptionStatus == 1 }]" v-else>
{{
{
1: '成交',
......@@ -117,10 +69,7 @@
</view>
<view class="goods-name">{{ item.carModel ? item.carModel : '未选择车型' }}</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="ind"
>
<view class="info flex" :key="ind">
<view class="label">{{ k.label }}</view>
<view class="value">{{ formatValue(item[k.key], k.key) || '-' }}</view>
</view>
......@@ -131,10 +80,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../../assets/images/home/nothing.webp"
/>
<image class="icon" src="../../../assets/images/home/nothing.webp" />
暂无接待记录
</view>
</template>
......@@ -146,12 +92,7 @@
</scroll-view>
</view>
</view>
<save-record
v-else
@cancel="handleCancel"
@submit="handleSubmit"
:customerInfoVal="customerInfo"
></save-record>
<save-record v-else @cancel="handleCancel" @submit="handleSubmit" :customerInfoVal="customerInfo"></save-record>
</view>
</template>
<script type="text/ecmascript-6">
......@@ -231,6 +172,7 @@ export default {
formatValue (val, k) {
if (!val) return
if (k == 'phoneNumber') {
val = val.toString()
return val.slice(0, 3) + " " + val.slice(3, 7) + " " + val.slice(7)
}
return val
......@@ -240,7 +182,7 @@ export default {
},
async handleSubmit (val) {
this.showRecord = true;
uni.$recordManager.addRecord(val)
await uni.$dbManager.addRecord(val)
uni.$logger.local.info(`添加记录${JSON.stringify(val)}`)
interruptRecord.removePreRecord(val.id)
this.getRecordNum()
......@@ -281,8 +223,8 @@ export default {
scroll (e) {
this.sticky = e.detail.scrollTop >= 148
},
getRecordNum () {
let recordFailListAll = uni.$recordManager.getRecords();
async getRecordNum () {
let recordFailListAll = await uni.$dbManager.getRecords();
if (typeof recordFailListAll == 'string') {
recordFailListAll = JSON.parse(recordFailListAll || '[]')
}
......
{
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "2.3.0",
"versionCode" : "100",
"transformPx" : false,
"name": "展业助手",
"appid": "__UNI__D3BD3DF",
"description": "",
"versionName": "2.3.0",
"versionCode": "100",
"transformPx": false,
/* 5+App特有相关 */
"app-plus" : {
"bounce" : "none",
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"screenOrientation" : "landscape",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"app-plus": {
"bounce": "none",
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"screenOrientation": "landscape",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* 模块配置 */
"modules" : {
"Camera" : {},
"Record" : {},
"VideoPlayer" : {},
"AudioPlayer" : {},
"SQLite" : {}
"modules": {
"Camera": {},
"Record": {},
"VideoPlayer": {},
"AudioPlayer": {},
"SQLite": {}
},
/* 应用发布信息 */
"distribute" : {
"distribute": {
/* android打包配置 */
"android" : {
"permissions" : [
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
......@@ -45,71 +45,83 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"targetSdkVersion" : 30
"abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86"
],
"targetSdkVersion": 30
},
/* ios打包配置 */
"ios" : {
"dSYMs" : false,
"UIBackgroundModes" : "audio"
"ios": {
"dSYMs": false,
"UIBackgroundModes": "audio"
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"speech" : {}
"sdkConfigs": {
"ad": {},
"speech": {},
"geolocation": {
"system": {
"__platform__": [
"ios",
"android"
]
}
}
},
"icons" : {
"android" : {
"hdpi" : "static/72.png",
"xhdpi" : "static/96.png",
"xxhdpi" : "static/144.png"
"icons": {
"android": {
"hdpi": "static/72.png",
"xhdpi": "static/96.png",
"xxhdpi": "static/144.png"
}
}
},
"nativePlugins" : {
"Ba-KeepAliveSuit" : {
"__plugin_info__" : {
"name" : "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description" : "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms" : "Android",
"url" : "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name" : "uni.gltap",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "11765",
"parameters" : {}
"nativePlugins": {
"Ba-KeepAliveSuit": {
"__plugin_info__": {
"name": "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description": "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms": "Android",
"url": "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name": "uni.gltap",
"ios_bundle_id": "",
"isCloud": true,
"bought": 1,
"pid": "11765",
"parameters": {}
}
}
}
},
/* 快应用特有相关 */
"quickapp" : {},
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx79d1ff39bee3d047",
"setting" : {
"urlCheck" : false
"mp-weixin": {
"appid": "wx79d1ff39bee3d047",
"setting": {
"urlCheck": false
},
"usingComponents" : true
"usingComponents": true
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": false
},
"vueVersion" : "2",
"h5" : {
"devServer" : {
"port" : 8080,
"https" : false
"vueVersion": "2",
"h5": {
"devServer": {
"port": 8080,
"https": false
}
}
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-30 20:57:30
* @LastEditTime: 2025-01-02 09:50:34
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -35,7 +35,7 @@ export default {
},
async mounted() {
uni.$logger.local.info(`进入接待首页!`)
// this.checkPackage() //检查安装包
this.checkPackage() //检查安装包
this.handleCheck() // 检查更新
this.handleSave(false)
// 获取当前页面栈数组
......@@ -386,7 +386,7 @@ export default {
uni.$logger.local.info(`添加记录${JSON.stringify(record)}`)
const unlock = await uni.$recordManager.lock()
console.log('record', record)
uni.$recordManager.addRecord(record)
await uni.$dbManager.addRecord(record)
interruptRecord.removePreRecord(record.id)
unlock()
},
......
import { storageApi } from './cache'
import fileManager from '@/utils/file/FileManager.js'
import fileManager from "@/utils/file/FileManager.js";
import utils from './utils'
/**
* 记录管理器类
......@@ -52,16 +52,17 @@ class RecordManager {
unlock() {
this.locker = false
}
/**
* 将一条新记录添加到当前对象的记录列表中
*
* @param {Object} record - 要添加的新记录对象
* @returns {Array} - 包含新记录的更新后的记录列表
*/
async addRecord(record, key) {
async addRecord(record,key) {
const records = this.getRecords(key) || []
records.push(record)
this.setRecords(records, key)
this.setRecords(records,key)
return records
}
/**
......@@ -70,7 +71,7 @@ class RecordManager {
* @param {number} id - 要移除的记录的ID
* @returns {Array} - 移除记录后的更新后的记录列表
*/
async removeRecord(id, key) {
async removeRecord(id,key) {
let records = this.getRecords(key)
records = records.filter(i => i.id !== id)
this.setRecords(records)
......@@ -92,7 +93,7 @@ class RecordManager {
* @returns {Object} - 具有给定 ID 的记录对象,如果没有找到符合条件的记录,则返回 undefined
*
*/
getRecordById(id, key) {
getRecordById(id,key) {
const records = this.getRecords(key)
return records.find(i => i.id === id)
}
......@@ -112,8 +113,8 @@ class RecordManager {
* @param {Array} records - 要设置的记录列表
* @returns {void} - 此函数不返回任何值
*/
setRecords(records, key) {
storageApi.setRecords(records, key)
setRecords(records,key) {
storageApi.setRecords(records,key)
}
/**
* 更新记录数组中的记录
......@@ -123,7 +124,7 @@ class RecordManager {
* @param {Object} record - 要更新的记录对象,必须包含一个唯一的 id 属性
* @throws {Error} 如果记录数组中找不到具有给定 id 的记录,将抛出错误
*/
updateRecord(record, key) {
updateRecord(record,key) {
const records = this.getRecords(key)
const index = records.findIndex(i => i.id === record.id)
if (index !== -1) {
......@@ -131,28 +132,28 @@ class RecordManager {
this.setRecords(records)
}
}
/**
* 兼容模式的异步处理函数
* 这个函数用于处理在兼容模式下的文件路径转换和记录属性的修正
* 它首先获取一个锁,以确保在操作过程中数据的一致性
* 然后,它获取客户端文件保存文件夹的路径,并检查是否获取成功
* 接着,它获取所有的记录,并对每个记录执行以下操作:
* - 检查记录的 recordUrlList 是否存在且不为空,对于每个 URL,判断其是否以 'file://' 开头
* - 如果不是,使用路径中的文件名构建一个新的客户端文件路径,并替换掉原来的 URL
* - 如果记录没有 id 属性,随机生成一个 UUID 并设置为记录的 id
*
* 在处理过程中,如果发生任何错误,它将抛出该错误
* 无论成功或失败,最终都会执行 finally 块中的代码。这里首先释放记录锁,然后调用 polling 方法,可能是为了继续下一次文件上传。
*
* @async
* @throws {Error} 如果获取记录失败或发生任何其他错误,将抛出错误
*/
/**
* 兼容模式的异步处理函数
* 这个函数用于处理在兼容模式下的文件路径转换和记录属性的修正
* 它首先获取一个锁,以确保在操作过程中数据的一致性
* 然后,它获取客户端文件保存文件夹的路径,并检查是否获取成功
* 接着,它获取所有的记录,并对每个记录执行以下操作:
* - 检查记录的 recordUrlList 是否存在且不为空,对于每个 URL,判断其是否以 'file://' 开头
* - 如果不是,使用路径中的文件名构建一个新的客户端文件路径,并替换掉原来的 URL
* - 如果记录没有 id 属性,随机生成一个 UUID 并设置为记录的 id
*
* 在处理过程中,如果发生任何错误,它将抛出该错误
* 无论成功或失败,最终都会执行 finally 块中的代码。这里首先释放记录锁,然后调用 polling 方法,可能是为了继续下一次文件上传。
*
* @async
* @throws {Error} 如果获取记录失败或发生任何其他错误,将抛出错误
*/
async compatible() {
const unlock = await this.lock()
let path = await utils.getFileSaveFolderOnClient()
try {
let records = this.getRecords()
if (typeof records === 'string') {
if(typeof records === 'string') {
records = JSON.parse(records)
}
records.forEach(i => {
......@@ -175,6 +176,7 @@ class RecordManager {
unlock()
}
}
/**
* 清除所有记录
*
......
......@@ -11,6 +11,7 @@ class TimeoutManager {
const promises = [this.delay(waitTime), timeout]
return Promise.race(promises)
}
cancelAllTasks() {
while (this.tasks.length) {
const abort = this.tasks.shift()
......@@ -18,9 +19,11 @@ class TimeoutManager {
}
uni.$logger.local.info('强制取消轮询.')
}
get isProcessing() {
return this.tasks.length > 0
}
delay(interval = 60 * 10) {
return new Promise(resolve => {
this.tasks.push(resolve)
......
......@@ -5,7 +5,6 @@ class LocalLog {
logger = null
constructor() {
this.logger = new LogCat()
// this.logger = { }
}
debug(msg) {
this.logger.writeLog(LogLevel.DEBUG, msg)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!