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

224 lines
5.0 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. <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">江西海正驾校</view>
  21. <view class="starBox">
  22. <u-rate active-color="#1989FA" inactive-color="#1989FA" gutter="1" :size="16" :value="4" disabled></u-rate>
  23. <view class="num">4.9</view>
  24. </view>
  25. <view class="evaluate" @click="$goPage('/pages/indexEntry/findShcool/shcoolComment/shcoolComment')">
  26. <view class="txt">50条评价</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></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"></tab1>
  50. <tab2 v-show="currentNav==2"></tab2>
  51. <tab3 v-show="currentNav==3" :coachList="coachList" :status="tab3Status"></tab3>
  52. <tab4 v-show="currentNav==4"></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 } 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. currentNav: 1,
  81. coachParams: {
  82. pageNo: 1,
  83. pageSize: 20
  84. },
  85. schoolId: '',
  86. coachList: [],
  87. tab3Status: 'loading',
  88. tab3Total: 20
  89. }
  90. },
  91. onLoad(options) {
  92. this.schoolId = options.schoolId
  93. this.coachParams.schoolId = this.schoolId
  94. this.coachPageFn()
  95. },
  96. onPullDownRefresh() {
  97. },
  98. onReachBottom() {
  99. if(this.currentNav==3&&this.coachList.length<this.tab3Total) {
  100. this.coachParams.pageNo = 1
  101. this.coachList = []
  102. this.coachPageFn()
  103. }
  104. },
  105. methods: {
  106. changeNav(item) {
  107. this.currentNav = item.id
  108. },
  109. async coachPageFn() {
  110. const {data: res} = await coachPage(this.coachParams)
  111. this.coachParams.pageNo ++
  112. this.coachList.push(...res.list)
  113. this.tab3Total = res.total
  114. if(this.coachList.length>=this.tab3Total) this.tab3Status = 'nomore'
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .navPoz {
  121. position: absolute;
  122. top: 0;
  123. z-index: 9;
  124. left: 0;
  125. }
  126. .main {
  127. width: 100%;
  128. min-height: 100vh;
  129. .swiper-box {
  130. position: relative;
  131. .radian {
  132. position: absolute;
  133. width: 100%;
  134. height: 84rpx;
  135. bottom: 0;
  136. left: 0;
  137. z-index: 9;
  138. }
  139. }
  140. .traTop {
  141. position: relative;
  142. top: -120rpx;
  143. z-index: 99;
  144. }
  145. .card {
  146. padding: 24rpx;
  147. .flex {
  148. position: relative;
  149. .schoolLogo {
  150. width: 204rpx;
  151. height: 140rpx;
  152. }
  153. .textCon {
  154. flex: 1;
  155. padding: 0 0 0 36rpx;
  156. .name {
  157. font-size: 32rpx;
  158. font-weight: 600;
  159. }
  160. .starBox {
  161. padding: 12rpx 0 6rpx 0;
  162. }
  163. .evaluate {
  164. display: flex;
  165. align-items: center;
  166. margin-top: 30rpx;
  167. .txt {
  168. font-size: 24rpx;
  169. color: #363A44;
  170. margin-right: 12rpx;
  171. }
  172. }
  173. }
  174. .pozPhone {
  175. position: absolute;
  176. top: 50%;
  177. right: 40rpx;
  178. width: 72rpx;
  179. height: 72rpx;
  180. transform: translateY(-50%);
  181. }
  182. }
  183. }
  184. .h1 {
  185. line-height: 100rpx;
  186. }
  187. .navBox {
  188. display: flex;
  189. justify-content: space-between;
  190. padding: 10rpx 32rpx 20rpx 32rpx;
  191. .nav {
  192. font-size: 28rpx;
  193. color: #363A44;
  194. &.active {
  195. color: $themC;
  196. font-weight: 600;
  197. font-size: 32rpx;
  198. position: relative;
  199. &::before {
  200. content: '';
  201. position: absolute;
  202. bottom: -18rpx;
  203. left: 50%;
  204. transform: translateX(-50%);
  205. width: 48rpx;
  206. height: 4rpx;
  207. background: #1989FA;
  208. border-radius: 2rpx 2rpx 0px 0px;
  209. }
  210. }
  211. }
  212. }
  213. }
  214. </style>