fix:修复滑动问题

This commit is contained in:
Jafeng 2026-02-11 17:45:09 +08:00
parent f980273cae
commit fdf2ca6136
5 changed files with 238 additions and 156 deletions

View File

@ -1,5 +1,6 @@
<template>
<view class="page">
<scroll-view scroll-y class="scroll" :style="{ height: scrollHeight + 'px' }">
<CustomerProfileTab
:data="archive"
:baseItems="baseItems"
@ -7,6 +8,7 @@
:floatingBottom="16"
@save="savePatch"
/>
</scroll-view>
</view>
</template>
@ -44,6 +46,7 @@ const archive = ref({
const baseItems = ref([]);
const internalItems = ref([]);
const scrollHeight = ref(0);
const accountStore = useAccountStore();
const { account, doctorInfo } = storeToRefs(accountStore);
@ -336,6 +339,7 @@ async function savePatch(patch) {
}
onLoad((options) => {
scrollHeight.value = Number(uni.getSystemInfoSync()?.windowHeight || 0) || 0;
archiveId.value = options?.archiveId ? String(options.archiveId) : '';
loadFromStorage();
ensureDoctor().then(async () => {
@ -351,7 +355,12 @@ onShow(() => {
<style scoped>
.page {
min-height: 100vh;
height: 100vh;
overflow: hidden;
background: #f5f6f8;
}
.scroll {
height: 100vh;
}
</style>

View File

@ -1,6 +1,7 @@
<template>
<!-- Mobile 来源: ykt-management-mobile/src/pages/customer/new-followup-record/new-followup-record.vue简化移植去除 pinia/接口 -->
<view class="page">
<scroll-view scroll-y class="scroll" :style="{ height: scrollHeight + 'px' }">
<view class="card">
<picker mode="date" :value="form.plannedExecutionTime" @change="changeDate">
<view class="row clickable">
@ -53,6 +54,9 @@
</view>
</view>
<view class="scroll-spacer" />
</scroll-view>
<view class="footer">
<button class="btn plain" @click="cancel">取消</button>
<button class="btn primary" @click="save">保存</button>
@ -91,6 +95,8 @@ import useAccountStore from '@/store/account';
import { toast } from '@/utils/widget';
import { getTodoEventTypeLabel, getTodoEventTypeOptions } from '@/utils/todo-const';
const scrollHeight = ref(0);
const archiveId = ref('');
const archiveName = ref('');
const archiveMobile = ref('');
@ -123,6 +129,13 @@ const mobiles = computed(() => {
});
onLoad((options) => {
try {
const { windowHeight } = uni.getSystemInfoSync();
scrollHeight.value = windowHeight || 0;
} catch {
scrollHeight.value = 0;
}
archiveId.value = options?.archiveId ? String(options.archiveId) : '';
const c = uni.getStorageSync('new-followup-record-customer');
if (c && typeof c === 'object') {
@ -322,9 +335,12 @@ function closeTypePicker() {
<style scoped>
.page {
min-height: 100vh;
height: 100vh;
overflow: hidden;
background: #f5f6f8;
padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.scroll {
width: 100%;
}
.card {
background: #fff;
@ -333,6 +349,9 @@ function closeTypePicker() {
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.scroll-spacer {
height: calc(76px + env(safe-area-inset-bottom));
}
.row {
display: flex;
align-items: center;

View File

@ -1,6 +1,7 @@
<template>
<!-- Mobile 来源: ykt-management-mobile/src/pages/customer/new-followup/new-followup.vuewxapp仅新增待办任务 -->
<view class="page">
<scroll-view scroll-y class="scroll" :style="{ height: scrollHeight + 'px' }">
<view class="card">
<picker mode="date" :value="form.planExecutionTime" @change="changeDate">
<view class="row clickable">
@ -74,6 +75,8 @@
</view>
</view>
</view>
<view class="scroll-spacer" />
</scroll-view>
<view class="footer">
<button class="btn plain" @click="cancel">取消</button>
@ -138,8 +141,26 @@ import { chooseAndUploadImage } from '@/utils/file';
const archiveId = ref('');
const archiveName = ref('');
const customerData = ref({});
const scrollHeight = ref(0);
const eventTypeList = getTodoEventTypeOptions();
// 访 6
// 访访访
// utils/todo-const.js
// followUpNoDeal(访)followUpPostTreatment(访)followUpReminder()
// serviceSummary()eventNotification()ContentReminder()
// questionnaire()followUpComplaint(访)followUpActivity(访)
const __ALL_TODO_EVENT_TYPE_OPTIONS__ = getTodoEventTypeOptions();
const __NEW_FOLLOWUP_EVENT_TYPE_VALUES__ = [
'followUp',
'followUpPostSurgery',
'appointmentReminder',
'medicationReminder',
'followUpNoShow',
'other',
];
const eventTypeList = __NEW_FOLLOWUP_EVENT_TYPE_VALUES__
.map((v) => __ALL_TODO_EVENT_TYPE_OPTIONS__.find((i) => i.value === v))
.filter(Boolean);
const accountStore = useAccountStore();
const { account, doctorInfo } = storeToRefs(accountStore);
@ -163,6 +184,7 @@ const eventTypeLabel = computed(() => getTodoEventTypeLabel(form.eventType));
onLoad((options) => {
resetForm();
scrollHeight.value = Number(uni.getSystemInfoSync()?.windowHeight || 0) || 0;
archiveId.value = options?.archiveId ? String(options.archiveId) : '';
const c = uni.getStorageSync('new-followup-customer');
if (c && typeof c === 'object') {
@ -319,7 +341,6 @@ async function save() {
if (!form.executeTeamId) return uni.showToast({ title: '请选择处理人', icon: 'none' });
if (!form.executorUserId) return uni.showToast({ title: '请选择处理人', icon: 'none' });
if (!form.eventType) return uni.showToast({ title: '请选择类型', icon: 'none' });
if (!String(form.taskContent || '').trim()) return uni.showToast({ title: '请输入目的', icon: 'none' });
await ensureDoctor();
const corpId = getCorpId();
@ -467,9 +488,13 @@ function chooseQuestionnaire() {
<style scoped>
.page {
min-height: 100vh;
height: 100vh;
background: #f5f6f8;
padding-bottom: calc(76px + env(safe-area-inset-bottom));
overflow: hidden;
}
.scroll-spacer {
height: calc(76px + env(safe-area-inset-bottom));
}
.card {
background: #fff;

View File

@ -2,7 +2,7 @@
<view class="page">
<!-- Mobile 来源: ykt-management-mobile/src/pages/customer/service-record-detail/service-record-detail.vue -->
<view v-if="!recordId" class="body">
<scroll-view scroll-y class="scroll">
<scroll-view scroll-y class="scroll" :style="{ height: scrollHeight + 'px' }">
<view class="card">
<view class="section-title">执行日期</view>
<picker mode="date" @change="pickDate" :disabled="true">
@ -93,6 +93,8 @@ import useAccountStore from '@/store/account';
import { toast } from '@/utils/widget';
import { getServiceTypeOptions } from '@/utils/service-type-const';
const scrollHeight = ref(0);
const archiveId = ref('');
const mode = ref('add');
const recordId = ref('');
@ -148,6 +150,13 @@ function getCurrentTeam() {
}
onLoad((options) => {
try {
const { windowHeight } = uni.getSystemInfoSync();
scrollHeight.value = windowHeight || 0;
} catch {
scrollHeight.value = 0;
}
archiveId.value = options?.archiveId ? String(options.archiveId) : '';
recordId.value = options?.id ? String(options.id) : '';
@ -295,9 +304,10 @@ async function submit(executionTime) {
<style scoped>
.page {
min-height: 100vh;
height: 100vh;
overflow: hidden;
background: #f5f6f8;
padding-bottom: calc(76px + env(safe-area-inset-bottom));
padding-bottom: 0;
}
.body {
height: 100vh;
@ -305,7 +315,7 @@ async function submit(executionTime) {
flex-direction: column;
}
.scroll {
flex: 1;
width: 100%;
}
.card {
background: #fff;

View File

@ -1,6 +1,7 @@
<template>
<!-- 详情页参考截图顶部蓝条显示创建信息支持编辑/删除黄底提示不渲染 -->
<view class="page">
<scroll-view scroll-y class="scroll" :style="{ height: scrollHeight + 'px' }">
<view class="topbar">
<view class="topbar-text">{{ topText }}</view>
</view>
@ -41,6 +42,9 @@
</view>
</view>
<view class="scroll-spacer" />
</scroll-view>
<view class="footer">
<button class="btn danger" @click="remove">删除</button>
<button class="btn primary" @click="edit">编辑</button>
@ -59,6 +63,8 @@ import { normalizeVisitRecordFormData } from './utils/visit-record';
import { normalizeTemplate, unwrapTemplateResponse } from './utils/template';
import { normalizeFileUrl } from '@/utils/file';
const scrollHeight = ref(0);
const archiveId = ref('');
const id = ref('');
const medicalType = ref('');
@ -331,6 +337,13 @@ async function fetchRecord({ silent = false } = {}) {
}
onLoad(async (opt) => {
try {
const { windowHeight } = uni.getSystemInfoSync();
scrollHeight.value = windowHeight || 0;
} catch {
scrollHeight.value = 0;
}
archiveId.value = opt?.archiveId ? String(opt.archiveId) : '';
id.value = opt?.id ? String(opt.id) : '';
medicalType.value = opt?.type ? String(opt.type) : '';
@ -408,9 +421,12 @@ function remove() {
<style scoped>
.page {
min-height: 100vh;
height: 100vh;
overflow: hidden;
background: #fff;
padding-bottom: calc(152rpx + env(safe-area-inset-bottom));
}
.scroll {
width: 100%;
}
.topbar {
background: #5d6df0;
@ -475,6 +491,9 @@ function remove() {
color: #9aa0a6;
padding: 16rpx 0;
}
.scroll-spacer {
height: calc(152rpx + env(safe-area-inset-bottom));
}
.footer {
position: fixed;
left: 0;