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

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