Compare commits
No commits in common. "eb2473df6f021fb8c14fe12500d316448eb33a0e" and "65dc8002dbd6205507ed35167b5dec46a529cfe4" have entirely different histories.
eb2473df6f
...
65dc8002db
21
src/main.js
21
src/main.js
@ -99,27 +99,6 @@ export function createApp() {
|
|||||||
location.reload(true)
|
location.reload(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查聊天页面是否可用
|
|
||||||
window.checkChatWebviewAvailable = () => {
|
|
||||||
let OAWebView = plus.webview.all()
|
|
||||||
OAWebView.forEach((webview, index) => {
|
|
||||||
if (webview.id === 'webviewId1') {
|
|
||||||
webview.evalJS(`doneCheckChatWebviewAvailable()`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取从base传来的多选视频列表
|
|
||||||
window.getBaseMulVideo = (videoList) => {
|
|
||||||
const videos = JSON.parse(decodeURIComponent(videoList))
|
|
||||||
console.error('=====videos', videos)
|
|
||||||
if(videos.length > 0){
|
|
||||||
const videoUri = videos[0]
|
|
||||||
console.error('=====videoUri', videoUri)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.message = ['success', 'error', 'warning'].reduce((acc, type) => {
|
window.message = ['success', 'error', 'warning'].reduce((acc, type) => {
|
||||||
acc[type] = (message) => {
|
acc[type] = (message) => {
|
||||||
if (typeof message === 'string') {
|
if (typeof message === 'string') {
|
||||||
|
@ -162,12 +162,6 @@ const photoActionsSelect = (index) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// let OAWebView = plus.webview.all()
|
|
||||||
// OAWebView.forEach((webview, index) => {
|
|
||||||
// if (webview.id === 'webviewId1') {
|
|
||||||
// webview.evalJS(`getPlusVideoPicker()`)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
uni.chooseVideo({
|
uni.chooseVideo({
|
||||||
sourceType: ['album'],
|
sourceType: ['album'],
|
||||||
compressed: true,
|
compressed: true,
|
||||||
@ -323,9 +317,7 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
virtualList.value.unshift(newItem)
|
virtualList.value.unshift(newItem)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await uploadImg(form, (e) =>
|
const result = await uploadImg(form, (e) => onProgressFn(e, randomId))
|
||||||
onProgressFn(e, randomId),
|
|
||||||
)
|
|
||||||
console.log('视频上传完成,结果:', result)
|
console.log('视频上传完成,结果:', result)
|
||||||
|
|
||||||
if (result.status === 0) {
|
if (result.status === 0) {
|
||||||
@ -377,7 +369,7 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
uploadsStore.updateUploadStatus(false)
|
uploadsStore.updateUploadStatus(false)
|
||||||
message.error('获取视频信息失败')
|
message.error('获取视频信息失败')
|
||||||
resolve('')
|
resolve('')
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -5,106 +5,8 @@ import lodash from 'lodash'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { createGlobalState, useStorage } from '@vueuse/core'
|
import { createGlobalState, useStorage } from '@vueuse/core'
|
||||||
import { uniStorage } from '@/utils/uniStorage.js'
|
import { uniStorage } from '@/utils/uniStorage.js'
|
||||||
import { initDatabase } from './sqlite'
|
|
||||||
|
|
||||||
export const useDialogueListStore = createGlobalState(() => {
|
export const useDialogueListStore = createGlobalState(() => {
|
||||||
const testDatabase = async () => {
|
|
||||||
// 初始化数据库
|
|
||||||
let chatDatabase = {
|
|
||||||
eventType: 'openDatabase',
|
|
||||||
eventParams: {
|
|
||||||
name: 'chat',
|
|
||||||
path: '_doc/chat.db',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
let chatDBexecuteSql = {
|
|
||||||
eventType: 'executeSql',
|
|
||||||
eventParams: {
|
|
||||||
name: 'chat',
|
|
||||||
sql: `CREATE TABLE IF NOT EXISTS talk_records (
|
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
||||||
msg_id TEXT NOT NULL,
|
|
||||||
sequence INTEGER NOT NULL,
|
|
||||||
talk_type INTEGER NOT NULL DEFAULT 1,
|
|
||||||
msg_type INTEGER NOT NULL DEFAULT 1,
|
|
||||||
user_id INTEGER NOT NULL DEFAULT 0,
|
|
||||||
receiver_id INTEGER NOT NULL DEFAULT 0,
|
|
||||||
is_revoke INTEGER NOT NULL DEFAULT 0,
|
|
||||||
is_mark INTEGER NOT NULL DEFAULT 0,
|
|
||||||
quote_id TEXT NOT NULL,
|
|
||||||
extra TEXT NOT NULL,
|
|
||||||
created_at TEXT NOT NULL,
|
|
||||||
updated_at TEXT NOT NULL,
|
|
||||||
biz_date TEXT
|
|
||||||
)`,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const content = {
|
|
||||||
content: "我试试传送文件和图片是不是一个接口",
|
|
||||||
name: "测试excel1.xlsx",
|
|
||||||
path: "https://cdn-test.szjixun.cn/fonchain-chat/chat/file/multipart/20250307/727a2371-ffc4-46da-b953-a7d449ff82ff-测试excel1.xlsx",
|
|
||||||
size: 9909,
|
|
||||||
drive: 3
|
|
||||||
};
|
|
||||||
const extra = JSON.stringify(content);
|
|
||||||
|
|
||||||
let chatDBexecuteSql2 = {
|
|
||||||
eventType: 'executeSql',
|
|
||||||
eventParams: {
|
|
||||||
name: 'chat',
|
|
||||||
sql: 'INSERT INTO talk_records (msg_id, sequence, talk_type, msg_type, user_id, receiver_id, is_revoke, is_mark, quote_id, extra, created_at, updated_at, biz_date) VALUES ("'+'77b715fb30f54f739a255a915ef72445'+'", 166, 2, 1, 1774, 888890, 0, 0, "'+''+'", "'+extra+'", "'+'2025-03-06T15:57:07.000Z'+'", "'+'2025-03-06T15:57:07.000Z'+'", "'+'20250306'+'")',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
let chatDBSelectSql = {
|
|
||||||
eventType: 'selectSql',
|
|
||||||
eventParams: {
|
|
||||||
name: 'chat',
|
|
||||||
sql: `SELECT * FROM talk_records ORDER BY sequence DESC LIMIT 20`,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
let chatDBIsOpenDatabase = {
|
|
||||||
eventType: 'isOpenDatabase',
|
|
||||||
eventParams: {
|
|
||||||
name: 'chat',
|
|
||||||
path: '_doc/chat.db',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
document.addEventListener('plusready', () => {
|
|
||||||
let OAWebView = plus.webview.all()
|
|
||||||
OAWebView.forEach((webview, index) => {
|
|
||||||
if (webview.id === 'webviewId1') {
|
|
||||||
webview.evalJS(
|
|
||||||
`operateSQLite('${encodeURIComponent(
|
|
||||||
JSON.stringify(chatDatabase),
|
|
||||||
)}')`,
|
|
||||||
)
|
|
||||||
webview.evalJS(
|
|
||||||
`operateSQLite('${encodeURIComponent(
|
|
||||||
JSON.stringify(chatDBexecuteSql),
|
|
||||||
)}')`,
|
|
||||||
)
|
|
||||||
webview.evalJS(
|
|
||||||
`operateSQLite('${encodeURIComponent(
|
|
||||||
JSON.stringify(chatDBexecuteSql2),
|
|
||||||
)}')`,
|
|
||||||
)
|
|
||||||
webview.evalJS(
|
|
||||||
`operateSQLite('${encodeURIComponent(
|
|
||||||
JSON.stringify(chatDBSelectSql),
|
|
||||||
)}')`,
|
|
||||||
)
|
|
||||||
webview.evalJS(
|
|
||||||
`operateSQLite('${encodeURIComponent(
|
|
||||||
JSON.stringify(chatDBIsOpenDatabase),
|
|
||||||
)}')`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// testDatabase()
|
|
||||||
|
|
||||||
const dialogueList = useStorage('dialogueList', [], uniStorage)
|
const dialogueList = useStorage('dialogueList', [], uniStorage)
|
||||||
// const dialogueList = ref([])
|
// const dialogueList = ref([])
|
||||||
const zpagingRef = ref()
|
const zpagingRef = ref()
|
||||||
@ -130,7 +32,7 @@ export const useDialogueListStore = createGlobalState(() => {
|
|||||||
talk: {
|
talk: {
|
||||||
username: dialogue.talk.username,
|
username: dialogue.talk.username,
|
||||||
talk_type: dialogue.talk.talk_type,
|
talk_type: dialogue.talk.talk_type,
|
||||||
receiver_id: dialogue.talk.receiver_id,
|
receiver_id: dialogue.talk.receiver_id
|
||||||
},
|
},
|
||||||
online: dialogue.online,
|
online: dialogue.online,
|
||||||
records: dialogue.records || [],
|
records: dialogue.records || [],
|
||||||
@ -141,7 +43,7 @@ export const useDialogueListStore = createGlobalState(() => {
|
|||||||
isDismiss: dialogue.isDismiss,
|
isDismiss: dialogue.isDismiss,
|
||||||
isQuit: dialogue.isQuit,
|
isQuit: dialogue.isQuit,
|
||||||
unreadNum: dialogue.unreadNum,
|
unreadNum: dialogue.unreadNum,
|
||||||
members: dialogue.members.map((member) => ({
|
members: dialogue.members.map(member => ({
|
||||||
id: member.id,
|
id: member.id,
|
||||||
nickname: member.nickname,
|
nickname: member.nickname,
|
||||||
avatar: member.avatar,
|
avatar: member.avatar,
|
||||||
@ -153,9 +55,9 @@ export const useDialogueListStore = createGlobalState(() => {
|
|||||||
key: member.key,
|
key: member.key,
|
||||||
erp_user_id: member.erp_user_id,
|
erp_user_id: member.erp_user_id,
|
||||||
is_mute: member.is_mute,
|
is_mute: member.is_mute,
|
||||||
is_mine: member.is_mine,
|
is_mine: member.is_mine
|
||||||
})),
|
})),
|
||||||
forwardType: dialogue.forwardType,
|
forwardType: dialogue.forwardType
|
||||||
}
|
}
|
||||||
dialogueList.value.push(newDialogue)
|
dialogueList.value.push(newDialogue)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user