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

491 lines
13 KiB

10 months ago
10 months ago
4 months ago
8 months ago
8 months ago
10 months ago
9 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
9 months ago
10 months ago
9 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
8 months ago
4 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
5 months ago
10 months ago
8 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
4 months ago
8 months ago
10 months ago
9 months ago
10 months ago
8 months ago
10 months ago
4 months ago
7 months ago
8 months ago
7 months ago
4 months ago
9 months ago
7 months ago
9 months ago
10 months ago
9 months ago
9 months ago
7 months ago
10 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
4 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
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
  1. <template>
  2. <view class="main">
  3. <view class="status_bar"></view>
  4. <view class="TopCon pad" >
  5. <!-- 地址 -->
  6. <view class="adrsCon">
  7. <view class="adr" v-if="vuex_cityInfo.city">{{ vuex_cityInfo.city }} </view>
  8. <view class="adr" v-else @click="getLatLngFn" style="display: flex;align-items: center;">
  9. <text>获取定位信息</text> <image src="@/static/images/icon/down.png" mode="" style="width: 18rpx;height: 18rpx;margin-left: 6rpx;"></image>
  10. </view>
  11. <!-- <view class="adrsIcon">
  12. <image src="@/static/images/icon/down.png" mode=""></image>
  13. </view> -->
  14. </view>
  15. <view class="flex-b">
  16. <!-- 搜索 -->
  17. <view class="searchCon" >
  18. <searchRow placeholder="搜索驾校名称" :disable="true" bg="#fff" @searchFn="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')"></searchRow>
  19. </view>
  20. <!-- 扫一扫 -->
  21. <view class="scan" @click="scanCodeClick">
  22. <image src="@/static/images/indexIcon/sancode.png" mode="aspectFill"></image>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 海报 -->
  27. <view class="pad">
  28. <uni-swiper-dot class="uni-swiper-dot-box bannerCon" :info="swiperInfo" v-if="swiperInfo.length"
  29. :current="current" :mode="mode" :dots-styles="dotsStyles"
  30. field="content">
  31. <swiper class="swiper-box" @change="change" :current="swiperDotIndex" >
  32. <swiper-item v-for="(item, index) in swiperInfo" :key="index" @click="bannerClick(item)" >
  33. <view class="swiper-item" :class="'swiper-item' + index">
  34. <view class="imgBox">
  35. <image :src="item.imgUrl" mode="widthFix"></image>
  36. </view>
  37. </view>
  38. </swiper-item>
  39. </swiper>
  40. </uni-swiper-dot>
  41. </view>
  42. <view class="pad">
  43. <!-- 精钢区 -->
  44. <view class="card">
  45. <view class="ul">
  46. <view class="li" v-for="(item,index) in entrySection" :key="index" @tap="entrySectionClick(item)">
  47. <view class="icon">
  48. <image :src="item.icon" mode=""></image>
  49. </view>
  50. <view class="name">{{ item.text }}</view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 优质驾校 -->
  55. <view class="schoolCon card" v-if="recommendSchool.length">
  56. <view class="h1_row">
  57. <view class="h1" ><text class="active">优质驾校</text></view>
  58. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findShcool/findShcool')"/>
  59. </view>
  60. <view class="li" v-for="(item,index) in recommendSchool" :key="index" @click="$goPage('/pages/indexEntry/findShcool/shcoolDetail/shcoolDetail?schoolId='+ item.id)">
  61. <schoolItem :item="item"/>
  62. </view>
  63. </view>
  64. <!-- 推荐教练 -->
  65. <view class="coachCon" v-if="coachList.length">
  66. <view class="h1_row">
  67. <view class="h1" ><text class="active">推荐教练</text></view>
  68. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findCoach/findCoach')"/>
  69. </view>
  70. <scroll-view style="width: 100%;" scroll-x="true" scroll-with-animation >
  71. <view class="ul3">
  72. <view class="li3" v-for="item in coachList" :key="item.id" @click="goCoachDetail(item)">
  73. <coachItem :item="item"/>
  74. </view>
  75. </view>
  76. </scroll-view>
  77. </view>
  78. <!-- 行业资讯政策法规 -->
  79. <view class="card">
  80. <view class="h1_row">
  81. <view class="tabs">
  82. <view class="h1" @click="changeInforma(1)"><text :class="{active: informa==1}">行业资讯</text></view>
  83. <view class="h1" @click="changeInforma(2)"><text :class="{active: informa==2}" style="margin-left: 30rpx;">政策法规</text></view>
  84. </view>
  85. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/industryPolicy/industryPolicy?type='+ informa)"/>
  86. </view>
  87. <view class="ul2">
  88. <view class="li2" v-for="(item,index) in informList" :key="index">
  89. <informaItem :item="item"/>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- 服务专区 -->
  94. <view class="card">
  95. <view class="h1" style="margin-top: 20rpx;"><text class="active">服务专区</text></view>
  96. <view class="severCon">
  97. <view class="severItem" @click="$goPage('/pages/indexEntry/parse/parse')">
  98. <view class="tit">学车指南</view>
  99. <view class="tps">政府平台 一站服务</view>
  100. <view class="go">
  101. <view class="goTxt">GO</view>
  102. <u-icon name="arrow-right" color="#fff" size="14"></u-icon>
  103. </view>
  104. </view>
  105. <view class="severItem tow" @click="$goPage('/pages/indexEntry/consult/consult')">
  106. <view class="tit">咨询投诉</view>
  107. <view class="tps">畅达沟通 听取民声</view>
  108. <view class="go">
  109. <view class="goTxt">GO</view>
  110. <u-icon name="arrow-right" color="#fff" size="14"></u-icon>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <u-popup :show="showPrivacy" mode="center" :round="20" >
  117. <privacyPopup @disagree="showPrivacy=false" @agree="showPrivacy=false"></privacyPopup>
  118. </u-popup>
  119. </view>
  120. </template>
  121. <script>
  122. import { imgUrl } from '@/config/site.config'
  123. import { getarticleList, getBannerList, getarticlezcList,getRecommendList, recommendSchoolList } from '@/config/api.js'
  124. import schoolItem from './comp/schoolItem'
  125. import informaItem from './comp/informaItem'
  126. import coachItem from './comp/coachItem'
  127. import { scanCodeFn } from '@/config/utils.js'
  128. import location from '@/common/js/location.js'
  129. export default {
  130. components: { schoolItem, informaItem, coachItem },
  131. data() {
  132. return {
  133. showPrivacy: false,
  134. imgUrl: imgUrl+'banner.png',
  135. backgroundSize: '100% 100%',
  136. keywords: '',
  137. entrySection: [{
  138. text: '学车报名',
  139. icon: require('../../../static/images/indexIcon/entryIcon (3).png'),
  140. url: '/pages/indexEntry/enroll/enroll',
  141. },
  142. {
  143. text: '找驾校',
  144. icon: require('../../../static/images/indexIcon/entryIcon (4).png'),
  145. url: '/pages/indexEntry/findShcool/findShcool',
  146. },
  147. {
  148. text: '找教练',
  149. icon: require('../../../static/images/indexIcon/entryIcon (1).png'),
  150. url: '/pages/indexEntry/findCoach/findCoach',
  151. },
  152. {
  153. text: '签到签退',
  154. icon: require('../../../static/images/indexIcon/entryIcon (5).png'),
  155. url: '/pages/indexEntry/signIn/signIn',
  156. },
  157. // {
  158. // text: '理论学习',
  159. // icon: require('../../../static/images/indexIcon/entryIcon (2).png'),
  160. // url: '/pages/indexEntry/theory/theory',
  161. // },
  162. ],
  163. swiperDotIndex: 0,
  164. current: 1,
  165. mode: 'default',
  166. swiperInfo: [],
  167. dotsStyles: {
  168. backgroundColor: '#E8E9EC',
  169. border: '1px #E8E9EC solid',
  170. color: '#fff',
  171. selectedBackgroundColor: '#1989FA',
  172. selectedBorder: '1px #1989FA solid'
  173. },
  174. bgColor: 'transparent',
  175. informList: [],
  176. informa: 1,
  177. coachList: [],//推荐教练
  178. recommendSchool: [],//推荐驾校
  179. }
  180. },
  181. async onLoad() {
  182. },
  183. onPullDownRefresh() {
  184. this.initApi()
  185. },
  186. onShow() {
  187. let _this = this
  188. // if(!this.vuex_cityInfo.lat) {
  189. // location.getLocation(()=>{
  190. // _this.$store.dispatch('getCity')
  191. // uni.showModal({
  192. // content: '为了您更好的给您推荐附近的驾校数据,需要获取位置信息,app想要获取您的位权限',
  193. // confirmText: "确定",
  194. // success: function(res) {
  195. // if (res.confirm) {
  196. // _this.$store.dispatch('getCity')
  197. // } else if (res.cancel) {
  198. // console.log('用户点击取消');
  199. // }
  200. // }
  201. // });
  202. // });
  203. // }
  204. let token = this.$store.state.user.vuex_loginInfo.accessToken
  205. if(token) {
  206. this.$store.dispatch('getUserInfo')
  207. }
  208. if(!this.swiperInfo.length) {
  209. this.getBannerListFn()
  210. // this.getarticleListFn()
  211. }
  212. this.initApi()
  213. },
  214. computed: {
  215. },
  216. methods: {
  217. async getLatLngFn() {
  218. await this.$store.dispatch('getCity')
  219. this.recommendSchoolList()
  220. },
  221. // 点击海报图
  222. bannerClick(item) {
  223. let link = item.jumpPath
  224. console.log(link)
  225. if(!link) return false
  226. this.$store.commit('updateWebVeiwUrl', link)
  227. this.$goPage('/pages/indexEntry/webView/webView')
  228. },
  229. initApi() {
  230. this.getarticleListFn()
  231. this.getRecommendList()
  232. this.recommendSchoolList()
  233. },
  234. goCoachDetail(item) {
  235. let objStr = encodeURIComponent(JSON.stringify(item))
  236. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  237. },
  238. // 推荐教练
  239. async getRecommendList() {
  240. const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, })
  241. this.coachList = res
  242. console.log(res)
  243. },
  244. // 推荐驾校
  245. async recommendSchoolList() {
  246. // if(!this.vuex_cityInfo.lat) {
  247. // await this.$store.dispatch('getCity')
  248. // }
  249. const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 3, lat: this.vuex_cityInfo.lat||'34.682945', lng: this.vuex_cityInfo.lng||'112.477298'})
  250. this.recommendSchool = res
  251. console.log(res)
  252. },
  253. async getBannerListFn() {
  254. const {data: res} = await getBannerList()
  255. this.swiperInfo = res.list
  256. console.log(this.swiperInfo)
  257. },
  258. async entrySectionClick(item) {
  259. if(item.text=='学车报名') {
  260. this.$store.commit('upDateSchoolCoach', {})
  261. this.$store.commit('upDateSchoolClass', {})
  262. this.$store.commit('updateSchool', {})
  263. return this.$u.utils.clickSignUp()
  264. }else if(item.text=='签到签退') {
  265. if(this.vuex_userInfo.applyStep<6) return this.$u.toast('请先报名学员')
  266. }
  267. this.$goPage(item.url)
  268. },
  269. changeInforma(val) {
  270. if(this.informa == val) return
  271. this.informa = val
  272. this.getarticleListFn()
  273. },
  274. // 行业资讯
  275. async getarticleListFn() {
  276. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  277. this.informList = res.list
  278. },
  279. async refereshFn() {
  280. const res = await this.$store.dispatch('refreshToken')
  281. console.log(res)
  282. uni.$u.http.setConfig((config) => {
  283. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  284. console.log(111)
  285. return config
  286. })
  287. console.log(222)
  288. // this.$store.dispatch('getUserInfo')
  289. },
  290. close() {
  291. },
  292. goPageSection(item) {
  293. uni.navigateTo({
  294. url:item.url
  295. })
  296. },
  297. // 扫码
  298. scanCodeClick() {
  299. scanCodeFn(this)
  300. },
  301. clickItem(e) {
  302. this.swiperDotIndex = e
  303. },
  304. change(e) {
  305. this.current = e.detail.current
  306. },
  307. goPage() {
  308. uni.navigateTo({
  309. url: '/pages/userCenter/login/loginByPhone'
  310. })
  311. },
  312. initFn() {
  313. uni.requestSubscribeMessage({
  314. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  315. success(res) {
  316. console.log('消息是否有权限呢')
  317. console.log(res)
  318. }
  319. })
  320. }
  321. }
  322. }
  323. </script>
  324. <style lang="scss" scoped>
  325. .h1_row {
  326. display: flex;
  327. align-items: center;
  328. justify-content: space-between;
  329. }
  330. .h1 {
  331. padding: 20rpx 0 20rpx 0;
  332. }
  333. .main {
  334. width: 100%;
  335. background: url('https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2024-02-27/1709013363812-0') #F6F7FA no-repeat;
  336. background-size: 100% 600rpx;
  337. .TopCon {
  338. width: 100%;
  339. // height: 120rpx;
  340. .flex-b {
  341. display: flex;
  342. height: 100%;
  343. height: 72rpx;
  344. margin-bottom: 20rpx;
  345. }
  346. .adrsCon {
  347. display: flex;
  348. align-items: center;
  349. // width: 180rpx;
  350. height: 88rpx;
  351. .adrsIcon {
  352. width: 17rpx;
  353. height: 17rpx;
  354. margin-top: 4rpx;
  355. }
  356. .adr {
  357. padding-right: 14rpx;
  358. font-size: 28rpx;
  359. color: #fff;
  360. }
  361. }
  362. .searchCon {
  363. flex:1;
  364. }
  365. .scan {
  366. width: 100rpx;
  367. height: 100%;
  368. display: flex;
  369. justify-content: flex-end;
  370. align-items: center;
  371. image {
  372. width: 52rpx;
  373. height: 52rpx;
  374. }
  375. }
  376. }
  377. .bannerCon {
  378. border-radius: 20rpx;
  379. margin-bottom: 20rpx;
  380. overflow: hidden;
  381. }
  382. .card {
  383. background: #FFFFFF;
  384. border-radius: 16rpx;
  385. margin-bottom: 20rpx;
  386. padding: 0 20rpx;
  387. .ul {
  388. height: 164rpx;
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. .li {
  393. flex: 1;
  394. display: flex;
  395. align-items: center;
  396. flex-direction: column;
  397. .icon {
  398. width: 72rpx;
  399. height: 72rpx;
  400. }
  401. .name {
  402. font-size: 26rpx;
  403. color: #333;
  404. padding-top: 20rpx;
  405. text-align: center;
  406. }
  407. }
  408. }
  409. }
  410. }
  411. .tabs {
  412. display: flex;
  413. }
  414. .severCon {
  415. display: flex;
  416. align-items: center;
  417. justify-content: space-between;
  418. padding: 20rpx 0rpx 20rpx 0rpx;
  419. }
  420. .severItem {
  421. width: 320rpx;
  422. height: 186rpx;
  423. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  424. background-size: 100% 100%;
  425. padding: 30rpx 20rpx;
  426. font-size: 24rpx;
  427. color: #fff;
  428. &.tow {
  429. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  430. background-size: 100% 100%;
  431. .go {
  432. background: #2AB188;
  433. }
  434. }
  435. .tit {
  436. font-size: 32rpx;
  437. }
  438. .tps {
  439. opacity: 0.8;
  440. margin: 12rpx 0;
  441. }
  442. .go {
  443. width: 70rpx;
  444. height: 38rpx;
  445. background: #1A61FB;
  446. border-radius: 10rpx;
  447. display: flex;
  448. align-items: center;
  449. .goTxt {
  450. padding-left: 4rpx;
  451. }
  452. }
  453. }
  454. .ul3 {
  455. display: flex;
  456. margin: 20rpx 0;
  457. }
  458. </style>