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

257 lines
6.4 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
5 months ago
10 months ago
10 months ago
10 months ago
5 months ago
10 months ago
8 months ago
10 months ago
5 months ago
3 weeks ago
5 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" :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. const jlcBg = require('@/static/images/bigImg/jlcbg.png')
  49. const radian = require('@/static/images/bigImg/radian.png')
  50. export default {
  51. components: { tab1, tab2, tab3, tab4, schoolItme},
  52. data() {
  53. return {
  54. swiperList: [],
  55. radianImg: radian,
  56. show: false,
  57. navList: [
  58. {text: '班型', id: 1},
  59. {text: '场地', id: 2},
  60. {text: '教练', id: 3},
  61. {text: '教练车', id: 4},
  62. ],
  63. params: {},
  64. schoolDetail: {},
  65. currentNav: 1,
  66. coachParams: {
  67. pageNo: 1,
  68. pageSize: 20
  69. },
  70. commentParams: {
  71. pageNo: 1,
  72. pageSize: 20
  73. },
  74. schoolId: '',
  75. coachList: [],
  76. tab3Status: 'loading',
  77. tab3Total: 20
  78. }
  79. },
  80. onLoad(options) {
  81. this.schoolId = options.schoolId
  82. this.coachParams.schoolId = this.schoolId
  83. this.commentParams.schoolId = this.schoolId
  84. this.coachPageFn()
  85. let vuex_cityInfo = this.$store.state.user.vuex_cityInfo
  86. if(!vuex_cityInfo.lat) {
  87. this.$store.dispatch('getCity')
  88. }else {
  89. this.params.lat = vuex_cityInfo.lat
  90. this.params.lng = vuex_cityInfo.lng
  91. }
  92. this.getSchoolDetailFn()
  93. // this.getListCommentFn()
  94. },
  95. onPullDownRefresh() {
  96. this.getSchoolDetailFn()
  97. if(this.currentNav==3&&this.coachList.length<this.tab3Total) {
  98. this.coachParams.pageNo = 1
  99. this.coachList = []
  100. this.coachPageFn()
  101. }
  102. },
  103. onReachBottom() {
  104. if(this.currentNav==3&&this.coachList.length<this.tab3Total) {
  105. this.coachPageFn()
  106. }
  107. },
  108. methods: {
  109. changeNav(item) {
  110. this.currentNav = item.id
  111. },
  112. // 驾校详情
  113. async getSchoolDetailFn() {
  114. uni.showLoading({
  115. title: '正在加载……'
  116. })
  117. const {data: res} = await getSchoolDetail(Object.assign(this.params,{id: this.schoolId}))
  118. this.schoolDetail = res
  119. this.swiperList = res.schoolIntroduceDO&&res.schoolIntroduceDO.headImages&&res.schoolIntroduceDO.headImages.split(',')
  120. if(!this.swiperList||!this.swiperList.length) {
  121. this.swiperList = [jlcBg]
  122. }
  123. this.$nextTick(()=>{uni.hideLoading()})
  124. console.log('this.swiperList')
  125. console.log(this.swiperList)
  126. },
  127. // 教练分页
  128. async coachPageFn() {
  129. const {data: res} = await coachPage(this.coachParams)
  130. this.coachParams.pageNo ++
  131. this.coachList.push(...res.list)
  132. this.tab3Total = res.total
  133. if(this.coachList.length>=this.tab3Total) this.tab3Status = 'nomore'
  134. },
  135. // 驾校评论分页
  136. // async getListCommentFn() {
  137. // const {data: res} = await getListComment(this.commentParams)
  138. // this.coachParams.pageNo ++
  139. // this.commentList.push(...res.list)
  140. // this.tab3Total = res.total
  141. // if(this.commentList.length>=this.tab4Total) this.tab3Status = 'nomore'
  142. // }
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. .severCon {
  148. margin-top: 20rpx;
  149. }
  150. .navPoz {
  151. position: absolute;
  152. top: 0;
  153. z-index: 9;
  154. left: 0;
  155. width: 100%;
  156. }
  157. .introduce {
  158. padding: 20rpx;
  159. font-size: 28rpx;
  160. color: #333;
  161. }
  162. .main {
  163. width: 100%;
  164. min-height: 100vh;
  165. .swiper-box {
  166. position: relative;
  167. width: 100%;
  168. .radian {
  169. position: absolute;
  170. width: 100%;
  171. height: 84rpx;
  172. bottom: 0;
  173. left: 0;
  174. z-index: 9;
  175. }
  176. }
  177. .traTop {
  178. position: relative;
  179. top: -120rpx;
  180. z-index: 99;
  181. }
  182. .card {
  183. padding: 0 20rpx;
  184. .flex {
  185. position: relative;
  186. .schoolLogo {
  187. width: 204rpx;
  188. height: 140rpx;
  189. }
  190. .textCon {
  191. flex: 1;
  192. padding: 0 0 0 36rpx;
  193. .name {
  194. font-size: 32rpx;
  195. font-weight: 600;
  196. }
  197. .starBox {
  198. padding: 12rpx 0 6rpx 0;
  199. }
  200. .evaluate {
  201. display: flex;
  202. align-items: center;
  203. margin-top: 30rpx;
  204. .txt {
  205. font-size: 24rpx;
  206. color: #363A44;
  207. margin-right: 12rpx;
  208. }
  209. }
  210. }
  211. .pozPhone {
  212. position: absolute;
  213. top: 50%;
  214. right: 40rpx;
  215. width: 72rpx;
  216. height: 72rpx;
  217. transform: translateY(-50%);
  218. }
  219. }
  220. }
  221. .h1 {
  222. line-height: 100rpx;
  223. }
  224. .navBox {
  225. display: flex;
  226. justify-content: space-between;
  227. padding: 10rpx 20rpx 20rpx 20rpx;
  228. .nav {
  229. width: 126rpx;
  230. height: 50rpx;
  231. background: #F6F7FA;
  232. border-radius: 10rpx;
  233. font-size: 24rpx;
  234. color: #999;
  235. text-align: center;
  236. line-height: 50rpx;
  237. &.active {
  238. color: #fff;
  239. background-color: $themC;;
  240. }
  241. }
  242. }
  243. }
  244. </style>