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

510 lines
13 KiB

8 months ago
7 months ago
7 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
7 months ago
8 months ago
8 months ago
8 months ago
7 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
7 months ago
8 months ago
8 months ago
7 months ago
6 months ago
7 months ago
7 months ago
8 months ago
7 months ago
7 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 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" v-if="coachList.length">
  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="查看全部" @click.native="$goPage('/pages/indexEntry/findCoach/findCoach')"/>
  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. swiperDotIndex: 0,
  175. current: 1,
  176. mode: 'default',
  177. swiperInfo: [],
  178. dotsStyles: {
  179. backgroundColor: '#E8E9EC',
  180. border: '1px #E8E9EC solid',
  181. color: '#fff',
  182. selectedBackgroundColor: '#1989FA',
  183. selectedBorder: '1px #1989FA solid'
  184. },
  185. bgColor: 'transparent',
  186. informList: [],
  187. informa: 1,
  188. coachList: [],//推荐教练
  189. recommendSchool: [],//推荐驾校
  190. }
  191. },
  192. async onLoad() {
  193. },
  194. onPullDownRefresh() {
  195. this.$store.dispatch('getCity')
  196. this.initApi()
  197. },
  198. onShow() {
  199. // if(!this.vuex_cityInfo.lat) {
  200. // this.$store.dispatch('getCity')
  201. // }
  202. let token = this.$store.state.user.vuex_loginInfo.accessToken
  203. if(token) {
  204. this.$store.dispatch('getUserInfo')
  205. }
  206. if(!this.swiperInfo.length) {
  207. this.getBannerListFn()
  208. // this.getarticleListFn()
  209. }
  210. this.initApi()
  211. },
  212. computed: {
  213. },
  214. methods: {
  215. initApi() {
  216. this.getarticleListFn()
  217. this.getRecommendList()
  218. this.recommendSchoolList()
  219. },
  220. goCoachDetail(item) {
  221. let objStr = encodeURIComponent(JSON.stringify(item))
  222. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  223. },
  224. // 推荐教练
  225. async getRecommendList() {
  226. const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, lat: this.vuex_cityInfo.lat||'', lng: this.vuex_cityInfo.lng||''})
  227. this.coachList = res
  228. console.log(res)
  229. },
  230. // 推荐驾校
  231. async recommendSchoolList() {
  232. if(!this.vuex_cityInfo.lat) {
  233. await this.$store.dispatch('getCity')
  234. }
  235. const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 3, lat: this.vuex_cityInfo.lat||'', lng: this.vuex_cityInfo.lng||''})
  236. this.recommendSchool = res
  237. console.log(res)
  238. },
  239. async getBannerListFn() {
  240. const {data: res} = await getBannerList()
  241. this.swiperInfo = res.list.map(item=>{
  242. return item.imgUrl
  243. })
  244. console.log(this.swiperInfo)
  245. },
  246. async entrySectionClick(item) {
  247. if(item.text=='学车报名') {
  248. this.$store.commit('upDateSchoolCoach', {})
  249. this.$store.commit('upDateSchoolClass', {})
  250. return this.$u.utils.clickSignUp()
  251. }
  252. this.$goPage(item.url)
  253. },
  254. changeInforma(val) {
  255. if(this.informa == val) return
  256. this.informa = val
  257. this.getarticleListFn()
  258. },
  259. // 行业资讯
  260. async getarticleListFn() {
  261. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  262. this.informList = res.list
  263. },
  264. async refereshFn() {
  265. const res = await this.$store.dispatch('refreshToken')
  266. console.log(res)
  267. uni.$u.http.setConfig((config) => {
  268. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  269. console.log(111)
  270. return config
  271. })
  272. console.log(222)
  273. // this.$store.dispatch('getUserInfo')
  274. },
  275. close() {
  276. },
  277. goPageSection(item) {
  278. uni.navigateTo({
  279. url:item.url
  280. })
  281. },
  282. // 扫码
  283. scanCodeFn() {
  284. let _this = this
  285. uni.scanCode({
  286. scanType: ['qrCode'],
  287. success: function(res) {
  288. console.log('条码类型:' + res.scanType);
  289. console.log('条码内容:' + res.result);
  290. let obj = JSON.parse(res.result)
  291. console.log(obj)
  292. // 扫教练码去报名的
  293. if(obj.QrType) {
  294. let item = {
  295. schoolName: obj.schoolName,
  296. schoolId: obj.schoolId,
  297. name: obj.coachName,
  298. id: obj.coachId,
  299. teachCarType: obj.teachCarType,
  300. key: obj.key,
  301. QrType: obj.QrType
  302. }
  303. console.log('***********')
  304. console.log(item)
  305. _this.$store.commit('upDateSchoolClass', {})
  306. _this.$store.commit('upDateSchoolCoach', item)
  307. if(obj.QrType==1) {
  308. _this.$u.utils.clickSignUp()
  309. }else {
  310. _this.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
  311. }
  312. }
  313. // _this.$store.commit('updateWebVeiwUrl', res.result)
  314. // uni.navigateTo({
  315. // url: '/pages/other/webView/webView'
  316. // })
  317. }
  318. });
  319. },
  320. clickItem(e) {
  321. this.swiperDotIndex = e
  322. },
  323. change(e) {
  324. this.current = e.detail.current
  325. },
  326. goPage() {
  327. uni.navigateTo({
  328. url: '/pages/userCenter/login/loginByPhone'
  329. })
  330. },
  331. initFn() {
  332. uni.requestSubscribeMessage({
  333. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  334. success(res) {
  335. console.log('消息是否有权限呢')
  336. console.log(res)
  337. }
  338. })
  339. }
  340. }
  341. }
  342. </script>
  343. <style lang="scss" scoped>
  344. .h1_row {
  345. display: flex;
  346. align-items: center;
  347. justify-content: space-between;
  348. }
  349. .h1 {
  350. padding: 20rpx 0 20rpx 0;
  351. }
  352. .main {
  353. width: 100%;
  354. background: url('https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2024-02-27/1709013363812-0') #F6F7FA no-repeat;
  355. background-size: 100% 600rpx;
  356. .TopCon {
  357. width: 100%;
  358. // height: 120rpx;
  359. .flex-b {
  360. display: flex;
  361. height: 100%;
  362. height: 72rpx;
  363. margin-bottom: 20rpx;
  364. }
  365. .adrsCon {
  366. display: flex;
  367. align-items: center;
  368. width: 180rpx;
  369. height: 88rpx;
  370. .adrsIcon {
  371. width: 17rpx;
  372. height: 17rpx;
  373. margin-top: 4rpx;
  374. }
  375. .adr {
  376. padding-right: 14rpx;
  377. font-size: 28rpx;
  378. color: #fff;
  379. }
  380. }
  381. .searchCon {
  382. flex:1;
  383. }
  384. .scan {
  385. width: 100rpx;
  386. height: 100%;
  387. display: flex;
  388. justify-content: flex-end;
  389. align-items: center;
  390. image {
  391. width: 52rpx;
  392. height: 52rpx;
  393. }
  394. }
  395. }
  396. .bannerCon {
  397. border-radius: 20rpx;
  398. margin-bottom: 20rpx;
  399. overflow: hidden;
  400. }
  401. .card {
  402. background: #FFFFFF;
  403. border-radius: 16rpx;
  404. margin-bottom: 20rpx;
  405. padding: 0 20rpx;
  406. .ul {
  407. height: 164rpx;
  408. display: flex;
  409. justify-content: space-between;
  410. align-items: center;
  411. .li {
  412. flex: 1;
  413. display: flex;
  414. align-items: center;
  415. flex-direction: column;
  416. .icon {
  417. width: 72rpx;
  418. height: 72rpx;
  419. }
  420. .name {
  421. font-size: 26rpx;
  422. color: #333;
  423. padding-top: 20rpx;
  424. text-align: center;
  425. }
  426. }
  427. }
  428. }
  429. }
  430. .tabs {
  431. display: flex;
  432. }
  433. .severCon {
  434. display: flex;
  435. align-items: center;
  436. justify-content: space-between;
  437. padding: 20rpx 0rpx 20rpx 0rpx;
  438. }
  439. .severItem {
  440. width: 320rpx;
  441. height: 186rpx;
  442. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  443. background-size: 100% 100%;
  444. padding: 30rpx 20rpx;
  445. font-size: 24rpx;
  446. color: #fff;
  447. &.tow {
  448. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  449. background-size: 100% 100%;
  450. .go {
  451. background: #2AB188;
  452. }
  453. }
  454. .tit {
  455. font-size: 32rpx;
  456. }
  457. .tps {
  458. opacity: 0.8;
  459. margin: 12rpx 0;
  460. }
  461. .go {
  462. width: 70rpx;
  463. height: 38rpx;
  464. background: #1A61FB;
  465. border-radius: 10rpx;
  466. display: flex;
  467. align-items: center;
  468. .goTxt {
  469. padding-left: 4rpx;
  470. }
  471. }
  472. }
  473. .ul3 {
  474. display: flex;
  475. margin: 20rpx 0;
  476. }
  477. </style>