企业详细信息页面编辑联系人功能开发
This commit is contained in:
@@ -51,25 +51,35 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 企业联系人列表 -->
|
||||
<view v-for="(contact, index) in companyInfo.companyContactList" :key="contact.id || index" class="contact-group">
|
||||
<view class="contact-group-title">企业联系人{{ index + 1 }}</view>
|
||||
|
||||
<view class="info-item btn-feel" @click="editContact(index, 'name')">
|
||||
<view class="info-label">联系人姓名</view>
|
||||
<view class="info-content">
|
||||
<text class="info-value">{{ contact.contactPerson || '暂无联系人' }}</text>
|
||||
<uni-icons color="#A2A2A2" type="right" size="16"></uni-icons>
|
||||
<!-- 企业联系人管理 -->
|
||||
<view class="contact-management-section">
|
||||
<view class="contact-section-header">
|
||||
<view class="contact-section-title">企业联系人</view>
|
||||
<view class="edit-contacts-btn btn-feel" @click="editContacts">
|
||||
<uni-icons type="compose" size="16" color="#256BFA"></uni-icons>
|
||||
<text class="edit-text">编辑联系人</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-item btn-feel" @click="editContact(index, 'phone')">
|
||||
<view class="info-label">联系电话</view>
|
||||
<view class="info-content">
|
||||
<text class="info-value">{{ contact.contactPersonPhone || '暂无联系电话' }}</text>
|
||||
<uni-icons color="#A2A2A2" type="right" size="16"></uni-icons>
|
||||
|
||||
<!-- 联系人列表展示 -->
|
||||
<view v-for="(contact, index) in companyInfo.companyContactList" :key="contact.id || index" class="contact-display-item">
|
||||
<view class="contact-display-title">联系人{{ index + 1 }}</view>
|
||||
<view class="contact-display-content">
|
||||
<view class="contact-field">
|
||||
<text class="field-label">姓名:</text>
|
||||
<text class="field-value">{{ contact.contactPerson || '暂无' }}</text>
|
||||
</view>
|
||||
<view class="contact-field">
|
||||
<text class="field-label">电话:</text>
|
||||
<text class="field-value">{{ contact.contactPersonPhone || '暂无' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 如果没有联系人,显示提示 -->
|
||||
<view v-if="!companyInfo.companyContactList || companyInfo.companyContactList.length === 0" class="no-contacts">
|
||||
<text class="no-contacts-text">暂无联系人信息</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</AppLayout>
|
||||
@@ -140,25 +150,9 @@ function editInfo(type) {
|
||||
}
|
||||
}
|
||||
|
||||
function editContact(contactIndex, field) {
|
||||
// 编辑联系人信息
|
||||
const contact = companyInfo.companyContactList[contactIndex];
|
||||
if (!contact) return;
|
||||
|
||||
// 跳转到联系人编辑页面,传递联系人索引和字段类型
|
||||
const editPages = {
|
||||
name: '/pages/mine/edit-contact-name',
|
||||
phone: '/pages/mine/edit-contact-phone'
|
||||
};
|
||||
|
||||
if (editPages[field]) {
|
||||
// 传递联系人索引和联系人ID
|
||||
const params = {
|
||||
contactIndex: contactIndex,
|
||||
contactId: contact.id
|
||||
};
|
||||
navTo(editPages[field], params);
|
||||
}
|
||||
function editContacts() {
|
||||
// 跳转到联系人编辑页面
|
||||
navTo('/pages/mine/edit-company-contacts');
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
@@ -285,15 +279,85 @@ function goBack() {
|
||||
}
|
||||
}
|
||||
|
||||
.contact-group {
|
||||
.contact-management-section {
|
||||
border-top: 20rpx solid #F4F4F4;
|
||||
|
||||
.contact-group-title {
|
||||
padding: 20rpx 30rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
.contact-section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 30rpx;
|
||||
background: #F8F8F8;
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
|
||||
.contact-section-title {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.edit-contacts-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8rpx 16rpx;
|
||||
background: #E6F7FF;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.edit-text {
|
||||
font-size: 24rpx;
|
||||
color: #256BFA;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contact-display-item {
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.contact-display-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.contact-display-content {
|
||||
.contact-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
font-size: 26rpx;
|
||||
color: #6C7282;
|
||||
min-width: 120rpx;
|
||||
}
|
||||
|
||||
.field-value {
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-contacts {
|
||||
padding: 40rpx 30rpx;
|
||||
text-align: center;
|
||||
|
||||
.no-contacts-text {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user