beizhu.vue
1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<template>
<up-popup :show="show" mode="bottom" round="16" :safeAreaInsetBottom="false">
<view class="desc-container">
<view class="title">
<view @click="show = false">
<up-icon name="close" color="#fff" size="20"></up-icon>
</view>
<text class="titleName">
动作备注
</text>
<view class="btn" @click="saveNoteContent">保存</view>
</view>
<view class="input-box">
<up-textarea v-model="tempNoteContent" placeholder="此处填写个人备注" class="noteConten"
customStyle="border-radius:12rpx; padding:20rpx;background: #242424;" />
</view>
</view>
</up-popup>
</template>
<script setup>
import { ref } from 'vue';
const show = ref(false);
const tempNoteContent = ref(''); // 临时编辑的备注内容
const emit = defineEmits(['saveSuccess']);
// 保存备注
const saveNoteContent = async () => {
const content = tempNoteContent.value.trim();
// 如果内容为空,直接返回,不提交
if (!content) {
uni.showToast({ title: '备注不能为空', icon: 'none' });
return;
}
emit('saveSuccess', content);
// 关闭弹窗
show.value = false;
};
const open = () => {
show.value = true;
};
defineExpose({ open });
</script>
<style lang="scss" scoped>
.desc-container {
background-color: #1a1a1a;
padding: 40rpx 30rpx 40rpx;
height: 75vh;
.title {
display: flex;
justify-content: space-between;
font-weight: 500;
text-align: center;
color: #fff;
font-size: 32rpx;
margin-bottom: 40rpx;
}
.btn {
width: 100rpx;
height: 50rpx;
background-color: #fedc1f;
color: #000;
border-radius: 30rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
}
.input-box {
margin-bottom: 60rpx;
// 输入文字白色
:deep(.u-textarea__field) {
color: #fff !important;
}
}
}
</style>