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

657 lines
16 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
10 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 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
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
1 year ago
10 months ago
1 year ago
12 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. <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">
  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. return this.$u.utils.clickSignUp()
  299. }
  300. if(item.text=='找驾驶馆') {
  301. const res = await this.$store.dispatch('checkLogin')
  302. if(!res) return
  303. if(!this.vuex_userInfo.schoolId) return this.$u.toast('您不是平台学员')
  304. }
  305. this.$goPage(item.url)
  306. },
  307. async goServiceSector(item) {
  308. if(item.text=='咨询投诉') {
  309. const res = this.$store.dispatch('checkLogin')
  310. if(!res) return
  311. }
  312. this.$goPage(item.url)
  313. },
  314. async getarticleListFn() {
  315. const {data: res} = await getarticleList(this.params)
  316. this.swiperInfo = res.list[0].articleManagementDO
  317. },
  318. async refereshFn() {
  319. const res = await this.$store.dispatch('refreshToken')
  320. console.log(res)
  321. uni.$u.http.setConfig((config) => {
  322. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  323. console.log(111)
  324. return config
  325. })
  326. console.log(222)
  327. // this.$store.dispatch('getUserInfo')
  328. },
  329. close() {
  330. },
  331. goPageSection(item) {
  332. uni.navigateTo({
  333. url:item.url
  334. })
  335. },
  336. // 扫码
  337. scanCodeFn() {
  338. let _this = this
  339. uni.scanCode({
  340. success: function(res) {
  341. console.log('条码类型:' + res.scanType);
  342. console.log('条码内容6:' + res.result);
  343. let obj = JSON.parse(res.result)
  344. // 扫教练码去报名的
  345. if(obj.coachId) {
  346. obj.nickname = decodeURIComponent(obj.nickname)
  347. obj.schoolName = decodeURIComponent(obj.schoolName)
  348. let item = {
  349. schoolName: obj.schoolName,
  350. schoolId: obj.schoolId,
  351. name: obj.nickname,
  352. id: obj.coachId
  353. }
  354. console.log('***********')
  355. console.log(item)
  356. _this.$store.commit('upDateSchoolClass', {})
  357. _this.$store.commit('upDateSchoolCoach', item)
  358. _this.$goPage('/pages/indexEntry/enroll/enroll')
  359. }
  360. // _this.$store.commit('updateWebVeiwUrl', res.result)
  361. // uni.navigateTo({
  362. // url: '/pages/other/webView/webView'
  363. // })
  364. }
  365. });
  366. },
  367. clickItem(e) {
  368. this.swiperDotIndex = e
  369. },
  370. change(e) {
  371. this.current = e.detail.current
  372. },
  373. goPage() {
  374. uni.navigateTo({
  375. url: '/pages/userCenter/login/loginByPhone'
  376. })
  377. },
  378. initFn() {
  379. uni.requestSubscribeMessage({
  380. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  381. success(res) {
  382. console.log('消息是否有权限呢')
  383. console.log(res)
  384. }
  385. })
  386. }
  387. }
  388. }
  389. </script>
  390. <style lang="scss" scoped>
  391. .main {
  392. width: 100%;
  393. .flex {
  394. .adrsIcon {
  395. width: 26rpx;
  396. height: 38rpx;
  397. margin-top: 4rpx;
  398. }
  399. .adr {
  400. padding-left: 14rpx;
  401. font-size: 28rpx;
  402. color: #fff;
  403. }
  404. }
  405. .rightScan {
  406. padding-right: 190rpx;
  407. }
  408. .scan {
  409. width: 64rpx;
  410. height: 64rpx;
  411. }
  412. .TopCon {
  413. width: 100%;
  414. height: 476rpx;
  415. // background: url('../../../static/images/bigImg/index_banner.png') no-repeat;
  416. // background: url('http://192.168.1.20:81/zhili/image/20230809/e7086ccf82ed4aa09d156f2590a50fba.png') no-repeat;
  417. position: relative;
  418. .flex-b {
  419. padding: 10rpx 212rpx 0 50rpx;
  420. }
  421. .searchCon {
  422. position: absolute;
  423. left: 0;
  424. bottom: 68rpx;
  425. padding: 0 28rpx;
  426. width: 100%;
  427. }
  428. }
  429. .card {
  430. background: #FFFFFF;
  431. border-radius: 16rpx;
  432. margin-bottom: 20rpx;
  433. &.traTop {
  434. // transform: translateY(-40rpx);
  435. margin-top: -40rpx;
  436. position: relative;
  437. z-index: 9;
  438. }
  439. .ul {
  440. height: 236rpx;
  441. display: flex;
  442. justify-content: space-between;
  443. align-items: center;
  444. padding: 0 20rpx;
  445. .li {
  446. flex: 1;
  447. display: flex;
  448. align-items: center;
  449. flex-direction: column;
  450. .icon {
  451. width: 92rpx;
  452. height: 92rpx;
  453. }
  454. .name {
  455. font-size: 26rpx;
  456. color: #333;
  457. padding-top: 20rpx;
  458. text-align: center;
  459. }
  460. }
  461. }
  462. .ul3 {
  463. height: 128rpx;
  464. display: flex;
  465. justify-content: space-between;
  466. align-items: center;
  467. padding: 0 30rpx;
  468. border: 2rpx solid #E8E9EC;
  469. border-radius: 16rpx;
  470. .li3 {
  471. // flex: 1;
  472. display: flex;
  473. align-items: center;
  474. flex-direction: column;
  475. .icon {
  476. width: 52rpx;
  477. height: 52rpx;
  478. }
  479. .name {
  480. font-size: 22rpx;
  481. color: #686B73;
  482. padding-top: 2rpx;
  483. text-align: center;
  484. }
  485. }
  486. }
  487. }
  488. .information {
  489. padding: 0 20rpx;
  490. height: 320rpx;
  491. .border {
  492. height: 86rpx;
  493. border-bottom: 2px dashed #E8E9EC;
  494. .h1 {
  495. font-size: 28rpx;
  496. color: #333;
  497. }
  498. .more {
  499. font-size: 24rpx;
  500. display: flex;
  501. .text {
  502. // margin-right: 8rpx;
  503. color: #686B73;
  504. }
  505. }
  506. }
  507. .swiper-item {
  508. height: 148rpx;
  509. .flex-b {
  510. padding: 30rpx 0 28rpx 0;
  511. .imgBox {
  512. width: 184rpx;
  513. height: 148rpx;
  514. background: linear-gradient(180deg, rgba(0, 122, 255, 0.5) 0%, #007AFF 100%);
  515. border-radius: 6rpx;
  516. overflow: hidden;
  517. }
  518. .rightText {
  519. flex: 1;
  520. padding: 0 0 0 30rpx;
  521. height: 148rpx;
  522. display: flex;
  523. flex-direction: column;
  524. justify-content: space-between;
  525. .text {
  526. font-size: 24rpx;
  527. color: #333;
  528. }
  529. .date {
  530. text-align: right;
  531. font-size: 20rpx;
  532. color: #686B73;
  533. }
  534. }
  535. }
  536. }
  537. }
  538. .serviceCon {
  539. width: 100%;
  540. padding: 0 20rpx 20rpx 20rpx;
  541. .h1 {
  542. font-size: 28rpx;
  543. color: #333;
  544. padding: 0 0 0 20rpx;
  545. font-weight: 500;
  546. line-height: 90rpx;
  547. }
  548. .ul2 {
  549. display: flex;
  550. flex-wrap: wrap;
  551. justify-content: space-between;
  552. .li2 {
  553. width: 48.8%;
  554. display: flex;
  555. align-items: center;
  556. padding: 14rpx 0 14rpx 14rpx;
  557. margin-bottom: 20rpx;
  558. border-radius: 16rpx;
  559. height: 160rpx;
  560. &.li2Bg0 {
  561. background: linear-gradient(180deg, #F7FBFF 0%, #EFF6FF 100%);
  562. }
  563. &.li2Bg1 {
  564. background: linear-gradient(180deg, #FFFAF3 0%, #FFF4EA 100%);
  565. }
  566. &.li2Bg2 {
  567. background: linear-gradient(180deg, #F4FFF5 0%, #F3FFED 100%);
  568. }
  569. &.li2Bg3 {
  570. background: linear-gradient(180deg, #EFFFF9 0%, #E3FFF5 100%);
  571. }
  572. &.li2Bg4 {
  573. background: linear-gradient(180deg, #FAF9FF 0%, #F9F5FF 100%);
  574. }
  575. &.li2Bg5 {
  576. background: linear-gradient(180deg, #FCF9FB 0%, #FFF5F8 100%);
  577. }
  578. &.li2Bg6 {
  579. background: linear-gradient(180deg, #FDFFF3 0%, #F5FFE1 100%);
  580. }
  581. &.li2Bg7 {
  582. background: linear-gradient(180deg, #EDF7FF 0%, #F3F1FF 100%);
  583. }
  584. .icon {
  585. width: 80rpx;
  586. height: 80rpx;
  587. }
  588. .textCon {
  589. // flex: 1;
  590. padding-left: 10rpx;
  591. .text {
  592. font-size: 32rpx;
  593. color: #333;
  594. font-weight: 500;
  595. }
  596. .tps {
  597. margin-top: 6rpx;
  598. font-size: 20rpx;
  599. color: #949494;
  600. }
  601. }
  602. }
  603. }
  604. }
  605. }
  606. </style>