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

548 lines
14 KiB

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
9 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
10 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
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
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 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
10 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
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">{{ 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="查看全部"/>
  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. return this.$u.utils.clickSignUp()
  299. }
  300. this.$goPage(item.url)
  301. },
  302. changeInforma(val) {
  303. if(this.informa == val) return
  304. this.informa = val
  305. this.getarticleListFn()
  306. },
  307. // 行业资讯
  308. async getarticleListFn() {
  309. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  310. this.informList = res.list
  311. },
  312. async refereshFn() {
  313. const res = await this.$store.dispatch('refreshToken')
  314. console.log(res)
  315. uni.$u.http.setConfig((config) => {
  316. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  317. console.log(111)
  318. return config
  319. })
  320. console.log(222)
  321. // this.$store.dispatch('getUserInfo')
  322. },
  323. close() {
  324. },
  325. goPageSection(item) {
  326. uni.navigateTo({
  327. url:item.url
  328. })
  329. },
  330. // 扫码
  331. scanCodeFn() {
  332. let _this = this
  333. uni.scanCode({
  334. success: function(res) {
  335. console.log('条码类型:' + res.scanType);
  336. console.log('条码内容6:' + res.result);
  337. let obj = JSON.parse(res.result)
  338. // 扫教练码去报名的
  339. if(obj.coachId) {
  340. obj.nickname = decodeURIComponent(obj.nickname)
  341. obj.schoolName = decodeURIComponent(obj.schoolName)
  342. let item = {
  343. schoolName: obj.schoolName,
  344. schoolId: obj.schoolId,
  345. name: obj.nickname,
  346. id: obj.coachId
  347. }
  348. console.log('***********')
  349. console.log(item)
  350. _this.$store.commit('upDateSchoolClass', {})
  351. _this.$store.commit('upDateSchoolCoach', item)
  352. _this.$goPage('/pages/indexEntry/enroll/enroll')
  353. }
  354. // _this.$store.commit('updateWebVeiwUrl', res.result)
  355. // uni.navigateTo({
  356. // url: '/pages/other/webView/webView'
  357. // })
  358. }
  359. });
  360. },
  361. clickItem(e) {
  362. this.swiperDotIndex = e
  363. },
  364. change(e) {
  365. this.current = e.detail.current
  366. },
  367. goPage() {
  368. uni.navigateTo({
  369. url: '/pages/userCenter/login/loginByPhone'
  370. })
  371. },
  372. initFn() {
  373. uni.requestSubscribeMessage({
  374. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  375. success(res) {
  376. console.log('消息是否有权限呢')
  377. console.log(res)
  378. }
  379. })
  380. }
  381. }
  382. }
  383. </script>
  384. <style lang="scss" scoped>
  385. .h1_row {
  386. display: flex;
  387. align-items: center;
  388. justify-content: space-between;
  389. }
  390. .h1 {
  391. padding: 20rpx 0 20rpx 0;
  392. }
  393. .main {
  394. width: 100%;
  395. background: url('../../../static/images/bigImg/homeBg.png') #F6F7FA no-repeat;
  396. background-size: 100% 600rpx;
  397. .TopCon {
  398. width: 100%;
  399. // height: 120rpx;
  400. .flex-b {
  401. display: flex;
  402. height: 100%;
  403. height: 72rpx;
  404. margin-bottom: 20rpx;
  405. }
  406. .adrsCon {
  407. display: flex;
  408. align-items: center;
  409. width: 180rpx;
  410. height: 88rpx;
  411. .adrsIcon {
  412. width: 17rpx;
  413. height: 17rpx;
  414. margin-top: 4rpx;
  415. }
  416. .adr {
  417. padding-right: 14rpx;
  418. font-size: 28rpx;
  419. color: #fff;
  420. }
  421. }
  422. .searchCon {
  423. flex:1;
  424. }
  425. .scan {
  426. width: 100rpx;
  427. height: 100%;
  428. display: flex;
  429. justify-content: flex-end;
  430. align-items: center;
  431. image {
  432. width: 52rpx;
  433. height: 52rpx;
  434. }
  435. }
  436. }
  437. .bannerCon {
  438. border-radius: 20rpx;
  439. margin-bottom: 20rpx;
  440. overflow: hidden;
  441. }
  442. .card {
  443. background: #FFFFFF;
  444. border-radius: 16rpx;
  445. margin-bottom: 20rpx;
  446. padding: 0 20rpx;
  447. .ul {
  448. height: 164rpx;
  449. display: flex;
  450. justify-content: space-between;
  451. align-items: center;
  452. .li {
  453. flex: 1;
  454. display: flex;
  455. align-items: center;
  456. flex-direction: column;
  457. .icon {
  458. width: 72rpx;
  459. height: 72rpx;
  460. }
  461. .name {
  462. font-size: 26rpx;
  463. color: #333;
  464. padding-top: 20rpx;
  465. text-align: center;
  466. }
  467. }
  468. }
  469. }
  470. }
  471. .tabs {
  472. display: flex;
  473. }
  474. .severCon {
  475. display: flex;
  476. align-items: center;
  477. justify-content: space-between;
  478. padding: 20rpx 0rpx 20rpx 0rpx;
  479. }
  480. .severItem {
  481. width: 320rpx;
  482. height: 186rpx;
  483. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  484. background-size: 100% 100%;
  485. padding: 30rpx 20rpx;
  486. font-size: 24rpx;
  487. color: #fff;
  488. &.tow {
  489. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  490. background-size: 100% 100%;
  491. .go {
  492. background: #2AB188;
  493. }
  494. }
  495. .tit {
  496. font-size: 32rpx;
  497. }
  498. .tps {
  499. opacity: 0.8;
  500. margin: 12rpx 0;
  501. }
  502. .go {
  503. width: 70rpx;
  504. height: 38rpx;
  505. background: #1A61FB;
  506. border-radius: 10rpx;
  507. display: flex;
  508. align-items: center;
  509. .goTxt {
  510. padding-left: 4rpx;
  511. }
  512. }
  513. }
  514. .ul3 {
  515. display: flex;
  516. margin: 20rpx 0;
  517. }
  518. </style>