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

244 lines
5.9 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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">
  18. <rich-text :nodes="schoolDetail.schoolIntroduceDO.introduce"></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. .flex {
  173. position: relative;
  174. .schoolLogo {
  175. width: 204rpx;
  176. height: 140rpx;
  177. }
  178. .textCon {
  179. flex: 1;
  180. padding: 0 0 0 36rpx;
  181. .name {
  182. font-size: 32rpx;
  183. font-weight: 600;
  184. }
  185. .starBox {
  186. padding: 12rpx 0 6rpx 0;
  187. }
  188. .evaluate {
  189. display: flex;
  190. align-items: center;
  191. margin-top: 30rpx;
  192. .txt {
  193. font-size: 24rpx;
  194. color: #363A44;
  195. margin-right: 12rpx;
  196. }
  197. }
  198. }
  199. .pozPhone {
  200. position: absolute;
  201. top: 50%;
  202. right: 40rpx;
  203. width: 72rpx;
  204. height: 72rpx;
  205. transform: translateY(-50%);
  206. }
  207. }
  208. }
  209. .h1 {
  210. line-height: 100rpx;
  211. }
  212. .navBox {
  213. display: flex;
  214. justify-content: space-between;
  215. padding: 10rpx 32rpx 20rpx 32rpx;
  216. .nav {
  217. width: 126rpx;
  218. height: 50rpx;
  219. background: #F6F7FA;
  220. border-radius: 10rpx;
  221. font-size: 24rpx;
  222. color: #999;
  223. text-align: center;
  224. line-height: 50rpx;
  225. &.active {
  226. color: #fff;
  227. background-color: $themC;;
  228. }
  229. }
  230. }
  231. }
  232. </style>