From 1384c92fab4845c131279db9218202039e6953c1 Mon Sep 17 00:00:00 2001 From: merak1237 <1036673629@qq.com> Date: Tue, 16 Sep 2025 10:00:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 2 +- pages/sys/home/home.vue | 3 +- pages/sys/user/changeInfo/changeInfo.vue | 5 +- pages/sys/user/myRepair/addRepair.vue | 87 ------------------- .../sys/user/serviceCenter/questionDetail.vue | 5 +- pages/sys/workbench/order/orderDetail.vue | 2 +- .../workbench/unitManagement/auditsDetail.vue | 19 +++- .../unitManagement/employeeAudits.vue | 54 +++++++++--- .../workbench/unitManagement/employeeEdit.vue | 10 ++- .../unitManagement/employeeManagement.vue | 48 ++++++++-- .../unitManagement/unitManagement.vue | 13 +-- vue.config.js | 4 +- 12 files changed, 127 insertions(+), 125 deletions(-) diff --git a/common/config.js b/common/config.js index 3511ef5..cebda09 100644 --- a/common/config.js +++ b/common/config.js @@ -32,6 +32,6 @@ const config = { //正式 config.baseUrl = 'http://183.230.235.66:11010/api'; - +config.imgUrl = 'http://183.230.235.66:11010'; // config.baseUrl = 'http://378a061a.r28.cpolar.top' export default config; diff --git a/pages/sys/home/home.vue b/pages/sys/home/home.vue index af8a76a..c59b0d4 100644 --- a/pages/sys/home/home.vue +++ b/pages/sys/home/home.vue @@ -156,10 +156,11 @@ imgRes.data.forEach(imgItem => { const mapping = imgIdToIndexMap.find(m => m.id === imgItem.ossId); if (mapping) { - this.$set(this.hotList[mapping.index], 'activityImgUrl', imgItem.url); + this.$set(this.hotList[mapping.index], 'activityImgUrl', this.vuex_config.imgUrl+imgItem.url); } }); } + console.log(this.hotList); } catch (error) { console.error('获取图片链接失败:', error); } diff --git a/pages/sys/user/changeInfo/changeInfo.vue b/pages/sys/user/changeInfo/changeInfo.vue index acf8d4a..1a3a585 100644 --- a/pages/sys/user/changeInfo/changeInfo.vue +++ b/pages/sys/user/changeInfo/changeInfo.vue @@ -106,7 +106,7 @@ export default { this.userInfo.sexLabel = this.genderOptions[this.userInfo.gender-1].label; this.$u.api.getImageUrl({}, this.userInfo.img).then(res=>{ if (res.code == 200) { - this.imgUrl=res.data[0].url; + this.imgUrl=this.vuex_config.baseUrl + res.data[0].url; } }); } @@ -146,7 +146,8 @@ export default { vm: this }); this.userInfo.img = result[0].data.ossId; - this.imgUrl = result[0].data.url; + this.imgUrl = this.vuex_config.imgUrl +result[0].data.url; + console.log(this.imgUrl); const allSuccess = result.every(item => item.code == 200); if (!allSuccess) { uni.showToast({ diff --git a/pages/sys/user/myRepair/addRepair.vue b/pages/sys/user/myRepair/addRepair.vue index 2931c38..651b8de 100644 --- a/pages/sys/user/myRepair/addRepair.vue +++ b/pages/sys/user/myRepair/addRepair.vue @@ -180,16 +180,6 @@ } }); }, - goRepaired() { - uni.navigateTo({ - url: '/pages/sys/user/myRepair/repaired' - }); - }, - goSelectLocation() { - uni.navigateTo({ - url: '/pages/sys/user/myRepair/selectLocation' - }); - } } } @@ -203,7 +193,6 @@ flex-direction: column; } - .add-repair-scroll-content { flex: 1; overflow-y: auto; @@ -240,42 +229,6 @@ height: 21rpx; } - .add-repair-address-btn { - width: 100%; - height: 48rpx; - background: #fff; - border: 2rpx solid #2186FF; - border-radius: 8rpx; - margin-bottom: 30rpx; - padding-left: 18rpx; - display: flex; - align-items: center; - justify-content: center; - } - - .add-repair-address-text { - font-size: 24rpx; - color: #007CFF; - margin-right: 15rpx; - } - - .add-repair-address-img { - width: 11rpx; - height: 21rpx; - } - - .add-repair-detail { - display: flex; - flex-direction: row; - align-items: center; - } - - .add-repair-detail1 { - font-size: 26rpx; - font-weight: bold; - color: #000; - } - .add-repair-detail2 { width: 100%; height: 98rpx; @@ -295,46 +248,6 @@ margin-bottom: 41rpx; } - .add-repair-label2 { - font-size: 32rpx; - color: #000000; - font-weight: 500; - margin-bottom: 25rpx; - margin-top: 25rpx; - } - - - .add-repair-type-list { - display: flex; - flex-wrap: wrap; - gap: 28rpx 21rpx; - } - - .add-repair-type-btn { - flex: 0 0 calc((100% - 42rpx) / 3); - box-sizing: border-box; - height: 73rpx; - background: #F2F7FF; - color: #2186FF; - font-size: 26rpx; - border-radius: 8rpx; - display: flex; - align-items: center; - justify-content: center; - border: none; - } - - .add-repair-type-btn.selected { - background: #2186FF; - color: #fff; - border: 2rpx solid #2186FF; - } - - .add-repair-type-btn.dashed { - border: 2rpx dashed #BDBDBD; - background: #fff; - color: #2186FF; - } .add-repair-optional { color: #888; diff --git a/pages/sys/user/serviceCenter/questionDetail.vue b/pages/sys/user/serviceCenter/questionDetail.vue index 2f72670..d9bf20f 100644 --- a/pages/sys/user/serviceCenter/questionDetail.vue +++ b/pages/sys/user/serviceCenter/questionDetail.vue @@ -9,10 +9,7 @@ - - {{info.content}} - - + {{info.time}} diff --git a/pages/sys/workbench/order/orderDetail.vue b/pages/sys/workbench/order/orderDetail.vue index 7e72380..f21420f 100644 --- a/pages/sys/workbench/order/orderDetail.vue +++ b/pages/sys/workbench/order/orderDetail.vue @@ -99,7 +99,7 @@ export default { if (!this.detail.orderImgUrl) return; const imgIds = this.detail.orderImgUrl.split(','); const res = await this.$u.api.getImageUrl({}, imgIds.join(',')); - if (res.code == 200 && res.data) this.orderImgUrls = res.data.map(item => item.url); + if (res.code == 200 && res.data) this.orderImgUrls = res.data.map(item => this.vuex_config.imgUrl+item.url); }, async getHandler() { let handlers = await this.$u.api.getHandler3({}, this.detail.type); diff --git a/pages/sys/workbench/unitManagement/auditsDetail.vue b/pages/sys/workbench/unitManagement/auditsDetail.vue index 8863854..ef434e5 100644 --- a/pages/sys/workbench/unitManagement/auditsDetail.vue +++ b/pages/sys/workbench/unitManagement/auditsDetail.vue @@ -32,7 +32,7 @@ 人脸图片: @@ -69,7 +69,9 @@ handleDesc: '', selectedImages: [], realImages: [], - infoImages: [] + infoImages: [], + imgUrl:'', + }; }, methods: { @@ -83,6 +85,7 @@ // 原有方法保持不变... handleApprove() { this.auditsDetail.isAudit=1 + this.auditsDetail.isAuditState=2 this.$u.api.unit.updateEmployee(this.auditsDetail).then(res => { if (res.code == "200") { // 提交逻辑 @@ -100,6 +103,7 @@ }, handleReject() { this.auditsDetail.isAudit=2 + this.auditsDetail.isAuditState=2 this.$u.api.unit.updateEmployee(this.auditsDetail).then(res => { if (res.code == "200") { // 提交逻辑 @@ -117,8 +121,15 @@ }, queryEmployee(id){ - this.$u.api.unit.queryEmployeeById(this.auditsDetail).then(res => { - this.auditsDetail = res.data; + const _this = this; + _this.$u.api.unit.queryEmployeeById(_this.auditsDetail).then(res => { + const {data} = res; + _this.auditsDetail = data; + _this.$u.api.getImageUrl({}, data.img).then(res=>{ + if (res.code == 200) { + _this.imgUrl=_this.vuex_config.imgUrl +res.data[0].url; + } + }); }); } } diff --git a/pages/sys/workbench/unitManagement/employeeAudits.vue b/pages/sys/workbench/unitManagement/employeeAudits.vue index 758e862..e389182 100644 --- a/pages/sys/workbench/unitManagement/employeeAudits.vue +++ b/pages/sys/workbench/unitManagement/employeeAudits.vue @@ -15,7 +15,7 @@ - + @@ -52,8 +52,7 @@ export default { data() { return { - employeeList: [ - ], // 员工列表数据 + employeeList: [], // 员工列表数据 pageNum: 1, // 当前页码 pageSize: 10, // 每页数量 noMore: false, // 是否没有更多数据 @@ -86,6 +85,7 @@ export default { let res = await this.$u.api.unit.queryEmployee({ pageNum: this.pageNum, pageSize: this.pageSize, + unitId: uni.getStorageSync('lifeData').vuex_user.unitId, }); if (res.code == "200") { let rows = res.rows || []; @@ -98,6 +98,7 @@ export default { } else { this.employeeList = [...this.employeeList, ...rows]; } + await this.getImageUrl(); } } catch (e) { console.error(e); @@ -107,13 +108,46 @@ export default { }, // 点击卡片事件 handleCardClick(item) { - console.log(item.id); - if (item.state === 1) { - uni.navigateTo({ - url: `/pages/sys/workbench/unitManagement/auditsDetail?id=${item.id}`, - }); + uni.navigateTo({ + url: `/pages/sys/workbench/unitManagement/auditsDetail?id=${item.id}`, + }); + }, + async getImageUrl() { + // 收集所有需要获取链接的图片ID + const imgIds = []; + const imgIdToIndexMap = []; // 保存图片ID对应的list索引 + + for (let i = 0; i < this.employeeList.length; i++) { + const item = this.employeeList[i]; + if (item.img) { + imgIds.push(item.img); + imgIdToIndexMap.push({ + id: item.img, + index: i + }); + } } - } + + // 如果有图片ID需要处理,则调用API一次获取所有图片链接 + if (imgIds.length > 0) { + console.log(imgIds); + try { + const imgRes = await this.$u.api.getImageUrl({}, imgIds.join(',')); + if (imgRes.code == 200 && imgRes.data) { + // 将返回的图片URL映射回对应的list项 + imgRes.data.forEach(imgItem => { + const mapping = imgIdToIndexMap.find(m => m.id === imgItem.ossId); + if (mapping) { + this.$set(this.employeeList[mapping.index], 'img', this.vuex_config.imgUrl+imgItem.url); + } + }); + } + console.log(this.employeeList); + } catch (error) { + console.error('获取图片链接失败:', error); + } + } + }, } }; @@ -196,7 +230,7 @@ export default { border-top-left-radius: 10px; border-bottom-left-radius: 10px; width: 26%; - text-align:left; + text-align: left; font-weight: bold; color: #fff; } diff --git a/pages/sys/workbench/unitManagement/employeeEdit.vue b/pages/sys/workbench/unitManagement/employeeEdit.vue index 63fd24e..6af854c 100644 --- a/pages/sys/workbench/unitManagement/employeeEdit.vue +++ b/pages/sys/workbench/unitManagement/employeeEdit.vue @@ -30,7 +30,7 @@ 人脸图片: @@ -84,6 +84,7 @@ export default { return { pageType: 'handle', // 'handle' 或 'detail' employeeDetail: {}, + imgUrl: '', }; }, methods: { @@ -97,14 +98,19 @@ export default { queryEmployee() { this.$u.api.unit.queryEmployeeById(this.employeeDetail).then(res => { this.employeeDetail = res.data; + this.$u.api.getImageUrl({}, this.employeeDetail.img).then(res=>{ + if (res.code == 200) { + this.imgUrl= this.vuex_config.imgUrl +res.data[0].url; + } + }); }); + console.log(this.employeeDetail); }, // 新增状态变更方法 changeStatus(newState) { this.employeeDetail.state = newState; }, saveInfo() { - console.log(this.employeeDetail); this.$u.api.unit.updateEmployee(this.employeeDetail).then(res => { if (res.code === 200) { uni.showToast({ diff --git a/pages/sys/workbench/unitManagement/employeeManagement.vue b/pages/sys/workbench/unitManagement/employeeManagement.vue index 5b1bb0c..6e9181b 100644 --- a/pages/sys/workbench/unitManagement/employeeManagement.vue +++ b/pages/sys/workbench/unitManagement/employeeManagement.vue @@ -105,7 +105,9 @@ export default { let params = { pageNum: this.pageNum, - pageSize: this.pageSize + pageSize: this.pageSize, + unitId: uni.getStorageSync('lifeData').vuex_user.unitId, + isAudit: 1 }; // 根据输入内容决定使用哪个搜索字段 @@ -129,6 +131,7 @@ export default { } else { this.list = [...this.list, ...rows]; } + await this.getImageUrl(); } } catch (e) { console.error(e); @@ -138,13 +141,46 @@ export default { }, // 点击卡片事件 handleCardClick(item) { - if (item.state === 1) { - uni.navigateTo({ - url: `/pages/sys/workbench/unitManagement/employeeEdit?id=${item.id}` - }); + uni.navigateTo({ + url: `/pages/sys/workbench/unitManagement/employeeEdit?id=${item.id}` + }); + }, + async getImageUrl() { + // 收集所有需要获取链接的图片ID + const imgIds = []; + const imgIdToIndexMap = []; // 保存图片ID对应的list索引 + + for (let i = 0; i < this.list.length; i++) { + const item = this.list[i]; + if (item.img) { + imgIds.push(item.img); + imgIdToIndexMap.push({ + id: item.img, + index: i + }); + } + } + + // 如果有图片ID需要处理,则调用API一次获取所有图片链接 + if (imgIds.length > 0) { + console.log(imgIds); + try { + const imgRes = await this.$u.api.getImageUrl({}, imgIds.join(',')); + if (imgRes.code == 200 && imgRes.data) { + // 将返回的图片URL映射回对应的list项 + imgRes.data.forEach(imgItem => { + const mapping = imgIdToIndexMap.find(m => m.id === imgItem.ossId); + if (mapping) { + this.$set(this.list[mapping.index], 'img', this.vuex_config.imgUrl+imgItem.url); + } + }); + } + console.log(this.list); + } catch (error) { + console.error('获取图片链接失败:', error); + } } }, - // 新增搜索方法 handleSearch() { this.pageNum = 1; diff --git a/pages/sys/workbench/unitManagement/unitManagement.vue b/pages/sys/workbench/unitManagement/unitManagement.vue index 762435c..ea3c917 100644 --- a/pages/sys/workbench/unitManagement/unitManagement.vue +++ b/pages/sys/workbench/unitManagement/unitManagement.vue @@ -4,7 +4,7 @@ - 南川区******单位(共189人) + 南川{{unitName}}单位 @@ -88,7 +88,7 @@ export default { return { showDialog: false, qrSize: 400, // 与CSS中保持一致 - + unitName:uni.getStorageSync('lifeData').vuex_user.unitName, } }, methods: { @@ -113,12 +113,15 @@ export default { }, // 修改后的makeQRCode方法 makeQRCode() { + let unitName = uni.getStorageSync('lifeData').vuex_user.unitName + var unitId = uni.getStorageSync('lifeData').vuex_user.unitId; + var tenantId = uni.getStorageSync('lifeData').vuex_user.tenantId; + // 获取uQRCode实例 var qr = new uQRCode(); // 设置二维码内容 - qr.data = `http://183.230.235.66:11010/parkH5?unitId=${uni.getStorageSync('lifeData').vuex_user.unitId} - & unitName=${uni.getStorageSync('lifeData').vuex_user.unitName} - & tenantId=${uni.getStorageSync('lifeData').vuex_user.tenantId}`; + let data = "http://183.230.235.66:11010/parkH5/#/?unitId=" + unitId + "&unitName=" + unitName + "&tenantId=" + tenantId; + qr.data = encodeURI(data) // 设置二维码大小,必须与canvas设置的宽高一致 qr.size = 200; // 调用制作二维码方法 diff --git a/vue.config.js b/vue.config.js index 82a9d6f..79baf67 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,8 +7,8 @@ module.exports = { port : 8081, proxy : { "/js" : { - // target : "http://183.230.235.66:11010/api", - target : "http://tc.cqsznc.com:7080/api", + target : "http://183.230.235.66:11010/api", + // target : "http://tc.cqsznc.com:7080/api", changeOrigin : true, secure : false, pathRewrite: {