cuiqian2004
2025-07-10 f57571f987f3d25730123f488fccdfa3158ec5b1
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<template>
    <view class="page-calendar-schedule-item" @click="triggerItem(scheduleData)">
        <view class="uni-panel-state">
            <text class="uni-panel-radius" :style="{'background-color':state_color}"></text>
        </view>
        <view class="uni-panel-w">
            <view class="uni-panel-text">
                <text class="uni-panel-title">{{scheduleData.Name}}</text>
            </view>
            <view class="uni-panel-text2">
                <rich-text preview="true" :nodes="noteHtml"></rich-text>
            </view>
        </view>
        <view class="uni-panel-schedule-right">
            <text class="fs-ArrowRight"></text>
        </view>
    </view>
</template>
 
<script>
    import parseHtml from "@/common/htmlParse.js"
    export default {
            name: "pageCalendarScheduleItem",
        props: {
            scheduleData: {
                type: Object,
                default () {
                    return {};
                }
            },
            calendarId: {
                type: String,
                default () {
                    return "";
                }
            },
            isMy: {
                type: Boolean,
                default () {
                    return true;
                }
            },
        },
        data() {
            return {}
        },
        computed: {
            state_color() {
                //console.log("state_color",this.scheduleData)
                if (this.scheduleData.TagName == "待办")
                    return '#3a87ad'
                else if (this.scheduleData.TagName == "重要")
                    return '#FF3030'
                else if (this.scheduleData.TagName == "会议")
                    return '#FFFF00'
                else if (this.scheduleData.TagName == "约会")
                    return '#CD661D'
                else if (this.scheduleData.TagName == "纪念日")
                    return '#228B22'
                else if (this.scheduleData.TagName == "不公开")
                    return '#8E388E'
                else if (this.scheduleData.TagName == "标记完成")
                    return '#858585'
                else
                    return '#000'
            },
            noteHtml() {
                if (this.scheduleData.Note)
                    return parseHtml(this.scheduleData.Note)
                else
                    return []
            },
        },
        methods: {
            triggerItem(item) {
                uni.navigateTo({
                    url: `/pages/calendar/schedule?calendarId=${this.calendarId}&eventId=${item.ID}&canEdit=${this.isMy ? "1": ""}`
                })
            },
        },
    }
</script>
 
<style lang="scss">
    .page-calendar-schedule-item {
        background-color: transparent;
        flex-direction: row !important;
        padding: 12px 2px;
        min-height: 24px;
        overflow: auto;
 
        //height: 64px;
        .uni-panel-w {
            flex-direction: column !important;
            float: left;
            width: calc(750rpx - 90px);
 
        }
 
        .uni-panel-radius {
            display: flex;
            margin: 4px;
            width: 16px;
            height: 16px;
            border-radius: 5px;
            background-color: #000;
        }
 
        .uni-panel-title {
            word-wrap: break-word;
            color: black;
            font-size: 16px;
            white-space: normal;
        }
 
        .uni-panel-text {
            flex: 1;
            margin-left: 4px;
        }
 
        .uni-panel-text2 {
            flex: 1;
            margin-left: 4px;
            color: #787878;
            font-size: 12px;
        }
 
        .uni-panel-state {
            font-size: 20px;
            width: 24px;
            position: relative;
            float: left;
            padding-left: 5px;
            text-align: center;
        }
 
        .uni-panel-schedule-right {
            font-size: 15px;
            padding: 2px;
            width: 24px;
            position: relative;
            float: right;
            text-align: center;
            color: #808080;
        }
    }
</style>