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

249 lines
6.0 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
6 months ago
6 months ago
8 months ago
8 months ago
8 months ago
8 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" :showReviewTotal="true"/>
  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. uni.showLoading({
  113. title: '正在加载……'
  114. })
  115. const {data: res} = await getSchoolDetail(Object.assign(this.params,{id: this.schoolId}))
  116. uni.hideLoading()
  117. this.schoolDetail = res
  118. this.swiperList = res.schoolIntroduceDO&&res.schoolIntroduceDO.headImages.split(',')
  119. },
  120. // 教练分页
  121. async coachPageFn() {
  122. const {data: res} = await coachPage(this.coachParams)
  123. this.coachParams.pageNo ++
  124. this.coachList.push(...res.list)
  125. this.tab3Total = res.total
  126. if(this.coachList.length>=this.tab3Total) this.tab3Status = 'nomore'
  127. },
  128. // 驾校评论分页
  129. // async getListCommentFn() {
  130. // const {data: res} = await getListComment(this.commentParams)
  131. // this.coachParams.pageNo ++
  132. // this.commentList.push(...res.list)
  133. // this.tab3Total = res.total
  134. // if(this.commentList.length>=this.tab4Total) this.tab3Status = 'nomore'
  135. // }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .severCon {
  141. margin-top: 20rpx;
  142. }
  143. .navPoz {
  144. position: absolute;
  145. top: 0;
  146. z-index: 9;
  147. left: 0;
  148. width: 100%;
  149. }
  150. .introduce {
  151. padding: 20rpx;
  152. font-size: 28rpx;
  153. color: #333;
  154. }
  155. .main {
  156. width: 100%;
  157. min-height: 100vh;
  158. .swiper-box {
  159. position: relative;
  160. width: 100%;
  161. .radian {
  162. position: absolute;
  163. width: 100%;
  164. height: 84rpx;
  165. bottom: 0;
  166. left: 0;
  167. z-index: 9;
  168. }
  169. }
  170. .traTop {
  171. position: relative;
  172. top: -120rpx;
  173. z-index: 99;
  174. }
  175. .card {
  176. padding: 0 20rpx;
  177. .flex {
  178. position: relative;
  179. .schoolLogo {
  180. width: 204rpx;
  181. height: 140rpx;
  182. }
  183. .textCon {
  184. flex: 1;
  185. padding: 0 0 0 36rpx;
  186. .name {
  187. font-size: 32rpx;
  188. font-weight: 600;
  189. }
  190. .starBox {
  191. padding: 12rpx 0 6rpx 0;
  192. }
  193. .evaluate {
  194. display: flex;
  195. align-items: center;
  196. margin-top: 30rpx;
  197. .txt {
  198. font-size: 24rpx;
  199. color: #363A44;
  200. margin-right: 12rpx;
  201. }
  202. }
  203. }
  204. .pozPhone {
  205. position: absolute;
  206. top: 50%;
  207. right: 40rpx;
  208. width: 72rpx;
  209. height: 72rpx;
  210. transform: translateY(-50%);
  211. }
  212. }
  213. }
  214. .h1 {
  215. line-height: 100rpx;
  216. }
  217. .navBox {
  218. display: flex;
  219. justify-content: space-between;
  220. padding: 10rpx 20rpx 20rpx 20rpx;
  221. .nav {
  222. width: 126rpx;
  223. height: 50rpx;
  224. background: #F6F7FA;
  225. border-radius: 10rpx;
  226. font-size: 24rpx;
  227. color: #999;
  228. text-align: center;
  229. line-height: 50rpx;
  230. &.active {
  231. color: #fff;
  232. background-color: $themC;;
  233. }
  234. }
  235. }
  236. }
  237. </style>