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

138 lines
2.9 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="step1">
  3. <coachInfo :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. updatedForm(val) {
  68. this.$emit('updatedForm', val)
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .poz_btn {
  75. // position: fixed;
  76. // bottom: 0;
  77. // left: 0;
  78. // padding: 32rpx;
  79. // width: 100%;
  80. // background: #F6F6F6;
  81. margin-top: 20rpx;
  82. .btn_row {
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. .btnBg {
  87. width: 396rpx;
  88. }
  89. }
  90. }
  91. .h1 {
  92. line-height: 100rpx;
  93. }
  94. .car {
  95. padding: 32rpx 28rpx;
  96. display: flex;
  97. flex-wrap: wrap;
  98. .carTag {
  99. height: 120rpx;
  100. background: #F8F8F8;
  101. padding: 0 18rpx;
  102. margin-right: 20rpx;
  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>