Commit 79267a73 by liimin

fix(ui): 修复组件交互和样式问题

- 修改 FinishStep 组件中的关闭事件处理器名称
- 为输入框添加 change 事件监听器以处理输入变化
- 重新布局底部按钮为并排显示并添加间距
- 修复 MessageBox 关闭逻辑并添加专门的关闭回调函数
- 修正对象属性比较操作符的一致性
- 移除未使用的组件实例导入
- 优化 FinishStep 组件中的空行和代码结构
- 调整 MessageBox 组件的关闭按钮事件处理逻辑
- 修复页面组件中的空行格式化问题
- 修正阿里云上传策略中的状态码比较操作符
1 parent dd95686c
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:is-footer="false" :is-footer="false"
position="center" position="center"
:title="step == 1 ? '客户信息完善' : '结果反馈'" :title="step == 1 ? '客户信息完善' : '结果反馈'"
@close="close"> @close="onMessageBoxClose">
<view class="popup-content"> <view class="popup-content">
<!-- 内容区域 --> <!-- 内容区域 -->
<scroll-view class="popup-body" scroll-y> <scroll-view class="popup-body" scroll-y>
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
:maxlength="i.maxlength" :maxlength="i.maxlength"
:placeholder="i.placeholder" :placeholder="i.placeholder"
style="flex: 1;" style="flex: 1;"
:type="i.inputType" /> :type="i.inputType"
@change="onInputChange(i.key)" />
</template> </template>
<template v-else> <template v-else>
<view :key="selectKey" <view :key="selectKey"
...@@ -82,16 +83,23 @@ ...@@ -82,16 +83,23 @@
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="popup-footer"> <view class="popup-footer">
<un-button round="4px" <view class="flex-1" style="margin-right: 12px;">
<un-button :block="true"
round="4px"
size="normal" size="normal"
:text="step == 1 ? '取消' : '上一步'" :text="step == 1 ? '取消' : '上一步'"
@click="cancel" /> @click="cancel" />
<un-button round="4px" </view>
<view class="flex-1">
<un-button :block="true"
round="4px"
size="normal" size="normal"
:text="sceneType == 0 ? (step == 1 ? '下一步' : '完成接待') : '完成接待'" :text="sceneType == 0 ? (step == 1 ? '下一步' : '完成接待') : '完成接待'"
type="primary" type="primary"
@click="submit" /> @click="submit" />
</view> </view>
</view>
</view> </view>
</MessageBox> </MessageBox>
<CarBrands ref="carBrandListVisible" <CarBrands ref="carBrandListVisible"
...@@ -283,15 +291,23 @@ const close = (): void => { ...@@ -283,15 +291,23 @@ const close = (): void => {
showPopup.value = false; showPopup.value = false;
errorTip.value = false; errorTip.value = false;
receptionStatus.value = ""; receptionStatus.value = "";
// 同时关闭 MessageBox
if (successRef.value != null) { if (successRef.value != null) {
(successRef.value as ComponentPublicInstance).$callMethod("close"); (successRef.value as ComponentPublicInstance).$callMethod("hide");
} }
}; };
// MessageBox 关闭时的回调
const onMessageBoxClose = (): void => {
// 只清理本地状态,不再调用 MessageBox.close()
errorTip.value = false;
receptionStatus.value = "";
};
// 显示成功提示 // 显示成功提示
const showSuccess = (): void => { const showSuccess = (): void => {
if (successRef.value != null) { if (successRef.value != null) {
successRef.value.$callMethod("open"); (successRef.value as ComponentPublicInstance).$callMethod("open");
} }
}; };
...@@ -336,7 +352,7 @@ function showError(key: string): boolean { ...@@ -336,7 +352,7 @@ function showError(key: string): boolean {
} }
function showSelectPopup(item: FormObjectItem): void { function showSelectPopup(item: FormObjectItem): void {
if (props.customerType == 0 || (item.disabled === true)) return; if (props.customerType == 0 || (item.disabled == true)) return;
const popKey = item.popKey !== null ? item.popKey : ""; const popKey = item.popKey !== null ? item.popKey : "";
const refValue = getRefValue(popKey); const refValue = getRefValue(popKey);
if (refValue != null) { if (refValue != null) {
...@@ -445,7 +461,6 @@ const open = (): void => { ...@@ -445,7 +461,6 @@ const open = (): void => {
recordService.getBusinessData().then((data: any) => { recordService.getBusinessData().then((data: any) => {
const customerInfo = (data != null ? data as UTSJSONObject : null); const customerInfo = (data != null ? data as UTSJSONObject : null);
if (customerInfo != null) { if (customerInfo != null) {
// 填充表单数据 // 填充表单数据
formData.value = { formData.value = {
...@@ -544,10 +559,9 @@ defineExpose({ open, close }); ...@@ -544,10 +559,9 @@ defineExpose({ open, close });
display: flex; display: flex;
padding: 12px 20px; padding: 12px 20px;
border-top: 1px solid #f0f0f0; border-top: 1px solid #f0f0f0;
gap: 10px; gap: 12px;
flex-shrink: 0; flex-shrink: 0;
align-items: center; align-items: center;
justify-content: space-between;
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:style="popupStyle"> :style="popupStyle">
<view class="tips-content"> <view class="tips-content">
<view class="icon-close-box flex" <view class="icon-close-box flex"
@click="hide"> @click="handleHide">
<uni-icons class="icon-close" <uni-icons class="icon-close"
color="#1A1A1A" color="#1A1A1A"
:size="18" :size="18"
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="tips-title"> <view class="tips-title">
<template v-if="back"> <template v-if="back">
<view class="sprite-icon icon-back" <view class="sprite-icon icon-back"
@click="hide"> @click="handleHide">
</view> </view>
</template> </template>
{{ title }} {{ title }}
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { ComponentPublicInstance } from "vue";
const props = defineProps({ const props = defineProps({
isAutoClose: { isAutoClose: {
...@@ -110,17 +109,10 @@ const popupStyle = computed(() => { ...@@ -110,17 +109,10 @@ const popupStyle = computed(() => {
maxHeight: props.maxHeight != null && props.maxHeight > 0 ? `${props.maxHeight ?? 0 }px` : "100%" maxHeight: props.maxHeight != null && props.maxHeight > 0 ? `${props.maxHeight ?? 0 }px` : "100%"
}; };
}); });
function onClose(): void {
emit("close");
}
function close(): void { function close(): void {
if (props.isAutoClose) { if (props.isAutoClose) {
visible.value = false; visible.value = false;
} else {
if (popupRef.value != null) {
(popupRef.value as ComponentPublicInstance).$callMethod("close");
}
} }
emit("close"); emit("close");
} }
...@@ -145,6 +137,11 @@ function confirm(): void { ...@@ -145,6 +137,11 @@ function confirm(): void {
emit("confirm"); emit("confirm");
} }
// 处理关闭按钮点击(不触发事件,只隐藏)
function handleHide(): void {
hide();
}
defineExpose({ open, close, hide }); defineExpose({ open, close, hide });
</script> </script>
......
...@@ -65,7 +65,7 @@ export class AliUniUploadStrategy extends AliOSSBaseStrategy { ...@@ -65,7 +65,7 @@ export class AliUniUploadStrategy extends AliOSSBaseStrategy {
name: "file", name: "file",
formData: formData as UTSJSONObject, formData: formData as UTSJSONObject,
success: (res) => { success: (res) => {
if (res.statusCode === 200 || res.statusCode === 204) { if (res.statusCode == 200 || res.statusCode == 204) {
logger.info(`[AliUniUploadStrategy] 上传成功: ${objectKey}`, "FileUploadService"); logger.info(`[AliUniUploadStrategy] 上传成功: ${objectKey}`, "FileUploadService");
const url = `${host}/${objectKey}`; const url = `${host}/${objectKey}`;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!