uniapp火车票样式

html 复制代码
<template>
  <view class="train-ticket">
    <view class="header">
      <view class="header-left">
        <text class="logo">铁路</text>
        <text class="ticket-type">电子客票</text>
      </view>
      <view class="header-right">
        <text class="ticket-number">{{ ticketData.ticketNumber }}</text>
      </view>
    </view>
    <view class="content">
      <view class="from-to">
        <text class="from">{{ ticketData.fromPlace }}</text>
        <text class="arrow">→</text>
        <text class="to">{{ ticketData.toPlace }}</text>
      </view>
      <view class="info-item">
        <text class="info-label">车次:</text>
        <text class="info-value">{{ ticketData.trainNumber }}</text>
      </view>
      <view class="info-item">
        <text class="info-label">座席:</text>
        <text class="info-value">{{ ticketData.seatClass }}</text>
      </view>
      <view class="info-item">
        <text class="info-label">出发时间:</text>
        <text class="info-value">{{ ticketData.departureTime }}</text>
      </view>
      <view class="info-item">
        <text class="info-label">到达时间:</text>
        <text class="info-value">{{ ticketData.arrivalTime }}</text>
      </view>
      <view class="info-item">
        <text class="info-label">乘车人:</text>
        <text class="info-value">{{ ticketData.passengerName }}</text>
      </view>
      <view class="info-item">
        <text class="info-label">身份证号:</text>
        <text class="info-value">{{ ticketData.idNumber }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "TrainTicket",
  data() {
    return {
      ticketData: {
        ticketNumber: "E00123456",
        fromPlace: "深圳北站",
        toPlace: "北京西站",
        trainNumber: "G888",
        seatClass: "一等座",
        departureTime: "10:00",
        arrivalTime: "18:00",
        passengerName: "ネф̶-イω",
        idNumber: "888888888888888888"
      }
    };
  }
};
</script>

<style scoped>
.train-ticket {
  width: calc(100% - 20px);
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  margin: 15px auto;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(135deg, #0078d7, #0057b8);
  color: white;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  margin-right: 8px;
}

.ticket-type {
  font-size: 14px;
}

.header-right {
}

.ticket-number {
  font-size: 14px;
}

.content {
  padding: 20px;
}

.from-to {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 18px;
  color: #333;
}

.from {
  width: 30%;
  text-align: left;
}

.arrow {
  width: 10%;
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 20px;
}

.to {
  width: 30%;
  text-align: right;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.info-label {
  width: 30%;
  font-weight: bold;
  color: #333;
  text-align: left;
}

.info-value {
  width: 70%;
  text-align: right;
}
</style>
相关推荐
小小龙学IT8 分钟前
Go 语言 reflect 反射包深度解析:从 Type/Value 到三大定律与工业实践
前端·golang
小溪学编程17 分钟前
C语言篇:枚举类型
java·c语言·前端
xingpanvip20 分钟前
星盘接口开发文档:推算星座接口指南
前端·php
Da Da 泓24 分钟前
HTML浅浅入门
前端·html
এ慕ོ冬℘゜26 分钟前
es6基础
前端·javascript·es6
熊猫钓鱼>_>31 分钟前
从2D平铺到3D沉浸:我用HarmonyOS 7端侧AI做了一个全程数据不出设备的空间化私密相册
前端·人工智能·3d·华为·华为云·harmonyos·鸿蒙
孔令飞1 小时前
Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中指针引用Go中
前端
溪语流沙2 小时前
【Web全栈进阶】PostgreSQL上手:Docker跑库 + 把早报站从SQLite迁过去
前端·docker·postgresql
IT_陈寒2 小时前
SpringBoot自动配置的坑:你以为的捷径可能是弯路
前端·人工智能·后端
paopaokaka_luck2 小时前
高校社团管理(AI辅助任务分配、协同过滤算法推荐、ECharts数据可视化、活动参与闭环、校园交流与反馈、器材借还管理)
java·前端·javascript·spring boot·数据分析·echarts