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

550 lines
14 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
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
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
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
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
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
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
  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">{{ vuex_cityInfo.city || '杭州' }} </view>
  8. <view class="adrsIcon">
  9. <image src="@/static/images/icon/down.png" mode=""></image>
  10. </view>
  11. </view>
  12. <view class="flex-b">
  13. <!-- 搜索 -->
  14. <view class="searchCon" >
  15. <searchRow placeholder="搜索驾校名称" :disable="true" bg="#fff" @searchFn="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')"></searchRow>
  16. </view>
  17. <!-- 扫一扫 -->
  18. <view class="scan" @click="scanCodeFn">
  19. <image src="@/static/images/indexIcon/sancode.png" mode="aspectFill"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 海报 -->
  24. <view class="pad">
  25. <uni-swiper-dot class="uni-swiper-dot-box bannerCon" @clickItem=clickItem :info="swiperInfo" v-if="swiperInfo.length"
  26. :current="current" :mode="mode" :dots-styles="dotsStyles"
  27. field="content">
  28. <swiper class="swiper-box" @change="change" :current="swiperDotIndex" >
  29. <swiper-item v-for="(item, index) in swiperInfo" :key="index" >
  30. <view class="swiper-item" :class="'swiper-item' + index">
  31. <view class="imgBox">
  32. <image :src="item" mode="widthFix"></image>
  33. </view>
  34. </view>
  35. </swiper-item>
  36. </swiper>
  37. </uni-swiper-dot>
  38. </view>
  39. <view class="pad">
  40. <!-- 精钢区 -->
  41. <view class="card">
  42. <view class="ul">
  43. <view class="li" v-for="(item,index) in entrySection" :key="index" @tap="entrySectionClick(item)">
  44. <view class="icon">
  45. <image :src="item.icon" mode=""></image>
  46. </view>
  47. <view class="name">{{ item.text }}</view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 优质驾校 -->
  52. <view class="schoolCon card">
  53. <view class="h1_row">
  54. <view class="h1" ><text class="active">优质驾校</text></view>
  55. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findShcool/findShcool')"/>
  56. </view>
  57. <view class="li" v-for="(item,index) in recommendSchool" :key="index" @click="$goPage('/pages/indexEntry/findShcool/shcoolDetail/shcoolDetail?schoolId='+ item.id)">
  58. <schoolItem :item="item"/>
  59. </view>
  60. </view>
  61. <!-- 推荐教练 -->
  62. <view class="coachCon">
  63. <view class="h1_row">
  64. <view class="h1" ><text class="active">推荐教练</text></view>
  65. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findCoach/findCoach')"/>
  66. </view>
  67. <scroll-view style="width: 100%;" scroll-x="true" scroll-with-animation >
  68. <view class="ul3">
  69. <view class="li3" v-for="item in coachList" :key="item.id" @click="goCoachDetail(item)">
  70. <coachItem :item="item"/>
  71. </view>
  72. </view>
  73. </scroll-view>
  74. </view>
  75. <!-- 行业资讯政策法规 -->
  76. <view class="card">
  77. <view class="h1_row">
  78. <view class="tabs">
  79. <view class="h1" @click="changeInforma(1)"><text :class="{active: informa==1}">行业资讯</text></view>
  80. <view class="h1" @click="changeInforma(2)"><text :class="{active: informa==2}" style="margin-left: 30rpx;">政策法规</text></view>
  81. </view>
  82. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/industryPolicy/industryPolicy?type='+ informa)"/>
  83. </view>
  84. <view class="ul2">
  85. <view class="li2" v-for="(item,index) in informList" :key="index">
  86. <informaItem :item="item"/>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 服务专区 -->
  91. <view class="card">
  92. <view class="h1" style="margin-top: 20rpx;"><text class="active">服务专区</text></view>
  93. <view class="severCon">
  94. <view class="severItem" @click="$goPage('/pages/indexEntry/parse/parse')">
  95. <view class="tit">学车指南</view>
  96. <view class="tps">政府平台 一站服务</view>
  97. <view class="go">
  98. <view class="goTxt">GO</view>
  99. <u-icon name="arrow-right" color="#fff" size="14"></u-icon>
  100. </view>
  101. </view>
  102. <view class="severItem tow" @click="$goPage('/pages/indexEntry/consult/consult')">
  103. <view class="tit">咨询投诉</view>
  104. <view class="tps">畅达沟通 听取民声</view>
  105. <view class="go">
  106. <view class="goTxt">GO</view>
  107. <u-icon name="arrow-right" color="#fff" size="14"></u-icon>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <u-popup :show="showPrivacy" mode="center" :round="20" >
  114. <privacyPopup @disagree="showPrivacy=false" @agree="showPrivacy=false"></privacyPopup>
  115. </u-popup>
  116. </view>
  117. </template>
  118. <script>
  119. import { imgUrl } from '@/config/site.config'
  120. import { getarticleList, getBannerList, getarticlezcList,getRecommendList, recommendSchoolList } from '@/config/api.js'
  121. import schoolItem from './comp/schoolItem'
  122. import informaItem from './comp/informaItem'
  123. import coachItem from './comp/coachItem'
  124. export default {
  125. components: { schoolItem, informaItem, coachItem },
  126. data() {
  127. return {
  128. showPrivacy: false,
  129. imgUrl: imgUrl+'banner.png',
  130. backgroundSize: '100% 100%',
  131. keywords: '',
  132. entrySection: [{
  133. text: '学车报名',
  134. icon: require('../../../static/images/indexIcon/entryIcon (3).png'),
  135. url: '/pages/indexEntry/enroll/enroll',
  136. goPage: function (){
  137. console.log(666)
  138. // this.$goPage(item.url)
  139. }
  140. },
  141. {
  142. text: '找驾校',
  143. icon: require('../../../static/images/indexIcon/entryIcon (4).png'),
  144. url: '/pages/indexEntry/findShcool/findShcool',
  145. goPage: (item)=>{
  146. this.$goPage(item.url)
  147. }
  148. },
  149. {
  150. text: '找教练',
  151. icon: require('../../../static/images/indexIcon/entryIcon (1).png'),
  152. url: '/pages/indexEntry/findCoach/findCoach',
  153. goPage: ((item)=>{
  154. this.$goPage(item.url)
  155. })
  156. },
  157. {
  158. text: '签到签退',
  159. icon: require('../../../static/images/indexIcon/entryIcon (5).png'),
  160. url: '/pages/indexEntry/signIn/signIn',
  161. goPage: ((item)=>{
  162. this.$u.toast('正在开发中,敬请期待...')
  163. })
  164. },
  165. {
  166. text: '理论学习',
  167. icon: require('../../../static/images/indexIcon/entryIcon (2).png'),
  168. url: '/pages/indexEntry/theory/theory',
  169. goPage: ((item)=>{
  170. this.$goPage(item.url)
  171. })
  172. },
  173. ],
  174. serviceSector: [{
  175. text: '学车指南',
  176. tps: '政府平台 一站服务',
  177. icon: require('../../../static/images/index/img_1@2x.png'),
  178. url: '/pages/indexEntry/parse/parse'
  179. },
  180. {
  181. text: '公益视频',
  182. tps: '立体呈现 学驾无忧',
  183. icon: require('../../../static/images/index/img_2@2x.png'),
  184. url: '/pages/indexEntry/publicVideo/publicVideo'
  185. },
  186. {
  187. text: '合格率排行',
  188. tps: '官方数据 阳光透明',
  189. icon: require('../../../static/images/index/img_3@2x.png'),
  190. url: '/pages/indexEntry/credit/credit?type=1'
  191. },
  192. {
  193. text: '行业政策',
  194. tps: '权威发布 精准解读',
  195. icon: require('../../../static/images/index/img_4@2x.png'),
  196. url: '/pages/indexEntry/industryPolicy/industryPolicy'
  197. },
  198. {
  199. text: '质量信誉排行',
  200. tps: '官方数据 阳光透明',
  201. icon: require('../../../static/images/index/img_5@2x.png'),
  202. url: '/pages/indexEntry/credit/credit'
  203. },
  204. {
  205. text: '咨询投诉',
  206. tps: '畅达沟通 听取民声',
  207. icon: require('../../../static/images/index/img_6@2x.png'),
  208. url: '/pages/indexEntry/consult/consult'
  209. },
  210. {
  211. text: '满分学习考试',
  212. tps: '网络教育 数据联网',
  213. icon: require('../../../static/images/index/img_7@2x.png'),
  214. url: ''
  215. },
  216. {
  217. text: '送考卷下乡',
  218. tps: '便民利民 就近考试',
  219. icon: require('../../../static/images/index/img_8@2x.png'),
  220. url: ''
  221. },
  222. ],
  223. swiperDotIndex: 0,
  224. current: 1,
  225. mode: 'default',
  226. swiperInfo: [],
  227. dotsStyles: {
  228. backgroundColor: '#E8E9EC',
  229. border: '1px #E8E9EC solid',
  230. color: '#fff',
  231. selectedBackgroundColor: '#1989FA',
  232. selectedBorder: '1px #1989FA solid'
  233. },
  234. bgColor: 'transparent',
  235. informList: [],
  236. informa: 1,
  237. coachList: [],//推荐教练
  238. recommendSchool: [],//推荐驾校
  239. }
  240. },
  241. async onLoad() {
  242. // this.getarticleListFn()
  243. // uni.getLocation({
  244. // type: 'wgs84',
  245. // success: function (res) {
  246. // console.log('当前位置的经度:' + res.longitude);
  247. // console.log('当前位置的纬度:' + res.latitude);
  248. // },
  249. // fail(err) {
  250. // console.log(err)
  251. // }
  252. // });
  253. if(!this.$store.state.user.vuex_cityInfo.lat) {
  254. await this.$store.dispatch('getCity')
  255. }
  256. // console.log(this.$store.state.user.vuex_cityInfo)
  257. },
  258. onPullDownRefresh() {
  259. },
  260. onShow() {
  261. this.$store.dispatch('getUserInfo')
  262. if(!this.swiperInfo.length) {
  263. this.getBannerListFn()
  264. // this.getarticleListFn()
  265. }
  266. this.getarticleListFn()
  267. this.getRecommendList()
  268. this.recommendSchoolList()
  269. },
  270. computed: {
  271. },
  272. methods: {
  273. goCoachDetail(item) {
  274. let objStr = encodeURIComponent(JSON.stringify(item))
  275. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  276. },
  277. // 推荐教练
  278. async getRecommendList() {
  279. const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, lat: this.vuex_cityInfo.lat||'', lng: this.vuex_cityInfo.lng||''})
  280. this.coachList = res
  281. console.log(res)
  282. },
  283. // 推荐驾校
  284. async recommendSchoolList() {
  285. const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 3, lat: this.vuex_cityInfo.lat||'', lng: this.vuex_cityInfo.lng||''})
  286. this.recommendSchool = res
  287. console.log(res)
  288. },
  289. async getBannerListFn() {
  290. const {data: res} = await getBannerList()
  291. this.swiperInfo = res.list.map(item=>{
  292. return item.imgUrl
  293. })
  294. console.log(this.swiperInfo)
  295. },
  296. async entrySectionClick(item) {
  297. if(item.text=='学车报名') {
  298. this.$store.commit('upDateSchoolCoach', {})
  299. this.$store.commit('upDateSchoolClass', {})
  300. return this.$u.utils.clickSignUp()
  301. }
  302. this.$goPage(item.url)
  303. },
  304. changeInforma(val) {
  305. if(this.informa == val) return
  306. this.informa = val
  307. this.getarticleListFn()
  308. },
  309. // 行业资讯
  310. async getarticleListFn() {
  311. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  312. this.informList = res.list
  313. },
  314. async refereshFn() {
  315. const res = await this.$store.dispatch('refreshToken')
  316. console.log(res)
  317. uni.$u.http.setConfig((config) => {
  318. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  319. console.log(111)
  320. return config
  321. })
  322. console.log(222)
  323. // this.$store.dispatch('getUserInfo')
  324. },
  325. close() {
  326. },
  327. goPageSection(item) {
  328. uni.navigateTo({
  329. url:item.url
  330. })
  331. },
  332. // 扫码
  333. scanCodeFn() {
  334. let _this = this
  335. uni.scanCode({
  336. success: function(res) {
  337. console.log('条码类型:' + res.scanType);
  338. console.log('条码内容6:' + res.result);
  339. let obj = JSON.parse(res.result)
  340. // 扫教练码去报名的
  341. if(obj.coachId) {
  342. obj.nickname = decodeURIComponent(obj.nickname)
  343. obj.schoolName = decodeURIComponent(obj.schoolName)
  344. let item = {
  345. schoolName: obj.schoolName,
  346. schoolId: obj.schoolId,
  347. name: obj.nickname,
  348. id: obj.coachId
  349. }
  350. console.log('***********')
  351. console.log(item)
  352. _this.$store.commit('upDateSchoolClass', {})
  353. _this.$store.commit('upDateSchoolCoach', item)
  354. _this.$goPage('/pages/indexEntry/enroll/enroll')
  355. }
  356. // _this.$store.commit('updateWebVeiwUrl', res.result)
  357. // uni.navigateTo({
  358. // url: '/pages/other/webView/webView'
  359. // })
  360. }
  361. });
  362. },
  363. clickItem(e) {
  364. this.swiperDotIndex = e
  365. },
  366. change(e) {
  367. this.current = e.detail.current
  368. },
  369. goPage() {
  370. uni.navigateTo({
  371. url: '/pages/userCenter/login/loginByPhone'
  372. })
  373. },
  374. initFn() {
  375. uni.requestSubscribeMessage({
  376. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  377. success(res) {
  378. console.log('消息是否有权限呢')
  379. console.log(res)
  380. }
  381. })
  382. }
  383. }
  384. }
  385. </script>
  386. <style lang="scss" scoped>
  387. .h1_row {
  388. display: flex;
  389. align-items: center;
  390. justify-content: space-between;
  391. }
  392. .h1 {
  393. padding: 20rpx 0 20rpx 0;
  394. }
  395. .main {
  396. width: 100%;
  397. background: url('../../../static/images/bigImg/homeBg.png') #F6F7FA no-repeat;
  398. background-size: 100% 600rpx;
  399. .TopCon {
  400. width: 100%;
  401. // height: 120rpx;
  402. .flex-b {
  403. display: flex;
  404. height: 100%;
  405. height: 72rpx;
  406. margin-bottom: 20rpx;
  407. }
  408. .adrsCon {
  409. display: flex;
  410. align-items: center;
  411. width: 180rpx;
  412. height: 88rpx;
  413. .adrsIcon {
  414. width: 17rpx;
  415. height: 17rpx;
  416. margin-top: 4rpx;
  417. }
  418. .adr {
  419. padding-right: 14rpx;
  420. font-size: 28rpx;
  421. color: #fff;
  422. }
  423. }
  424. .searchCon {
  425. flex:1;
  426. }
  427. .scan {
  428. width: 100rpx;
  429. height: 100%;
  430. display: flex;
  431. justify-content: flex-end;
  432. align-items: center;
  433. image {
  434. width: 52rpx;
  435. height: 52rpx;
  436. }
  437. }
  438. }
  439. .bannerCon {
  440. border-radius: 20rpx;
  441. margin-bottom: 20rpx;
  442. overflow: hidden;
  443. }
  444. .card {
  445. background: #FFFFFF;
  446. border-radius: 16rpx;
  447. margin-bottom: 20rpx;
  448. padding: 0 20rpx;
  449. .ul {
  450. height: 164rpx;
  451. display: flex;
  452. justify-content: space-between;
  453. align-items: center;
  454. .li {
  455. flex: 1;
  456. display: flex;
  457. align-items: center;
  458. flex-direction: column;
  459. .icon {
  460. width: 72rpx;
  461. height: 72rpx;
  462. }
  463. .name {
  464. font-size: 26rpx;
  465. color: #333;
  466. padding-top: 20rpx;
  467. text-align: center;
  468. }
  469. }
  470. }
  471. }
  472. }
  473. .tabs {
  474. display: flex;
  475. }
  476. .severCon {
  477. display: flex;
  478. align-items: center;
  479. justify-content: space-between;
  480. padding: 20rpx 0rpx 20rpx 0rpx;
  481. }
  482. .severItem {
  483. width: 320rpx;
  484. height: 186rpx;
  485. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  486. background-size: 100% 100%;
  487. padding: 30rpx 20rpx;
  488. font-size: 24rpx;
  489. color: #fff;
  490. &.tow {
  491. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  492. background-size: 100% 100%;
  493. .go {
  494. background: #2AB188;
  495. }
  496. }
  497. .tit {
  498. font-size: 32rpx;
  499. }
  500. .tps {
  501. opacity: 0.8;
  502. margin: 12rpx 0;
  503. }
  504. .go {
  505. width: 70rpx;
  506. height: 38rpx;
  507. background: #1A61FB;
  508. border-radius: 10rpx;
  509. display: flex;
  510. align-items: center;
  511. .goTxt {
  512. padding-left: 4rpx;
  513. }
  514. }
  515. }
  516. .ul3 {
  517. display: flex;
  518. margin: 20rpx 0;
  519. }
  520. </style>