ykt-wxapp/pages/others/edit-positive-find.vue

129 lines
2.8 KiB
Vue
Raw Permalink Normal View History

2026-01-27 16:46:36 +08:00
<template>
<view class="page">
<scroll-view scroll-y class="scroll">
<view class="section">
<view class="title">阳性发现</view>
<textarea
v-model="category"
class="textarea"
placeholder="请输入阳性发现"
placeholder-class="placeholder"
:maxlength="200"
/>
</view>
<view class="section">
<view class="title">处理意见</view>
<textarea
v-model="opinion"
class="textarea"
placeholder="请输入处理意见"
placeholder-class="placeholder"
:maxlength="500"
/>
</view>
2026-01-28 20:01:28 +08:00
<view style="height: 240rpx;"></view>
2026-01-27 16:46:36 +08:00
</scroll-view>
<view class="footer">
<button class="btn plain" @click="cancel">取消</button>
<button class="btn primary" @click="save">保存</button>
</view>
</view>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { toast } from '@/utils/widget';
const category = ref('');
const opinion = ref('');
const eventName = ref('');
onLoad((opt) => {
eventName.value = String(opt?.eventName || '');
if (opt?.title) uni.setNavigationBarTitle({ title: String(opt.title) });
const data = uni.getStorageSync('current-positive-find') || {};
category.value = typeof data?.category === 'string' ? data.category : '';
opinion.value = typeof data?.opinion === 'string' ? data.opinion : '';
});
function cancel() {
uni.navigateBack();
}
function save() {
if (!String(category.value || '').trim()) return toast('请输入阳性发现');
if (!String(opinion.value || '').trim()) return toast('请输入处理意见');
if (eventName.value) {
uni.$emit(eventName.value, { category: String(category.value).trim(), opinion: String(opinion.value).trim() });
}
uni.navigateBack();
}
</script>
<style scoped>
.page {
min-height: 100vh;
background: #fff;
2026-01-28 20:01:28 +08:00
padding-bottom: calc(152rpx + env(safe-area-inset-bottom));
2026-01-27 16:46:36 +08:00
}
.scroll {
height: 100vh;
}
.section {
2026-01-28 20:01:28 +08:00
padding: 32rpx 28rpx 0;
2026-01-27 16:46:36 +08:00
}
.title {
2026-01-28 20:01:28 +08:00
font-size: 30rpx;
2026-01-27 16:46:36 +08:00
font-weight: 700;
color: #111827;
2026-01-28 20:01:28 +08:00
margin-bottom: 20rpx;
2026-01-27 16:46:36 +08:00
}
.textarea {
width: 100%;
2026-01-28 20:01:28 +08:00
min-height: 240rpx;
border: 2rpx solid #e5e7eb;
border-radius: 16rpx;
padding: 20rpx;
2026-01-27 16:46:36 +08:00
box-sizing: border-box;
2026-01-28 20:01:28 +08:00
font-size: 28rpx;
2026-01-27 16:46:36 +08:00
color: #111827;
}
.placeholder {
color: #9aa0a6;
}
.footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #fff;
2026-01-28 20:01:28 +08:00
padding: 24rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
2026-01-27 16:46:36 +08:00
display: flex;
2026-01-28 20:01:28 +08:00
gap: 24rpx;
box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06);
2026-01-27 16:46:36 +08:00
}
.btn {
flex: 1;
2026-01-28 20:01:28 +08:00
height: 88rpx;
line-height: 88rpx;
border-radius: 12rpx;
font-size: 30rpx;
2026-01-27 16:46:36 +08:00
}
.btn::after {
border: none;
}
.btn.plain {
background: #fff;
color: #4f6ef7;
2026-01-28 20:01:28 +08:00
border: 2rpx solid #4f6ef7;
2026-01-27 16:46:36 +08:00
}
.btn.primary {
background: #4f6ef7;
color: #fff;
}
</style>