addCar.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="content">
  3. <!-- 填写车辆信息 -->
  4. <view class="carMessage">
  5. <view class="mesView">
  6. <view class="leftTitle">车牌号</view>
  7. <input class="plateNumber" placeholder-style="color:#999999" placeholder="请输入车牌号" disabled="true"
  8. @tap="plateShow=true" v-model.trim="plateNo" />
  9. <plate-input v-if="plateShow" :plate="plateNo" @export="setPlate" @close="plateShow=false" />
  10. </view>
  11. <view class="mesView" @click="goCarModel()">
  12. <view class="leftTitle">车型</view>
  13. <view class="carModBtn noSelectColor" v-if="!carMod">请添加您的爱车</view>
  14. <view class="carModBtn selectColor" v-else>{{carMod}}</view>
  15. <image src="../../static/img/rightArrow.png" class="rightArrow"></image>
  16. </view>
  17. <view class="mesView">
  18. <view class="leftTitle">购车时间</view>
  19. <picker class="timeBtn" @change="bindChange" mode="date">
  20. <view class="uni-input selectColor" v-if="time">{{time}}</view>
  21. <view class="uni-input noSelectColor" v-else>请选择您的购车时间</view>
  22. </picker>
  23. <image src="../../static/img/rightArrow.png" class="rightArrow"></image>
  24. </view>
  25. <view class="mesView">
  26. <view class="leftTitle">行驶里程</view>
  27. <input class="mileageInput selectColor" type="number" v-model="mileage" placeholder="请输入"
  28. placeholder-style="color:#999999" />
  29. <view class="kmStr">km</view>
  30. </view>
  31. </view>
  32. <view class="bottomView">
  33. <view class="saveCar">保存爱车</view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import plateInput from "@/components/uni-plate-input/uni-plate-input.vue"
  39. export default {
  40. components: {
  41. plateInput
  42. },
  43. data() {
  44. return {
  45. homeData: '',
  46. shopId: '',
  47. plateNo: '',
  48. plateShow: false,
  49. joinFirst: false,
  50. carMod: '',
  51. time: '',
  52. mileage: '',
  53. }
  54. },
  55. onLoad() {
  56. },
  57. methods: {
  58. goCarModel(){
  59. uni.navigateTo({
  60. url:'carModel'
  61. })
  62. },
  63. setPlate(plate) {
  64. if (plate.length >= 7) this.plateNo = plate;
  65. this.plateShow = false;
  66. },
  67. bindChange(e) {
  68. console.log(e);
  69. this.time = e.target.value
  70. },
  71. }
  72. }
  73. </script>
  74. <style>
  75. .content {
  76. min-height: 100vh;
  77. background-color: #F4F5F7;
  78. padding-top: 20rpx;
  79. }
  80. .carMessage {
  81. margin: 0rpx 24rpx 40rpx;
  82. padding-top: 20rpx;
  83. height: 500rpx;
  84. background-color: #FFFFFF;
  85. border-radius: 10rpx;
  86. }
  87. .mesView {
  88. display: flex;
  89. align-items: center;
  90. width: 100%;
  91. height: 120rpx;
  92. background-color: #FFFFFF;
  93. }
  94. .leftTitle {
  95. margin: 28rpx;
  96. width: 120rpx;
  97. font-size: 28rpx;
  98. color: #666666;
  99. }
  100. .noSelectColor {
  101. color: #999999;
  102. }
  103. .selectColor {
  104. color: #333333;
  105. }
  106. .rightArrow {
  107. margin-right: 28rpx;
  108. width: 14rpx;
  109. height: 23rpx;
  110. }
  111. .cityBtn {
  112. width: 65%;
  113. font-size: 28rpx;
  114. }
  115. .plateNumber {
  116. width: 55%;
  117. font-size: 28rpx;
  118. }
  119. .carModBtn {
  120. width: 65%;
  121. font-size: 28rpx;
  122. }
  123. .timeBtn {
  124. width: 65%;
  125. font-size: 28rpx;
  126. }
  127. .mileageInput {
  128. width: 20%;
  129. font-size: 28rpx;
  130. }
  131. .kmStr {
  132. font-size: 28rpx;
  133. color: #333333;
  134. }
  135. .bottomView {
  136. background-color: #FFFFFF;
  137. width: 100%;
  138. height: 120rpx;
  139. position: fixed;
  140. bottom: 0rpx;
  141. }
  142. .saveCar {
  143. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  144. margin: 23rpx 30rpx;
  145. height: 74rpx;
  146. line-height: 74rpx;
  147. border-radius: 37rpx;
  148. color: #FFFFFF;
  149. font-size: 30rpx;
  150. font-weight: bold;
  151. text-align: center;
  152. }
  153. </style>