洛阳学员端
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.

136 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. align-items: center;
  87. justify-content: center;
  88. .btnBg {
  89. width: 396rpx;
  90. }
  91. }
  92. }
  93. .h1 {
  94. line-height: 100rpx;
  95. }
  96. .car {
  97. padding: 32rpx 28rpx;
  98. .carTag {
  99. height: 120rpx;
  100. background: #F8F8F8;
  101. padding: 0 18rpx;
  102. color: $themC;
  103. border-radius: 12rpx;
  104. font-size: 28rpx;
  105. font-weight: 500;
  106. width: fit-content;
  107. line-height: 120rpx;
  108. }
  109. }
  110. .site {
  111. padding: 28rpx 40rpx 28rpx 36rpx;
  112. display: flex;
  113. align-items: center;
  114. .leftTxt {
  115. width: 0;
  116. flex: 1;
  117. color: $themC;
  118. .adrs {
  119. font-size: 32rpx;
  120. font-weight: 550;
  121. margin-bottom: 10rpx;
  122. }
  123. .adrsTxt {
  124. font-size: 28rpx;
  125. font-weight: 400;
  126. }
  127. }
  128. .icon {
  129. width: 72rpx;
  130. height: 72rpx;
  131. }
  132. }
  133. </style>