master
wangxia 6 months ago
parent 2ebb51cbcd
commit 81848ab974

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import RootStore from "@xkit-yx/im-store-v2"; import RootStore from "@xkit-yx/im-store-v2";
import V2NIM, { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK"; import V2NIM, { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK";
import { getMsgContentTipByType,setTabUnread } from "./pages/NEUIKit/utils/msg"; import { getMsgContentTipByType, setTabUnread } from "./pages/NEUIKit/utils/msg";
import { STORAGE_KEY } from "./pages/NEUIKit/utils/constants"; import { STORAGE_KEY } from "./pages/NEUIKit/utils/constants";
import { isWxApp } from "./pages/NEUIKit/utils"; import { isWxApp } from "./pages/NEUIKit/utils";
import { V2NIMMessage, V2NIMMessagePushConfig, V2NIMConversation } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService"; import { V2NIMMessage, V2NIMMessagePushConfig, V2NIMConversation } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService";
@ -14,10 +14,10 @@ export default {
themeColor: "#00b666", themeColor: "#00b666",
themeBackgroundColor: "#00b66621", themeBackgroundColor: "#00b66621",
}, },
onLaunch() { onLaunch() {
let that = this; let that = this;
uni.removeStorageSync("selectedCity"); uni.removeStorageSync("selectedCity");
// //
uni.addInterceptor("navigateTo", { uni.addInterceptor("navigateTo", {
invoke(args) { invoke(args) {
@ -41,7 +41,9 @@ export default {
onShow: function (options) { onShow: function (options) {
let that = this; let that = this;
console.log("show 项目init", options, decodeURIComponent(options.query.scene)); console.log("show 项目init", options, decodeURIComponent(options.query.scene));
let requestComeFrom = this.G.globalConstantData.requestComeFrom;
uni.setStorageSync("requestComeFrom", (requestComeFrom && (requestComeFrom == "assistant_miniapp" || requestComeFrom == "supply_chain_miniapp")) ? 'isToB' : 'isToC');
// id // id
uni.removeStorageSync("scene"); uni.removeStorageSync("scene");
uni.removeStorageSync("user_scene"); uni.removeStorageSync("user_scene");
@ -65,16 +67,16 @@ export default {
} else { } else {
uni.setStorageSync("apply-invite-code", ""); uni.setStorageSync("apply-invite-code", "");
} }
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {
this.G.checkToken(); this.G.checkToken();
} }
// - // -
if (!that.globalData.timer) { if (!that.globalData.timer) {
that.checkNum(); that.checkNum();
that.checkAndReconnectIM(); // that.checkAndReconnectIM(); //
// 15 // 15
that.globalData.timer = setInterval(() => { that.globalData.timer = setInterval(() => {
that.checkNum(); that.checkNum();
@ -88,7 +90,7 @@ export default {
that.initWyyx(); that.initWyyx();
} }
}); });
// //
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {
// console.log("app.vue IM"); // console.log("app.vue IM");
@ -98,15 +100,17 @@ export default {
onHide: function () { onHide: function () {
// //
console.log("应用进入后台保持IM连接检测"); console.log("应用进入后台保持IM连接检测");
// //
if (uni.$UIKitNIM && uni.$UIKitNIM.V2NIMLoginService) { if (uni.$UIKitNIM && uni.$UIKitNIM.V2NIMLoginService) {
uni.$UIKitNIM.V2NIMLoginService.ping().then(() => { uni.$UIKitNIM.V2NIMLoginService.ping()
// console.log(""); .then(() => {
}).catch(err => { // console.log("");
// console.error("", err); })
this.reconnectIM(); .catch((err) => {
}); // console.error("", err);
this.reconnectIM();
});
} }
}, },
onUnload() { onUnload() {
@ -116,7 +120,7 @@ export default {
this.globalData.timer = null; this.globalData.timer = null;
console.log("定时器已清除"); console.log("定时器已清除");
} }
if (this.globalData.reconnectTimer) { if (this.globalData.reconnectTimer) {
clearInterval(this.globalData.reconnectTimer); clearInterval(this.globalData.reconnectTimer);
this.globalData.reconnectTimer = null; this.globalData.reconnectTimer = null;
@ -131,7 +135,7 @@ export default {
if (uni.$UIKitNIM && uni.$UIKitStore) { if (uni.$UIKitNIM && uni.$UIKitStore) {
const connectStatus = uni.$UIKitStore.connectStore.connectStatus; const connectStatus = uni.$UIKitStore.connectStore.connectStatus;
// console.log('IM:', connectStatus); // console.log('IM:', connectStatus);
// //
// 0: // 0:
// 1: // 1:
@ -147,17 +151,17 @@ export default {
} }
}, 1000); }, 1000);
}, },
// IM // IM
reconnectIM() { reconnectIM() {
let that = this; let that = this;
// //
if (this.globalData.reconnectTimer) { if (this.globalData.reconnectTimer) {
// console.log(""); // console.log("");
return; return;
} }
// //
const attemptReconnect = () => { const attemptReconnect = () => {
if (!uni.getStorageSync("apply-token") || !uni.getStorageSync("apply-uid")) { if (!uni.getStorageSync("apply-token") || !uni.getStorageSync("apply-uid")) {
@ -166,11 +170,11 @@ export default {
that.globalData.reconnectTimer = null; that.globalData.reconnectTimer = null;
return; return;
} }
if (uni.$UIKitNIM && uni.$UIKitNIM.V2NIMLoginService) { if (uni.$UIKitNIM && uni.$UIKitNIM.V2NIMLoginService) {
const account = uni.getStorageSync("im-accid"); const account = uni.getStorageSync("im-accid");
const token = uni.getStorageSync("im-token"); const token = uni.getStorageSync("im-token");
if (account && token) { if (account && token) {
console.log(`尝试重连IM (account: ${account})`); console.log(`尝试重连IM (account: ${account})`);
uni.$UIKitNIM.V2NIMLoginService.login(account, token) uni.$UIKitNIM.V2NIMLoginService.login(account, token)
@ -191,10 +195,10 @@ export default {
that.initWyyx(); that.initWyyx();
} }
}; };
// //
// attemptReconnect(); // attemptReconnect();
// 510 // 510
let reconnectAttempts = 0; let reconnectAttempts = 0;
this.globalData.reconnectTimer = setInterval(() => { this.globalData.reconnectTimer = setInterval(() => {
@ -219,35 +223,35 @@ export default {
}, },
(res) => { (res) => {
console.log("wyyx_getConfig", res); console.log("wyyx_getConfig", res);
// //
if (!res || !res.appKey || !res.accid || !res.token) { if (!res || !res.appKey || !res.accid || !res.token) {
console.error("获取IM配置失败参数不完整"); console.error("获取IM配置失败参数不完整");
return; return;
} }
let resData = { let resData = {
appkey: res.appKey, appkey: res.appKey,
accid: res.accid, accid: res.accid,
token: res.token, token: res.token,
}; };
// IM // IM
uni.setStorageSync('im-appkey', resData.appkey); uni.setStorageSync("im-appkey", resData.appkey);
uni.setStorageSync('im-accid', resData.accid); uni.setStorageSync("im-accid", resData.accid);
uni.setStorageSync('im-token', resData.token); uni.setStorageSync("im-token", resData.token);
const imOptions = { const imOptions = {
appkey: resData.appkey, appkey: resData.appkey,
account: resData.accid, account: resData.accid,
token: resData.token, token: resData.token,
}; };
this.initNim(imOptions); this.initNim(imOptions);
} }
); );
}, },
async initNim(opts) { async initNim(opts) {
let that = this; let that = this;
// nim sdk // nim sdk
@ -409,9 +413,9 @@ export default {
that.playAudio(); that.playAudio();
} }
}); });
setTabUnread() setTabUnread();
}, },
playAudio() { playAudio() {
let that = this; let that = this;
const innerAudioContext = uni.createInnerAudioContext(); const innerAudioContext = uni.createInnerAudioContext();
@ -426,7 +430,7 @@ export default {
console.log("提示音播放错误:", res.errMsg, res.errCode); console.log("提示音播放错误:", res.errMsg, res.errCode);
}); });
}, },
checkNum() { checkNum() {
let that = this; let that = this;
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {

@ -68,12 +68,12 @@ export default {
} }
// //
uni.$on("newMessage", function (data) { uni.$on("newMessage", function (data) {
console.log("newMessage 接收", data); // console.log("newMessage ", data);
that.setBadge(data); that.setBadge(data);
}); });
// //
uni.$on("userAuthChange", function (data) { uni.$on("userAuthChange", function (data) {
console.log("newMessage 接收", data); // console.log("newMessage ", data);
that.corpUserFlag = uni.getStorageSync("apply-userinfo").corpUserFlag; that.corpUserFlag = uni.getStorageSync("apply-userinfo").corpUserFlag;
// this.checkUserAuth(); // this.checkUserAuth();
}); });
@ -148,7 +148,7 @@ export default {
}, },
setBadge(data) { setBadge(data) {
let that = this; let that = this;
console.log("datadatadatadatadatadata", data); // console.log("datadatadatadatadatadata", data);
for (var k in that.tabbarInfo) { for (var k in that.tabbarInfo) {
if (that.tabbarInfo[k].pagePath == "/pages/message/index") { if (that.tabbarInfo[k].pagePath == "/pages/message/index") {
if (data) { if (data) {
@ -165,7 +165,7 @@ export default {
} }
that.tabbarInfo[k].count = that.messageCount + that.noticeCount; that.tabbarInfo[k].count = that.messageCount + that.noticeCount;
console.log("that.tabbarInfo[k].count", that.tabbarInfo[k].count); // console.log("that.tabbarInfo[k].count", that.tabbarInfo[k].count);
// that.tabbarInfo[k].type = data.type; // that.tabbarInfo[k].type = data.type;
} }
// else if (that.tabbarInfo[k].pagePath == "/pages/workBench/index") { // else if (that.tabbarInfo[k].pagePath == "/pages/workBench/index") {

@ -21,6 +21,7 @@ import {
import { deepClone } from '../utils' import { deepClone } from '../utils'
const appellation = ref('-') const appellation = ref('-')
const appType = ref(uni.getStorageSync("requestComeFrom"));
const { pid,account, teamId, ignoreAlias, nickFromMsg } = withDefaults( const { pid,account, teamId, ignoreAlias, nickFromMsg } = withDefaults(
defineProps<{ defineProps<{
@ -53,7 +54,7 @@ const uninstallAppellationWatch = autorun(() => {
} }
} }
getUserInfo().then(res => { getUserInfo().then(res => {
if(res.serverExtension){ if(res.serverExtension && appType.value == 'isToB'){
subtitle.value = '@' + JSON.parse(res.serverExtension).fullName; subtitle.value = '@' + JSON.parse(res.serverExtension).fullName;
}else{ }else{
subtitle.value = ''; subtitle.value = '';

@ -147,21 +147,18 @@ const lastMsgContent = computed(() => {
if (sendingState === V2NIMConst.V2NIMMessageSendingState.V2NIM_MESSAGE_SENDING_STATE_FAILED) { if (sendingState === V2NIMConst.V2NIMMessageSendingState.V2NIM_MESSAGE_SENDING_STATE_FAILED) {
return t("conversationSendFailText"); return t("conversationSendFailText");
} }
console.log("lastMsglastMsglastMsg", lastMsg);
let _str = "[多媒体]"; let _str = "[多媒体]";
if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.raw) { if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.raw) {
console.log("lastMsglastMsglastMsg123", lastMsg); if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.raw && lastMsg.attachment.ext == ".mp4" && lastMsg.attachment.url) {
if(!lastMsg.text && lastMsg.attachment && lastMsg.attachment.raw && lastMsg.attachment.ext == '.mp4' && lastMsg.attachment.url){
_str = "[视频]"; _str = "[视频]";
} } else if (JSON.parse(lastMsg.attachment.raw).type == 100002) {
else if (JSON.parse(lastMsg.attachment.raw).type == 100002){
_str = "[工单] " + JSON.parse(lastMsg.attachment.raw).userName; _str = "[工单] " + JSON.parse(lastMsg.attachment.raw).userName;
} } else if (JSON.parse(lastMsg.attachment.raw).type == 100000) {
else {
_str = "[职位] " + JSON.parse(lastMsg.attachment.raw).title; _str = "[职位] " + JSON.parse(lastMsg.attachment.raw).title;
} else {
} _str = "[新消息] ";
}
} }
if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.ext == ".mp3") { if (!lastMsg.text && lastMsg.attachment && lastMsg.attachment.ext == ".mp3") {
_str = "[语音]"; _str = "[语音]";

@ -25,6 +25,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed,getCurrentInstance } from "vue";
import { onUnmounted, ref, defineExpose, watch } from "../../../utils/transformVue"; import { onUnmounted, ref, defineExpose, watch } from "../../../utils/transformVue";
import { autorun } from "mobx"; import { autorun } from "mobx";
import { onHide } from "@dcloudio/uni-app"; import { onHide } from "@dcloudio/uni-app";
@ -38,7 +39,8 @@ import { customNavigateTo } from "../../../utils/customNavigate";
import { deepClone } from "../../../utils"; import { deepClone } from "../../../utils";
import { V2NIMConversation } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMConversationService"; import { V2NIMConversation } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMConversationService";
const corpUserFlag = ref(uni.getStorageSync("apply-userinfo").corpUserFlag); const corpUserFlag = ref(uni.getStorageSync("apply-userinfo").corpUserFlag);
const G = getCurrentInstance().appContext.app.config.globalProperties.G;
const appType = ref(uni.getStorageSync("requestComeFrom"));
const conversationList = ref<V2NIMConversation[]>([]); const conversationList = ref<V2NIMConversation[]>([]);
defineExpose({ defineExpose({
conversationList, conversationList,
@ -73,7 +75,8 @@ const handleSessionItemClick = async (conversation: V2NIMConversation) => {
await uni.$UIKitStore.uiStore.selectConversation(conversation.conversationId); await uni.$UIKitStore.uiStore.selectConversation(conversation.conversationId);
const itemUserInfo = await uni.$UIKitStore.userStore.getUserActive(conversation.conversationId.split('|')[2]) const itemUserInfo = await uni.$UIKitStore.userStore.getUserActive(conversation.conversationId.split('|')[2])
let _title = ''; let _title = '';
if(itemUserInfo.serverExtension){ console.log('appType.valueappType.valueappType.value',appType.value);
if(itemUserInfo.serverExtension && appType.value == 'isToB'){
_title = itemUserInfo.name + '@' + JSON.parse(itemUserInfo.serverExtension).fullName; _title = itemUserInfo.name + '@' + JSON.parse(itemUserInfo.serverExtension).fullName;
}else{ }else{
_title = itemUserInfo.name; _title = itemUserInfo.name;
@ -156,7 +159,6 @@ onHide(() => {
}); });
const conversationListWatch = autorun(() => { const conversationListWatch = autorun(() => {
console.log("uni.$UIKitStore?.uiStore?.conversations", uni.$UIKitStore?.uiStore?.conversations);
const conversations = deepClone(uni.$UIKitStore?.uiStore?.conversations) || []; const conversations = deepClone(uni.$UIKitStore?.uiStore?.conversations) || [];
// renderKey // renderKey
@ -184,7 +186,6 @@ const conversationListWatch = autorun(() => {
loading.value = false; loading.value = false;
}, 2000); }, 2000);
console.log("conversationListWatch", conversationList.value);
setTabUnread(); setTabUnread();
}); });
// const conversationListWatch = autorun(() => { // const conversationListWatch = autorun(() => {

@ -56,7 +56,6 @@ export const getMsgContentTipByType = (msg: {
} }
export const setTabUnread = (val): void => { export const setTabUnread = (val): void => {
console.log('setTabUnread', val);
const routes = getCurrentPages() const routes = getCurrentPages()
const curRoute = routes[routes.length - 1].route const curRoute = routes[routes.length - 1].route
const tabPaths = [ const tabPaths = [
@ -67,16 +66,14 @@ export const setTabUnread = (val): void => {
'pages/person/index', 'pages/person/index',
'root/person/changeTeam' 'root/person/changeTeam'
] ]
console.log('11111111111111111111111111111111111111111111');
if (curRoute && !tabPaths.includes(curRoute)) { if (curRoute && !tabPaths.includes(curRoute)) {
// 不是首页和聊天页不需要设置tabbar的badge // 不是首页和聊天页不需要设置tabbar的badge
return return
} }
console.log('22222222222222222222222222222222222222222222');
const store = uni.$UIKitStore const store = uni.$UIKitStore
const unread = store?.conversationStore.totalUnreadCount || 0 const unread = store?.conversationStore.totalUnreadCount || 0
console.log('store?.conversationStore.totalUnreadCount', store?.conversationStore.totalUnreadCount); // console.log('store?.conversationStore.totalUnreadCount', store?.conversationStore.totalUnreadCount);
uni.$emit('newMessage', { count: store?.conversationStore.totalUnreadCount, type: 'message' }) uni.$emit('newMessage', { count: store?.conversationStore.totalUnreadCount, type: 'message' })
uni.setStorageSync("chat_info", { count: store?.conversationStore.totalUnreadCount, type: 'message' }); uni.setStorageSync("chat_info", { count: store?.conversationStore.totalUnreadCount, type: 'message' });
// if (unread === 0) { // if (unread === 0) {

@ -18,7 +18,7 @@
<!-- <view class=""> --> <!-- <view class=""> -->
<view> <view>
<view :class="[from ? 'sticky' : '']" v-if="isLogin"> <view :class="[from ? 'sticky' : '']" v-if="isLogin">
<div class="g_text_c g_h_24 g_pt_12 g_pb_12 g_bg_f" style="z-index: 100" v-if="from == 'chat'"></div> <div class="g_text_c g_h_24 g_pt_16 g_pb_4 g_bg_f" style="z-index: 100" v-if="from == 'chat'"></div>
<view style="background-color: #fff" class=""> <view style="background-color: #fff" class="">
<view class="m-select"> <view class="m-select">
<view style="height: 52px" class="g_flex_column_center g_pt_8"> <view style="height: 52px" class="g_flex_column_center g_pt_8">

@ -0,0 +1,133 @@
<template>
<div class="">
<div class="">
<div class="g_p_10 g_pt_8 g_bg_ed sticky">
<div class="g_text_c g_h_24 g_pt_6 g_pb_12">快捷回复</div>
<u-search height="80" v-model="keys" @change="searchReply('change')" @clear="searchReply('search')" @search="searchReply('search')" class="" placeholder="搜索常用回复" bg-color="#fff" :show-action="false" placeholder-class="g_c_c" search-icon-color="#999999" :maxlength="20"></u-search>
<div class="g_pt_8">
<u-tabs bg-color="transparent" from="index" gutter="20" :showBar="true" bar-width="60" bar-height="6" :list="tabInfo.list" :is-scroll="true" v-model="tabInfo.active" active-color="#00b666" @change="handleUpdateTab" font-size="34" duration="0.05" height="72"></u-tabs>
</div>
</div>
</div>
<div class="g_pl_16 g_pr_10">
<div class="" v-if="tabInfo.list[tabInfo.active].classify == 1">
<div class="g_mt_6" v-for="item in chosenList">
<div class="g_c_main leftLine g_fw_600">
{{ item.classifyName }}
</div>
<template v-for="innerItem in item.recordList" :key="innerItem.recordSort">
<div class="g_flex_row_start g_pl_10 g_pt_6" @click="sendQuickReply(innerItem)">
<div class="g_c_main">
{{ innerItem.ask + "" }}
</div>
<div class="g_text_u">
{{ innerItem.answer }}
</div>
</div>
</template>
</div>
</div>
<div class="" v-if="tabInfo.list[tabInfo.active].classify == 2">
<template v-for="item in chosenList" :key="item.id">
<div class="g_flex_row_start g_pt_6" @click="sendQuickReply(item)">
<div class="g_c_main">
{{ item.ask + "" }}
</div>
<div class="g_text_u">
{{ item.answer }}
</div>
</div>
</template>
</div>
<div class="" style="margin-top: 120px" v-if="chosenList.length == 0">
<g-empty text="暂无回复" />
</div>
</div>
</div>
</template>
<script>
import api from "../utils/api.js";
export default {
//
name: "",
//
components: {},
//
props: {},
//
data() {
return {
keys: "",
chosenList: [],
tabInfo: {
list: [
{
name: "常用回复",
classify: 1,
},
{
name: "自定义回复",
classify: 2,
},
],
active: 0,
},
};
},
//
computed: {},
//
watch: {},
created() {
this.getChosenList();
},
mounted() {},
//
methods: {
sendQuickReply(_item) {
let that = this;
that.$emit("sendQuickReply", _item);
},
handleUpdateTab(e) {
let that = this;
that.chosenList = [];
that.tabInfo.active = e;
that.getChosenList();
},
searchReply(e) {
let that = this;
if ((e == "change" && that.keys == "") || e == "search") {
that.getChosenList();
}
},
getChosenList() {
let that = this;
let url = "get_getChosenList";
if (that.tabInfo.list[that.tabInfo.active].classify == 2) {
url = "get_getSelfList";
}
that.G.Get(api[url], { keys: that.keys }, (res) => {
console.log("resresresres", res);
that.chosenList = res;
});
},
},
};
</script>
<style scoped lang="less">
.leftLine {
position: relative;
&::before {
content: "";
position: absolute;
left: -6px;
top: 50%;
width: 3px;
height: 80%;
background-color: #00b666;
transform: translateY(-50%);
}
}
</style>

@ -33,19 +33,27 @@
<u-popup v-model="jobListShow" mode="bottom" z-index="999999" border-radius="12" :closeable="true" :mask-close-able="true" :mask="true" @close="jobListShow = false"> <u-popup v-model="jobListShow" mode="bottom" z-index="999999" border-radius="12" :closeable="true" :mask-close-able="true" :mask="true" @close="jobListShow = false">
<scroll-view :scroll-y="true" @scrolltolower="reachBottom" class="g_bg_ed" style="height: 95vh"> <scroll-view :scroll-y="true" @scrolltolower="reachBottom" class="g_bg_ed" style="height: 95vh">
<div class=""> <div class="">
<!-- 发送工单 -->
<div class="" v-if="popType == 'apply'"> <div class="" v-if="popType == 'apply'">
<gListApply from="chat" :upAgencyId="beCollectedAgencyId" @sendApply="sendApply"></gListApply> <gListApply from="chat" :upAgencyId="beCollectedAgencyId" @sendApply="sendApply"></gListApply>
</div> </div>
<!-- 发送职位 -->
<div class="" v-if="popType == 'job'"> <div class="" v-if="popType == 'job'">
<div class="m-search g_p_10 g_pt_8 g_position_rela g_flex_1 g_bg_ed sticky"> <div class="g_p_10 g_pt_8 g_bg_ed sticky">
<div class="g_text_c g_h_24 g_pt_6 g_pb_12">发送职位</div> <div class="g_text_c g_h_24 g_pt_6 g_pb_12">发送职位</div>
<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> <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 class="g_pt_8" v-if="popType == 'job'"> <div class="g_pt_8">
<u-tabs bg-color="transparent" from="index" gutter="20" :showBar="false" :list="tabInfo.list" :is-scroll="true" v-model="tabInfo.active" active-color="#00b666" @change="handleUpdateTab" font-size="34" duration="0.05" height="48"></u-tabs> <u-tabs bg-color="transparent" from="index" gutter="20" :showBar="false" :list="tabInfo.list" :is-scroll="true" v-model="tabInfo.active" active-color="#00b666" @change="handleUpdateTab" font-size="34" duration="0.05" height="48"></u-tabs>
</div> </div>
</div> </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="嘿,这里还没有数据呢" /> <g-list-job from="chat" @uploadList="getList" @sendJob="sendJob" bg="#ededed" class="" :query="query" :list="query.list" :loading="loading" :speed="speed" :isShowLoginBtn="false" emptyText="嘿,这里还没有数据呢" />
</div> </div>
<!-- 快捷回复 -->
<div class="" v-if="popType == 'reply'">
<quickReply @sendQuickReply="sendQuickReply" ></quickReply>
<!-- <gListApply from="chat" :upAgencyId="beCollectedAgencyId" @sendApply="sendApply"></gListApply> -->
</div>
</div> </div>
</scroll-view> </scroll-view>
</u-popup> </u-popup>
@ -54,6 +62,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import gListJob from "../../../../components/list/job"; import gListJob from "../../../../components/list/job";
import quickReply from "../../components/quickReply.vue";
import gListApply from "../../../../pages/workBench/index.vue"; import gListApply from "../../../../pages/workBench/index.vue";
import { onShow } from "@dcloudio/uni-app"; import { onShow } from "@dcloudio/uni-app";
import { events } from "../../utils/constants"; import { events } from "../../utils/constants";
@ -77,13 +86,7 @@ const G = getCurrentInstance().appContext.app.config.globalProperties.G;
const F = getCurrentInstance().appContext.app.config.globalProperties.F; const F = getCurrentInstance().appContext.app.config.globalProperties.F;
import api from "../../utils/api.js"; import api from "../../utils/api.js";
console.log("apiapiapi", api); console.log("apiapiapi", api);
const appType = computed(() => { const appType = ref(uni.getStorageSync("requestComeFrom"));
let val = "isToC";
if (G.globalConstantData.requestComeFrom && (G.globalConstantData.requestComeFrom == "assistant_miniapp" || G.globalConstantData.requestComeFrom == "supply_chain_miniapp")) {
val = "isToB";
}
return val; //
});
const popType = ref(""); // const popType = ref(""); //
export interface YxReplyMsg { export interface YxReplyMsg {
messageClientId: string; messageClientId: string;
@ -740,6 +743,19 @@ const sendApply = (_item) => {
}, },
}); });
}; };
const sendQuickReply = (e) =>{
console.log(e);
const textMsg = uni.$UIKitNIM.V2NIMMessageCreator.createTextMessage(e.answer);
uni.$UIKitStore.msgStore.sendMessageActive({
msg: textMsg,
conversationId,
sendBefore: () => {
jobListShow.value = false;
uni.$emit(events.ON_SCROLL_BOTTOM);
// scrollBottom();
},
});
}
const reachBottom = () => { const reachBottom = () => {
if (query.value.isFinish == -1 || query.value.isFinish == query.value.size) { if (query.value.isFinish == -1 || query.value.isFinish == query.value.size) {
query.value.page++; query.value.page++;

@ -48,11 +48,15 @@
<Icon @tap="handleSetting" type="icon-shezhi" :size="20" /> <Icon @tap="handleSetting" type="icon-shezhi" :size="20" />
</div> </div>
</div> --> </div> -->
<div class="g_flex_c"> <div class="g_flex_row_between flex_center">
<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-if="audioPanelVisible" :size="28" type="audio-btn-selected" key="audio-btn-selected" />
<Icon v-else :size="28" type="icon-audio" key="icon-audio" /> <Icon v-else :size="28" type="icon-audio" key="icon-audio" />
</div> </div>
<div class="g_ml_6">
<div class="g_w_64 g_h_40 g_radius_6 g_bg_main g_c_f g_fs_14 g_text_c g_position_rela" style="line-height: 40px;top:-3px" @click="sendQuickReply"></div>
<!-- <g-button btnText="常用语" fontSize="14" mode="square" type="primary" size="mini" @clickBtn="sendApply(item)" /> -->
</div>
<!-- v-if="inputVisible" --> <!-- v-if="inputVisible" -->
<div class="msg-input g_flex_1"> <div class="msg-input g_flex_1">
<!-- 当从表情面板切换到文字输入时直接唤起键盘会导致input框滚动消失故此处需要用EmojiInput兼容下保证先隐藏表情面板再弹出键盘 --> <!-- 当从表情面板切换到文字输入时直接唤起键盘会导致input框滚动消失故此处需要用EmojiInput兼容下保证先隐藏表情面板再弹出键盘 -->
@ -148,6 +152,15 @@
</div> </div>
<div class="icon-text">{{ "发送工单" }}</div> <div class="icon-text">{{ "发送工单" }}</div>
</div> </div>
<!-- #ifdef MP-WEIXIN -->
<div class="send-more-panel-item-wrapper">
<div class="send-more-panel-item" @tap="(event) => handleSendPosition()">
<div class="iconfont icon-fasong1 g_c_6 g_fs_24"></div>
</div>
<div class="icon-text">{{ "发送位置" }}</div>
</div>
<!-- #endif -->
<!-- <div class="send-more-panel-item-wrapper"> <!-- <div class="send-more-panel-item-wrapper">
<div class="send-more-panel-item" @tap="(event) => handleSetting()"> <div class="send-more-panel-item" @tap="(event) => handleSetting()">
<Icon type="icon-shezhi" :size="30"></Icon> <Icon type="icon-shezhi" :size="30"></Icon>
@ -196,7 +209,7 @@
import Face from "./face.vue"; import Face from "./face.vue";
import VoicePanel from "./voice-panel.vue"; import VoicePanel from "./voice-panel.vue";
import Icon from "../../../components/Icon.vue"; import Icon from "../../../components/Icon.vue";
import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults, defineEmits, watch} from "vue"; import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults, defineEmits, watch } from "vue";
// import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults, defineEmits, watch } from "../../../utils/transformVue"; // import { ref, getCurrentInstance, computed, onUnmounted, onMounted, defineProps, withDefaults, defineEmits, watch } from "../../../utils/transformVue";
import { ALLOW_AT, events, REPLY_MSG_TYPE_MAP } from "../../../utils/constants"; import { ALLOW_AT, events, REPLY_MSG_TYPE_MAP } from "../../../utils/constants";
import { emojiMap } from "../../../utils/emoji"; import { emojiMap } from "../../../utils/emoji";
@ -220,13 +233,7 @@ import { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK";
export type MentionedMember = { accountId: string; appellation: string }; export type MentionedMember = { accountId: string; appellation: string };
const corpUserFlag = ref(uni.getStorageSync("apply-userinfo").corpUserFlag); const corpUserFlag = ref(uni.getStorageSync("apply-userinfo").corpUserFlag);
const G = getCurrentInstance().appContext.app.config.globalProperties.G; const G = getCurrentInstance().appContext.app.config.globalProperties.G;
const appType = computed(() => { const appType = ref(uni.getStorageSync("requestComeFrom"));
let val = "isToC";
if (G.globalConstantData.requestComeFrom && (G.globalConstantData.requestComeFrom == "assistant_miniapp" || G.globalConstantData.requestComeFrom == "supply_chain_miniapp")) {
val = "isToB";
}
return val; //
});
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
conversationType: V2NIMConst.V2NIMConversationType; conversationType: V2NIMConst.V2NIMConversationType;
@ -567,6 +574,35 @@ const handleSendapply = () => {
console.log("props.jobListShow", props.jobListShow); console.log("props.jobListShow", props.jobListShow);
emits("jobListShow", { isShow: true, type: "apply" }); emits("jobListShow", { isShow: true, type: "apply" });
}; };
const handleSendPosition = () => {
uni.chooseLocation({
success(e) {
const customMsg = uni.$UIKitNIM.V2NIMMessageCreator.createCustomMessage(
"",
JSON.stringify({
type: 100003,
address: e.address || "-",
latitude: e.latitude || "-",
longitude: e.longitude || "-",
name: e.name || "-",
})
);
console.log("customMsg", customMsg);
uni.$UIKitStore.msgStore.sendMessageActive({
msg: customMsg,
conversationId,
sendBefore: () => {
uni.$emit(events.ON_SCROLL_BOTTOM);
// scrollBottom();
},
});
console.log(e);
},
fail(e) {
console.log("err", e);
},
});
};
const sendPointJob = () => { const sendPointJob = () => {
emits("exportPointJob"); emits("exportPointJob");
@ -800,7 +836,7 @@ const screenHeight = ref(0);
screenHeight.value = uni.getSystemInfoSync().windowHeight; screenHeight.value = uni.getSystemInfoSync().windowHeight;
const chooseData = ref({}); const chooseData = ref({});
onMounted(() => { onMounted(() => {
ssff.value = uni.getWindowInfo().safeArea.top + 14; ssff.value = uni.getWindowInfo().safeArea.top + 14;
if (uni.getStorageSync("im_sendParams")) { if (uni.getStorageSync("im_sendParams")) {
chooseData.value = JSON.parse(uni.getStorageSync("im_sendParams")).jobDetail; chooseData.value = JSON.parse(uni.getStorageSync("im_sendParams")).jobDetail;
} }
@ -927,7 +963,7 @@ onMounted(() => {
emojiVisible.value = false; emojiVisible.value = false;
extVisible.value = false; extVisible.value = false;
uni.$emit(events.KeyboardEvent, 0); uni.$emit(events.KeyboardEvent, 0);
uni.$emit("msgKeyHeight", '100%'); // uni.$emit("msgKeyHeight", "100%"); //
} }
}); });
} }
@ -1010,7 +1046,9 @@ const onAtMembersExtHandler = () => {
// @ts-ignore // @ts-ignore
return ext; return ext;
}; };
const sendQuickReply = () => {
emits("jobListShow", { isShow: true, type: "reply" });
};
onUnmounted(() => { onUnmounted(() => {
uni.$off(events.REPLY_MSG); uni.$off(events.REPLY_MSG);
uni.$off(events.ON_REEDIT_MSG); uni.$off(events.ON_REEDIT_MSG);

@ -337,25 +337,40 @@
style="background-color: #ffffff;border-radius: 8px;padding: 12px;width: calc(100% - 24px);position: relative;left: 50%;transform: translateX(-50%);" style="background-color: #ffffff;border-radius: 8px;padding: 12px;width: calc(100% - 24px);position: relative;left: 50%;transform: translateX(-50%);"
@tap="goApplyDetail(JSON.parse(props.msg.attachment.raw))"> @tap="goApplyDetail(JSON.parse(props.msg.attachment.raw))">
<div class="g_text_c g_fw_600 g_fs_16 g_mb_12">工单信息</div> <div class="g_text_c g_fw_600 g_fs_16 g_mb_12">工单信息</div>
<div class="g_flex_row_center g_mb_8"> <div class="g_flex_row_center g_fs_14 g_mb_8">
<div class="g_w_120 g_text_r">姓名</div> <div class="g_w_120 g_text_r">姓名</div>
<div class="g_flex_1 g_fw_600">{{ JSON.parse(props.msg.attachment.raw).userName }}</div> <div class="g_flex_1 ">{{ JSON.parse(props.msg.attachment.raw).userName }}</div>
</div> </div>
<div class="g_flex_row_center g_mb_8"> <div class="g_flex_row_center g_fs_14 g_mb_8">
<div class="g_w_120 g_text_r">身份证号</div> <div class="g_w_120 g_text_r">身份证号</div>
<div class="g_flex_1 g_fw_600">{{ JSON.parse(props.msg.attachment.raw).idCard }}</div> <div class="g_flex_1 ">{{ JSON.parse(props.msg.attachment.raw).idCard }}</div>
</div> </div>
<div class="g_flex_row_center g_mb_8"> <div class="g_flex_row_center g_fs_14 g_mb_8">
<div class="g_w_120 g_text_r">企业岗位</div> <div class="g_w_120 g_text_r">企业岗位</div>
<div class="g_flex_1 g_fw_600">{{ JSON.parse(props.msg.attachment.raw).storeJobName }}</div> <div class="g_flex_1 ">{{ JSON.parse(props.msg.attachment.raw).storeJobName }}</div>
</div> </div>
<div class="g_flex_row_center g_mb_8"> <div class="g_flex_row_center g_fs_14 g_mb_8">
<div class="g_w_120 g_text_r">面试时间</div> <div class="g_w_120 g_text_r">面试时间</div>
<div class="g_flex_1 g_fw_600">{{ JSON.parse(props.msg.attachment.raw).interviewTime }}</div> <div class="g_flex_1 ">{{ JSON.parse(props.msg.attachment.raw).interviewTime }}</div>
</div> </div>
<div class="g_flex_row_center g_mb_8"> <div class="g_flex_row_center g_fs_14 g_mb_8">
<div class="g_w_120 g_text_r">电话</div> <div class="g_w_120 g_text_r">电话</div>
<div class="g_flex_1 g_fw_600">{{ JSON.parse(props.msg.attachment.raw).tel }}</div> <div class="g_flex_1 ">{{ JSON.parse(props.msg.attachment.raw).tel }}</div>
</div>
</div>
</div>
<!-- 100003代表位置卡片 -->
<div class="msg-common" :style="{ flexDirection: !props.msg.isSelf ? 'row' : 'row-reverse' }"
v-else-if="props.msg.messageType == 100 && props.msg.attachment && JSON.parse(props.msg.attachment.raw).type == 100003">
<div class="job-card" style="background-color: #ffffff;border-radius: 8px;padding: 12px;width: calc(100% - 24px);position: relative;left: 50%;transform: translateX(-50%);" @tap="goMap(JSON.parse(props.msg.attachment.raw))">
<div class="g_flex_row_start flex_center g_mb_8">
<div class="iconfont icon-dizhi1 g_c_main g_mr_4"></div>
<div class=" g_fs_18 g_c_3 g_fw_600">
{{ JSON.parse(props.msg.attachment.raw).name }}
</div>
</div>
<div class="g_flex_row_start g_fs_14 g_c_6 ">
{{ JSON.parse(props.msg.attachment.raw).address }}
</div> </div>
</div> </div>
</div> </div>
@ -455,13 +470,7 @@
import Icon from '../../../components/Icon.vue' import Icon from '../../../components/Icon.vue'
import Appellation from '../../../components/Appellation.vue' import Appellation from '../../../components/Appellation.vue'
const G = getCurrentInstance().appContext.app.config.globalProperties.G; const G = getCurrentInstance().appContext.app.config.globalProperties.G;
const appType = computed(() => { const appType = ref(uni.getStorageSync("requestComeFrom"));
let val = "isToC";
if (G.globalConstantData.requestComeFrom && (G.globalConstantData.requestComeFrom == "assistant_miniapp" || G.globalConstantData.requestComeFrom == "supply_chain_miniapp")) {
val = "isToB";
}
return val; //
});
console.log('message-item',jsa) console.log('message-item',jsa)
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -567,7 +576,7 @@
} }
} }
getUserInfo().then(res => { getUserInfo().then(res => {
if(res.serverExtension){ if(res.serverExtension && appType.value == 'isToB'){
subtitle.value = '@' + JSON.parse(res.serverExtension).fullName; subtitle.value = '@' + JSON.parse(res.serverExtension).fullName;
}else{ }else{
subtitle.value = ''; subtitle.value = '';
@ -603,6 +612,20 @@
url: `/root/detail/apply?id=${_item.applyId}&type=${_item.active}&relationId=${_item.relationId}`, url: `/root/detail/apply?id=${_item.applyId}&type=${_item.active}&relationId=${_item.relationId}`,
}); });
} }
const goMap = (_item)=>{
console.log(_item);
let params = {};
_item.latitude && (params.latitude = _item.latitude)
_item.longitude && (params.longitude = _item.longitude)
if(uni && uni.chooseLocation){
uni.chooseLocation({
...params,
success(e) {
}
});
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -3,6 +3,8 @@ let jobInfo = {
yi_job_list: '/yishoudan/custom/job/listApp', // 一才职位列表(招工宝发送商家职位用) yi_job_list: '/yishoudan/custom/job/listApp', // 一才职位列表(招工宝发送商家职位用)
job_list: "/assistant/custom/job/v2/list",// 职位列表() job_list: "/assistant/custom/job/v2/list",// 职位列表()
get_AgencyIdByAccId: "/wyyx/systemuser/getAgencyIdByAccid",// 通过accid获取代理id get_AgencyIdByAccId: "/wyyx/systemuser/getAgencyIdByAccid",// 通过accid获取代理id
get_getChosenList: "/common/salesmen/ask/answer/getChosenList",// 快捷回复查询
get_getSelfList: "/common/salesmen/ask/answer/getSelfList",// 自定义回复查询
} }
export default jobInfo; export default jobInfo;

@ -10,7 +10,7 @@
<view class="g_flex_row_start"> <view class="g_flex_row_start">
<view v-for="item in dateList.list" :key="item.value" class="g_mr_20" :class="dateList.active == item.value ? 'g_c_main' : ''" @click="changeDate(item)">{{ item.name }}</view> <view v-for="item in dateList.list" :key="item.value" class="g_mr_20" :class="dateList.active == item.value ? 'g_c_main' : ''" @click="changeDate(item)">{{ item.name }}</view>
</view> </view>
<view class="g_text_underline g_bg_f g_radius_8 g_p_8" :class="dateList.active == -1 && dateList.popActive == -1 ? 'g_c_main' : ''" @click="customDateShow = true">自定义</view> <view class="g_text_u g_bg_f g_radius_8 g_p_8" :class="dateList.active == -1 && dateList.popActive == -1 ? 'g_c_main' : ''" @click="customDateShow = true">自定义</view>
</view> </view>
<view class="g_bg_f g_ml_10 g_mr_10 g_radius_8" v-if="dataList.length > 0"> <view class="g_bg_f g_ml_10 g_mr_10 g_radius_8" v-if="dataList.length > 0">
<view class="tableTitle g_fs_16"> <view class="tableTitle g_fs_16">

@ -428,7 +428,7 @@ scroll-view::-webkit-scrollbar {
text-align: justify; text-align: justify;
text-align-last: justify; text-align-last: justify;
} }
&_underline { &_u {
text-decoration: underline; text-decoration: underline;
} }
} }

Loading…
Cancel
Save