洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
2.9 KiB

10 months ago
  1. <template>
  2. <view class="step1">
  3. <coachInfo @click.native="showStep2" :FormData="FormData"/>
  4. <view class="h1">预约时间</view>
  5. <pickDate :FormData="FormData" @updatedForm="updatedForm"/>
  6. <view class="" v-if="showCarList.length">
  7. <view class="h1">教练车</view>
  8. <view class="card">
  9. <view class="car">
  10. <view class="carTag" v-for="(item,index) in showCarList" :key="index">{{item}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="" v-if="showSiteList.length">
  15. <view class="h1">训练场地</view>
  16. <view class="card" @click="$u.utils.openMap(item.latitude,item.longitude)" v-for="(item,index) in showSiteList" :key="index">
  17. <view class="site">
  18. <view class="leftTxt">
  19. <view class="adrs">{{item.siteName}}</view>
  20. <view class="adrsTxt">{{item.siteAddress}}</view>
  21. </view>
  22. <view class="icon">
  23. <image src="@/static/images/car/btn_daohang.png" mode=""></image>
  24. <!-- <image src="@/static/images/car/btn_daohang_cli.png" mode=""></image> -->
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="poz_btn">
  30. <view class="btn_row" >
  31. <view class="btnBg" @click="openPopup">下一步</view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import coachInfo from './coachInfo'
  38. import pickDate from './pickDate'
  39. export default {
  40. components: { coachInfo, pickDate },
  41. props: ['FormData'],
  42. data() {
  43. return {
  44. }
  45. },
  46. computed: {
  47. showSiteList() {
  48. return this.FormData.courseArr.reduce((acc,obj)=>{
  49. const found = acc.some(item => item.siteName == obj.siteName );
  50. if (!found) {
  51. acc.push(obj);
  52. }
  53. return acc;
  54. },[])
  55. },
  56. showCarList() {
  57. return [...new Set(this.FormData.courseArr.map(item=>item.carNumber))]
  58. }
  59. },
  60. methods: {
  61. openPopup(num) {
  62. if(!this.FormData.courseArr.length) {
  63. return this.$u.toast('请选择排课日期')
  64. }
  65. this.$emit('openPopup', num)
  66. },
  67. showStep2() {
  68. this.$emit('showStep2')
  69. },
  70. updatedForm(val) {
  71. this.$emit('updatedForm', val)
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .poz_btn {
  78. // position: fixed;
  79. // bottom: 0;
  80. // left: 0;
  81. // padding: 32rpx;
  82. // width: 100%;
  83. // background: #F6F6F6;
  84. .btn_row {
  85. display: flex;
  86. height: 200rpx;
  87. align-items: center;
  88. justify-content: center;
  89. .btnBg {
  90. width: 396rpx;
  91. }
  92. }
  93. }
  94. .h1 {
  95. line-height: 100rpx;
  96. }
  97. .car {
  98. padding: 32rpx 28rpx;
  99. .carTag {
  100. height: 120rpx;
  101. background: #F8F8F8;
  102. padding: 0 18rpx;
  103. color: $themC;
  104. border-radius: 12rpx;
  105. font-size: 28rpx;
  106. font-weight: 500;
  107. width: fit-content;
  108. line-height: 120rpx;
  109. }
  110. }
  111. .site {
  112. padding: 28rpx 40rpx 28rpx 36rpx;
  113. display: flex;
  114. align-items: center;
  115. .leftTxt {
  116. width: 0;
  117. flex: 1;
  118. color: $themC;
  119. .adrs {
  120. font-size: 32rpx;
  121. font-weight: 550;
  122. margin-bottom: 10rpx;
  123. }
  124. .adrsTxt {
  125. font-size: 28rpx;
  126. font-weight: 400;
  127. }
  128. }
  129. .icon {
  130. width: 72rpx;
  131. height: 72rpx;
  132. }
  133. }
  134. </style>