From 570b8ab98f1190f0d7b6e942c29f187d55b81ce8 Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Fri, 19 Sep 2025 18:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 49 +++++++++++++++- root/detail/apply.vue | 42 +++++++++++++- root/home/applicationSuccess.vue | 120 +++++++++++++++++++++++++++++++++++++-- root/home/quickApplication.vue | 5 ++ utils/common.js | 3 +- 5 files changed, 211 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index b6999b1..4881722 100644 --- a/main.js +++ b/main.js @@ -34,7 +34,7 @@ export function createApp () { app.config.productionTip = false; app.component('g-empty', gEmpty); - app.component('g-tabbar', gTabbar); + app.component('g-tabbar', gTabbar); app.component('g-loading', gLoading); app.component('g-button', gButton); app.component('g-list-job', gListJob); @@ -100,7 +100,7 @@ export function createApp () { uni.setStorageSync("apply-agencyId", res.user.agencyId); // 单独存储 -- 代理id,方便获取 uni.setStorageSync("apply-supplierAccount", res.supplierAccount); // 单独存储 -- 是否是发单号,方便获取 0.不是发单号 1.是发单号 if (res.agencyId) { - // if (res.agencyStatus == 1) { + // if (res.agencyStatus == 1) { G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 @@ -242,6 +242,51 @@ export function createApp () { }, $sourceType); }, /** +* 上传到oss +*/ + uploadImgToOss (callback = () => { }, customDir = '', type = 'default', $num = 1, $sourceType = ['album', 'camera']) { + var that = this; + G.uploadImage($num, (imgRes) => { + uni.showLoading({ + title: '上传中...', + }) + console.log('imgRes', imgRes); + let imgPath = JSON.parse(imgRes)[0] + console.log('imgPath', imgPath); + G.Get(apiInfo.getOssInfo, { prefix: customDir }, ({ data }) => { + console.log('uploadImgToOssresresresres', data); + const { policy, signature, accessid, dir, host } = data; + let key = dir + that.getUUID() + const formData = { + "key": key + "_${filename}", + "policy": policy, + "OSSAccessKeyId": accessid, + signature, + "success_action_status": "200", + }; + + uni.uploadFile({ + url: host, + filePath: imgPath, + name: "file", + + formData: formData, + success: function (res) { + if (res.errMsg = "uploadFile:ok") { + const imgUrl = `${host}/${key}_${imgPath.split('/').pop()}`; + callback({ + status: '上传成功', + image: imgUrl + }); + } + console.log('resresresresresresres', res); + }, + fail: function (res) { }, + }); + }) + }) + }, + /** * 上传临时文件(不需要选择图库) */ uploadTmpImg ($fileName, callback = () => { }) { diff --git a/root/detail/apply.vue b/root/detail/apply.vue index fe05930..adb12d4 100644 --- a/root/detail/apply.vue +++ b/root/detail/apply.vue @@ -1174,7 +1174,47 @@ export default { }, goIm(cusData) { let that = this; + that.F.wyyxPost( + that.api.wyyx_create, + { + // senderUserId: uni.getStorageSync("apply-uid"), + // receiverUserId: cusData, + senderAccid: uni.getStorageSync("im-accid"), + receiverAccid: cusData.accid, + }, + (res) => { + uni.$UIKitStore.uiStore.selectConversation(res.conversationId); + const customMsg = uni.$UIKitNIM.V2NIMMessageCreator.createCustomMessage( + "", + JSON.stringify({ + type: 100002, + userName: that.orderDetail.userName + that.G.titleToStr(that.orderDetail) || "-", + idCard: that.orderDetail.idCard || "-", + storeJobName: that.orderDetail.storeJobName || "-", + interviewTime: that.G.getPointTime(that.orderDetail.interviewTime, "YY--MM--DD HH:MM") || "-", + tel: that.orderDetail.tel || "-", + applyId: that.orderDetail.id || null, + relationId: that.orderDetail.relationId || null, + active: that.orderDetail.active, + }) + ); + console.log("customMsg", customMsg); + uni.$UIKitStore.msgStore.sendMessageActive({ + msg: customMsg, + conversationId: res.conversationId, + sendBefore: () => { + uni.navigateTo({ + url: "/root/NEUIKit/pages/Chat/index", + }); + that.goImLoading = false; + // scrollBottom(); + }, + }); + }, + () => {} + ); + return; that.F.wyyxPost( that.api.wyyx_create, { @@ -1196,7 +1236,7 @@ export default { that.F.wyyxPost( that.api.wyyx_sendMessage, { - conversationType: 1, + conversationType: 1, senderAccid: uni.getStorageSync("im-accid"), receiverAccid: cusData.accid, text: that.G.objToStr(params, "copy"), diff --git a/root/home/applicationSuccess.vue b/root/home/applicationSuccess.vue index 5d8ab2b..52c637b 100644 --- a/root/home/applicationSuccess.vue +++ b/root/home/applicationSuccess.vue @@ -5,8 +5,13 @@ 已报名成功 您已成功报名该岗位,请等待发单号审核。 - - + + + + + + + 查看报名工单 @@ -16,6 +21,13 @@ diff --git a/root/home/quickApplication.vue b/root/home/quickApplication.vue index 01db7fd..c613eb3 100644 --- a/root/home/quickApplication.vue +++ b/root/home/quickApplication.vue @@ -459,6 +459,11 @@ export default { handleClickMobile() {}, submitForm() { let that = this; + + uni.navigateTo({ + url: "/root/home/applicationSuccess?jobId=" + that.updateInfo.jobId, + }); + return if (!that.agreeRadio) { uni.showToast({ icon: "none", diff --git a/utils/common.js b/utils/common.js index 9b0b693..a32ecf9 100644 --- a/utils/common.js +++ b/utils/common.js @@ -14,7 +14,7 @@ let data = { loginText: '请登录', coziID: '7537572244600471579', baseUrl: "https://daotian.matripe.com.cn",// 网络请求的基础路径 - // baseUrl: "http://192.168.3.83:8001", // 网络请求的基础路径 + // baseUrl: "http://192.168.1.87:8001", // 网络请求的基础路径 // #ifdef MP-WEIXIN version: uni.getAccountInfoSync().miniProgram.version || "1.0.16", // #endif @@ -118,6 +118,7 @@ let data = { } }); }, + /* 上传图片 */ uploadImage ($num = 1, callback = () => { }, $sourceType = ['album', 'camera']) {