Commit e93b0665 authored by 王炽's avatar 王炽

任务优化

parent 3d053ccf
...@@ -48,10 +48,11 @@ ...@@ -48,10 +48,11 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: center; text-align: center;
display: block; display: block;
overflow: hidden; // overflow: hidden;
text-overflow: ellipsis; // text-overflow: ellipsis;
white-space: nowrap; // white-space: nowrap;
max-width: 560rpx; max-width: 560rpx;
max-height: 200rpx;
} }
.points_text { .points_text {
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<!-- 弹窗内容 --> <!-- 弹窗内容 -->
<view class="task_complete_tips_container"> <view class="task_complete_tips_container">
<!-- 第一行:标题文字 --> <!-- 第一行:标题文字 -->
<text class="tips_title">完成{{ taskTitle }}任务</text> <text class="tips_title">{{ displayTitle }}</text>
<!-- <text class="tips_title">完成任务完成任务完成任务任务任务</text> -->
<!-- 第二行:积分文字 --> <!-- 第二行:积分文字 -->
<text class="points_text">获得{{ points }}积分</text> <text class="points_text">获得{{ points }}积分</text>
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
</template> </template>
<script setup> <script setup>
import { defineProps, defineEmits, ref, watch } from 'vue'; import { defineProps, defineEmits, ref, watch,computed } from 'vue';
import md from '../../md'; import md from '../../md';
// Props 定义 // Props 定义
...@@ -49,6 +50,16 @@ const props = defineProps({ ...@@ -49,6 +50,16 @@ const props = defineProps({
} }
}); });
// 处理标题文本,超过14个字显示省略号
const displayTitle = computed(() => {
const title = `完成${props.taskTitle}任务`;
if (title.length > 14) {
return title.substring(0, 14) + '...';
}
console.log('title:', title);
return title;
});
// Emits 定义 // Emits 定义
const emit = defineEmits(['close', 'accept']); const emit = defineEmits(['close', 'accept']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment