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

258 lines
6.4 KiB

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