addOrEdit.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="container">
  3. <view class="box">
  4. <view class="body">
  5. <!-- 姓名区域 -->
  6. <view class="body_box">
  7. <view class="body_box_key">姓名</view>
  8. <view class="body_box_value">
  9. <input class="input" type="text" placeholder="请输入姓名" v-model="name" />
  10. </view>
  11. </view>
  12. <!-- 身份证号区域 -->
  13. <view class="body_box">
  14. <view class="body_box_key">身份证号</view>
  15. <view class="body_box_value">
  16. <input class="input" type="text" placeholder="请输入身份证号" v-model="identity" />
  17. </view>
  18. </view>
  19. <!-- 联系电话区域 -->
  20. <view class="body_box">
  21. <view class="body_box_key">联系电话</view>
  22. <view class="body_box_value">
  23. <input class="input" type="text" placeholder="请输入联系电话" v-model="phone" />
  24. </view>
  25. </view>
  26. </view>
  27. <view class="btn">确定</view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. // 姓名
  36. name: '',
  37. // 身份证号
  38. identity: '',
  39. // 电话
  40. phone: ''
  41. }
  42. },
  43. onLoad(options) {
  44. // console.log(options)
  45. if (options.type === '2') {
  46. // 编辑状态
  47. const info = JSON.parse(options.info)
  48. this.name = info.name
  49. this.identity = info.identity
  50. this.phone = info.phone
  51. uni.setNavigationBarTitle({
  52. title: '编辑旅客'
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .container {
  60. display: flex;
  61. flex-direction: column;
  62. height: 100vh;
  63. background-color: #f2f2f2;
  64. .box {
  65. margin-top: 20rpx;
  66. height: calc(100vh - 20rpx);
  67. background-color: #fff;
  68. .body {
  69. box-sizing: border-box;
  70. padding: 0 20rpx;
  71. height: calc(100vh - 236rpx);
  72. background-color: #fff;
  73. .body_box {
  74. display: flex;
  75. align-items: center;
  76. margin-top: 30rpx;
  77. height: 80rpx;
  78. .body_box_key {
  79. width: 152rpx;
  80. color: #808080;
  81. font-size: 28rpx;
  82. }
  83. .body_box_value {
  84. display: flex;
  85. align-items: center;
  86. box-sizing: border-box;
  87. padding: 0 28rpx;
  88. width: 559rpx;
  89. height: 80rpx;
  90. font-size: 28rpx;
  91. border-radius: 15rpx;
  92. background-color: #f2f2f2;
  93. .input {
  94. width: 100%;
  95. }
  96. }
  97. }
  98. }
  99. .btn {
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. margin: 45rpx auto;
  104. width: 710rpx;
  105. height: 96rpx;
  106. font-size: 32rpx;
  107. border-radius: 64rpx;
  108. color: #fff;
  109. background-color: #096562;
  110. }
  111. }
  112. }
  113. </style>