Update message-types.vue
This commit is contained in:
parent
3b76d28edc
commit
902491bc1a
@ -77,8 +77,12 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
|
import api from "@/utils/api.js";
|
||||||
import { getParsedCustomMessage } from "@/utils/chat-utils.js";
|
import { getParsedCustomMessage } from "@/utils/chat-utils.js";
|
||||||
import { toast } from '@/utils/widget'
|
import { toast } from '@/utils/widget'
|
||||||
|
import useAccountStore from "@/store/account.js";
|
||||||
|
|
||||||
// import MessageCard from "./message-card/message-card.vue";
|
// import MessageCard from "./message-card/message-card.vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -93,6 +97,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
defineEmits(["playVoice", "previewImage", "viewDetail"]);
|
defineEmits(["playVoice", "previewImage", "viewDetail"]);
|
||||||
|
const { account, openid } = storeToRefs(useAccountStore());
|
||||||
|
|
||||||
// 计算当前语音是否正在播放
|
// 计算当前语音是否正在播放
|
||||||
const isPlaying = computed(() => {
|
const isPlaying = computed(() => {
|
||||||
@ -209,6 +214,9 @@ const handleArticleClick = (message) => {
|
|||||||
uni.openChannelsActivity({
|
uni.openChannelsActivity({
|
||||||
finderUserName: payloadData.value.wechatChannels.finderUserName,
|
finderUserName: payloadData.value.wechatChannels.finderUserName,
|
||||||
feedId: payloadData.value.wechatChannels.feedId,
|
feedId: payloadData.value.wechatChannels.feedId,
|
||||||
|
success: () => {
|
||||||
|
markArticleRead(payloadData.value.sendId, payloadData.value.articleId);
|
||||||
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
const errMsg = err.errMsg || '';
|
const errMsg = err.errMsg || '';
|
||||||
if (/cancel/i.test(errMsg)) {
|
if (/cancel/i.test(errMsg)) {
|
||||||
@ -273,6 +281,20 @@ function isWechatChannels() {
|
|||||||
const wechatChannels = payloadData.value.wechatChannels || {};
|
const wechatChannels = payloadData.value.wechatChannels || {};
|
||||||
return typeof wechatChannels.finderUserName === 'string' && wechatChannels.finderUserName.trim() && typeof wechatChannels.feedId === 'string' && wechatChannels.feedId.trim();
|
return typeof wechatChannels.finderUserName === 'string' && wechatChannels.finderUserName.trim() && typeof wechatChannels.feedId === 'string' && wechatChannels.feedId.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function markArticleRead(sendId, articleId) {
|
||||||
|
const unionid = account.value?.unionid;
|
||||||
|
if (!unionid || !articleId) return;
|
||||||
|
try {
|
||||||
|
const { success } = await api(
|
||||||
|
"addArticleReadRecord",
|
||||||
|
{ corpId: props.corpId, articleId, unionid, sendId },
|
||||||
|
false
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.warn("markArticleRead failed:", err?.message || err);
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user