学员端小程序
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.

255 lines
6.4 KiB

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