no message

cyl/master-0804
jscyl13849007907 3 months ago
parent 3694e9afd0
commit ecab8b4bab

@ -0,0 +1,17 @@
let bindInfo = {
chat_create:"/yishoudan/common/user/job/match/getTalk",// 创建会话
chat_send:"/yishoudan/common/user/job/match/doTalk",// 处理会话
chat_ai_job:"/yishoudan/store/job/getShareJobs",// gpt返回的职位列表
chat_daotian_job:"/yishoudan/store/job/platform/list",// 稻田职位列表
job_detail_daotian:"/yishoudan/store/job/platform/detail",// 稻田职位详情
chat_config:'/yishoudan/common/user/job/match/getBotInfo',// 获取机器人配置
ai_config:'/robot/config/getRobotList',// 获取机器人列表
chat_getConversationld:'/chat/message/getConversationId',// 获取会话id
chat_getHistory:'/chat/message/getPageList',// 获取历史记录
chat_addHistory:'/chat/message/addChatMessage',// 新增聊天记录
chat_delMsg:'/chat/message/deleteMessage',// 删除聊天记录
}
export default bindInfo;

@ -6,6 +6,7 @@ import orderInfo from './order.js';
import personInfo from './person.js'; import personInfo from './person.js';
import wyyxInfo from './wyyx.js'; import wyyxInfo from './wyyx.js';
import commonInfo from './common.js'; import commonInfo from './common.js';
import chatInfo from './chat.js';
let testInfo = {// 测试接口 let testInfo = {// 测试接口
testUrl:"/overall/store/job/list",// 来源:稻田 小程序首页列表 testUrl:"/overall/store/job/list",// 来源:稻田 小程序首页列表
@ -19,4 +20,4 @@ let baseInfo = {// 公共接口
getConfig:"/yishoudan/weixin/config/getConfig", getConfig:"/yishoudan/weixin/config/getConfig",
} }
export default Object.assign(testInfo,baseInfo,loginInfo,userInfo,bindInfo,jobInfo,orderInfo,personInfo,commonInfo,wyyxInfo); export default Object.assign(testInfo,baseInfo,loginInfo,userInfo,bindInfo,jobInfo,orderInfo,personInfo,commonInfo,wyyxInfo,chatInfo);

@ -114,7 +114,7 @@
<view class="m-item chat-right" v-else style="max-width: 80vw"> <view class="m-item chat-right" v-else style="max-width: 80vw">
<view class="msg g_bg_main g_c_f g_fs_17 g_pl_16 g_pr_16 g_pt_10 g_pb_10" <view class="msg g_bg_main g_c_f g_fs_17 g_pl_16 g_pr_16 g_pt_10 g_pb_10"
@longpress="handleLongPress(item)" style="min-height: 45px;" @longpress="handleLongPress(item)" style="min-height: 25px;"
v-if="!item.isHidden" v-if="!item.isHidden"
> >
<g-chat-message :cusMessage="item.msg" style="max-width: 80%" v-if="item.msg" /> <g-chat-message :cusMessage="item.msg" style="max-width: 80%" v-if="item.msg" />
@ -2307,7 +2307,7 @@
line-height: 1.5; line-height: 1.5;
// letter-spacing: 1.5px; // letter-spacing: 1.5px;
word-break: break-all; word-break: break-all;
min-height: 45px; min-height: 25px;
} }
} }
@ -2319,7 +2319,7 @@
line-height: 1.5; line-height: 1.5;
// letter-spacing: 1.5px; // letter-spacing: 1.5px;
word-break: break-all; word-break: break-all;
min-height: 45px; min-height: 25px;
} }
} }
} }

