修改页面

This commit is contained in:
2025-09-16 10:00:38 +08:00
parent a3aaf7dd4e
commit 1384c92fab
12 changed files with 127 additions and 125 deletions

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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({

View File

@@ -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;

View File

@@ -9,10 +9,7 @@
</view>
<!-- 内容区 -->
<view class="question-content">
<view class="question-desc">
{{info.content}}
</view>
<view class="question-desc" v-html=" info.content"></view>
<image src="info.img" class="question-img" mode="widthFix" />
<view class="question-time">{{info.time}}</view>
</view>

View File

@@ -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);

View File

@@ -32,7 +32,7 @@
<text class="label">人脸图片</text>
<image
class="face-image"
:src="auditsDetail.img || '/static/ic_avg.png'"
:src="imgUrl || '/static/ic_avg.png'"
mode="aspectFill"
/>
</view>
@@ -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;
}
});
});
}
}

View File

@@ -15,7 +15,7 @@
<!-- 员工审核卡片 -->
<view v-for="(item, index) in employeeList" :key="index" class="employee-card" @click="handleCardClick(item)">
<!-- 左侧头像 -->
<image class="avatar" :src="item.avatar || '/static/ic_avg.png'"/>
<image class="avatar" :src="item.img || '/static/ic_avg.png'"/>
<!-- 右侧信息 -->
<view class="info-container">
@@ -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);
}
}
},
}
};
</script>
@@ -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;
}

View File

@@ -30,7 +30,7 @@
<text class="label">人脸图片</text>
<image
class="face-image"
:src="employeeDetail.img || '/static/ic_avg.png'"
:src="imgUrl || '/static/ic_avg.png'"
mode="aspectFill"
/>
</view>
@@ -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({

View File

@@ -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;

View File

@@ -4,7 +4,7 @@
<view class="unit-header-container">
<view class="unit-header">
<image class="header-icon" src="/static/ic_enterprise.png" mode="aspectFit"/>
<view class="unit-title">南川******单位共189人</view>
<view class="unit-title">南川{{unitName}}单位</view>
</view>
</view>
@@ -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;
// 调用制作二维码方法

View File

@@ -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: {