Files
xl-mobile/src/components/MessageCard.vue

101 lines
2.6 KiB
Vue
Raw Normal View History

2025-03-28 10:48:50 +08:00
<script setup>
import {computed} from 'vue';
import messageIcon from "../static/icons/messageIcon.png";
import XActionsheet from "./XActionsheet.vue";
2025-05-12 19:45:27 +08:00
import OpenTypeFun from "./OpenTypeFun.js";
2025-06-23 17:28:26 +08:00
import {toPage} from "../utils/uils.js";
2025-03-28 10:48:50 +08:00
const itemList = computed(() => {
const item = [];
true ?
item.push({text: '标记未读', type: 0}) :
item.push({text: '标记已读', type: 1});
return item;
})
2025-05-12 19:45:27 +08:00
const {contextRow, type, data} = defineProps({
2025-03-28 10:48:50 +08:00
contextRow: {
type: String,
default: 'ellipsis-1'
2025-05-12 19:45:27 +08:00
},
type: {
type: Number,
default: 0
},
data: {
type: Object,
default: null
2025-03-28 10:48:50 +08:00
}
});
const selectActionsheet = (e) => {
console.log(e);
}
</script>
<template>
<x-actionsheet
@success="selectActionsheet"
:itemList="itemList">
<view
2025-06-23 17:28:26 +08:00
@click.stop="type === 0 ? toPage(`/pages/taskDetails/index?id=${data.task_id}&task_children_id=${data.task_children_id}&tab=3`) : OpenTypeFun(data)"
2025-03-28 10:48:50 +08:00
class="!py-[30rpx] !px-[24rpx] bg-[#fff] rounded-[8rpx] !flex items-center gap-[20rpx] overflow-hidden relative !mb-[20rpx]">
<image class="!size-[72rpx] flex-shrink-0" mode="aspectFill" :src="messageIcon"></image>
<view class="flex-grow !flex flex-col gap-[12rpx]">
<view class="!flex justify-between items-center">
2025-05-12 19:45:27 +08:00
<view class="bh">{{ type === 0 ? '任务编号: DF12122' : data.title }}</view>
2025-03-28 10:48:50 +08:00
<view class="time">2024-01-26 14:00</view>
</view>
<view :class="['context', contextRow]">
2025-05-12 19:45:27 +08:00
{{ data.content }}
2025-03-28 10:48:50 +08:00
</view>
</view>
2025-05-12 19:45:27 +08:00
<view class="status" v-if="data.is_top === 1">置顶</view>
2025-03-28 10:48:50 +08:00
</view>
</x-actionsheet>
</template>
<style lang="scss" scoped>
.status {
padding: 5rpx 16rpx;
background: rgb(253, 244, 191);
border-bottom-left-radius: 8rpx;
position: absolute;
right: 0;
top: 0;
color: rgb(162, 109, 10);
font-size: 11px;
font-weight: 500;
line-height: 140%;
letter-spacing: 0;
text-align: center;
}
.context {
color: rgb(78, 89, 105);
font-size: 12px;
font-weight: 400;
line-height: 140%;
letter-spacing: 0;
text-align: left;
}
.bh {
color: rgb(29, 33, 41);
font-size: 14px;
font-weight: 500;
line-height: 22px;
letter-spacing: 0;
text-align: left;
}
.time {
color: rgb(134, 144, 156);
font-size: 12px;
font-weight: 400;
line-height: 140%;
letter-spacing: 0;
text-align: left;
}
</style>