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

245 lines
5.9 KiB

10 months ago
9 months ago
10 months ago
9 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
  1. <template>
  2. <view class="main pageBg">
  3. <view class="swiper-box" >
  4. <view class="navPoz">
  5. <topNavbar title="驾校详情"></topNavbar>
  6. </view>
  7. <u-swiper :list="swiperList" :height="261"></u-swiper>
  8. <view class="radian">
  9. <image :src="radianImg" mode=""></image>
  10. </view>
  11. </view>
  12. <view class="pad traTop">
  13. <!-- 驾校信息 -->
  14. <view class="card " v-if="Object.keys(schoolDetail).length">
  15. <schoolItme :item="schoolDetail"/>
  16. <view class="introduce" v-if=" schoolDetail.schoolIntroduceDO">
  17. <u-read-more :showHeight="64" :toggle="true" :fontSize="12">
  18. <rich-text :nodes="schoolDetail.schoolIntroduceDO.introduce" style="font-size: 24rpx;"></rich-text>
  19. </u-read-more>
  20. </view>
  21. </view>
  22. <!-- 驾校位置 -->
  23. <view class="shoolPoz" style="margin-top: 20rpx; ">
  24. <pozCard :info="{address: schoolDetail.address,distance: schoolDetail.distance, lat: schoolDetail.lat, lng: schoolDetail.lng, schoolName:schoolDetail.shortName}"></pozCard>
  25. </view>
  26. <!-- 驾校服务 -->
  27. <view class="severCon card">
  28. <view class="h1"><text class="active">驾校服务</text></view>
  29. <view class="navBox">
  30. <view class="nav" v-for="(item,index) in navList" :key="index" :class="{active: currentNav==item.id}" @click="changeNav(item)">{{ item.text }}</view>
  31. </view>
  32. <tab1 v-show="currentNav==1" :classList="schoolDetail.schoolClassDOList"></tab1>
  33. <tab2 v-show="currentNav==2" :siteList="schoolDetail.trainingSiteDOS"></tab2>
  34. <tab3 v-show="currentNav==3" :coachList="coachList" :status="tab3Status"></tab3>
  35. <tab4 v-show="currentNav==4" :carList="schoolDetail.carDOS"></tab4>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import tab1 from './comp/tab1.vue'
  42. import tab2 from './comp/tab2.vue'
  43. import tab3 from './comp/tab3.vue'
  44. import tab4 from './comp/tab4.vue'
  45. import { coachPage, getSchoolDetail, getListComment } from '@/config/api.js'
  46. import { imgUrl } from '@/config/site.config'
  47. import schoolItme from '@/pages/tabbar/index/comp/schoolItem.vue'
  48. export default {
  49. components: { tab1, tab2, tab3, tab4, schoolItme},
  50. data() {
  51. return {
  52. swiperList: [],
  53. radianImg: imgUrl+'radian.png',
  54. show: false,
  55. navList: [
  56. {text: '班型', id: 1},
  57. {text: '场地', id: 2},
  58. {text: '教练', id: 3},
  59. {text: '教练车', id: 4},
  60. ],
  61. params: {},
  62. schoolDetail: {},
  63. currentNav: 1,
  64. coachParams: {
  65. pageNo: 1,
  66. pageSize: 20
  67. },
  68. commentParams: {
  69. pageNo: 1,
  70. pageSize: 20
  71. },
  72. schoolId: '',
  73. coachList: [],
  74. tab3Status: 'loading',
  75. tab3Total: 20
  76. }
  77. },
  78. onLoad(options) {
  79. this.schoolId = options.schoolId
  80. this.coachParams.schoolId = this.schoolId
  81. this.commentParams.schoolId = this.schoolId
  82. this.coachPageFn()
  83. let vuex_cityInfo = this.$store.state.user.vuex_cityInfo
  84. if(!vuex_cityInfo.lat) {
  85. this.$store.dispatch('getCity')
  86. }else {
  87. this.params.lat = vuex_cityInfo.lat
  88. this.params.lng = vuex_cityInfo.lng
  89. }
  90. this.getSchoolDetailFn()
  91. // this.getListCommentFn()
  92. },
  93. onPullDownRefresh() {
  94. this.getSchoolDetailFn()
  95. if(this.currentNav==3&&this.coachList.length<this.tab3Total) {
  96. this.coachParams.pageNo = 1
  97. this.coachList = []
  98. this.coachPageFn()
  99. }
  100. },
  101. onReachBottom() {
  102. if(this.currentNav==3&&this.coachList.length<this.tab3Total) {
  103. this.coachPageFn()
  104. }
  105. },
  106. methods: {
  107. changeNav(item) {
  108. this.currentNav = item.id
  109. },
  110. // 驾校详情
  111. async getSchoolDetailFn() {
  112. const {data: res} = await getSchoolDetail(Object.assign(this.params,{id: this.schoolId}))
  113. this.schoolDetail = res
  114. this.swiperList = res.schoolIntroduceDO&&res.schoolIntroduceDO.headImages.split(',')
  115. },
  116. // 教练分页
  117. async coachPageFn() {
  118. const {data: res} = await coachPage(this.coachParams)
  119. this.coachParams.pageNo ++
  120. this.coachList.push(...res.list)
  121. this.tab3Total = res.total
  122. if(this.coachList.length>=this.tab3Total) this.tab3Status = 'nomore'
  123. },
  124. // 驾校评论分页
  125. // async getListCommentFn() {
  126. // const {data: res} = await getListComment(this.commentParams)
  127. // this.coachParams.pageNo ++
  128. // this.commentList.push(...res.list)
  129. // this.tab3Total = res.total
  130. // if(this.commentList.length>=this.tab4Total) this.tab3Status = 'nomore'
  131. // }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .severCon {
  137. margin-top: 20rpx;
  138. }
  139. .navPoz {
  140. position: absolute;
  141. top: 0;
  142. z-index: 9;
  143. left: 0;
  144. width: 100%;
  145. }
  146. .introduce {
  147. padding: 20rpx;
  148. font-size: 28rpx;
  149. color: #333;
  150. }
  151. .main {
  152. width: 100%;
  153. min-height: 100vh;
  154. .swiper-box {
  155. position: relative;
  156. width: 100%;
  157. .radian {
  158. position: absolute;
  159. width: 100%;
  160. height: 84rpx;
  161. bottom: 0;
  162. left: 0;
  163. z-index: 9;
  164. }
  165. }
  166. .traTop {
  167. position: relative;
  168. top: -120rpx;
  169. z-index: 99;
  170. }
  171. .card {
  172. padding: 0 20rpx;
  173. .flex {
  174. position: relative;
  175. .schoolLogo {
  176. width: 204rpx;
  177. height: 140rpx;
  178. }
  179. .textCon {
  180. flex: 1;
  181. padding: 0 0 0 36rpx;
  182. .name {
  183. font-size: 32rpx;
  184. font-weight: 600;
  185. }
  186. .starBox {
  187. padding: 12rpx 0 6rpx 0;
  188. }
  189. .evaluate {
  190. display: flex;
  191. align-items: center;
  192. margin-top: 30rpx;
  193. .txt {
  194. font-size: 24rpx;
  195. color: #363A44;
  196. margin-right: 12rpx;
  197. }
  198. }
  199. }
  200. .pozPhone {
  201. position: absolute;
  202. top: 50%;
  203. right: 40rpx;
  204. width: 72rpx;
  205. height: 72rpx;
  206. transform: translateY(-50%);
  207. }
  208. }
  209. }
  210. .h1 {
  211. line-height: 100rpx;
  212. }
  213. .navBox {
  214. display: flex;
  215. justify-content: space-between;
  216. padding: 10rpx 20rpx 20rpx 20rpx;
  217. .nav {
  218. width: 126rpx;
  219. height: 50rpx;
  220. background: #F6F7FA;
  221. border-radius: 10rpx;
  222. font-size: 24rpx;
  223. color: #999;
  224. text-align: center;
  225. line-height: 50rpx;
  226. &.active {
  227. color: #fff;
  228. background-color: $themC;;
  229. }
  230. }
  231. }
  232. }
  233. </style>