学员端小程序
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.

675 lines
17 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="main pageBg">
  3. <!-- <button @click="$goPage('/pages/userCenter/login/face')">进入人脸识别</button> -->
  4. <view style="background-color: #2170FD; width: 100%;height: 20rpx;"></view>
  5. <!-- <u-navbar title=" " :bgColor="bgColor" :autoBack="false">
  6. <view class="" slot="left">
  7. <view class="flex">
  8. <view class="adrsIcon">
  9. <image src="@/static/images/index/dingwei.png" mode=""></image>
  10. </view>
  11. <view class="adr">{{ vuex_cityInfo.city }} </view>
  12. </view>
  13. </view>
  14. <view class="rightScan" slot="right">
  15. <view class="scan" @click="scanCodeFn">
  16. <image src="@/static/images/index/scan.png" mode=""></image>
  17. </view>
  18. </view>
  19. </u-navbar> -->
  20. <!-- <button @click="refereshFn">刷新token</button> -->
  21. <view class="TopCon" :style="{ backgroundImage: `url(${imgUrl})`, backgroundSize: backgroundSize }">
  22. <view class="status_bar"></view>
  23. <!-- 地址扫一扫 -->
  24. <!-- #ifdef MP-WEIXIN -->
  25. <view class="flex-b">
  26. <view class="flex">
  27. <view class="adrsIcon">
  28. <image src="@/static/images/index/dingwei.png" mode=""></image>
  29. </view>
  30. <view class="adr">{{ vuex_cityInfo.city || '杭州' }} </view>
  31. </view>
  32. <view class="scan" @click="scanCodeFn">
  33. <image src="@/static/images/index/scan.png" mode=""></image>
  34. </view>
  35. </view>
  36. <!-- #endif -->
  37. <!-- 搜索 -->
  38. <view class="searchCon" @click.capture="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')">
  39. <searchRow placeholder="搜索驾校、教练…" :disable="true"></searchRow>
  40. </view>
  41. </view>
  42. <view class="pad">
  43. <!-- 精钢区 -->
  44. <view class="card traTop">
  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="card">
  56. <view class="ul3">
  57. <view class="li3" v-for="(item,index) in moreSection" :key="index" @click="goPageSection(item)">
  58. <view class="icon">
  59. <image :src="item.icon" mode=""></image>
  60. </view>
  61. <view class="name">{{ item.text }}</view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 行业资讯 -->
  66. <view class="card">
  67. <view class="information">
  68. <view class="flex-b border">
  69. <view class="h1">行业资讯</view>
  70. <view class="more" @click="$goPage('/pages/indexEntry/iIndustryInfo/iIndustryInfo')">
  71. <view class="text">更多</view>
  72. <view class="icon">
  73. <u-icon name="arrow-right"></u-icon>
  74. </view>
  75. </view>
  76. </view>
  77. <uni-swiper-dot class="uni-swiper-dot-box" @clickItem=clickItem :info="swiperInfo" v-if="swiperInfo.length"
  78. :current="current" :mode="mode" style="height: 230rpx;" :dots-styles="dotsStyles"
  79. field="content">
  80. <swiper class="swiper-box" @change="change" :current="swiperDotIndex" style="height: 230rpx;">
  81. <swiper-item v-for="(item, index) in swiperInfo" :key="index" @click="$goPage('/pages/indexEntry/iIndustryInfo/detail/detail?id='+ item.id)">
  82. <view class="swiper-item" :class="'swiper-item' + index">
  83. <view class="flex-b">
  84. <view class="imgBox">
  85. <image :src="item.picture" mode="aspectFill"></image>
  86. </view>
  87. <view class="rightText">
  88. <view class="text towRowText">{{ item.title }}</view>
  89. <view class="date">{{ $u.timeFormat(item.createTime, 'yyyy/mm/dd') }}</view>
  90. </view>
  91. </view>
  92. </view>
  93. </swiper-item>
  94. </swiper>
  95. </uni-swiper-dot>
  96. </view>
  97. </view>
  98. <!-- 服务专区 -->
  99. <view class="card serviceCon">
  100. <view class="h1">服务专区</view>
  101. <view class="ul2">
  102. <view class="li2" v-for="(item,index) in serviceSector" :key="index" :class="'li2Bg' + index" @click="goServiceSector(item)">
  103. <view class="icon">
  104. <image :src="item.icon" mode=""></image>
  105. </view>
  106. <view class="textCon">
  107. <view class="text">{{ item.text }}</view>
  108. <view class="tps">{{ item.tps}}</view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <view style="height: 20rpx;width: 100%;"></view>
  114. </view>
  115. <u-popup :show="showPrivacy" mode="center" :round="20" >
  116. <privacyPopup @disagree="showPrivacy=false" @agree="showPrivacy=false"></privacyPopup>
  117. </u-popup>
  118. </view>
  119. </template>
  120. <script>
  121. import { imgUrl } from '@/config/site.config'
  122. import { getarticleList } from '@/config/api.js'
  123. export default {
  124. data() {
  125. return {
  126. showPrivacy: false,
  127. imgUrl: imgUrl+'banner.png',
  128. backgroundSize: '100% 100%',
  129. keywords: '',
  130. entrySection: [{
  131. text: '我要报名',
  132. icon: require('../../../static/images/index/ic_baoming.png'),
  133. url: '/pages/indexEntry/enroll/enroll',
  134. goPage: function (){
  135. console.log(666)
  136. // this.$goPage(item.url)
  137. }
  138. },
  139. {
  140. text: '找驾校',
  141. icon: require('../../../static/images/index/ic_jiaxiao.png'),
  142. url: '/pages/indexEntry/findShcool/findShcool',
  143. goPage: (item)=>{
  144. this.$goPage(item.url)
  145. }
  146. },
  147. {
  148. text: '找考场',
  149. icon: require('../../../static/images/index/ic_kaochang.png'),
  150. url: '/pages/indexEntry/examines/examines',
  151. goPage: ((item)=>{
  152. this.$goPage(item.url)
  153. })
  154. },
  155. {
  156. text: '找驾驶馆',
  157. icon: require('../../../static/images/index/ic_jsg.png'),
  158. url: '/pages/carEntry/simulateAppointment/simulateAppointment',
  159. goPage: ((item)=>{
  160. this.$goPage(item.url)
  161. })
  162. },
  163. {
  164. text: '找陪练',
  165. icon: require('../../../static/images/index/ic_peilian.png'),
  166. goPage: ((item)=>{
  167. this.$u.toast('正在开发中,敬请期待...')
  168. })
  169. },
  170. {
  171. text: '理论学习',
  172. icon: require('../../../static/images/index/ic_lilun.png'),
  173. url: '/pages/indexEntry/theory/theory',
  174. goPage: ((item)=>{
  175. this.$goPage(item.url)
  176. })
  177. },
  178. ],
  179. moreSection: [{
  180. text: '摩托车业务',
  181. icon: require('../../../static/images/index/btn_motuoche.png'),
  182. url: '/pages/indexEntry/enroll/enroll'
  183. },
  184. {
  185. text: '考试预约',
  186. icon: require('../../../static/images/index/btn_yuyue.png'),
  187. url: '/pages/indexEntry/findShcool/findShcool'
  188. },
  189. {
  190. text: '交通求助',
  191. icon: require('../../../static/images/index/btn_jiuzhu.png'),
  192. url: '/pages/indexEntry/examines/examines'
  193. },
  194. {
  195. text: '学驾保险',
  196. icon: require('../../../static/images/index/btn_baoxian.png'),
  197. },
  198. {
  199. text: '更多',
  200. icon: require('../../../static/images/index/btn_gengduo.png'),
  201. url: '/pages/indexEntry/theory/theory'
  202. },
  203. ],
  204. serviceSector: [{
  205. text: '学车指南',
  206. tps: '政府平台 一站服务',
  207. icon: require('../../../static/images/index/img_1@2x.png'),
  208. url: '/pages/indexEntry/parse/parse'
  209. },
  210. {
  211. text: '公益视频',
  212. tps: '立体呈现 学驾无忧',
  213. icon: require('../../../static/images/index/img_2@2x.png'),
  214. url: '/pages/indexEntry/publicVideo/publicVideo'
  215. },
  216. {
  217. text: '合格率排行',
  218. tps: '官方数据 阳光透明',
  219. icon: require('../../../static/images/index/img_3@2x.png'),
  220. url: '/pages/indexEntry/credit/credit?type=1'
  221. },
  222. {
  223. text: '行业政策',
  224. tps: '权威发布 精准解读',
  225. icon: require('../../../static/images/index/img_4@2x.png'),
  226. url: '/pages/indexEntry/industryPolicy/industryPolicy'
  227. },
  228. {
  229. text: '质量信誉排行',
  230. tps: '官方数据 阳光透明',
  231. icon: require('../../../static/images/index/img_5@2x.png'),
  232. url: '/pages/indexEntry/credit/credit'
  233. },
  234. {
  235. text: '咨询投诉',
  236. tps: '畅达沟通 听取民声',
  237. icon: require('../../../static/images/index/img_6@2x.png'),
  238. url: '/pages/indexEntry/consult/consult'
  239. },
  240. {
  241. text: '满分学习考试',
  242. tps: '网络教育 数据联网',
  243. icon: require('../../../static/images/index/img_7@2x.png'),
  244. url: ''
  245. },
  246. {
  247. text: '送考卷下乡',
  248. tps: '便民利民 就近考试',
  249. icon: require('../../../static/images/index/img_8@2x.png'),
  250. url: ''
  251. },
  252. ],
  253. swiperDotIndex: 0,
  254. current: 1,
  255. mode: 'default',
  256. swiperInfo: [],
  257. dotsStyles: {
  258. backgroundColor: '#E8E9EC',
  259. border: '1px #E8E9EC solid',
  260. color: '#fff',
  261. selectedBackgroundColor: '#1989FA',
  262. selectedBorder: '1px #1989FA solid'
  263. },
  264. bgColor: 'transparent'
  265. }
  266. },
  267. async onLoad() {
  268. // this.getarticleListFn()
  269. // uni.getLocation({
  270. // type: 'wgs84',
  271. // success: function (res) {
  272. // console.log('当前位置的经度:' + res.longitude);
  273. // console.log('当前位置的纬度:' + res.latitude);
  274. // },
  275. // fail(err) {
  276. // console.log(err)
  277. // }
  278. // });
  279. if(!this.$store.state.user.vuex_cityInfo.lat) {
  280. await this.$store.dispatch('getCity')
  281. }
  282. // console.log(this.$store.state.user.vuex_cityInfo)
  283. },
  284. onPullDownRefresh() {
  285. this.getarticleListFn()
  286. },
  287. onShow() {
  288. this.$store.dispatch('getUserInfo')
  289. if(!this.swiperInfo.length) {
  290. this.getarticleListFn()
  291. }
  292. },
  293. computed: {
  294. },
  295. methods: {
  296. async entrySectionClick(item) {
  297. if(item.text=='我要报名') {
  298. let token = this.$store.state.user.vuex_loginInfo.accessToken
  299. if(!token) {
  300. this.$store.commit('goLogin')
  301. return
  302. }
  303. // this.$goPage(item.url)
  304. this.$store.commit('updateNonPlatformStudent', false)
  305. if(this.vuex_userInfo.applyStep==3) {
  306. return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  307. }
  308. // 去填表
  309. if(this.vuex_userInfo.applyStep==2) {
  310. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  311. }
  312. // 去支付
  313. if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
  314. return this.$goPage('/pages/indexEntry/enroll/payment/payment')
  315. }
  316. }
  317. if(item.text=='找驾驶馆') {
  318. const res = await this.$store.dispatch('checkLogin')
  319. if(!res) return
  320. if(!this.vuex_userInfo.schoolId) return this.$u.toast('您不是平台学员')
  321. }
  322. this.$goPage(item.url)
  323. },
  324. async goServiceSector(item) {
  325. if(item.text=='咨询投诉') {
  326. const res = this.$store.dispatch('checkLogin')
  327. if(!res) return
  328. }
  329. this.$goPage(item.url)
  330. },
  331. async getarticleListFn() {
  332. const {data: res} = await getarticleList(this.params)
  333. this.swiperInfo = res.list[0].articleManagementDO
  334. },
  335. async refereshFn() {
  336. const res = await this.$store.dispatch('refreshToken')
  337. console.log(res)
  338. uni.$u.http.setConfig((config) => {
  339. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  340. console.log(111)
  341. return config
  342. })
  343. console.log(222)
  344. // this.$store.dispatch('getUserInfo')
  345. },
  346. close() {
  347. },
  348. goPageSection(item) {
  349. uni.navigateTo({
  350. url:item.url
  351. })
  352. },
  353. // 扫码
  354. scanCodeFn() {
  355. let _this = this
  356. uni.scanCode({
  357. success: function(res) {
  358. console.log('条码类型:' + res.scanType);
  359. console.log('条码内容6:' + res.result);
  360. let obj = JSON.parse(res.result)
  361. // 扫教练码去报名的
  362. if(obj.coachId) {
  363. obj.nickname = decodeURIComponent(obj.nickname)
  364. obj.schoolName = decodeURIComponent(obj.schoolName)
  365. let item = {
  366. schoolName: obj.schoolName,
  367. schoolId: obj.schoolId,
  368. name: obj.nickname,
  369. id: obj.coachId
  370. }
  371. console.log('***********')
  372. console.log(item)
  373. _this.$store.commit('upDateSchoolClass', {})
  374. _this.$store.commit('upDateSchoolCoach', item)
  375. _this.$goPage('/pages/indexEntry/enroll/enroll')
  376. }
  377. // _this.$store.commit('updateWebVeiwUrl', res.result)
  378. // uni.navigateTo({
  379. // url: '/pages/other/webView/webView'
  380. // })
  381. }
  382. });
  383. },
  384. clickItem(e) {
  385. this.swiperDotIndex = e
  386. },
  387. change(e) {
  388. this.current = e.detail.current
  389. },
  390. goPage() {
  391. uni.navigateTo({
  392. url: '/pages/userCenter/login/loginByPhone'
  393. })
  394. },
  395. initFn() {
  396. uni.requestSubscribeMessage({
  397. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  398. success(res) {
  399. console.log('消息是否有权限呢')
  400. console.log(res)
  401. }
  402. })
  403. }
  404. }
  405. }
  406. </script>
  407. <style lang="scss" scoped>
  408. .main {
  409. width: 100%;
  410. .flex {
  411. .adrsIcon {
  412. width: 26rpx;
  413. height: 38rpx;
  414. margin-top: 4rpx;
  415. }
  416. .adr {
  417. padding-left: 14rpx;
  418. font-size: 28rpx;
  419. color: #fff;
  420. }
  421. }
  422. .rightScan {
  423. padding-right: 190rpx;
  424. }
  425. .scan {
  426. width: 64rpx;
  427. height: 64rpx;
  428. }
  429. .TopCon {
  430. width: 100%;
  431. height: 476rpx;
  432. // background: url('../../../static/images/bigImg/index_banner.png') no-repeat;
  433. // background: url('http://192.168.1.20:81/zhili/image/20230809/e7086ccf82ed4aa09d156f2590a50fba.png') no-repeat;
  434. position: relative;
  435. .flex-b {
  436. padding: 10rpx 212rpx 0 50rpx;
  437. }
  438. .searchCon {
  439. position: absolute;
  440. left: 0;
  441. bottom: 68rpx;
  442. padding: 0 28rpx;
  443. width: 100%;
  444. }
  445. }
  446. .card {
  447. background: #FFFFFF;
  448. border-radius: 16rpx;
  449. margin-bottom: 20rpx;
  450. &.traTop {
  451. // transform: translateY(-40rpx);
  452. margin-top: -40rpx;
  453. position: relative;
  454. z-index: 9;
  455. }
  456. .ul {
  457. height: 236rpx;
  458. display: flex;
  459. justify-content: space-between;
  460. align-items: center;
  461. padding: 0 20rpx;
  462. .li {
  463. flex: 1;
  464. display: flex;
  465. align-items: center;
  466. flex-direction: column;
  467. .icon {
  468. width: 92rpx;
  469. height: 92rpx;
  470. }
  471. .name {
  472. font-size: 26rpx;
  473. color: #333;
  474. padding-top: 20rpx;
  475. text-align: center;
  476. }
  477. }
  478. }
  479. .ul3 {
  480. height: 128rpx;
  481. display: flex;
  482. justify-content: space-between;
  483. align-items: center;
  484. padding: 0 30rpx;
  485. border: 2rpx solid #E8E9EC;
  486. border-radius: 16rpx;
  487. .li3 {
  488. // flex: 1;
  489. display: flex;
  490. align-items: center;
  491. flex-direction: column;
  492. .icon {
  493. width: 52rpx;
  494. height: 52rpx;
  495. }
  496. .name {
  497. font-size: 22rpx;
  498. color: #686B73;
  499. padding-top: 2rpx;
  500. text-align: center;
  501. }
  502. }
  503. }
  504. }
  505. .information {
  506. padding: 0 20rpx;
  507. height: 320rpx;
  508. .border {
  509. height: 86rpx;
  510. border-bottom: 2px dashed #E8E9EC;
  511. .h1 {
  512. font-size: 28rpx;
  513. color: #333;
  514. }
  515. .more {
  516. font-size: 24rpx;
  517. display: flex;
  518. .text {
  519. // margin-right: 8rpx;
  520. color: #686B73;
  521. }
  522. }
  523. }
  524. .swiper-item {
  525. height: 148rpx;
  526. .flex-b {
  527. padding: 30rpx 0 28rpx 0;
  528. .imgBox {
  529. width: 184rpx;
  530. height: 148rpx;
  531. background: linear-gradient(180deg, rgba(0, 122, 255, 0.5) 0%, #007AFF 100%);
  532. border-radius: 6rpx;
  533. overflow: hidden;
  534. }
  535. .rightText {
  536. flex: 1;
  537. padding: 0 0 0 30rpx;
  538. height: 148rpx;
  539. display: flex;
  540. flex-direction: column;
  541. justify-content: space-between;
  542. .text {
  543. font-size: 24rpx;
  544. color: #333;
  545. }
  546. .date {
  547. text-align: right;
  548. font-size: 20rpx;
  549. color: #686B73;
  550. }
  551. }
  552. }
  553. }
  554. }
  555. .serviceCon {
  556. width: 100%;
  557. padding: 0 20rpx 20rpx 20rpx;
  558. .h1 {
  559. font-size: 28rpx;
  560. color: #333;
  561. padding: 0 0 0 20rpx;
  562. font-weight: 500;
  563. line-height: 90rpx;
  564. }
  565. .ul2 {
  566. display: flex;
  567. flex-wrap: wrap;
  568. justify-content: space-between;
  569. .li2 {
  570. width: 48.8%;
  571. display: flex;
  572. align-items: center;
  573. padding: 14rpx 0 14rpx 14rpx;
  574. margin-bottom: 20rpx;
  575. border-radius: 16rpx;
  576. height: 160rpx;
  577. &.li2Bg0 {
  578. background: linear-gradient(180deg, #F7FBFF 0%, #EFF6FF 100%);
  579. }
  580. &.li2Bg1 {
  581. background: linear-gradient(180deg, #FFFAF3 0%, #FFF4EA 100%);
  582. }
  583. &.li2Bg2 {
  584. background: linear-gradient(180deg, #F4FFF5 0%, #F3FFED 100%);
  585. }
  586. &.li2Bg3 {
  587. background: linear-gradient(180deg, #EFFFF9 0%, #E3FFF5 100%);
  588. }
  589. &.li2Bg4 {
  590. background: linear-gradient(180deg, #FAF9FF 0%, #F9F5FF 100%);
  591. }
  592. &.li2Bg5 {
  593. background: linear-gradient(180deg, #FCF9FB 0%, #FFF5F8 100%);
  594. }
  595. &.li2Bg6 {
  596. background: linear-gradient(180deg, #FDFFF3 0%, #F5FFE1 100%);
  597. }
  598. &.li2Bg7 {
  599. background: linear-gradient(180deg, #EDF7FF 0%, #F3F1FF 100%);
  600. }
  601. .icon {
  602. width: 80rpx;
  603. height: 80rpx;
  604. }
  605. .textCon {
  606. // flex: 1;
  607. padding-left: 10rpx;
  608. .text {
  609. font-size: 32rpx;
  610. color: #333;
  611. font-weight: 500;
  612. }
  613. .tps {
  614. margin-top: 6rpx;
  615. font-size: 20rpx;
  616. color: #949494;
  617. }
  618. }
  619. }
  620. }
  621. }
  622. }
  623. </style>