@ -1,8 +1,14 @@
// let ajaxUrl = "http://192.168.3.83:8001"; // let ajaxUrl = "http://192.168.3.83:8001";
let ajaxUrl = "https://daotian.matripe.com.cn"; let ajaxUrl = "https://daotian.matripe.com.cn";
let requestTask;
let data = { let data = {
ajaxUrl: ajaxUrl, ajaxUrl: ajaxUrl,
Get ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) { startAbort($bool = 0) {
if ($bool == 1) {
requestTask.abort();
}
},
Get($url = '', $parmas = {}, callback = () => {}, failback = () => {}) {
let that = this, let that = this,
params = {}; params = {};
let promise = new Promise((resolve, reject) => { let promise = new Promise((resolve, reject) => {
@ -13,7 +19,7 @@ let data = {
that.postData($url, params, callback, failback, 'GET'); that.postData($url, params, callback, failback, 'GET');
}).catch(); }).catch();
}, },
Post ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) { Post($url = '', $parmas = {}, callback = () => {}, failback = () => {}) {
let that = this, let that = this,
params = {}; params = {};
let promise = new Promise((resolve, reject) => { let promise = new Promise((resolve, reject) => {
@ -24,7 +30,7 @@ let data = {
that.postData($url, params, callback, failback, 'POST'); that.postData($url, params, callback, failback, 'POST');
}).catch(); }).catch();
}, },
Put ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) { Put($url = '', $parmas = {}, callback = () => {}, failback = () => {}) {
let that = this, let that = this,
params = {}; params = {};
let promise = new Promise((resolve, reject) => { let promise = new Promise((resolve, reject) => {
@ -36,7 +42,7 @@ let data = {
}).catch(); }).catch();
}, },
setPublicParams () { setPublicParams() {
let that = this, let that = this,
params = {}; params = {};
let uuid_new = ""; let uuid_new = "";
@ -48,7 +54,7 @@ let data = {
} }
// #endif // #endif
params = { params = {
'requestComeFrom':'assistant_miniapp', 'requestComeFrom': 'assistant_miniapp',
// #ifdef APP-PLUS // #ifdef APP-PLUS
'g-open-env': 'APP-PLUS', 'g-open-env': 'APP-PLUS',
appId: uuid_new, appId: uuid_new,
@ -85,7 +91,7 @@ let data = {
return params return params
}, },
// 发送请求 // 发送请求
postData ($url = '', $parmas = {}, callback = () => { }, failback = () => { }, $method) { postData($url = '', $parmas = {}, callback = () => {}, failback = () => {}, $method) {
let that = this, let that = this,
$header = {}; $header = {};
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {
@ -107,7 +113,11 @@ let data = {
} }
} }
console.log("公共参数,+++++", Object.assign($parmas, that.setPublicParams())); console.log("公共参数,+++++", Object.assign($parmas, that.setPublicParams()));
uni.request({ uni.getNetworkType({
success: function(res) {
// console.log(res);
if (res.networkType != 'none') {
requestTask = uni.request({
url: ajaxUrl + $url, url: ajaxUrl + $url,
data: Object.assign($parmas, that.setPublicParams()), data: Object.assign($parmas, that.setPublicParams()),
header: Object.assign($header, that.setPublicParams()), header: Object.assign($header, that.setPublicParams()),
@ -117,9 +127,9 @@ let data = {
// console.log('测试报错123123123123123123$url',$url); // console.log('测试报错123123123123123123$url',$url);
let resData = res.data; let resData = res.data;
if (resData.status == 200) {// 正常 if (resData.status == 200) { // 正常
callback(resData.data, resData.msg); callback(resData.data, resData.msg);
} else if (resData.status == 9999) {// 登录过期或者身份变动等需要登录的场景 } else if (resData.status == 9999) { // 登录过期或者身份变动等需要登录的场景
uni.showToast({ uni.showToast({
title: resData.msg, title: resData.msg,
icon: "none" icon: "none"
@ -127,10 +137,11 @@ let data = {
failback(resData); failback(resData);
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' + that.getPathCopy().level url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' +
that.getPathCopy().level
}); });
}, 1500); }, 1500);
} else if (resData.status == 500 || resData.status == 502) {// 某种原因导致接口提示该状态码 } else if (resData.status == 500 || resData.status == 502) { // 某种原因导致接口提示该状态码
// if (resData.msg == '系统异常,请稍后') { // if (resData.msg == '系统异常,请稍后') {
// uni.reLaunch({ // uni.reLaunch({
// url: '/root/other/error' // url: '/root/other/error'
@ -145,18 +156,19 @@ let data = {
// } // }
} else if (resData.status == 2002) { } else if (resData.status == 2002) {
uni.showToast({ uni.showToast({
title:'已切换团队,需要重新登录', title: '已切换团队,需要重新登录',
icon: "none" icon: "none"
}); });
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/root/person/loginIndex?path=/pages/home/index&level=' + that.getPathCopy().level url: '/root/person/loginIndex?path=/pages/home/index&level=' + that
.getPathCopy().level
}); });
}, 1500); }, 1500);
} else {// 其他异常 } else { // 其他异常
if($url == '/yishoudan/user/apply/order/V2/details'){ if ($url == '/yishoudan/user/apply/order/V2/details') {
}else{ } else {
uni.showToast({ uni.showToast({
title: resData.msg, title: resData.msg,
icon: "none" icon: "none"
@ -167,19 +179,27 @@ let data = {
failback(resData.msg); failback(resData.msg);
} }
}, },
fail (error) { fail(error) {
uni.showToast({ uni.showToast({
// title: error.errMsg, // title: error.errMsg,
title:'系统异常,请稍后', title: '系统异常,请稍后',
icon: "none" icon: "none"
}) })
failback(error); failback(error);
} }
}); });
} else {
uni.showToast({
title: '网络异常,请检查网络',
icon: "none"
})
}
},
});
}, },
// 头像上传 // 头像上传
uploadFile ($file, callback = () => { }) { uploadFile($file, callback = () => {}) {
let that = this; let that = this;
uni.uploadFile({ uni.uploadFile({
url: ajaxUrl + '/user/changeUserImgsrc', url: ajaxUrl + '/user/changeUserImgsrc',
@ -196,7 +216,7 @@ let data = {
}, },
/* path /* path
*/ */
getPathCopy () { getPathCopy() {
const pages = getCurrentPages(); const pages = getCurrentPages();
if (pages.length > 0) { if (pages.length > 0) {
let _path = pages[pages.length - 1].route; let _path = pages[pages.length - 1].route;

Loading…
Cancel
Save