| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <view class="tl-item">
- <view class="tl-left">
- <view class="tl-dot" :class="dotCls"></view>
- <view v-if="isLast" class="tl-line tl-line-empty"></view>
- <view v-else class="tl-line"></view>
- </view>
- <view class="tl-body">
- <view class="tl-head">
- <text class="tl-title">{{ title }}</text>
- <StatusTag :status="status" type="promo" :text="statusText" />
- </view>
- <text v-if="time" class="tl-time">{{ time }}</text>
- <text v-if="desc" class="tl-desc">{{ desc }}</text>
- </view>
- </view>
- </template>
- <script>
- import StatusTag from '@/components/status-tag.vue'
- /**
- * TimeLineItem — 时间线条目(分子级)
- * 用法:<TimeLineItem title="晋升 T2" time="2026-08-20" desc="依据:客户评分4.8达标" status="promoted" :is-last="true" />
- * 契约:status∈{promoted, evaluated, rejected};statusText 覆盖默认映射
- */
- export default {
- name: 'TimeLineItem',
- components: { StatusTag },
- props: {
- title: { type: String, default: '' },
- time: { type: String, default: '' },
- desc: { type: String, default: '' },
- status: { type: String, default: '' },
- statusText: { type: String, default: '' },
- isLast: { type: Boolean, default: false }
- },
- computed: {
- dotCls() {
- if (this.status === 'promoted') return 'dot-green'
- if (this.status === 'rejected') return 'dot-red'
- return 'dot-grey'
- }
- }
- }
- </script>
- <style scoped>
- .tl-item {
- display: flex;
- align-items: stretch;
- }
- .tl-left {
- width: 40rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-right: 20rpx;
- }
- .tl-dot {
- width: 20rpx;
- height: 20rpx;
- border-radius: 50%;
- margin-top: 8rpx;
- flex-shrink: 0;
- }
- .dot-green { background: #0E8A4F; }
- .dot-grey { background: #94A3B2; }
- .dot-red { background: #C0392B; }
- .tl-line {
- width: 2rpx;
- flex: 1;
- background: #E3ECF4;
- min-height: 60rpx;
- }
- .tl-line-empty {
- background: transparent;
- }
- .tl-body {
- flex: 1;
- background: #FFFFFF;
- border: 1rpx solid #E3ECF4;
- border-radius: 14rpx;
- padding: 20rpx 22rpx;
- margin-bottom: 24rpx;
- }
- .tl-head {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .tl-title { font-size: 28rpx; font-weight: 700; color: #1F4E79; }
- .tl-time { display: block; font-size: 22rpx; color: #3B5A78; margin-top: 8rpx; }
- .tl-desc { display: block; font-size: 24rpx; color: #3B5A78; line-height: 1.6; margin-top: 8rpx; }
- </style>
|