cyl/master-0822
wangxia 6 months ago
parent 67dd3b0e62
commit 051453f94c

@ -20,7 +20,7 @@
</view>
<view v-if="speed > 0" class="link">
<block class="" v-for="(item, index) in jobArray" :key="index">
<view class="item g_position_rela g_mb_10 g_ml_12 g_mr_12 g_bg_f g_radius_8 g_border_e_b" :class="from == 'share' ? 'g_pl_32' : ''">
<view class="item g_position_rela g_mb_10 g_ml_12 g_mr_12 g_bg_f g_radius_8 g_border_e_b" :class="from == 'share' || from == 'chat' ? 'g_pl_32' : ''">
<view class="g_p_10 g_position_rela" style="" @click="handleCard(item, index)">
<i class="iconfont icon-yitingzhao" v-if="item.recruitment == 2 && from != 'mine'" style="position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); color: #ff4d4f; font-size: 80px; z-index: 1"></i>
<view class="m-top g_flex_row_between">
@ -130,6 +130,9 @@
<view class="checkBox" hover-class="none" v-if="from == 'share'" @click.stop="checkJob(item)">
<checkbox class="biggerSize" style="transform: scale(0.8, 0.8)" color="g_c_main" :checked="item.checked" :value="item.checked"></checkbox>
</view>
<view class="checkBox" hover-class="none" v-if="from == 'chat'" @click.stop="sendJob(item)">
选择
</view>
</view>
</block>
<view class="g_mt_32 g_pb_32 g_c_9 g_pl_12 g_text_c" v-if="isShowLoginBtn && jobArray.length > 0" hover-class="none">
@ -192,6 +195,7 @@ export default {
//
computed: {
status() {
console.log("this.query", this.query);
if (this.query.isFinish >= 0 && this.query.isFinish < this.query.size) {
return "nomore";
} else {
@ -416,6 +420,10 @@ export default {
},
checkJob(_item) {
this.$emit("checkJob", _item);
},
sendJob(_item){
this.$emit("sendJob", _item);
},
submitApply(e) {
let that = this;

@ -2,6 +2,7 @@ $filter_bg_color: #e3ecfd;
$main_bg_color: #1890ff;
$page_bg_color: #ededed;
$main_color: #1890ff;
@import '../../static/css/base.scss';
image {
vertical-align: top;
}

@ -1,8 +1,6 @@
<template>
<!-- 处理滚动穿透 此为官方推荐做法 https://uniapp.dcloud.net.cn/component/uniui/uni-popup.html#%E4%BB%8B%E7%BB%8D -->
<page-meta
:page-style="'overflow:' + (moveThrough ? 'hidden' : 'visible')"
></page-meta>
<page-meta :page-style="'overflow:' + (moveThrough ? 'hidden' : 'visible')"></page-meta>
<div :class="isH5 ? 'msg-page-wrapper-h5' : 'msg-page-wrapper'">
<NavBar :title="title" :showLeft="true" v-if="false">
<template v-slot:left>
@ -15,188 +13,180 @@
<NetworkAlert />
</div>
<div :class="isH5 ? 'msg-wrapper-h5' : 'msg-wrapper'">
<MessageList
:conversationType="conversationType"
:to="to"
:msgs="msgs"
:loading-more="loadingMore"
:no-more="noMore"
:reply-msgs-map="replyMsgsMap"
/>
<MessageList :conversationType="conversationType" :to="to" :msgs="msgs" :loading-more="loadingMore" :no-more="noMore" :reply-msgs-map="replyMsgsMap" />
</div>
<!-- <div style="height: 'auto';position: fixed;left: 0;bottom: 0;width: 100vw;"> -->
<MessageInput
:reply-msgs-map="replyMsgsMap"
:jobListShow.sync="jobListShow"
@jobListShow="
(e) => {
jobListShow = e;
}
"
:conversation-type="conversationType"
:to="to"
/>
<!-- </div> -->
<u-popup v-model="jobListShow" mode="bottom" z-index="999999" border-radius="12" :closeable="false" :mask-close-able="true" :mask="true" @close="jobListShow = false">
<view class="g_bg_ed" style="min-height: 70vh">
<div class="m-search g_p_10 g_pt_8 g_position_rela g_flex_1 bg_shawdoc" style id="searchInputBox">
<u-search height="80" v-model="keyword" @input="checkLength" @clear="searchJob" @search="searchJob" class="" placeholder="搜索职位名称" bg-color="#fff" :show-action="false" placeholder-class="g_c_c" search-icon-color="#999999" :maxlength="20"></u-search>
</div>
<g-list-job from="chat" @uploadList="getList" @sendJob="sendJob" bg="#ededed" class="" :query="query" :list="query.list" :loading="loading" :speed="speed" :isShowLoginBtn="false" emptyText="嘿,这里还没有数据呢" />
</view>
</u-popup>
</div>
</template>
<script lang="ts" setup>
import { onShow } from '@dcloudio/uni-app'
import { events } from '../../utils/constants'
import { trackInit } from '../../utils/reporter'
import { autorun } from 'mobx'
import { ref, onMounted, onUnmounted } from '../../utils/transformVue'
import { deepClone, getUniPlatform } from '../../utils'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { customSwitchTab,customNavigateTo } from '../../utils/customNavigate'
import NetworkAlert from '../../components/NetworkAlert.vue'
import NavBar from './message/nav-bar.vue'
import Icon from '../../components/Icon.vue'
import MessageList from './message/message-list.vue'
import MessageInput from './message/message-input.vue'
import { HISTORY_LIMIT,MSG_ID_FLAG } from '../../utils/constants'
import { t } from '../../utils/i18n'
import { V2NIMMessage } from 'nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService'
import { V2NIMConst } from 'nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK'
import gListJob from "../../../../components/list/job";
import { onShow } from "@dcloudio/uni-app";
import { events } from "../../utils/constants";
import { trackInit } from "../../utils/reporter";
import { autorun } from "mobx";
import { ref, onMounted, computed, onUnmounted, getCurrentInstance } from "vue";
// import { ref, onMounted, onUnmounted, getCurrentInstance } from "../../utils/transformVue";
import { deepClone, getUniPlatform } from "../../utils";
import { onLoad, onUnload } from "@dcloudio/uni-app";
import { customSwitchTab, customNavigateTo } from "../../utils/customNavigate";
import NetworkAlert from "../../components/NetworkAlert.vue";
import NavBar from "./message/nav-bar.vue";
import Icon from "../../components/Icon.vue";
import MessageList from "./message/message-list.vue";
import MessageInput from "./message/message-input.vue";
import { HISTORY_LIMIT, MSG_ID_FLAG } from "../../utils/constants";
import { t } from "../../utils/i18n";
import { V2NIMMessage } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService";
import { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK";
const G = getCurrentInstance().appContext.app.config.globalProperties.G;
const F = getCurrentInstance().appContext.app.config.globalProperties.F;
const api = getCurrentInstance().appContext.app.config.globalProperties.api;
export interface YxReplyMsg {
messageClientId: string
scene: V2NIMConst.V2NIMConversationType
from: string
receiverId: string
to: string
idServer: string
time: number
}
trackInit('ChatUIKit')
const title = ref('')
const conversationId = uni.$UIKitStore.uiStore.selectedConversation
const conversationType =
uni.$UIKitNIM.V2NIMConversationIdUtil.parseConversationType(conversationId)
const to =
uni.$UIKitNIM.V2NIMConversationIdUtil.parseConversationTargetId(
conversationId
)
messageClientId: string;
scene: V2NIMConst.V2NIMConversationType;
from: string;
receiverId: string;
to: string;
idServer: string;
time: number;
}
trackInit("ChatUIKit");
const title = ref("");
const jobListShow = ref(false);
const toDetail = () => {
uni.navigateTo({
url: "/root/detail/job?id=" + 146579,
});
};
const conversationId = uni.$UIKitStore.uiStore.selectedConversation;
const conversationType = uni.$UIKitNIM.V2NIMConversationIdUtil.parseConversationType(conversationId);
const to = uni.$UIKitNIM.V2NIMConversationIdUtil.parseConversationTargetId(conversationId);
const isH5 = getUniPlatform() === 'web'
const isH5 = getUniPlatform() === "web";
// uni-popup 穿
const moveThrough = ref(false)
const moveThrough = ref(false);
const backToConversation = () => {
customSwitchTab({
url: '/pages/Conversation/index',
})
}
url: "/pages/Conversation/index",
});
};
// false
const teamManagerVisible = uni.$UIKitStore.localOptions.teamMsgReceiptVisible
const teamManagerVisible = uni.$UIKitStore.localOptions.teamMsgReceiptVisible;
// p2p p2p false
const p2pMsgReceiptVisible = uni.$UIKitStore.localOptions.p2pMsgReceiptVisible
const p2pMsgReceiptVisible = uni.$UIKitStore.localOptions.p2pMsgReceiptVisible;
let isMounted = false
let isMounted = false;
const loadingMore = ref(false)
const noMore = ref(false)
const loadingMore = ref(false);
const noMore = ref(false);
const msgs = ref<V2NIMMessage[]>([])
const msgs = ref<V2NIMMessage[]>([]);
//
const replyMsgsMap = ref<Record<string, V2NIMMessage>>()
const replyMsgsMap = ref<Record<string, V2NIMMessage>>();
const handleDismissTeam = (data: any) => {
if (data.teamId === to) {
uni.showModal({
content: t('onDismissTeamText'),
content: t("onDismissTeamText"),
showCancel: false,
success(data) {
if (data.confirm) {
backToConversation()
backToConversation();
}
},
})
}
});
}
};
const handleRemoveTeamMembers = (data: any) => {
uni
.showToast({
title: t('onRemoveTeamText'),
icon: 'success',
title: t("onRemoveTeamText"),
icon: "success",
duration: 1000,
})
.then(() => {
backToConversation()
})
}
backToConversation();
});
};
//
const handleReceiveMessages = (msgs: V2NIMMessage[]) => {
const routes = getCurrentPages()
const curRoute = routes[routes.length - 1].route
const routes = getCurrentPages();
const curRoute = routes[routes.length - 1].route;
//
if (
msgs.length &&
!msgs[0]?.isSelf &&
msgs[0].conversationId == conversationId &&
curRoute?.includes('Chat/index')
) {
handleMsgReceipt(msgs)
}
uni.$emit(events.ON_SCROLL_BOTTOM, msgs)
if (msgs.length && !msgs[0]?.isSelf && msgs[0].conversationId == conversationId && curRoute?.includes("Chat/index")) {
handleMsgReceipt(msgs);
}
uni.$emit(events.ON_SCROLL_BOTTOM, msgs);
};
//
const handleMsgReceipt = (msg: V2NIMMessage[]) => {
if (
msg[0].conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P &&
p2pMsgReceiptVisible
) {
uni.$UIKitStore.msgStore.sendMsgReceiptActive(msg[0])
} else if (
msg[0].conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM &&
teamManagerVisible
) {
uni.$UIKitStore.msgStore.sendTeamMsgReceiptActive(msg)
}
if (msg[0].conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P && p2pMsgReceiptVisible) {
uni.$UIKitStore.msgStore.sendMsgReceiptActive(msg[0]);
} else if (msg[0].conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM && teamManagerVisible) {
uni.$UIKitStore.msgStore.sendTeamMsgReceiptActive(msg);
}
};
//
const handleHistoryMsgReceipt = (msgs: V2NIMMessage[]) => {
//
if (
conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P &&
p2pMsgReceiptVisible
) {
const myUserAccountId = uni.$UIKitNIM.V2NIMLoginService.getLoginUser()
if (conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P && p2pMsgReceiptVisible) {
const myUserAccountId = uni.$UIKitNIM.V2NIMLoginService.getLoginUser();
const othersMsgs = msgs
.filter(
(item: V2NIMMessage) =>
// @ts-ignore
!['beReCallMsg', 'reCallMsg'].includes(item.recallType || '')
!["beReCallMsg", "reCallMsg"].includes(item.recallType || "")
)
.filter((item: V2NIMMessage) => item.senderId !== myUserAccountId)
.filter((item: V2NIMMessage) => item.senderId !== myUserAccountId);
//
if (othersMsgs.length > 0) {
uni.$UIKitStore.msgStore.sendMsgReceiptActive(othersMsgs?.[0])
uni.$UIKitStore.msgStore.sendMsgReceiptActive(othersMsgs?.[0]);
}
//
} else if (
conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM &&
teamManagerVisible
) {
const myUserAccountId = uni.$UIKitNIM.V2NIMLoginService.getLoginUser()
} else if (conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM && teamManagerVisible) {
const myUserAccountId = uni.$UIKitNIM.V2NIMLoginService.getLoginUser();
const myMsgs = msgs
.filter(
(item: V2NIMMessage) =>
// @ts-ignore
!['beReCallMsg', 'reCallMsg'].includes(item.recallType || '')
!["beReCallMsg", "reCallMsg"].includes(item.recallType || "")
)
.filter((item: V2NIMMessage) => item.senderId === myUserAccountId)
.filter((item: V2NIMMessage) => item.senderId === myUserAccountId);
uni.$UIKitStore.msgStore.getTeamMsgReadsActive(myMsgs, conversationId)
uni.$UIKitStore.msgStore.getTeamMsgReadsActive(myMsgs, conversationId);
//
// sdk 50
@ -204,159 +194,121 @@ const handleHistoryMsgReceipt = (msgs: V2NIMMessage[]) => {
.filter(
(item: V2NIMMessage) =>
// @ts-ignore
!['beReCallMsg', 'reCallMsg'].includes(item.recallType || '')
!["beReCallMsg", "reCallMsg"].includes(item.recallType || "")
)
.filter((item: V2NIMMessage) => item.senderId !== myUserAccountId)
.filter((item: V2NIMMessage) => item.senderId !== myUserAccountId);
if (othersMsgs.length > 0 && othersMsgs.length < 50) {
uni.$UIKitStore.msgStore.sendTeamMsgReceiptActive(othersMsgs)
}
uni.$UIKitStore.msgStore.sendTeamMsgReceiptActive(othersMsgs);
}
}
};
//
const getHistory = async (endTime: number, lastMsgId?: string) => {
try {
if (noMore.value) {
return []
return [];
}
if (loadingMore.value) {
return []
return [];
}
loadingMore.value = true
loadingMore.value = true;
if (conversationId) {
const historyMsgs = await uni.$UIKitStore.msgStore.getHistoryMsgActive({
conversationId,
endTime,
lastMsgId,
limit: HISTORY_LIMIT,
})
});
// console.log(historyMsgs)
// pin msg
await uni.$UIKitStore.msgStore.getPinnedMessageListActive(conversationId)
loadingMore.value = false
await uni.$UIKitStore.msgStore.getPinnedMessageListActive(conversationId);
loadingMore.value = false;
if (historyMsgs.length < HISTORY_LIMIT) {
noMore.value = true
noMore.value = true;
}
//
handleHistoryMsgReceipt(historyMsgs)
return historyMsgs
handleHistoryMsgReceipt(historyMsgs);
return historyMsgs;
}
} catch (error) {
loadingMore.value = false
throw error
}
loadingMore.value = false;
throw error;
}
};
//
const loadMoreMsgs = (lastMsg: V2NIMMessage) => {
// console.log("")
getHistory(lastMsg.createTime, lastMsg.messageServerId).then(
(res: V2NIMMessage[]) => {
getHistory(lastMsg.createTime, lastMsg.messageServerId).then((res: V2NIMMessage[]) => {
// console.log(res)
// console.log("")
uni.$emit('newScroll')
}
);
uni.$emit("newScroll");
});
};
const conversationTypeWatch = autorun(() => {
//
if (
conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P
) {
title.value = deepClone(
uni.$UIKitStore.uiStore.getAppellation({ account: to })
)
if (conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P) {
title.value = deepClone(uni.$UIKitStore.uiStore.getAppellation({ account: to }));
//
} else if (
conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM
) {
const team = uni.$UIKitStore.teamStore.teams.get(to)
const subTitle = `(${team?.memberCount || 0})`
title.value = (team?.name || '') + subTitle
} else if (conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
const team = uni.$UIKitStore.teamStore.teams.get(to);
const subTitle = `(${team?.memberCount || 0})`;
title.value = (team?.name || "") + subTitle;
}
})
});
//
const connectedWatch = autorun(() => {
if (
uni.$UIKitStore.connectStore.connectStatus ===
V2NIMConst.V2NIMConnectStatus.V2NIM_CONNECT_STATUS_CONNECTED
) {
if (
uni.$UIKitStore.connectStore.loginStatus ==
V2NIMConst.V2NIMLoginStatus.V2NIM_LOGIN_STATUS_LOGINED
) {
if (uni.$UIKitStore.connectStore.connectStatus === V2NIMConst.V2NIMConnectStatus.V2NIM_CONNECT_STATUS_CONNECTED) {
if (uni.$UIKitStore.connectStore.loginStatus == V2NIMConst.V2NIMLoginStatus.V2NIM_LOGIN_STATUS_LOGINED) {
getHistory(Date.now()).then(() => {
if (!isMounted) {
console.log("已登录已登录已登录已登录已登录已登录已登录已登录已登录")
console.log("已登录已登录已登录已登录已登录已登录已登录已登录已登录");
// uni.$emit(events.ON_SCROLL_BOTTOM)
isMounted = true
isMounted = true;
}
})
});
}
}
})
});
//
const msgsWatch = autorun(() => {
// Clone pinState
const messages = [...uni.$UIKitStore.msgStore.getMsg(conversationId)]
const messages = [...uni.$UIKitStore.msgStore.getMsg(conversationId)];
if (messages.length !== 0) {
msgs.value = messages
msgs.value = messages;
}
// map
if (messages.length !== 0) {
const _replyMsgsMap: any = {}
const reqMsgs: YxReplyMsg[] = []
const messageClientIds: Record<string, string> = {}
const _replyMsgsMap: any = {};
const reqMsgs: YxReplyMsg[] = [];
const messageClientIds: Record<string, string> = {};
msgs.value.forEach((msg) => {
if (msg.serverExtension) {
try {
// yxReplyMsg
const { yxReplyMsg } = JSON.parse(msg.serverExtension)
const { yxReplyMsg } = JSON.parse(msg.serverExtension);
if (yxReplyMsg) {
// replyMsg
const replyMsg = msgs.value.find(
(item) => item.messageClientId === yxReplyMsg.idClient
)
const replyMsg = msgs.value.find((item) => item.messageClientId === yxReplyMsg.idClient);
// map
if (replyMsg) {
_replyMsgsMap[msg.messageClientId] = replyMsg
_replyMsgsMap[msg.messageClientId] = replyMsg;
// 1. 2. 3.
} else {
_replyMsgsMap[msg.messageClientId] = { messageClientId: 'noFind' }
const {
scene,
from,
to,
idServer,
messageClientId,
time,
receiverId,
} = yxReplyMsg
if (
scene &&
from &&
to &&
idServer &&
messageClientId &&
time &&
receiverId
) {
_replyMsgsMap[msg.messageClientId] = { messageClientId: "noFind" };
const { scene, from, to, idServer, messageClientId, time, receiverId } = yxReplyMsg;
if (scene && from && to && idServer && messageClientId && time && receiverId) {
reqMsgs.push({
scene,
from,
@ -365,14 +317,14 @@ const msgsWatch = autorun(() => {
messageClientId,
time,
receiverId,
})
messageClientIds[idServer] = msg.messageClientId
});
messageClientIds[idServer] = msg.messageClientId;
}
}
}
} catch {}
}
})
});
if (reqMsgs.length > 0) {
// ,
@ -391,17 +343,17 @@ const msgsWatch = autorun(() => {
if (res?.length > 0) {
res.forEach((item: V2NIMMessage) => {
if (item.messageServerId) {
_replyMsgsMap[messageClientIds[item.messageServerId]] = item
_replyMsgsMap[messageClientIds[item.messageServerId]] = item;
}
})
});
}
replyMsgsMap.value = { ..._replyMsgsMap }
replyMsgsMap.value = { ..._replyMsgsMap };
})
.catch(() => {
replyMsgsMap.value = { ..._replyMsgsMap }
})
replyMsgsMap.value = { ..._replyMsgsMap };
});
} else {
replyMsgsMap.value = { ..._replyMsgsMap }
replyMsgsMap.value = { ..._replyMsgsMap };
}
}
@ -409,103 +361,209 @@ const msgsWatch = autorun(() => {
// if (messages.length < 6) {
// uni.hideKeyboard()
// }
})
});
//
const setNavTitle = () => {
if (
conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P
) {
title.value = uni.$UIKitStore.uiStore.getAppellation({ account: to })
} else if (
conversationType ===
V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM
) {
const team = uni.$UIKitStore.teamStore.teams.get(to)
const subTitle = `(${team?.memberCount || 0})`
title.value = (team?.name || '') + subTitle
if (conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P) {
title.value = uni.$UIKitStore.uiStore.getAppellation({ account: to });
} else if (conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
const team = uni.$UIKitStore.teamStore.teams.get(to);
const subTitle = `(${team?.memberCount || 0})`;
title.value = (team?.name || "") + subTitle;
}
uni.setNavigationBarTitle({
title: title.value,
});
}
};
onShow(function () {
setNavTitle()
scrollToBottom()
setNavTitle();
scrollToBottom();
// 使 uni.navigateBackonload
if (msgs.value.length) {
const _msgs = [...msgs.value].reverse()
handleHistoryMsgReceipt(_msgs)
const _msgs = [...msgs.value].reverse();
handleHistoryMsgReceipt(_msgs);
}
})
});
const scrollToBottom = () => {
const timer = setTimeout(() => {
uni.$emit(events.ON_SCROLL_BOTTOM)
clearTimeout(timer)
}, 300)
}
uni.$emit(events.ON_SCROLL_BOTTOM);
clearTimeout(timer);
}, 300);
};
onLoad(() => {
uni.$on(events.HANDLE_MOVE_THROUGH, (flag) => {
moveThrough.value = flag
})
})
moveThrough.value = flag;
});
});
const msgHeight = ref(0);
onMounted(() => {
setNavTitle()
uni.$on('msgHeight', (res) => {
console.log(res)
msgHeight.value = res
})
setNavTitle();
getList();
uni.$on("msgHeight", (res) => {
console.log(res);
msgHeight.value = res;
});
// scrollToBottom()
uni.$UIKitNIM.V2NIMMessageService.on(
'onReceiveMessages',
handleReceiveMessages
)
uni.$UIKitNIM.V2NIMMessageService.on("onReceiveMessages", handleReceiveMessages);
uni.$UIKitNIM.V2NIMTeamService.on('onTeamDismissed', handleDismissTeam)
uni.$UIKitNIM.V2NIMTeamService.on("onTeamDismissed", handleDismissTeam);
uni.$UIKitNIM.V2NIMTeamService.on('onTeamLeft', handleRemoveTeamMembers)
uni.$UIKitNIM.V2NIMTeamService.on("onTeamLeft", handleRemoveTeamMembers);
uni.$on(events.GET_HISTORY_MSG, loadMoreMsgs)
})
uni.$on(events.GET_HISTORY_MSG, loadMoreMsgs);
});
onUnmounted(() => {
uni.$UIKitNIM.V2NIMTeamService.off('onTeamDismissed', handleDismissTeam)
uni.$UIKitNIM.V2NIMTeamService.off("onTeamDismissed", handleDismissTeam);
uni.$UIKitNIM.V2NIMTeamService.off(
'onTeamMemberLeft',
handleRemoveTeamMembers
)
uni.$UIKitNIM.V2NIMTeamService.off("onTeamMemberLeft", handleRemoveTeamMembers);
uni.$UIKitNIM.V2NIMMessageService.off(
'onReceiveMessages',
handleReceiveMessages
)
uni.$UIKitNIM.V2NIMMessageService.off("onReceiveMessages", handleReceiveMessages);
uni.$off(events.GET_HISTORY_MSG, loadMoreMsgs)
uni.$off(events.GET_HISTORY_MSG, loadMoreMsgs);
// store
connectedWatch()
msgsWatch()
conversationTypeWatch()
connectedWatch();
msgsWatch();
conversationTypeWatch();
});
const query = ref({
page: 1,
size: 50,
list: [],
isFinish: -1,
});
const loading = ref(false);
const speed = ref(-1);
const keyword = ref("");
const checkLength = (e) => {
console.log("e", e);
console.log("keyword", keyword.value);
if (e.length == 0) {
keyword.value = "";
searchJob();
}
};
const searchJob = () => {
query.value.list = [];
query.value.page = 1;
getList();
};
const getList = ($type = "init") => {
loading.value = true;
G.Post(
api.job_list,
{
pageNum: query.value.page,
pageSize: query.value.size,
agencyId: uni.getStorageSync("apply-agencyId"),
classify: 99,
sortTag: 2,
keys: keyword.value,
cityName: "全国",
},
(res) => {
console.log("res", res);
loading.value = false;
speed.value = res.recordCount;
query.value.isFinish = res.recordList.length;
console.log("query.value", query.value);
res.recordList = G.toGetAddressv3(res.recordList);
res.recordList = G.toGetAge(res.recordList);
res.recordList = G.yijobCopy(res.recordList);
if ($type == "init") {
query.value.list = [];
if (res.recordList.length > 0) {
query.value.list = res.recordList.map((item, index) => {
// console.log(item)
return {
...item,
title: item.jobName,
address: item.district + item.age,
priceStr: item.salaryClassify != 7 ? G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
logo: item.agencyLogo,
time: G.setDeadLine(item.updateTime, "jiaofu"),
fuWuFei: G.setReturnFee(item.returnFee, item.returnFeeType),
gender: G.getGenderByMinAge(item),
leafCateId: item.id,
// serverPrice: tabInfo.value.list[tabInfo.value.active].tip == 2 ? G.setReturnFee(item.returnFee, item.returnFeeType) : G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
serverPrice: G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
recruitmentSwitch: item.recruitment == 1 ? true : false,
recruitmentImage: item.recruitment,
isToday: item.today == 0 ? false : true,
};
});
}
} else {
query.value.list = query.value.list.concat(
res.recordList.map((item, index) => {
return {
...item,
title: item.jobName,
priceStr: item.salaryClassify != 7 ? G.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue) : G.getSalaryClassifyValue(item.salaryClassify, item.minMonthlyPay, item.maxMonthlyPay),
fuWuFei: G.setReturnFee(item.returnFee, item.returnFeeType),
gender: G.getGenderByMinAge(item),
logo: item.agencyLogo,
time: G.setDeadLine(item.updateTime, "jiaofu"),
leafCateId: item.id,
serverPrice: G.setReturnFee(item.agencyReturnFee, item.agencyReturnFeeType),
recruitmentSwitch: item.recruitment == 1 ? true : false,
recruitmentImage: item.recruitment,
isToday: item.today == 0 ? false : true,
};
})
onUnload(() => {
uni.$off(events.CONFIRM_FORWARD_MSG)
uni.$off(events.CANCEL_FORWARD_MSG)
);
}
console.log('query.value.list',query.value.list)
}
);
};
const sendJob = (_item) => {
console.log("_item", _item);
let listInner = ["district", "gender", "age"];
let newList = [];
listInner.forEach((item) => {
if (_item[item]) {
newList.push(_item[item]);
}
});
_item.info = newList.join("丨");
const customMsg = uni.$UIKitNIM.V2NIMMessageCreator.createCustomMessage(
"",
JSON.stringify({
type: 100000,
title: _item.jobName,
info: _item.info,
label: _item.jobSpecialLabelNameArray.length > 0 ? _item.jobSpecialLabelNameArray : [],
salaryClassifyValue: _item.priceStr,
serviceFee: _item.fuWuFei ? _item.fuWuFei : "",
monthPay: _item.monthlyPay,
jobId: _item.id,
})
);
console.log("customMsg", customMsg);
uni.$UIKitStore.msgStore.sendMessageActive({
msg: customMsg,
conversationId,
sendBefore: () => {
// scrollBottom();
},
});
};
onUnload(() => {
uni.$off(events.CONFIRM_FORWARD_MSG);
uni.$off(events.CANCEL_FORWARD_MSG);
});
</script>
<style lang="scss">
@import "../../base.scss";
page {
height: 100%;
overflow: hidden;

@ -14,18 +14,14 @@
<div class="reply-line"></div>
<div class="reply-title">{{ t("replyText") }}</div>
<div class="reply-to">
<Appellation :account="replyMsg && replyMsg.senderId"
:team-id="props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM ? to : ''"
color="#929299" :fontSize="13"> </Appellation>
<Appellation :account="replyMsg && replyMsg.senderId" :team-id="props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM ? to : ''" color="#929299" :fontSize="13"> </Appellation>
</div>
<div class="reply-to-colon">:</div>
<div v-if="replyMsg && replyMsg.messageClientId === 'noFind'" class="reply-noFind">
{{ t("replyNotFindText") }}
</div>
<div class="reply-message" v-else>
<message-one-line
v-if="replyMsg && replyMsg.messageType === V2NIMConst.V2NIMMessageType.V2NIM_MESSAGE_TYPE_TEXT"
:text="replyMsg && replyMsg.text"></message-one-line>
<message-one-line v-if="replyMsg && replyMsg.messageType === V2NIMConst.V2NIMMessageType.V2NIM_MESSAGE_TYPE_TEXT" :text="replyMsg && replyMsg.text"></message-one-line>
<div v-else>
{{ "[" + REPLY_MSG_TYPE_MAP[replyMsg && replyMsg.messageType] + "]" }}
</div>
@ -53,8 +49,7 @@
</div>
</div> -->
<div class="g_flex_c">
<div @tap="handleAudioVisible" v-if="!isWeb && false" class="msg-input-button g_p_5"
style="padding-right: 7px; padding-left: 10px">
<div @tap="handleAudioVisible" v-if="!isWeb && false" class="msg-input-button g_p_5" style="padding-right: 7px; padding-left: 10px">
<Icon v-if="audioPanelVisible" :size="28" type="audio-btn-selected" key="audio-btn-selected" />
<Icon v-else :size="28" type="icon-audio" key="icon-audio" />
</div>
@ -69,22 +64,14 @@
</div>
<!--键盘高度{{keyHeight}} 输入框距离底部距离{{writeStyle}}屏幕高度{{screenHeight}}顶部聊天区域高度{{msgKeyHeight}}-->
<input v-show="!showEmojiInput" :focus="isFocus" class="msg-input-input g_flex_1"
:maxlength="-1"
:placeholder="isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')"
v-model="inputText" type="text" :disabled="isTeamMute" :confirm-hold="true"
cursor-spacing="20" :adjust-position="pushUp" confirm-type="send"
@keyboardheightchange="keyboardheightchange" @confirm="handleSendTextMsg"
@blur="handleInputBlur" @input="handleInput" id="msg-input" />
<input v-show="!showEmojiInput" :focus="isFocus" class="msg-input-input g_flex_1" :maxlength="-1" :placeholder="isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')" v-model="inputText" type="text" :disabled="isTeamMute" :confirm-hold="true" cursor-spacing="20" :adjust-position="pushUp" confirm-type="send" @keyboardheightchange="keyboardheightchange" @confirm="handleSendTextMsg" @blur="handleInputBlur" @input="handleInput" id="msg-input" />
</div>
<div class="msg-input-button" v-if="false">
<Icon @tap="handleEmojiVisible" class="g_p_6" style="padding-right: 5px" :size="28"
type="icon-biaoqing" />
<Icon @tap="handleEmojiVisible" class="g_p_6" style="padding-right: 5px" :size="28" type="icon-biaoqing" />
</div>
<div class="msg-input-button">
<Icon @tap="handleSendMoreVisible" class="g_p_6" style="padding-left: 5px; padding-right: 8px"
type="send-more" :size="28" />
<Icon @tap="handleSendMoreVisible" class="g_p_6" style="padding-left: 5px; padding-right: 8px" type="send-more" :size="28" />
</div>
</div>
<!-- 表情面板 -->
@ -117,15 +104,13 @@
</div>
<div class="icon-text">{{ t("albumText") }}</div>
</div>
<div class="send-more-panel-item-wrapper"
v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
<div class="send-more-panel-item-wrapper" v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
<div class="send-more-panel-item" @tap="handleCall(1)">
<Icon type="icon-audio-call" :size="30"></Icon>
</div>
<div class="icon-text">{{ t("voiceCallText") }}</div>
</div>
<div class="send-more-panel-item-wrapper"
v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
<div class="send-more-panel-item-wrapper" v-if="isApp && props.conversationType !== V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM">
<div class="send-more-panel-item" @tap="() => handleCall(2)">
<Icon type="icon-video-call" :size="30"></Icon>
</div>
@ -143,7 +128,12 @@
</div>
<div class="icon-text">{{ t("customText") }}</div>
</div>
<div class="send-more-panel-item-wrapper" v-if="corpUserFlag">
<div class="send-more-panel-item" @tap="(event) => handleSendJob()">
<Icon type="icon-touxiang5" :size="30"></Icon>
</div>
<div class="icon-text">{{ "发送职位" }}</div>
</div>
<div class="send-more-panel-item-wrapper">
<div class="send-more-panel-item" @tap="(event) => handleSetting()">
<Icon type="icon-shezhi" :size="30"></Icon>
@ -157,8 +147,7 @@
</div>
</div>
<!-- @消息相关 popup -->
<UniPopup ref="popupRef" background-color="#ffffff" type="bottom" mask-background-color="rgba(0,0,0,0.4)"
@change="onPopupChange">
<UniPopup ref="popupRef" background-color="#ffffff" type="bottom" mask-background-color="rgba(0,0,0,0.4)" @change="onPopupChange">
<MentionMemberList :team-id="to"></MentionMemberList>
</UniPopup>
</div>
@ -169,7 +158,7 @@
import Face from "./face.vue";
import VoicePanel from "./voice-panel.vue";
import Icon from "../../../components/Icon.vue";
import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults } from "../../../utils/transformVue";
import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults, defineEmits } from "../../../utils/transformVue";
import { ALLOW_AT, events, REPLY_MSG_TYPE_MAP } from "../../../utils/constants";
import { emojiMap } from "../../../utils/emoji";
import { t } from "../../../utils/i18n";
@ -199,10 +188,11 @@
replyMsgsMap?: {
[key: string]: V2NIMMessageForUI;
};
jobListShow: Boolean;
}>(),
{}
);
const emits = defineEmits(["jobListShow"]);
const conversationId = props.conversationType === V2NIMConst.V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P ? uni.$UIKitNIM.V2NIMConversationIdUtil.p2pConversationId(props.to) : uni.$UIKitNIM.V2NIMConversationIdUtil.teamConversationId(props.to);
const inputText = ref("");
@ -360,28 +350,22 @@
const isIOS = ref(false);
writeStyle.value = "bottom:0";
// #ifdef MP-WEIXIN
const pushUp = ref(false)
const pushUp = ref(false);
// #endif
// #ifdef APP-PLUS
const pushUp = ref(true)
const pushUp = ref(true);
// #endif
const keyHeight = ref(350);
const msgKeyHeight = ref('100%')
const msgKeyHeight = ref("100%");
const keyboardheightchange = (e) => {
// console.log("", e.detail.height);
keyHeight.value = e.detail.height;
uni.$emit(events.KeyboardEvent, e.detail.height);
uni.$emit('KeyboardHeight', e.detail.height);
uni.$emit("KeyboardHeight", e.detail.height);
if (e.detail.height === 0) {
writeStyle.value = "bottom: 0";
@ -390,17 +374,15 @@
} else {
uni.$emit(events.KeyboardEvent, 0);
}
uni.$emit('msgKeyHeight', '100%');
uni.$emit("msgKeyHeight", "100%");
} else {
emojiVisible.value = false;
extVisible.value = false;
audioPanelVisible.value = false;
sendMoreVisible.value = false;
msgKeyHeight.value = screenHeight.value - keyHeight.value
uni.$emit('msgKeyHeight', msgKeyHeight.value);
msgKeyHeight.value = screenHeight.value - keyHeight.value;
uni.$emit("msgKeyHeight", msgKeyHeight.value);
// #ifdef MP-WEIXIN
writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`;
@ -415,15 +397,11 @@
// #endif
}
// }
};
const handleInputBlur = () => {
isFocus.value = false;
uni.$emit('msgKeyHeight', '100%');
uni.$emit("msgKeyHeight", "100%");
};
//
@ -513,7 +491,10 @@
},
});
};
const handleSendJob = () => {
console.log("props.jobListShow", props.jobListShow);
emits("jobListShow", true);
};
const handleSendCustomMsg = () => {
const customMsg = uni.$UIKitNIM.V2NIMMessageCreator.createCustomMessage(
"这是PGQ的自定义消息",
@ -540,7 +521,6 @@
//
const handleEmojiVisible = () => {
showEmojiInput.value = true;
extVisible.value = true;
@ -575,8 +555,6 @@
// }, 300)
};
//
const handleEmojiDelete = () => {
let target = "";
@ -863,23 +841,21 @@
});
}
uni.$on('msgHeight', (res) => {
uni.$on("msgHeight", (res) => {
// console.log('inputinputinputinputinputinputinputinput')
// console.log(res)
msgHeight.value = res
})
uni.$on('screenHeight', (res) => {
msgHeight.value = res;
});
uni.$on("screenHeight", (res) => {
// console.log(res)
if (res) {
screenHeight.value = res
screenHeight.value = res;
} else {
screenHeight.value = uni.getSystemInfoSync().windowHeight
screenHeight.value = uni.getSystemInfoSync().windowHeight;
}
})
isTeamMute.value = false
});
isTeamMute.value = false;
});
// //
// const handleEmoji = (emoji: { key: string; type: string }) => {
@ -895,8 +871,6 @@
}
};
const onAtMembersExtHandler = () => {
let ext: YxServerExt;
if (selectedAtMembers.value.length) {
@ -969,8 +943,6 @@
</script>
<style scoped lang="scss">
.input-root {
width: 100%;
display: flex;

Loading…
Cancel
Save