修改表单显示逻辑

master
于肖磊 2025-09-22 16:48:24 +08:00
parent 532317e6a0
commit de05219dc3
5 changed files with 41 additions and 18 deletions

View File

@ -5,7 +5,7 @@
<view class="flex-1 flex-row align-c ht-auto gap-5 oh cr-gray"> <view class="flex-1 flex-row align-c ht-auto gap-5 oh cr-gray">
<view class="flex-1 flex-row align-c jc-c" :data-index="0" @tap="data_time_change"> <view class="flex-1 flex-row align-c jc-c" :data-index="0" @tap="data_time_change">
<view class="text-line-1">{{ com_data.start_placeholder }}</view> <view class="text-line-1">{{ com_data.start_placeholder }}</view>
</view>- </view>
<view class="flex-1 flex-row align-c jc-c" :data-index="1" @tap="data_time_change"> <view class="flex-1 flex-row align-c jc-c" :data-index="1" @tap="data_time_change">
<view class="text-line-1">{{ com_data.end_placeholder }}</view> <view class="text-line-1">{{ com_data.end_placeholder }}</view>
</view> </view>

View File

@ -17,15 +17,20 @@
<!-- #ifndef MP-ALIPAY --> <!-- #ifndef MP-ALIPAY -->
<!-- 支付宝小程序 不支持同时上下左右滑动--> <!-- 支付宝小程序 不支持同时上下左右滑动-->
<scroll-view :scroll-top="scrollTop" :scroll-y="true" :scroll-x="overall_config.type_value == 'default' || z_index_id !== '' ? false : true" :class="overall_config.is_show_save_draft == '1' || overall_config.is_show_submit == '1' ? 'scroll-box wh-auto' : 'ht wh-auto'" enable-flex lower-threshold="60" scroll-with-animation> <scroll-view :scroll-top="scrollTop" :scroll-y="true" :scroll-x="overall_config.type_value == 'default' || z_index_id !== '' ? false : true" :class="overall_config.is_show_save_draft == '1' || overall_config.is_show_submit == '1' ? 'scroll-box wh-auto' : 'ht wh-auto'" enable-flex lower-threshold="60" scroll-with-animation>
<view :style="content_style + (overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;'))"> <view class="pr wh-auto ht-auto">
<template v-if="!isEmpty(img_url)"> <template v-if="propIsMask">
<image :src="img_url" mode="aspectFit" /> <view class="scoll-mask"></view>
</template> </template>
</view> <view :style="content_style + (overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;'))">
<view v-if="is_show_heading_title == '1'" class="head-title flex-row bg-white" :style="heading_title_style + (overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;'))">{{ form_name }}</view> <template v-if="!isEmpty(img_url)">
<view class="data-list bg-white" :style="overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;height:' + overall_config.custom_height * 2 + 'rpx')"> <image :src="img_url" mode="aspectFit" />
<!-- form表单子组件显示 --> </template>
<form-input-base ref="componentForm" :propKey="propKey" :propConfig="propValue.config" :propDataFormId="propDataFormId" @onSubmitEvent="submit_event" /> </view>
<view v-if="is_show_heading_title == '1'" class="head-title flex-row bg-white" :style="heading_title_style + (overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;'))">{{ form_name }}</view>
<view class="data-list bg-white" :style="overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;height:' + overall_config.custom_height * 2 + 'rpx')">
<!-- form表单子组件显示 -->
<form-input-base ref="componentForm" :propKey="propKey" :propConfig="propValue.config" :propDataFormId="propDataFormId" @onSubmitEvent="submit_event" />
</view>
</view> </view>
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
@ -70,6 +75,10 @@ export default {
type: [String, Number], type: [String, Number],
default: 0, default: 0,
}, },
propIsMask: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
@ -135,7 +144,9 @@ export default {
* 点击提交按钮触发方法 * 点击提交按钮触发方法
*/ */
on_submit_event() { on_submit_event() {
this.$refs.componentForm.on_submit_event(); if (!this.propIsMask) {
this.$refs.componentForm.on_submit_event();
}
}, },
/* /*
* 表单校验完成之后返回的数据内容 * 表单校验完成之后返回的数据内容
@ -197,6 +208,7 @@ export default {
.save_draft_title { .save_draft_title {
min-width: 180rpx; min-width: 180rpx;
font-size: 24rpx; font-size: 24rpx;
margin: 0 20rpx 0 0;
} }
.submit_title { .submit_title {
text-align: center; text-align: center;
@ -204,7 +216,6 @@ export default {
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx; font-size: 32rpx;
margin: 0 0 0 20rpx;
} }
} }
.data-list { .data-list {
@ -226,4 +237,13 @@ export default {
overflow-x: auto; overflow-x: auto;
scroll-behavior: smooth; /* 使滚动更加平滑 */ scroll-behavior: smooth; /* 使滚动更加平滑 */
} }
.scoll-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
z-index: 999;
}
</style> </style>

View File

@ -2,7 +2,7 @@
<view :class="theme_view"> <view :class="theme_view">
<block v-if="(data || null) != null && (data.config || null) != null"> <block v-if="(data || null) != null && (data.config || null) != null">
<!-- diy模块 --> <!-- diy模块 -->
<component-form-input :propValue="data" :propDataFormId="data.id" :propKey="random_value" @onLocationBack="user_back_choice_location"> <component-form-input :propValue="data" :propDataFormId="data.id" :propKey="random_value" propIsMask @onLocationBack="user_back_choice_location">
<!-- 底部内容 --> <!-- 底部内容 -->
<template slot="diy-bottom-content"> <template slot="diy-bottom-content">
<!-- 结尾 --> <!-- 结尾 -->

View File

@ -33,10 +33,8 @@
default: '', default: '',
}, },
propSubId: { propSubId: {
type: Object, type: [String, Number],
default: () => { default: '',
return {};
},
}, },
propReplyContent: { propReplyContent: {
type: String, type: String,

View File

@ -60,7 +60,7 @@
<template v-else> <template v-else>
<view v-if="comment_item.subComments && comment_item.subComments.length > 0" class="sub-comment-list flex-col jc-c"> <view v-if="comment_item.subComments && comment_item.subComments.length > 0" class="sub-comment-list flex-col jc-c">
<view class="sub-comment-item flex-row align-s gap-10" v-for="(sub_comment_item, sub_comment_index) in comment_item.subComments" :key="sub_comment_index"> <view class="sub-comment-item flex-row align-s gap-10" v-for="(sub_comment_item, sub_comment_index) in comment_item.subComments" :key="sub_comment_index">
<commentInfoComponent class="wh-auto ht-auto" :propsComment="sub_comment_item" :propsId="sub_comment_item.id" @comment_reply="sub_comment_reply" @comment_like="sub_comment_like"></commentInfoComponent> <commentInfoComponent class="wh-auto ht-auto" :propComment="sub_comment_item" :propId="comment_item.id" :propSubId="sub_comment_item.id" @comment_reply="sub_comment_reply" @comment_like="sub_comment_like"></commentInfoComponent>
</view> </view>
</view> </view>
<template v-if="comment_item.show_sub_comment_loading"> <template v-if="comment_item.show_sub_comment_loading">
@ -433,7 +433,12 @@
}, },
// //
comment_reply(id) { comment_reply(id) {
const index = this.active_comments.findIndex(item => item.id === id);
if (index >= 0) {
const data = this.active_comments[index];
this.input_placeholder = `回复 ${data.userNick};`;
}
}, },
// //
comment_like(id) { comment_like(id) {