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

543 lines
14 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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" style="margin: 28rpx 0;"><text class="active">优质驾校</text></view>
  55. <moreRight text="查看全部"/>
  56. </view>
  57. <view class="li" v-for="(item,index) in 3" :key="index">
  58. <schoolItem :item="{}"/>
  59. </view>
  60. </view>
  61. <!-- 推荐教练 -->
  62. <view class="coachCon">
  63. <view class="h1_row">
  64. <view class="h1" style="margin: 28rpx 0;"><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 6" :key="item">
  70. <coachItem/>
  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}">政策法规</text></view>
  81. </view>
  82. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/industryPolicy/industryPolicy')"/>
  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 } 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/examines/examines',
  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/carEntry/simulateAppointment/simulateAppointment',
  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. }
  238. },
  239. async onLoad() {
  240. // this.getarticleListFn()
  241. // uni.getLocation({
  242. // type: 'wgs84',
  243. // success: function (res) {
  244. // console.log('当前位置的经度:' + res.longitude);
  245. // console.log('当前位置的纬度:' + res.latitude);
  246. // },
  247. // fail(err) {
  248. // console.log(err)
  249. // }
  250. // });
  251. if(!this.$store.state.user.vuex_cityInfo.lat) {
  252. await this.$store.dispatch('getCity')
  253. }
  254. // console.log(this.$store.state.user.vuex_cityInfo)
  255. },
  256. onPullDownRefresh() {
  257. },
  258. onShow() {
  259. this.$store.dispatch('getUserInfo')
  260. if(!this.swiperInfo.length) {
  261. this.getBannerListFn()
  262. // this.getarticleListFn()
  263. }
  264. this.getarticleListFn()
  265. },
  266. computed: {
  267. },
  268. methods: {
  269. async getBannerListFn() {
  270. const {data: res} = await getBannerList()
  271. this.swiperInfo = res.list.map(item=>{
  272. return item.imgUrl
  273. })
  274. console.log(this.swiperInfo)
  275. },
  276. async entrySectionClick(item) {
  277. if(item.text=='我要报名') {
  278. return this.$u.utils.clickSignUp()
  279. }
  280. if(item.text=='找驾驶馆') {
  281. const res = await this.$store.dispatch('checkLogin')
  282. if(!res) return
  283. if(!this.vuex_userInfo.schoolId) return this.$u.toast('您不是平台学员')
  284. }
  285. this.$goPage(item.url)
  286. },
  287. changeInforma(val) {
  288. this.informa = val
  289. this.getarticleListFn()
  290. },
  291. // 行业资讯
  292. async getarticleListFn() {
  293. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  294. this.informList = res.list
  295. },
  296. async refereshFn() {
  297. const res = await this.$store.dispatch('refreshToken')
  298. console.log(res)
  299. uni.$u.http.setConfig((config) => {
  300. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  301. console.log(111)
  302. return config
  303. })
  304. console.log(222)
  305. // this.$store.dispatch('getUserInfo')
  306. },
  307. close() {
  308. },
  309. goPageSection(item) {
  310. uni.navigateTo({
  311. url:item.url
  312. })
  313. },
  314. // 扫码
  315. scanCodeFn() {
  316. let _this = this
  317. uni.scanCode({
  318. success: function(res) {
  319. console.log('条码类型:' + res.scanType);
  320. console.log('条码内容6:' + res.result);
  321. let obj = JSON.parse(res.result)
  322. // 扫教练码去报名的
  323. if(obj.coachId) {
  324. obj.nickname = decodeURIComponent(obj.nickname)
  325. obj.schoolName = decodeURIComponent(obj.schoolName)
  326. let item = {
  327. schoolName: obj.schoolName,
  328. schoolId: obj.schoolId,
  329. name: obj.nickname,
  330. id: obj.coachId
  331. }
  332. console.log('***********')
  333. console.log(item)
  334. _this.$store.commit('upDateSchoolClass', {})
  335. _this.$store.commit('upDateSchoolCoach', item)
  336. _this.$goPage('/pages/indexEntry/enroll/enroll')
  337. }
  338. // _this.$store.commit('updateWebVeiwUrl', res.result)
  339. // uni.navigateTo({
  340. // url: '/pages/other/webView/webView'
  341. // })
  342. }
  343. });
  344. },
  345. clickItem(e) {
  346. this.swiperDotIndex = e
  347. },
  348. change(e) {
  349. this.current = e.detail.current
  350. },
  351. goPage() {
  352. uni.navigateTo({
  353. url: '/pages/userCenter/login/loginByPhone'
  354. })
  355. },
  356. initFn() {
  357. uni.requestSubscribeMessage({
  358. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  359. success(res) {
  360. console.log('消息是否有权限呢')
  361. console.log(res)
  362. }
  363. })
  364. }
  365. }
  366. }
  367. </script>
  368. <style lang="scss" scoped>
  369. .h1_row {
  370. display: flex;
  371. align-items: center;
  372. justify-content: space-between;
  373. padding-right: 20rpx;
  374. }
  375. .h1 {
  376. padding-top: 10rpx;
  377. .active {
  378. &::before {
  379. background: url('../../../static/images/icon/h1Active.png') #F6F7FA no-repeat;
  380. background-size: 52rpx 12rpx;
  381. }
  382. }
  383. }
  384. .ul2 {
  385. padding: 10rpx 20rpx 0 20rpx;
  386. }
  387. .main {
  388. width: 100%;
  389. background: url('../../../static/images/bigImg/homeBg.png') #F6F7FA no-repeat;
  390. background-size: 100% 600rpx;
  391. .TopCon {
  392. width: 100%;
  393. // height: 120rpx;
  394. .flex-b {
  395. display: flex;
  396. height: 100%;
  397. height: 72rpx;
  398. margin-bottom: 20rpx;
  399. }
  400. .adrsCon {
  401. display: flex;
  402. align-items: center;
  403. width: 180rpx;
  404. height: 88rpx;
  405. .adrsIcon {
  406. width: 17rpx;
  407. height: 17rpx;
  408. margin-top: 4rpx;
  409. }
  410. .adr {
  411. padding-right: 14rpx;
  412. font-size: 28rpx;
  413. color: #fff;
  414. }
  415. }
  416. .searchCon {
  417. flex:1;
  418. }
  419. .scan {
  420. width: 100rpx;
  421. height: 100%;
  422. display: flex;
  423. justify-content: flex-end;
  424. align-items: center;
  425. image {
  426. width: 52rpx;
  427. height: 52rpx;
  428. }
  429. }
  430. }
  431. .bannerCon {
  432. border-radius: 20rpx;
  433. margin-bottom: 20rpx;
  434. overflow: hidden;
  435. }
  436. .card {
  437. background: #FFFFFF;
  438. border-radius: 16rpx;
  439. margin-bottom: 20rpx;
  440. .ul {
  441. height: 164rpx;
  442. display: flex;
  443. justify-content: space-between;
  444. align-items: center;
  445. padding: 0 20rpx;
  446. .li {
  447. flex: 1;
  448. display: flex;
  449. align-items: center;
  450. flex-direction: column;
  451. .icon {
  452. width: 72rpx;
  453. height: 72rpx;
  454. }
  455. .name {
  456. font-size: 26rpx;
  457. color: #333;
  458. padding-top: 20rpx;
  459. text-align: center;
  460. }
  461. }
  462. }
  463. }
  464. }
  465. .tabs {
  466. display: flex;
  467. padding: 20rpx 0 10rpx 0;
  468. }
  469. .severCon {
  470. display: flex;
  471. align-items: center;
  472. justify-content: space-between;
  473. padding: 40rpx 20rpx 20rpx 20rpx;
  474. }
  475. .severItem {
  476. width: 320rpx;
  477. height: 186rpx;
  478. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  479. background-size: 100% 100%;
  480. padding: 30rpx 20rpx;
  481. font-size: 24rpx;
  482. color: #fff;
  483. &.tow {
  484. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  485. background-size: 100% 100%;
  486. .go {
  487. background: #2AB188;
  488. }
  489. }
  490. .tit {
  491. font-size: 32rpx;
  492. }
  493. .tps {
  494. opacity: 0.8;
  495. margin: 12rpx 0;
  496. }
  497. .go {
  498. width: 70rpx;
  499. height: 38rpx;
  500. background: #1A61FB;
  501. border-radius: 10rpx;
  502. display: flex;
  503. align-items: center;
  504. .goTxt {
  505. padding-left: 4rpx;
  506. }
  507. }
  508. }
  509. .ul3 {
  510. display: flex;
  511. margin-bottom: 20rpx;
  512. }
  513. </style>