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>
相关推荐
开发者小天28 分钟前
为什么 /deep/ 现在不推荐使用?
前端·javascript·node.js
如白驹过隙1 小时前
cloudflare缓存配置
前端·缓存
excel1 小时前
JavaScript 异步编程全解析:Promise、Async/Await 与进阶技巧
前端
Jerry说前后端1 小时前
Android 组件封装实践:从解耦到架构演进
android·前端·架构
不如摸鱼去2 小时前
Trae 辅助下的 uni-app 跨端小程序工程化开发实践分享
微信小程序·小程序·uni-app·aigc·ai编程
步行cgn2 小时前
在 HTML 表单中,name 和 value 属性在 GET 和 POST 请求中的对应关系如下:
前端·hive·html
hrrrrb2 小时前
【Java Web 快速入门】十一、Spring Boot 原理
java·前端·spring boot
找不到工作的菜鸟2 小时前
Three.js三大组件:场景(Scene)、相机(Camera)、渲染器(Renderer)
前端·javascript·html
定栓2 小时前
vue3入门-v-model、ref和reactive讲解
前端·javascript·vue.js
专注API从业者2 小时前
基于 Flink 的淘宝实时数据管道设计:商品详情流式处理与异构存储
大数据·前端·数据库·数据挖掘·flink