调整标签管理的错乱
This commit is contained in:
@@ -165,8 +165,9 @@
|
||||
</view>
|
||||
<view class="form-item tag-select-wrapper">
|
||||
<text class="form-item__label">标签分类</text>
|
||||
<view
|
||||
class="tag-select"
|
||||
<view
|
||||
ref="tagTypeSelect"
|
||||
class="tag-select"
|
||||
@click.stop="toggleTagTypeDropdown"
|
||||
>
|
||||
<text
|
||||
@@ -176,9 +177,10 @@
|
||||
</text>
|
||||
<uni-icons type="bottom" size="16" color="#9ca3af"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
v-if="showTagTypeDropdown"
|
||||
class="tag-select-dropdown"
|
||||
<view
|
||||
ref="tagTypeDropdown"
|
||||
v-if="showTagTypeDropdown"
|
||||
class="tag-select-dropdown"
|
||||
@click.stop
|
||||
>
|
||||
<view
|
||||
@@ -439,6 +441,13 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
}).exec();
|
||||
}, 100);
|
||||
// #endif
|
||||
|
||||
// 监听窗口大小变化,重新定位下拉框
|
||||
uni.onWindowResize(() => {
|
||||
if (this.showTagTypeDropdown) {
|
||||
this.updateTagTypeDropdownPosition();
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 计算并更新导航栏和内容区域的位置
|
||||
@@ -830,6 +839,30 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
},
|
||||
toggleTagTypeDropdown() {
|
||||
this.showTagTypeDropdown = !this.showTagTypeDropdown;
|
||||
if (this.showTagTypeDropdown) {
|
||||
this.$nextTick(() => {
|
||||
this.updateTagTypeDropdownPosition();
|
||||
});
|
||||
}
|
||||
},
|
||||
updateTagTypeDropdownPosition() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.tag-select').boundingClientRect((rect) => {
|
||||
if (rect) {
|
||||
const dropdownEl = this.$refs.tagTypeDropdown;
|
||||
if (dropdownEl) {
|
||||
// 在 uni-app 中,直接操作 DOM 需要使用 nextTick
|
||||
this.$nextTick(() => {
|
||||
const el = dropdownEl.$el || dropdownEl;
|
||||
if (el && el.style) {
|
||||
el.style.top = (rect.bottom + 8) + 'px';
|
||||
el.style.left = rect.left + 'px';
|
||||
el.style.width = rect.width + 'px';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).exec();
|
||||
},
|
||||
selectTagType(option) {
|
||||
this.tagForm.tagType = option;
|
||||
@@ -1337,16 +1370,30 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
.form-card {
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
padding: 40rpx 24rpx 32rpx 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
box-shadow: 0 2rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
/* 第一个表单项特殊处理,确保顶部空间 */
|
||||
.form-card .form-item:first-child {
|
||||
padding-top: 24rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
/* 表单项样式 */
|
||||
.form-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
flex-wrap: nowrap !important;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32rpx;
|
||||
min-height: 88rpx;
|
||||
padding-top: 8rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.form-item:last-child {
|
||||
@@ -1356,16 +1403,34 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
/* 表单项标签样式 */
|
||||
.form-item__label {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
margin-bottom: 16rpx;
|
||||
line-height: 1.5;
|
||||
width: 140rpx;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
margin-right: 24rpx;
|
||||
margin-left: 0;
|
||||
padding: 12rpx 0 12rpx 16rpx;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
min-height: 88rpx;
|
||||
line-height: 1.4;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/* 输入框样式 */
|
||||
.form-item__input {
|
||||
width: 100%;
|
||||
flex: 1 !important;
|
||||
flex-shrink: 1 !important;
|
||||
flex-grow: 1 !important;
|
||||
min-width: 0 !important;
|
||||
max-width: none !important;
|
||||
width: auto !important;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background-color: #F9FAFB;
|
||||
border: 2rpx solid #E5E7EB;
|
||||
border-radius: 16rpx;
|
||||
@@ -1374,6 +1439,9 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
color: #333333;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.3s ease;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.form-item__input:focus {
|
||||
@@ -1384,7 +1452,12 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
|
||||
/* 文本域样式 */
|
||||
.form-item__textarea {
|
||||
width: 100%;
|
||||
flex: 1 !important;
|
||||
flex-shrink: 1 !important;
|
||||
flex-grow: 1 !important;
|
||||
min-width: 0 !important;
|
||||
max-width: none !important;
|
||||
width: auto !important;
|
||||
min-height: 160rpx;
|
||||
background-color: #F9FAFB;
|
||||
border: 2rpx solid #E5E7EB;
|
||||
@@ -1406,6 +1479,13 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
/* 标签选择器样式 */
|
||||
.tag-select-wrapper {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
flex-shrink: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
height: 88rpx;
|
||||
}
|
||||
|
||||
.tag-select {
|
||||
@@ -1443,19 +1523,16 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
|
||||
/* 下拉菜单样式 */
|
||||
.tag-select-dropdown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: fixed;
|
||||
background-color: #FFFFFF;
|
||||
border: 2rpx solid #E5E7EB;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 8rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.12);
|
||||
z-index: 100;
|
||||
z-index: 9999;
|
||||
overflow: hidden;
|
||||
max-height: 400rpx;
|
||||
overflow-y: auto;
|
||||
min-width: 200rpx;
|
||||
}
|
||||
|
||||
.tag-select-dropdown__item {
|
||||
@@ -1490,7 +1567,12 @@ import ServiceListFurniture from "./serviceListFurniture.vue";
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: transparent;
|
||||
z-index: 99;
|
||||
z-index: 9998;
|
||||
}
|
||||
|
||||
/* textarea类型表单项 - 标签和textarea在同一行,但textarea可以换行 */
|
||||
.form-item--textarea {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
/* 开关类型表单项 - 横向布局 */
|
||||
|
||||
@@ -30,12 +30,6 @@
|
||||
@click="switchTab('training')">
|
||||
<text>陪练</text>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === 'quality' }"
|
||||
@click="switchTab('quality')">
|
||||
<text>质检</text>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === 'material' }"
|
||||
@@ -58,18 +52,6 @@
|
||||
:style="{ top: computedContentTop || contentTop }"
|
||||
@refresh-training-list="handleRefreshTrainingList"></training-tab>
|
||||
|
||||
<!-- 质检tab -->
|
||||
<scroll-view
|
||||
class="tab-content tab-content-container"
|
||||
:style="{ top: computedContentTop || contentTop }"
|
||||
scroll-y
|
||||
v-if="activeTab === 'quality'">
|
||||
<view class="champion-card">
|
||||
<text class="champion-title">质检</text>
|
||||
<text class="champion-desc">这里是质检相关的内容展示区域</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 素材tab -->
|
||||
<material-tab
|
||||
v-if="activeTab === 'material'"
|
||||
|
||||
Reference in New Issue
Block a user