Compare commits
No commits in common. "8eb0f0b4f224d815505dcded8e9abf06ec352a70" and "ba52f9a576786699b2afadfbdcc5e774fccf938b" have entirely different histories.
8eb0f0b4f2
...
ba52f9a576
@ -31,16 +31,15 @@
|
|||||||
"@uni-helper/axios-adapter": "^1.5.2",
|
"@uni-helper/axios-adapter": "^1.5.2",
|
||||||
"@uni-helper/localforage-adapter": "^1.0.2",
|
"@uni-helper/localforage-adapter": "^1.0.2",
|
||||||
"@uni-helper/uni-use": "^0.19.12",
|
"@uni-helper/uni-use": "^0.19.12",
|
||||||
"@vueuse/core": "^9.13.0",
|
|
||||||
"@vueup/vue-quill": "^1.2.0",
|
"@vueup/vue-quill": "^1.2.0",
|
||||||
"quill": "^1.3.7",
|
"@vueuse/core": "^9.13.0",
|
||||||
"quill-mention": "^4.1.0",
|
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"dayjs": "^1.11.12",
|
"dayjs": "^1.11.12",
|
||||||
"less": "^4.2.0",
|
"less": "^4.2.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nzh": "^1.0.13",
|
"nzh": "^1.0.13",
|
||||||
"pinia-plugin-persistedstate": "^4.1.3",
|
"pinia-plugin-persistedstate": "^4.1.3",
|
||||||
|
"quill-mention": "^6.0.2",
|
||||||
"vconsole": "^3.15.1",
|
"vconsole": "^3.15.1",
|
||||||
"vue": "^3.3.8",
|
"vue": "^3.3.8",
|
||||||
"vue-i18n": "11.0.0-rc.1"
|
"vue-i18n": "11.0.0-rc.1"
|
||||||
|
@ -86,12 +86,9 @@ importers:
|
|||||||
pinia-plugin-persistedstate:
|
pinia-plugin-persistedstate:
|
||||||
specifier: ^4.1.3
|
specifier: ^4.1.3
|
||||||
version: 4.1.3(pinia@2.0.36(typescript@5.5.4)(vue@3.4.35(typescript@5.5.4)))(rollup@4.19.2)
|
version: 4.1.3(pinia@2.0.36(typescript@5.5.4)(vue@3.4.35(typescript@5.5.4)))(rollup@4.19.2)
|
||||||
quill:
|
|
||||||
specifier: ^1.3.7
|
|
||||||
version: 1.3.7
|
|
||||||
quill-mention:
|
quill-mention:
|
||||||
specifier: ^4.1.0
|
specifier: ^6.0.2
|
||||||
version: 4.1.0
|
version: 6.0.2
|
||||||
vconsole:
|
vconsole:
|
||||||
specifier: ^3.15.1
|
specifier: ^3.15.1
|
||||||
version: 3.15.1
|
version: 3.15.1
|
||||||
@ -3000,6 +2997,9 @@ packages:
|
|||||||
fast-diff@1.2.0:
|
fast-diff@1.2.0:
|
||||||
resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
|
resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
|
||||||
|
|
||||||
|
fast-diff@1.3.0:
|
||||||
|
resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==}
|
||||||
|
|
||||||
fast-glob@3.3.2:
|
fast-glob@3.3.2:
|
||||||
resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
|
resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
|
||||||
engines: {node: '>=8.6.0'}
|
engines: {node: '>=8.6.0'}
|
||||||
@ -3986,6 +3986,9 @@ packages:
|
|||||||
parchment@1.1.4:
|
parchment@1.1.4:
|
||||||
resolution: {integrity: sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==}
|
resolution: {integrity: sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==}
|
||||||
|
|
||||||
|
parchment@3.0.0:
|
||||||
|
resolution: {integrity: sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==}
|
||||||
|
|
||||||
parse-bmfont-ascii@1.0.6:
|
parse-bmfont-ascii@1.0.6:
|
||||||
resolution: {integrity: sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==}
|
resolution: {integrity: sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==}
|
||||||
|
|
||||||
@ -4259,12 +4262,20 @@ packages:
|
|||||||
quill-delta@4.2.2:
|
quill-delta@4.2.2:
|
||||||
resolution: {integrity: sha512-qjbn82b/yJzOjstBgkhtBjN2TNK+ZHP/BgUQO+j6bRhWQQdmj2lH6hXG7+nwwLF41Xgn//7/83lxs9n2BkTtTg==}
|
resolution: {integrity: sha512-qjbn82b/yJzOjstBgkhtBjN2TNK+ZHP/BgUQO+j6bRhWQQdmj2lH6hXG7+nwwLF41Xgn//7/83lxs9n2BkTtTg==}
|
||||||
|
|
||||||
quill-mention@4.1.0:
|
quill-delta@5.1.0:
|
||||||
resolution: {integrity: sha512-dT8HLYeuGU8yjjUr5SgdOusFSqQ7FQt/DWefz4V/L2omJsZ9CVYWepg3GyqV/evNDV7LQtfM7cadxtYD2bi2ew==}
|
resolution: {integrity: sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==}
|
||||||
|
engines: {node: '>= 12.0.0'}
|
||||||
|
|
||||||
|
quill-mention@6.0.2:
|
||||||
|
resolution: {integrity: sha512-ZyiEzLxtoNJ/hAjMyfVsugpXAcOdD2fbHmJT3yKuwpUxiDHdmutVJqOzpItqiVbcjUecnjAF+/Yo1IN3/W6iAg==}
|
||||||
|
|
||||||
quill@1.3.7:
|
quill@1.3.7:
|
||||||
resolution: {integrity: sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==}
|
resolution: {integrity: sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==}
|
||||||
|
|
||||||
|
quill@2.0.2:
|
||||||
|
resolution: {integrity: sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==}
|
||||||
|
engines: {npm: '>=8.2.3'}
|
||||||
|
|
||||||
range-parser@1.2.1:
|
range-parser@1.2.1:
|
||||||
resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
|
resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
|
||||||
engines: {node: '>= 0.6'}
|
engines: {node: '>= 0.6'}
|
||||||
@ -8945,6 +8956,8 @@ snapshots:
|
|||||||
|
|
||||||
fast-diff@1.2.0: {}
|
fast-diff@1.2.0: {}
|
||||||
|
|
||||||
|
fast-diff@1.3.0: {}
|
||||||
|
|
||||||
fast-glob@3.3.2:
|
fast-glob@3.3.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nodelib/fs.stat': 2.0.5
|
'@nodelib/fs.stat': 2.0.5
|
||||||
@ -10140,6 +10153,8 @@ snapshots:
|
|||||||
|
|
||||||
parchment@1.1.4: {}
|
parchment@1.1.4: {}
|
||||||
|
|
||||||
|
parchment@3.0.0: {}
|
||||||
|
|
||||||
parse-bmfont-ascii@1.0.6: {}
|
parse-bmfont-ascii@1.0.6: {}
|
||||||
|
|
||||||
parse-bmfont-binary@1.0.6: {}
|
parse-bmfont-binary@1.0.6: {}
|
||||||
@ -10392,9 +10407,15 @@ snapshots:
|
|||||||
lodash.clonedeep: 4.5.0
|
lodash.clonedeep: 4.5.0
|
||||||
lodash.isequal: 4.5.0
|
lodash.isequal: 4.5.0
|
||||||
|
|
||||||
quill-mention@4.1.0:
|
quill-delta@5.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
quill: 1.3.7
|
fast-diff: 1.3.0
|
||||||
|
lodash.clonedeep: 4.5.0
|
||||||
|
lodash.isequal: 4.5.0
|
||||||
|
|
||||||
|
quill-mention@6.0.2:
|
||||||
|
dependencies:
|
||||||
|
quill: 2.0.2
|
||||||
|
|
||||||
quill@1.3.7:
|
quill@1.3.7:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -10405,6 +10426,13 @@ snapshots:
|
|||||||
parchment: 1.1.4
|
parchment: 1.1.4
|
||||||
quill-delta: 3.6.3
|
quill-delta: 3.6.3
|
||||||
|
|
||||||
|
quill@2.0.2:
|
||||||
|
dependencies:
|
||||||
|
eventemitter3: 5.0.1
|
||||||
|
lodash-es: 4.17.21
|
||||||
|
parchment: 3.0.0
|
||||||
|
quill-delta: 5.1.0
|
||||||
|
|
||||||
range-parser@1.2.1: {}
|
range-parser@1.2.1: {}
|
||||||
|
|
||||||
raw-body@2.5.2:
|
raw-body@2.5.2:
|
||||||
|
@ -45,12 +45,3 @@ export const ServeTalkDate = (data) => {
|
|||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取会话Id
|
|
||||||
export const ServeGetSessionId = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/api/v1/talk/session/getId',
|
|
||||||
method: 'POST',
|
|
||||||
data,
|
|
||||||
})
|
|
||||||
}
|
|
@ -21,20 +21,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { defineProps, defineEmits, reactive, watch } from 'vue'
|
import { defineProps, defineEmits, reactive, watch } from 'vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
searchText: {
|
searchText: String,
|
||||||
type: String,
|
first_talk_record_infos: Object,
|
||||||
default: ''
|
disabled: Boolean,
|
||||||
},
|
|
||||||
first_talk_record_infos: {
|
|
||||||
type: Object,
|
|
||||||
default(){
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
searchText: '', //搜索内容
|
searchText: '', //搜索内容
|
||||||
|
@ -25,33 +25,33 @@ const getFileTypeIMG = computed(() => {
|
|||||||
let objT = {
|
let objT = {
|
||||||
finishedImg: '',
|
finishedImg: '',
|
||||||
blankImg: '',
|
blankImg: '',
|
||||||
progressColor: '',
|
progressColor: ''
|
||||||
}
|
};
|
||||||
|
|
||||||
switch (suffix) {
|
switch (suffix) {
|
||||||
case 'pdf':
|
case 'pdf':
|
||||||
objT.finishedImg = filePaperPDF
|
objT.finishedImg = filePaperPDF
|
||||||
objT.blankImg = filePaperPDFBlank
|
objT.blankImg = filePaperPDFBlank
|
||||||
objT.progressColor = '#DE4E4E'
|
objT.progressColor = '#DE4E4E'
|
||||||
break
|
break;
|
||||||
case 'doc':
|
case 'doc':
|
||||||
case 'docx':
|
case 'docx':
|
||||||
objT.finishedImg = filePaperWord
|
objT.finishedImg = filePaperWord
|
||||||
objT.blankImg = filePaperWordBlank
|
objT.blankImg = filePaperWordBlank
|
||||||
objT.progressColor = '#2750B2'
|
objT.progressColor = '#2750B2'
|
||||||
break
|
break;
|
||||||
case 'xls':
|
case 'xls':
|
||||||
case 'xlsx':
|
case 'xlsx':
|
||||||
objT.finishedImg = filePaperExcel
|
objT.finishedImg = filePaperExcel
|
||||||
objT.blankImg = filePaperExcelBlank
|
objT.blankImg = filePaperExcelBlank
|
||||||
objT.progressColor = '#3C7F4B'
|
objT.progressColor = '#3C7F4B'
|
||||||
break
|
break;
|
||||||
case 'ppt':
|
case 'ppt':
|
||||||
case 'pptx':
|
case 'pptx':
|
||||||
objT.finishedImg = filePaperPPT
|
objT.finishedImg = filePaperPPT
|
||||||
objT.blankImg = filePaperPPTBlank
|
objT.blankImg = filePaperPPTBlank
|
||||||
objT.progressColor = '#B74B2B'
|
objT.progressColor = '#B74B2B'
|
||||||
break
|
break;
|
||||||
default:
|
default:
|
||||||
objT.finishedImg = filePaperOther
|
objT.finishedImg = filePaperOther
|
||||||
objT.blankImg = filePaperOtherBlank
|
objT.blankImg = filePaperOtherBlank
|
||||||
@ -60,78 +60,22 @@ const getFileTypeIMG = computed(() => {
|
|||||||
return objT
|
return objT
|
||||||
})
|
})
|
||||||
|
|
||||||
const previewPDF = () => {
|
|
||||||
if (typeof plus !== 'undefined') {
|
|
||||||
downloadAndOpenFile()
|
|
||||||
} else {
|
|
||||||
document.addEventListener('plusready', () => {
|
|
||||||
downloadAndOpenFile()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const downloadAndOpenFile = () => {
|
|
||||||
uni.showLoading({ title: '加载中...', mask: true })
|
|
||||||
const downloadUrl = props?.extra?.path
|
|
||||||
if (!downloadUrl) {
|
|
||||||
uni.hideLoading()
|
|
||||||
uni.showToast({ title: '文件路径无效', icon: 'none' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const options = {
|
|
||||||
filename: '_doc/downloads/', // 保存路径
|
|
||||||
}
|
|
||||||
const dtask = plus.downloader.createDownload(downloadUrl, options, function (
|
|
||||||
d,
|
|
||||||
status,
|
|
||||||
) {
|
|
||||||
if (status === 200) {
|
|
||||||
uni.hideLoading()
|
|
||||||
const filePath = d.filename
|
|
||||||
if (filePath) {
|
|
||||||
plus.runtime.openFile(filePath, {}, function () {})
|
|
||||||
} else {
|
|
||||||
uni.showToast({ title: '文件路径无效', icon: 'none' })
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
dtask.start()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section
|
<section
|
||||||
class="file-message"
|
class="file-message"
|
||||||
@click="previewPDF"
|
|
||||||
:class="{ left: data.float === 'left', right: data.float === 'right' }"
|
:class="{ left: data.float === 'left', right: data.float === 'right' }"
|
||||||
>
|
>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<div
|
<div class="w-[228rpx] text-[32rpx] text-[#1A1A1A] h-[88rpx] leading-[44rpx] textEllipsis file_name">
|
||||||
class="w-[228rpx] text-[32rpx] text-[#1A1A1A] h-[88rpx] leading-[44rpx] textEllipsis file_name"
|
|
||||||
>
|
|
||||||
{{ extra.name }}
|
{{ extra.name }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="data.uploadStatus === 2 || !data.uploadStatus" class="w-[95rpx]">
|
||||||
v-if="data.uploadStatus === 2 || !data.uploadStatus"
|
<tm-image :width="95" :height="95" :src="getFileTypeIMG.finishedImg"></tm-image>
|
||||||
class="w-[95rpx]"
|
|
||||||
>
|
|
||||||
<tm-image
|
|
||||||
:width="95"
|
|
||||||
:height="95"
|
|
||||||
:src="getFileTypeIMG.finishedImg"
|
|
||||||
></tm-image>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="data.uploadStatus === 1 || data.uploadStatus === 3" class="w-[95rpx]">
|
||||||
v-if="data.uploadStatus === 1 || data.uploadStatus === 3"
|
<tm-image :width="95" :height="95" :src="getFileTypeIMG.blankImg"></tm-image>
|
||||||
class="w-[95rpx]"
|
|
||||||
>
|
|
||||||
<tm-image
|
|
||||||
:width="95"
|
|
||||||
:height="95"
|
|
||||||
:src="getFileTypeIMG.blankImg"
|
|
||||||
></tm-image>
|
|
||||||
<wd-circle
|
<wd-circle
|
||||||
customClass="circleProgress"
|
customClass="circleProgress"
|
||||||
:modelValue="data.uploadCurrent"
|
:modelValue="data.uploadCurrent"
|
||||||
@ -143,9 +87,7 @@ const downloadAndOpenFile = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="divider mt-[28rpx]"></div>
|
<div class="divider mt-[28rpx]"></div>
|
||||||
<div class="text-[24rpx] text-[#747474] mt-[10rpx]">
|
<div class="text-[24rpx] text-[#747474] mt-[10rpx]">{{ fileFormatSize(extra.size) }}</div>
|
||||||
{{ fileFormatSize(extra.size) }}
|
|
||||||
</div>
|
|
||||||
<!-- <div class="main">
|
<!-- <div class="main">
|
||||||
<div class="ext">{{ getFileNameSuffix(extra.name) }}</div>
|
<div class="ext">{{ getFileNameSuffix(extra.name) }}</div>
|
||||||
<div class="file-box">
|
<div class="file-box">
|
||||||
@ -275,7 +217,7 @@ const downloadAndOpenFile = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.divider {
|
.divider {
|
||||||
background-color: #e7e7e7;
|
background-color: #E7E7E7;
|
||||||
height: 1rpx;
|
height: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,12 +379,6 @@ const handleClickItem = (item) => {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(props?.manageType === 'searchRecord'){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/search/searchByCondition/index?condition=member'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let itemList = dialogueParams.memberList
|
let itemList = dialogueParams.memberList
|
||||||
if (
|
if (
|
||||||
props?.manageType === 'admin' &&
|
props?.manageType === 'admin' &&
|
||||||
|
@ -96,9 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-records-search chat-settings-card">
|
<div class="chat-records-search chat-settings-card">
|
||||||
<div @click="toSearchPage">
|
|
||||||
<customInput :disabled="true"></customInput>
|
<customInput :disabled="true"></customInput>
|
||||||
</div>
|
|
||||||
<div class="record-search-types">
|
<div class="record-search-types">
|
||||||
<div
|
<div
|
||||||
class="record-search-types-each"
|
class="record-search-types-each"
|
||||||
@ -153,10 +151,8 @@
|
|||||||
@click="showConfirmPrompt(2)"
|
@click="showConfirmPrompt(2)"
|
||||||
class="clear-chat-record-btn-each"
|
class="clear-chat-record-btn-each"
|
||||||
v-if="
|
v-if="
|
||||||
groupParams?.groupInfo?.is_manager &&
|
groupParams?.groupInfo?.is_manager && dialogueParams.type === 2
|
||||||
dialogueParams.type === 2 &&
|
&& (groupParams?.groupInfo?.group_type === 1 || groupParams?.groupInfo?.group_type === 3)
|
||||||
(groupParams?.groupInfo?.group_type === 1 ||
|
|
||||||
groupParams?.groupInfo?.group_type === 3)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span class="text-[32rpx] font-regular">
|
<span class="text-[32rpx] font-regular">
|
||||||
@ -167,10 +163,8 @@
|
|||||||
@click="showConfirmPrompt(3)"
|
@click="showConfirmPrompt(3)"
|
||||||
class="clear-chat-record-btn-each"
|
class="clear-chat-record-btn-each"
|
||||||
v-if="
|
v-if="
|
||||||
groupParams?.groupInfo?.is_manager &&
|
groupParams?.groupInfo?.is_manager && dialogueParams.type === 2
|
||||||
dialogueParams.type === 2 &&
|
&& (groupParams?.groupInfo?.group_type === 1 || groupParams?.groupInfo?.group_type === 3)
|
||||||
(groupParams?.groupInfo?.group_type === 1 ||
|
|
||||||
groupParams?.groupInfo?.group_type === 3)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span class="text-[32rpx] font-regular">
|
<span class="text-[32rpx] font-regular">
|
||||||
@ -505,7 +499,10 @@ const toSearchByConditionPage = (flag) => {
|
|||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
'/pages/search/searchByCondition/index?condition=' + condition
|
'/pages/search/searchByCondition/index?condition=' +
|
||||||
|
condition +
|
||||||
|
'&receiver_id=' +
|
||||||
|
state.groupId,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -632,21 +629,6 @@ const inviteMembersInGroup = async (memberList) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击跳转到搜索页面
|
|
||||||
const toSearchPage = () => {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:
|
|
||||||
// '/pages/search/searchByCondition/index?condition=text'
|
|
||||||
// })
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/search/moreResult/moreResultDetail?talk_type=' +
|
|
||||||
dialogueParams.type +
|
|
||||||
'&receiver_id=' +
|
|
||||||
dialogueParams.receiver_id,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.outer-layer {
|
.outer-layer {
|
||||||
|
@ -1,39 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="emojiRoot">
|
<div class="emojiRoot">
|
||||||
<div
|
<div @click="()=>photoActionsSelect(0)" class="flex flex-col items-center">
|
||||||
@click="() => photoActionsSelect(0)"
|
<div class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center">
|
||||||
class="flex flex-col items-center"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center"
|
|
||||||
>
|
|
||||||
<tm-image :width="53" :height="44" :src="photoAlbum"></tm-image>
|
<tm-image :width="53" :height="44" :src="photoAlbum"></tm-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">照片</div>
|
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">照片</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div @click="()=>photoActionsSelect(1)" class="flex flex-col items-center">
|
||||||
@click="() => photoActionsSelect(1)"
|
<div class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center">
|
||||||
class="flex flex-col items-center"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center"
|
|
||||||
>
|
|
||||||
<tm-image :width="53" :height="44" :src="videoImg"></tm-image>
|
<tm-image :width="53" :height="44" :src="videoImg"></tm-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">视频</div>
|
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">视频</div>
|
||||||
</div>
|
</div>
|
||||||
<div @click="takePhoto" class="flex flex-col items-center">
|
<div @click="takePhoto" class="flex flex-col items-center">
|
||||||
<div
|
<div class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center">
|
||||||
class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center"
|
|
||||||
>
|
|
||||||
<tm-image :width="53" :height="44" :src="photoGraph"></tm-image>
|
<tm-image :width="53" :height="44" :src="photoGraph"></tm-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">拍摄</div>
|
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">拍摄</div>
|
||||||
</div>
|
</div>
|
||||||
<div @click="chooseFile" class="flex flex-col items-center">
|
<div @click="chooseFile" class="flex flex-col items-center">
|
||||||
<div
|
<div class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center">
|
||||||
class="w-[106rpx] h-[106rpx] bg-[#F9F9F9] rounded-[60rpx] flex-center"
|
|
||||||
>
|
|
||||||
<tm-image :width="53" :height="44" :src="folder"></tm-image>
|
<tm-image :width="53" :height="44" :src="folder"></tm-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">文件</div>
|
<div class="mt-[6rpx] text-[#666666] text-[24rpx]">文件</div>
|
||||||
@ -41,15 +27,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, defineProps, defineEmits } from 'vue'
|
import { ref, reactive, defineProps, defineEmits } from "vue"
|
||||||
import dayjs from 'dayjs'
|
import dayjs from "dayjs";
|
||||||
import { beautifyTime } from '@/utils/datetime'
|
import { beautifyTime } from '@/utils/datetime'
|
||||||
import {
|
import { useDialogueListStore, useDialogueStore, useUserStore,useUploadsStore } from '@/store'
|
||||||
useDialogueListStore,
|
|
||||||
useDialogueStore,
|
|
||||||
useUserStore,
|
|
||||||
useUploadsStore,
|
|
||||||
} from '@/store'
|
|
||||||
import { useSessionMenu } from '@/hooks'
|
import { useSessionMenu } from '@/hooks'
|
||||||
import photoAlbum from '@/static/image/chatList/photoAlbum.png'
|
import photoAlbum from '@/static/image/chatList/photoAlbum.png'
|
||||||
import photoGraph from '@/static/image/chatList/photoGraph.png'
|
import photoGraph from '@/static/image/chatList/photoGraph.png'
|
||||||
@ -62,34 +43,26 @@ const props = defineProps({
|
|||||||
sendUserInfo: {
|
sendUserInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {},
|
default: {},
|
||||||
required: true,
|
required: true
|
||||||
},
|
},
|
||||||
talkParams: {
|
talkParams: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {},
|
default: {},
|
||||||
required: true,
|
required: true
|
||||||
},
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
base64Url: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const uploadsStore = useUploadsStore()
|
const uploadsStore = useUploadsStore()
|
||||||
const {
|
const { addDialogueRecord, virtualList, updateUploadProgress } = useDialogueListStore()
|
||||||
addDialogueRecord,
|
|
||||||
virtualList,
|
|
||||||
updateUploadProgress,
|
|
||||||
} = useDialogueListStore()
|
|
||||||
const dialogueStore = useDialogueStore()
|
const dialogueStore = useDialogueStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const emit = defineEmits(['selectImg'])
|
const emit = defineEmits(['selectImg'])
|
||||||
|
|
||||||
const onProgressFn = (progress, id) => {
|
const onProgressFn = (progress, id) => {
|
||||||
console.log((progress.loaded / progress.total) * 100, 'progress')
|
console.log(progress.loaded / progress.total * 100, 'progress');
|
||||||
|
|
||||||
updateUploadProgress(id, (progress.loaded / progress.total) * 100)
|
updateUploadProgress(id, progress.loaded / progress.total * 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
const photoActionsSelect = (index) => {
|
const photoActionsSelect = (index) => {
|
||||||
@ -98,31 +71,28 @@ const photoActionsSelect = (index) => {
|
|||||||
sourceType: ['album'],
|
sourceType: ['album'],
|
||||||
count: 9,
|
count: 9,
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
console.log(res, 'res')
|
console.log(res,'res');
|
||||||
res.tempFiles.forEach(async (file) => {
|
res.tempFiles.forEach(async (file) => {
|
||||||
let data = await onUploadImageVideo(file, 'image')
|
let data = await onUploadImageVideo(file, 'image')
|
||||||
emit('selectImg', data, data.file_num)
|
emit('selectImg', data, data.file_num)
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
uni.chooseVideo({
|
uni.chooseVideo({
|
||||||
sourceType: ['album'],
|
sourceType: ['album'],
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
console.log(res, 'res')
|
console.log(res,'res');
|
||||||
let data = await onUploadImageVideo(
|
let data = await onUploadImageVideo(res.tempFile, 'video',res.tempFilePath)
|
||||||
res.tempFile,
|
|
||||||
'video',
|
|
||||||
res.tempFilePath,
|
|
||||||
)
|
|
||||||
emit('selectImg', data, data.file_num)
|
emit('selectImg', data, data.file_num)
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onUploadImageVideo = async (file, type = 'image',fileUrl) => {
|
const onUploadImageVideo = async (file, type = 'image',fileUrl) => {
|
||||||
console.log(file, 'file')
|
console.log(file, 'file');
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
if (type === 'image') {
|
if (type === 'image') {
|
||||||
let image = new Image()
|
let image = new Image()
|
||||||
@ -130,20 +100,20 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
image.onload = () => {
|
image.onload = () => {
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append('file', file)
|
form.append('file', file)
|
||||||
form.append('source', 'fonchain-chat')
|
form.append("source", "fonchain-chat");
|
||||||
form.append('urlParam', `width=${image.width}&height=${image.height}`)
|
form.append("urlParam", `width=${image.width}&height=${image.height}`);
|
||||||
let randomId = uniqueId()
|
let randomId = uniqueId()
|
||||||
let newItem = {
|
let newItem = {
|
||||||
avatar: userStore.avatar,
|
avatar: userStore.avatar,
|
||||||
created_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
created_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
extra: {
|
extra: {
|
||||||
height: image.height,
|
height: image.height,
|
||||||
name: '',
|
name: "",
|
||||||
size: 0,
|
size: 0,
|
||||||
url: image.src,
|
url: image.src,
|
||||||
width: image.width,
|
width: image.width
|
||||||
},
|
},
|
||||||
float: 'right',
|
float: "right",
|
||||||
isCheck: false,
|
isCheck: false,
|
||||||
is_mark: 0,
|
is_mark: 0,
|
||||||
is_read: 0,
|
is_read: 0,
|
||||||
@ -161,8 +131,7 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtualList.value.unshift(newItem)
|
virtualList.value.unshift(newItem)
|
||||||
uploadImg(form, (e) => onProgressFn(e, randomId)).then(
|
uploadImg(form, (e) => onProgressFn(e, randomId)).then(({ status, data, msg }) => {
|
||||||
({ status, data, msg }) => {
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
resolve({
|
resolve({
|
||||||
type: 'image',
|
type: 'image',
|
||||||
@ -176,18 +145,17 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
resolve('')
|
resolve('')
|
||||||
message.error(msg)
|
message.error(msg)
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.getVideoInfo({
|
uni.getVideoInfo({
|
||||||
src:fileUrl,
|
src:fileUrl,
|
||||||
success:(resp)=>{
|
success:(resp)=>{
|
||||||
console.log(resp)
|
console.log(resp);
|
||||||
form.append('file', file)
|
form.append('file', file)
|
||||||
form.append('source', 'fonchain-chat')
|
form.append("source", "fonchain-chat");
|
||||||
form.append('type', 'video')
|
form.append("type", "video");
|
||||||
form.append('urlParam', `width=${resp.width}&height=${resp.height}`)
|
form.append("urlParam", `width=${resp.width}&height=${resp.height}`);
|
||||||
let randomId = uniqueId()
|
let randomId = uniqueId()
|
||||||
let newItem = {
|
let newItem = {
|
||||||
avatar: userStore.avatar,
|
avatar: userStore.avatar,
|
||||||
@ -195,11 +163,11 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
extra: {
|
extra: {
|
||||||
duration: parseInt(resp.duration),
|
duration: parseInt(resp.duration),
|
||||||
height: resp.height,
|
height: resp.height,
|
||||||
name: '',
|
name: "",
|
||||||
url: fileUrl,
|
url: fileUrl,
|
||||||
width: resp.width,
|
width: resp.width
|
||||||
},
|
},
|
||||||
float: 'right',
|
float: "right",
|
||||||
isCheck: false,
|
isCheck: false,
|
||||||
is_mark: 0,
|
is_mark: 0,
|
||||||
is_read: 0,
|
is_read: 0,
|
||||||
@ -216,10 +184,9 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
uploadStatus: 1, // 1 上传中 2 上传成功 3 上传失败
|
uploadStatus: 1, // 1 上传中 2 上传成功 3 上传失败
|
||||||
}
|
}
|
||||||
virtualList.value.unshift(newItem)
|
virtualList.value.unshift(newItem)
|
||||||
uploadImg(form, (e) => onProgressFn(e, randomId)).then(
|
uploadImg(form, (e) => onProgressFn(e, randomId)).then(({ status, data, msg }) => {
|
||||||
({ status, data, msg }) => {
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
console.log(data)
|
console.log(data);
|
||||||
resolve({
|
resolve({
|
||||||
type: 'video',
|
type: 'video',
|
||||||
url: data.ori_url,
|
url: data.ori_url,
|
||||||
@ -232,9 +199,8 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
// resolve('')
|
// resolve('')
|
||||||
// message.error(msg)
|
// message.error(msg)
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
)
|
}
|
||||||
},
|
|
||||||
})
|
})
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
}
|
}
|
||||||
@ -243,59 +209,58 @@ const onUploadImageVideo = async (file, type = 'image', fileUrl) => {
|
|||||||
|
|
||||||
const base64ToFile = (base64) => {
|
const base64ToFile = (base64) => {
|
||||||
// base64转file
|
// base64转file
|
||||||
const [header, base64String] = base64.split(';base64,')
|
const [header, base64String] = base64.split(";base64,");
|
||||||
const imageType = header.split(':')[1]
|
const imageType = header.split(":")[1];
|
||||||
const byteCharacters = atob(base64String)
|
const byteCharacters = atob(base64String);
|
||||||
const byteArray = new Uint8Array(
|
const byteArray = new Uint8Array(
|
||||||
Array.from(byteCharacters, (char) => char.charCodeAt(0)),
|
Array.from(byteCharacters, (char) => char.charCodeAt(0))
|
||||||
)
|
);
|
||||||
return new File([new Blob([byteArray], { type: imageType })], 'example.png', {
|
return new File(
|
||||||
type: imageType,
|
[new Blob([byteArray], { type: imageType })],
|
||||||
})
|
"example.png",
|
||||||
|
{ type: imageType }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const choosePhoto = (filter = 'none', maximum = 9, multiple = true) => {
|
const choosePhoto = (filter = 'none', maximum = 9, multiple = true) => {
|
||||||
window.plus?.gallery.pick(
|
window.plus?.gallery.pick((res) => {
|
||||||
(res) => {
|
console.log(res);
|
||||||
console.log(res)
|
|
||||||
res.files.reverse()
|
res.files.reverse()
|
||||||
res.files.forEach(async (filePath) => {
|
res.files.forEach(async (filePath) => {
|
||||||
const suffix = filePath.split('.').pop()?.toLowerCase() || ''
|
const suffix = filePath.split('.').pop()?.toLowerCase() || ''
|
||||||
if (['jpg', 'png'].includes(suffix)) {
|
if (['jpg', 'png'].includes(suffix)) {
|
||||||
console.log('进入图片')
|
console.log("进入图片")
|
||||||
window.plus?.io?.resolveLocalFileSystemURL(
|
window.plus?.io?.resolveLocalFileSystemURL(filePath, async (entry) => {
|
||||||
filePath,
|
|
||||||
async (entry) => {
|
|
||||||
entry.file((file) => {
|
entry.file((file) => {
|
||||||
const fileReader = new plus.io.FileReader()
|
const fileReader = new plus.io.FileReader();
|
||||||
fileReader.readAsDataURL(file)
|
fileReader.readAsDataURL(file);
|
||||||
fileReader.onloadend = async (e) => {
|
fileReader.onloadend = async (e) => {
|
||||||
const base64Url = e.target.result
|
const base64Url = e.target.result;
|
||||||
const fileObj = base64ToFile(base64Url)
|
const fileObj = base64ToFile(base64Url);
|
||||||
let data = await onUploadImageVideo(fileObj, 'image')
|
let data = await onUploadImageVideo(fileObj, 'image')
|
||||||
emit('selectImg', data)
|
emit('selectImg', data)
|
||||||
}
|
};
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
console.log(err)
|
console.log(err);
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (['mp4', 'flv'].includes(suffix)) {
|
if (['mp4', 'flv'].includes(suffix)) {
|
||||||
console.log(filePath, '进入视频')
|
console.log(filePath,"进入视频")
|
||||||
// const localUrl = plus.io.convertLocalFileSystemURL(filePath)
|
// const localUrl = plus.io.convertLocalFileSystemURL(filePath)
|
||||||
// console.log(localUrl);
|
// console.log(localUrl);
|
||||||
|
|
||||||
plus.io.getVideoInfo({
|
plus.io.getVideoInfo({
|
||||||
filePath:filePath,
|
filePath:filePath,
|
||||||
success:(event)=>{
|
success:(event)=>{
|
||||||
console.log(event)
|
console.log(event);
|
||||||
},
|
},
|
||||||
fail:(err)=>{
|
fail:(err)=>{
|
||||||
console.log(err)
|
console.log(err);
|
||||||
},
|
}
|
||||||
})
|
});
|
||||||
// window.plus?.io?.resolveLocalFileSystemURL(localUrl, async (entry) => {
|
// window.plus?.io?.resolveLocalFileSystemURL(localUrl, async (entry) => {
|
||||||
// entry.file((file) => {
|
// entry.file((file) => {
|
||||||
// console.log(file,'file');
|
// console.log(file,'file');
|
||||||
@ -315,73 +280,22 @@ const choosePhoto = (filter = 'none', maximum = 9, multiple = true) => {
|
|||||||
// )
|
// )
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
}, (err) => {
|
||||||
(err) => {
|
console.log(err);
|
||||||
console.log(err)
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filter: filter,
|
filter: filter,
|
||||||
maximum: maximum,
|
maximum: maximum,
|
||||||
multiple: multiple,
|
multiple: multiple,
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const takePhoto = () => {
|
const takePhoto = () => {
|
||||||
if (typeof plus !== 'undefined') {
|
|
||||||
getCamera()
|
|
||||||
} else {
|
|
||||||
document.addEventListener('plusready', () => {
|
|
||||||
getCamera()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getCamera = () => {
|
|
||||||
const cmr = plus.camera.getCamera()
|
|
||||||
cmr.captureImage(
|
|
||||||
(p) => {
|
|
||||||
plus.io.resolveLocalFileSystemURL(
|
|
||||||
p,
|
|
||||||
(entry) => {
|
|
||||||
compressAndShowImage(entry.toLocalURL(), entry.name)
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
console.log(err)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
},
|
|
||||||
() => {},
|
|
||||||
{ index: '2' },
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const compressAndShowImage = (url, filename) => {
|
|
||||||
const dst = `_doc/upload/${filename}`
|
|
||||||
plus.zip.compressImage(
|
|
||||||
{ src: url, dst, quality: 10, overwrite: true },
|
|
||||||
(zip) => displayImage(zip.target),
|
|
||||||
(err) => {
|
|
||||||
console.log(err)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const displayImage = (url) => {
|
|
||||||
plus.io.resolveLocalFileSystemURL(url, (entry) => {
|
|
||||||
entry.file((file) => {
|
|
||||||
const fileReader = new plus.io.FileReader()
|
|
||||||
fileReader.readAsDataURL(file)
|
|
||||||
fileReader.onloadend = async (e) => {
|
|
||||||
state.base64Url = e.target.result
|
|
||||||
const imageFile = base64ToFile(state.base64Url)
|
|
||||||
let data = await onUploadImageVideo(imageFile, 'image')
|
|
||||||
emit('selectImg', data, data.file_num)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const chooseFile = () => {
|
const chooseFile = () => {
|
||||||
uni.chooseFile({
|
uni.chooseFile({
|
||||||
count: 1,
|
count: 1,
|
||||||
@ -397,7 +311,7 @@ const chooseFile = () => {
|
|||||||
size: res.tempFiles[0].size,
|
size: res.tempFiles[0].size,
|
||||||
path: res.tempFilePaths[0],
|
path: res.tempFilePaths[0],
|
||||||
},
|
},
|
||||||
float: 'right',
|
float: "right",
|
||||||
isCheck: false,
|
isCheck: false,
|
||||||
is_mark: 0,
|
is_mark: 0,
|
||||||
is_read: 0,
|
is_read: 0,
|
||||||
@ -415,9 +329,12 @@ const chooseFile = () => {
|
|||||||
}
|
}
|
||||||
virtualList.value.unshift(newItem)
|
virtualList.value.unshift(newItem)
|
||||||
uploadsStore.initUploadFile(res.tempFiles[0], props.talkParams,randomId)
|
uploadsStore.initUploadFile(res.tempFiles[0], props.talkParams,randomId)
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.emojiRoot {
|
.emojiRoot {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -136,7 +136,7 @@ const cellClick = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/dialog/index?sessionId=${props.data.id}`,
|
url: `/pages/dialog/index?sessionId=${props.data.id}&talkType=${props.data.talk_type}&receiverId=${props.data.receiver_id}&indexName=${props.data.index_name}`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ onLoad((options) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/dialog/index?sessionId=${openSession.id}`,
|
url: `/pages/dialog/index?sessionId=${openSession.id}&talkType=${openSession.talk_type}&receiverId=${openSession.receiver_id}&indexName=${openSession.index_name}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -99,26 +99,11 @@ import { beautifyTime } from '@/utils/datetime'
|
|||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
searchItem: Object | Number,
|
searchItem: Object | Number,
|
||||||
searchResultKey: {
|
searchResultKey: String,
|
||||||
type: String,
|
searchText: String, //搜索内容
|
||||||
default: '',
|
searchRecordDetail: Boolean, //是否是搜索聊天记录详情
|
||||||
},
|
pointerIconSrc: String, //箭头图标
|
||||||
searchText: {
|
conditionType: Number, //搜索类型
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
}, //搜索内容
|
|
||||||
searchRecordDetail: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
}, //是否是搜索聊天记录详情
|
|
||||||
pointerIconSrc: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
}, //箭头图标
|
|
||||||
conditionType: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
}, //搜索类型
|
|
||||||
})
|
})
|
||||||
// 映射表-查找对应结构下的属性名
|
// 映射表-查找对应结构下的属性名
|
||||||
const keyMapping = {
|
const keyMapping = {
|
||||||
@ -208,8 +193,10 @@ const imgText = computed(() => {
|
|||||||
})
|
})
|
||||||
// 映射表-根据groupType设置对应值
|
// 映射表-根据groupType设置对应值
|
||||||
const groupTypeMapping = {
|
const groupTypeMapping = {
|
||||||
0: {},
|
0: {
|
||||||
1: {},
|
},
|
||||||
|
1: {
|
||||||
|
},
|
||||||
2: {
|
2: {
|
||||||
result_type: t('index.mine.department'),
|
result_type: t('index.mine.department'),
|
||||||
result_type_color: '#377EC6',
|
result_type_color: '#377EC6',
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
'font-size': '28rpx',
|
'font-size': '28rpx',
|
||||||
'font-weight': 400,
|
'font-weight': 400,
|
||||||
}"
|
}"
|
||||||
:refresher-enabled="false"
|
|
||||||
>
|
>
|
||||||
<template #top>
|
<template #top>
|
||||||
<div class="searchRoot">
|
<div class="searchRoot">
|
||||||
@ -140,37 +139,14 @@ const state = reactive({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
searchResultPageSize: {
|
searchResultPageSize: Number, //搜索结果每页数据量
|
||||||
type: Number,
|
listLimit: Boolean, //是否限制列表内数据数量
|
||||||
default: 0,
|
apiParams: String, //请求参数
|
||||||
}, //搜索结果每页数据量
|
|
||||||
listLimit: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
}, //是否限制列表内数据数量
|
|
||||||
apiParams: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
}, //请求参数
|
|
||||||
apiRequest: Function, //请求
|
apiRequest: Function, //请求
|
||||||
searchText: {
|
searchText: String, //搜索内容
|
||||||
type: String,
|
isPagination: Boolean, //是否分页
|
||||||
default: '',
|
searchRecordDetail: Boolean, //是否是搜索聊天记录的详情
|
||||||
}, //搜索内容
|
first_talk_record_infos: Object, //接受者信息
|
||||||
isPagination: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
}, //是否分页
|
|
||||||
searchRecordDetail: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
}, //是否是搜索聊天记录的详情
|
|
||||||
first_talk_record_infos: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
}, //接受者信息
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
@ -300,12 +276,8 @@ const queryAllSearch = (pageNum, searchResultPageSize) => {
|
|||||||
)
|
)
|
||||||
let total = data.count
|
let total = data.count
|
||||||
if (props.searchRecordDetail) {
|
if (props.searchRecordDetail) {
|
||||||
if(state?.first_talk_record_infos?.talk_type === 1){
|
|
||||||
total = data.user_record_count
|
|
||||||
} else if (state?.first_talk_record_infos?.talk_type === 2){
|
|
||||||
total = data.group_record_count
|
total = data.group_record_count
|
||||||
}
|
}
|
||||||
}
|
|
||||||
zPaging.value?.completeByTotal([data], total)
|
zPaging.value?.completeByTotal([data], total)
|
||||||
} else {
|
} else {
|
||||||
zPaging.value?.complete([data])
|
zPaging.value?.complete([data])
|
||||||
@ -394,12 +366,6 @@ const getHasMoreResult = (searchResultKey) => {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'general_infos':
|
case 'general_infos':
|
||||||
if (
|
|
||||||
state.searchResult['record_count'] &&
|
|
||||||
state.searchResult['record_count'] > 3
|
|
||||||
) {
|
|
||||||
has_more_result = t('has_more') + t('chat.type.record')
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@ -413,40 +379,12 @@ const toMoreResultPage = (searchResultKey) => {
|
|||||||
|
|
||||||
//点击了搜索结果项
|
//点击了搜索结果项
|
||||||
const clickSearchItem = (searchResultKey, searchItem) => {
|
const clickSearchItem = (searchResultKey, searchItem) => {
|
||||||
console.log(searchResultKey, searchItem)
|
|
||||||
let talk_type = searchItem.talk_type
|
|
||||||
let receiver_id = searchItem.receiver_id
|
|
||||||
if (searchResultKey === 'user_infos') {
|
|
||||||
talk_type = 1
|
|
||||||
receiver_id = searchItem.id
|
|
||||||
} else if (searchResultKey === 'combinedGroup') {
|
|
||||||
talk_type = searchItem.type || 2
|
|
||||||
receiver_id = searchItem.group_id || searchItem.id
|
|
||||||
} else if (searchResultKey === 'general_infos') {
|
|
||||||
if (searchItem.talk_type === 1) {
|
|
||||||
if (searchItem.user_id === state.uid) {
|
|
||||||
//发送人是自己,接收人不需要变
|
|
||||||
}
|
|
||||||
if (searchItem.receiver_id === state.uid) {
|
|
||||||
//接收人是自己,这里需要变成对方
|
|
||||||
let temp_id = searchItem.receiver_id
|
|
||||||
let temp_name = searchItem.receiver_name
|
|
||||||
let temp_avatar = searchItem.receiver_avatar
|
|
||||||
searchItem.receiver_id = searchItem.user_id
|
|
||||||
searchItem.receiver_name = searchItem.user_name
|
|
||||||
searchItem.receiver_avatar = searchItem.user_avatar
|
|
||||||
searchItem.user_id = temp_id
|
|
||||||
searchItem.user_name = temp_name
|
|
||||||
searchItem.user_avatar = temp_avatar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
emits(
|
emits(
|
||||||
'clickSearchItem',
|
'clickSearchItem',
|
||||||
state.searchText,
|
state.searchText,
|
||||||
searchResultKey,
|
searchResultKey,
|
||||||
talk_type,
|
searchItem.talk_type,
|
||||||
receiver_id,
|
searchItem.receiver_id,
|
||||||
encodeURIComponent(JSON.stringify(searchItem)),
|
encodeURIComponent(JSON.stringify(searchItem)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import searchList from './components/searchList.vue'
|
import searchList from './components/searchList.vue'
|
||||||
import { ServeSeachQueryAll, ServeGetSessionId } from '@/api/search/index'
|
import { ServeSeachQueryAll } from '@/api/search/index'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { handleSetWebviewStyle } from '@/utils/common'
|
import { handleSetWebviewStyle } from '@/utils/common'
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ const toMoreResultPage = (searchResultKey, searchText) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//点击了搜索结果项
|
//点击了搜索结果项
|
||||||
const clickSearchItem = async (
|
const clickSearchItem = (
|
||||||
searchText,
|
searchText,
|
||||||
searchResultKey,
|
searchResultKey,
|
||||||
talk_type,
|
talk_type,
|
||||||
@ -47,25 +47,17 @@ const clickSearchItem = async (
|
|||||||
console.log(searchResultKey)
|
console.log(searchResultKey)
|
||||||
const result = JSON.parse(decodeURIComponent(res))
|
const result = JSON.parse(decodeURIComponent(res))
|
||||||
console.log(result)
|
console.log(result)
|
||||||
console.log(talk_type, receiver_id)
|
|
||||||
const sessionId = await getSessionId(talk_type, receiver_id)
|
|
||||||
if (searchResultKey === 'user_infos') {
|
if (searchResultKey === 'user_infos') {
|
||||||
dialogueStore.setDialogue({
|
|
||||||
name: result.nickname,
|
|
||||||
talk_type: 1,
|
|
||||||
receiver_id: receiver_id,
|
|
||||||
})
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/dialog/index?sessionId=' + sessionId,
|
|
||||||
})
|
|
||||||
} else if (searchResultKey === 'combinedGroup') {
|
} else if (searchResultKey === 'combinedGroup') {
|
||||||
dialogueStore.setDialogue({
|
dialogueStore.setDialogue({
|
||||||
name: result.name || result.group_name,
|
name: result.name || result.group_name,
|
||||||
talk_type: result.type || 2,
|
talk_type: result.type || 2,
|
||||||
receiver_id: result.group_id || result.id,
|
receiver_id: result.id || result.group_id,
|
||||||
})
|
})
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/dialog/index?sessionId=' + sessionId
|
url: '/pages/dialog/index',
|
||||||
})
|
})
|
||||||
} else if (searchResultKey === 'general_infos') {
|
} else if (searchResultKey === 'general_infos') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -79,25 +71,5 @@ const clickSearchItem = async (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取会话Id
|
|
||||||
const getSessionId = (talk_type, receiver_id) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let params = {
|
|
||||||
talkType: talk_type,
|
|
||||||
receiverId: receiver_id,
|
|
||||||
}
|
|
||||||
const resp = ServeGetSessionId(params)
|
|
||||||
console.log(resp)
|
|
||||||
resp.then(({ code, data }) => {
|
|
||||||
console.log(data)
|
|
||||||
if (code == 200) {
|
|
||||||
resolve(data?.sessionId)
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
resp.catch(() => {})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
ServeQueryUser,
|
ServeQueryUser,
|
||||||
ServeQueryGroup,
|
ServeQueryGroup,
|
||||||
ServeTalkRecord,
|
ServeTalkRecord,
|
||||||
ServeGetSessionId,
|
|
||||||
} from '@/api/search/index'
|
} from '@/api/search/index'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
|
|
||||||
@ -31,9 +30,9 @@ const dialogueStore = useDialogueStore()
|
|||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
apiRequest: Function,
|
apiRequest: Function,
|
||||||
apiParams: '',
|
apiParams: String,
|
||||||
searchText: '',
|
searchText: String,
|
||||||
searchResultKey: '',
|
searchResultKey: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
@ -91,7 +90,7 @@ const lastIdChange = (last_id, last_group_id, last_member_id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//点击了搜索结果项
|
//点击了搜索结果项
|
||||||
const clickSearchItem = async (
|
const clickSearchItem = (
|
||||||
searchText,
|
searchText,
|
||||||
searchResultKey,
|
searchResultKey,
|
||||||
talk_type,
|
talk_type,
|
||||||
@ -101,57 +100,21 @@ const clickSearchItem = async (
|
|||||||
console.log(state.searchResultKey)
|
console.log(state.searchResultKey)
|
||||||
const result = JSON.parse(decodeURIComponent(res))
|
const result = JSON.parse(decodeURIComponent(res))
|
||||||
console.log(result)
|
console.log(result)
|
||||||
console.log(talk_type, receiver_id)
|
|
||||||
const sessionId = await getSessionId(talk_type, receiver_id)
|
|
||||||
if (state.searchResultKey === 'user_infos') {
|
if (state.searchResultKey === 'user_infos') {
|
||||||
dialogueStore.setDialogue({
|
|
||||||
name: result.nickname,
|
|
||||||
talk_type: 1,
|
|
||||||
receiver_id: receiver_id,
|
|
||||||
})
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/dialog/index?sessionId=' + sessionId,
|
|
||||||
})
|
|
||||||
} else if (state.searchResultKey === 'combinedGroup') {
|
} else if (state.searchResultKey === 'combinedGroup') {
|
||||||
dialogueStore.setDialogue({
|
dialogueStore.setDialogue({
|
||||||
name: result.name || result.group_name,
|
name: result.name || result.group_name,
|
||||||
talk_type: result.type || 2,
|
talk_type: result.type || 2,
|
||||||
receiver_id: result.group_id || result.id,
|
receiver_id: result.id || result.group_id,
|
||||||
})
|
})
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/dialog/index?sessionId=' + sessionId,
|
url: '/pages/dialog/index',
|
||||||
})
|
})
|
||||||
} else if (state.searchResultKey === 'general_infos') {
|
} else if (state.searchResultKey === 'general_infos') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url: '/pages/search/moreResult/moreResultDetail?searchText=' + searchText,
|
||||||
'/pages/search/moreResult/moreResultDetail?searchText=' +
|
|
||||||
searchText +
|
|
||||||
'&talk_type=' +
|
|
||||||
talk_type +
|
|
||||||
'&receiver_id=' +
|
|
||||||
receiver_id,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取会话Id
|
|
||||||
const getSessionId = (talk_type, receiver_id) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let params = {
|
|
||||||
talkType: talk_type,
|
|
||||||
receiverId: receiver_id,
|
|
||||||
}
|
|
||||||
const resp = ServeGetSessionId(params)
|
|
||||||
console.log(resp)
|
|
||||||
resp.then(({ code, data }) => {
|
|
||||||
console.log(data)
|
|
||||||
if (code == 200) {
|
|
||||||
resolve(data?.sessionId)
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
resp.catch(() => {})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
@ -27,8 +27,8 @@ const dialogueStore = useDialogueStore()
|
|||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
apiParams: '',
|
apiParams: String,
|
||||||
searchText: '',
|
searchText: String,
|
||||||
uid: computed(() => userStore.uid), //当前用户id
|
uid: computed(() => userStore.uid), //当前用户id
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -64,8 +64,7 @@
|
|||||||
v-if="
|
v-if="
|
||||||
state.condition === 'imgAndVideo' ||
|
state.condition === 'imgAndVideo' ||
|
||||||
state.condition === 'file' ||
|
state.condition === 'file' ||
|
||||||
state.condition === 'link' ||
|
state.condition === 'link'
|
||||||
state.condition === 'member'
|
|
||||||
"
|
"
|
||||||
:style="{
|
:style="{
|
||||||
padding: state.condition === 'imgAndVideo' ? '0 27rpx' : '',
|
padding: state.condition === 'imgAndVideo' ? '0 27rpx' : '',
|
||||||
@ -73,11 +72,7 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="search-by-condition-input"
|
class="search-by-condition-input"
|
||||||
v-if="
|
v-if="state.condition === 'file' || state.condition === 'link'"
|
||||||
state.condition === 'file' ||
|
|
||||||
state.condition === 'link' ||
|
|
||||||
state.condition === 'member'
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<customInput
|
<customInput
|
||||||
:searchText="state.searchText"
|
:searchText="state.searchText"
|
||||||
@ -178,7 +173,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="condition-each-result-attachments"
|
class="condition-each-result-attachments"
|
||||||
@click="previewPDF(item)"
|
|
||||||
v-if="
|
v-if="
|
||||||
state.condition === 'file' || state.condition === 'link'
|
state.condition === 'file' || state.condition === 'link'
|
||||||
"
|
"
|
||||||
@ -261,7 +255,7 @@ import useZPaging from '@/uni_modules/z-paging/components/z-paging/js/hooks/useZ
|
|||||||
import { parseTime } from '@/utils/datetime'
|
import { parseTime } from '@/utils/datetime'
|
||||||
import { onMounted, reactive, computed, ref } from 'vue'
|
import { onMounted, reactive, computed, ref } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { ServeTalkDate, ServeGetSessionId } from '@/api/search/index'
|
import { ServeTalkDate } from '@/api/search/index'
|
||||||
import { ServeFindTalkRecords } from '@/api/chat/index'
|
import { ServeFindTalkRecords } from '@/api/chat/index'
|
||||||
import { useDialogueStore } from '@/store'
|
import { useDialogueStore } from '@/store'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
@ -279,6 +273,7 @@ const dialogueParams = reactive({
|
|||||||
let nowDay = new Date().setHours(0, 0, 0, 0)
|
let nowDay = new Date().setHours(0, 0, 0, 0)
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
receiver_id: '', //目标人id
|
||||||
pageTitle: '', //页面标题
|
pageTitle: '', //页面标题
|
||||||
dateStyle: [], //日期样式
|
dateStyle: [], //日期样式
|
||||||
nowDate: new Date(nowDay), //当前时间
|
nowDate: new Date(nowDay), //当前时间
|
||||||
@ -294,16 +289,16 @@ const state = reactive({
|
|||||||
searchResultList: [], //搜索结果列表
|
searchResultList: [], //搜索结果列表
|
||||||
cursor: 0, //上次查询的游标
|
cursor: 0, //上次查询的游标
|
||||||
msg_type: 0, //查询的消息类型
|
msg_type: 0, //查询的消息类型
|
||||||
group_member_id: 0, //群成员id
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
console.log(options)
|
console.log(options)
|
||||||
|
if (options.receiver_id) {
|
||||||
|
state.receiver_id = Number(options.receiver_id)
|
||||||
|
}
|
||||||
if (options.condition) {
|
if (options.condition) {
|
||||||
state.condition = options.condition
|
state.condition = options.condition
|
||||||
if (options.condition === 'member') {
|
if (options.condition === 'date') {
|
||||||
// queryAllSearch()
|
|
||||||
} else if (options.condition === 'date') {
|
|
||||||
state.showPageTitle = true
|
state.showPageTitle = true
|
||||||
state.pageTitle = t('search.condition.date')
|
state.pageTitle = t('search.condition.date')
|
||||||
ServeQueryTalkDate(parseTime(state.nowDate, '{y}{m}'))
|
ServeQueryTalkDate(parseTime(state.nowDate, '{y}{m}'))
|
||||||
@ -357,7 +352,7 @@ const ServeQueryTalkDate = (month) => {
|
|||||||
let params = {
|
let params = {
|
||||||
month: month,
|
month: month,
|
||||||
talk_type: dialogueParams.talk_type, //1私聊2群聊
|
talk_type: dialogueParams.talk_type, //1私聊2群聊
|
||||||
receiver_id: dialogueParams.receiver_id, //目标人id
|
receiver_id: state.receiver_id, //目标人id
|
||||||
}
|
}
|
||||||
const resp = ServeTalkDate(params)
|
const resp = ServeTalkDate(params)
|
||||||
console.log(resp)
|
console.log(resp)
|
||||||
@ -392,7 +387,7 @@ const ServeQueryTalkDate = (month) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//点击选择日期
|
//点击选择日期
|
||||||
const selectDate = async (e) => {
|
const selectDate = (e) => {
|
||||||
if (e == parseTime(state.nowDate, '{y}/{m}/{d}')) {
|
if (e == parseTime(state.nowDate, '{y}/{m}/{d}')) {
|
||||||
console.log('==今日')
|
console.log('==今日')
|
||||||
state.dateStyle = [
|
state.dateStyle = [
|
||||||
@ -418,37 +413,6 @@ const selectDate = async (e) => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
const sessionId = await getSessionId(
|
|
||||||
dialogueParams.talk_type,
|
|
||||||
dialogueParams.receiver_id,
|
|
||||||
)
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/dialog/index?sessionId=' +
|
|
||||||
sessionId +
|
|
||||||
'&recordDate=' +
|
|
||||||
parseTime(e, '{y}-{m}-{d}'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取会话Id
|
|
||||||
const getSessionId = (talk_type, receiver_id) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let params = {
|
|
||||||
talkType: talk_type,
|
|
||||||
receiverId: receiver_id,
|
|
||||||
}
|
|
||||||
const resp = ServeGetSessionId(params)
|
|
||||||
console.log(resp)
|
|
||||||
resp.then(({ code, data }) => {
|
|
||||||
console.log(data)
|
|
||||||
if (code == 200) {
|
|
||||||
resolve(data?.sessionId)
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
resp.catch(() => {})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击确认选择月份
|
//点击确认选择月份
|
||||||
@ -502,7 +466,7 @@ const queryAllSearch = () => {
|
|||||||
direction: 'up', //down向下查最新,up向上查老数据
|
direction: 'up', //down向下查最新,up向上查老数据
|
||||||
start_time: '',
|
start_time: '',
|
||||||
end_time: '',
|
end_time: '',
|
||||||
group_member_user_id: state.group_member_id, //群成员id,当查询群历史消息的时候,需要指定群成员的时候送
|
group_member_user_id: 0, //群成员id,当查询群历史消息的时候,需要指定群成员的时候送
|
||||||
file_name: state.msg_type === 6 ? state.searchText : '',
|
file_name: state.msg_type === 6 ? state.searchText : '',
|
||||||
}
|
}
|
||||||
console.log(params)
|
console.log(params)
|
||||||
@ -600,43 +564,6 @@ const fileTypeAvatar = (fileType) => {
|
|||||||
}
|
}
|
||||||
return file_type_avatar
|
return file_type_avatar
|
||||||
}
|
}
|
||||||
|
|
||||||
const previewPDF = (item) => {
|
|
||||||
console.log(item)
|
|
||||||
if (typeof plus !== 'undefined') {
|
|
||||||
downloadAndOpenFile(item)
|
|
||||||
} else {
|
|
||||||
document.addEventListener('plusready', () => {
|
|
||||||
downloadAndOpenFile(item)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const downloadAndOpenFile = (item) => {
|
|
||||||
uni.showLoading({ title: '加载中...', mask: true })
|
|
||||||
const downloadUrl = item?.extra?.path
|
|
||||||
const options = {
|
|
||||||
filename: '_doc/downloads/', // 保存路径
|
|
||||||
}
|
|
||||||
const dtask = plus.downloader.createDownload(downloadUrl, options, function (
|
|
||||||
d,
|
|
||||||
status,
|
|
||||||
) {
|
|
||||||
if (status === 200) {
|
|
||||||
uni.hideLoading()
|
|
||||||
const filePath = d.filename
|
|
||||||
plus.runtime.openFile(
|
|
||||||
filePath,
|
|
||||||
{},
|
|
||||||
function () {},
|
|
||||||
function (error) {},
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
dtask.start()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.search-by-date {
|
.search-by-date {
|
||||||
@ -743,7 +670,6 @@ body::v-deep .round-3 {
|
|||||||
span {
|
span {
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
color: $theme-text;
|
color: $theme-text;
|
||||||
word-break: break-all;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.attachment-sub-info {
|
.attachment-sub-info {
|
||||||
|
Loading…
Reference in New Issue
Block a user