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>
相关推荐
mCell6 小时前
【短文】不是最强,是最适合
前端·aigc·deepseek
余瑜鱼鱼鱼7 小时前
HTML常用标签总结
前端·html
Jave21087 小时前
Vue 中 mixins 混合开发的主要使用场景有哪些?
前端·vue.js
徐同保7 小时前
openclaw安装
前端
JEECG低代码平台8 小时前
JeecgBoot低代码平台 Ant Design Vue 4.x 升级避坑指南
前端·vue.js·低代码
yashuk8 小时前
Go-Gin Web 框架完整教程
前端·golang·gin
唐叔在学习8 小时前
e.preventDefault()到底怎么用?
前端·javascript
北寻北爱8 小时前
面试题-vue篇
前端·vue.js
XPoet8 小时前
AI 编程工程化:Skill——给你的 AI 员工装上技能包
前端·后端·ai编程
JEECG低代码平台8 小时前
JeecgBoot低代码平台 Qiankun 微前端集成指南:主应用配置全流程
前端·低代码