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

517 lines
14 KiB

10 months ago
10 months ago
1 week ago
1 week ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
1 week ago
1 week ago
10 months ago
10 months ago
10 months ago
9 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
8 months ago
3 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
5 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
1 week ago
10 months ago
8 months ago
10 months ago
5 months ago
8 months ago
10 months ago
10 months ago
10 months ago
1 week ago
10 months ago
5 months ago
1 week ago
5 months ago
8 months ago
1 week ago
8 months ago
8 months ago
1 week ago
5 months ago
1 week ago
10 months ago
8 months ago
1 week ago
10 months ago
10 months ago
9 months ago
9 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
8 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
5 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
3 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 oneRowText" v-if="vuex_cityInfo.city" @click="getLatLngFn">{{vuex_cityInfo.city}} <text v-if="vuex_cityInfo.name"> / {{vuex_cityInfo.name}}</text></view>
  8. <view class="adr" v-else @click="getLatLngFn" style="display: flex;align-items: center;">
  9. <text>获取定位信息</text>
  10. <!-- <image src="@/static/images/icon/down.png" mode="" style="width: 18rpx;height: 18rpx;margin-left: 6rpx;"></image> -->
  11. </view>
  12. <view class="adrsIcon">
  13. <image src="@/static/images/icon/down.png" mode=""></image>
  14. </view>
  15. </view>
  16. <view class="flex-b">
  17. <!-- 搜索 -->
  18. <view class="searchCon" >
  19. <searchRow placeholder="搜索驾校名称" :disable="true" bg="#fff" @searchFn="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')"></searchRow>
  20. </view>
  21. <!-- 扫一扫 -->
  22. <view class="scan" @click="scanCodeClick">
  23. <image src="@/static/images/indexIcon/sancode.png" mode="aspectFill"></image>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 海报 -->
  28. <view class="pad">
  29. <uni-swiper-dot class="uni-swiper-dot-box bannerCon" :info="swiperInfo" v-if="swiperInfo.length"
  30. :current="current" :mode="mode" :dots-styles="dotsStyles"
  31. field="content">
  32. <swiper class="swiper-box" @change="change" :current="swiperDotIndex" >
  33. <swiper-item v-for="(item, index) in swiperInfo" :key="index" @click="bannerClick(item)" >
  34. <view class="swiper-item" :class="'swiper-item' + index">
  35. <view class="imgBox">
  36. <image :src="item.imgUrl" mode=""></image>
  37. </view>
  38. </view>
  39. </swiper-item>
  40. </swiper>
  41. </uni-swiper-dot>
  42. </view>
  43. <view class="pad">
  44. <!-- 精钢区 -->
  45. <view class="card">
  46. <view class="ul">
  47. <view class="li" v-for="(item,index) in entrySection" :key="index" @tap="entrySectionClick(item)">
  48. <view class="icon">
  49. <image :src="item.icon" mode=""></image>
  50. </view>
  51. <view class="name">{{ item.text }}</view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 优质驾校 -->
  56. <view class="schoolCon card" v-show="recommendSchool.length">
  57. <view class="h1_row">
  58. <view class="h1" ><text class="active">风采驾校</text></view>
  59. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findShcool/findShcool')"/>
  60. </view>
  61. <view class="li" v-for="(item,index) in recommendSchool" :key="index" @click="$goPage('/pages/indexEntry/findShcool/shcoolDetail/shcoolDetail?schoolId='+ item.id)" style="height: 176rpx;">
  62. <schoolItem :item="item"/>
  63. </view>
  64. </view>
  65. <!-- 推荐教练 -->
  66. <view class="coachCon" v-if="coachList.length">
  67. <view class="h1_row">
  68. <view class="h1" ><text class="active">推荐教练</text></view>
  69. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/findCoach/findCoach')"/>
  70. </view>
  71. <scroll-view style="width: 100%;" scroll-x="true" scroll-with-animation >
  72. <view class="ul3">
  73. <view class="li3" v-for="item in coachList" :key="item.id" @click="goCoachDetail(item)">
  74. <coachItem :item="item"/>
  75. </view>
  76. </view>
  77. </scroll-view>
  78. </view>
  79. <!-- 行业资讯政策法规 -->
  80. <view class="card">
  81. <view class="h1_row">
  82. <view class="tabs">
  83. <view class="h1" @click="changeInforma(1)"><text :class="{active: informa==1}">行业资讯</text></view>
  84. <view class="h1" @click="changeInforma(2)"><text :class="{active: informa==2}" style="margin-left: 30rpx;">政策法规</text></view>
  85. </view>
  86. <moreRight text="查看全部" @click.native="$goPage('/pages/indexEntry/industryPolicy/industryPolicy?type='+ informa)"/>
  87. </view>
  88. <view class="ul2">
  89. <view class="li2" v-for="(item,index) in informList" :key="index">
  90. <informaItem :item="item"/>
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 服务专区 -->
  95. <view class="card">
  96. <view class="h1" style="margin-top: 20rpx;"><text class="active">服务专区</text></view>
  97. <view class="severCon">
  98. <view class="severItem" @click="$goPage('/pages/indexEntry/parse/parse')">
  99. <view class="tit">学车指南</view>
  100. <view class="tps">政府平台 一站服务</view>
  101. <view class="go">
  102. <view class="goTxt">GO</view>
  103. <u-icon name="arrow-right" color="#fff" size="14"></u-icon>
  104. </view>
  105. </view>
  106. <view class="severItem tow" @click="$goPage('/pages/indexEntry/consult/consult')">
  107. <view class="tit">咨询投诉</view>
  108. <view class="tps">畅达沟通 听取民声</view>
  109. <view class="go">
  110. <view class="goTxt">GO</view>
  111. <u-icon name="arrow-right" color="#fff" size="14"></u-icon>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <u-popup :show="showPrivacy" mode="center" :round="20" >
  118. <privacyPopup @disagree="showPrivacy=false" @agree="showPrivacy=false"></privacyPopup>
  119. </u-popup>
  120. </view>
  121. </template>
  122. <script>
  123. import { imgUrl } from '@/config/site.config'
  124. import { getarticleList, getBannerList, getarticlezcList,getRecommendList, recommendSchoolList } from '@/config/api.js'
  125. import schoolItem from './comp/schoolItem'
  126. import informaItem from './comp/informaItem'
  127. import coachItem from './comp/coachItem'
  128. import { scanCodeFn } from '@/config/utils.js'
  129. // import location from '@/common/js/location.js'
  130. export default {
  131. components: { schoolItem, informaItem, coachItem },
  132. data() {
  133. return {
  134. showPrivacy: false,
  135. imgUrl: imgUrl+'banner.png',
  136. backgroundSize: '100% 100%',
  137. keywords: '',
  138. entrySection: [{
  139. text: '学车报名',
  140. icon: require('../../../static/images/indexIcon/entryIcon (3).png'),
  141. url: '/pages/indexEntry/enroll/enroll',
  142. },
  143. {
  144. text: '找驾校',
  145. icon: require('../../../static/images/indexIcon/entryIcon (4).png'),
  146. url: '/pages/indexEntry/findShcool/findShcool',
  147. },
  148. {
  149. text: '找教练',
  150. icon: require('../../../static/images/indexIcon/entryIcon (1).png'),
  151. url: '/pages/indexEntry/findCoach/findCoach',
  152. },
  153. {
  154. text: '签到签退',
  155. icon: require('../../../static/images/indexIcon/entryIcon (5).png'),
  156. url: '/pages/indexEntry/signIn/signIn',
  157. },
  158. // {
  159. // text: '理论学习',
  160. // icon: require('../../../static/images/indexIcon/entryIcon (2).png'),
  161. // url: '/pages/indexEntry/theory/theory',
  162. // },
  163. ],
  164. swiperDotIndex: 0,
  165. current: 1,
  166. mode: 'default',
  167. swiperInfo: [],
  168. dotsStyles: {
  169. backgroundColor: '#E8E9EC',
  170. border: '1px #E8E9EC solid',
  171. color: '#fff',
  172. selectedBackgroundColor: '#1989FA',
  173. selectedBorder: '1px #1989FA solid'
  174. },
  175. bgColor: 'transparent',
  176. informList: [],
  177. informa: 1,
  178. coachList: [],//推荐教练
  179. recommendSchool: [],//推荐驾校
  180. sweixin:null
  181. }
  182. },
  183. async onLoad() {
  184. this.initApi()
  185. },
  186. onPullDownRefresh() {
  187. this.initApi()
  188. },
  189. onShow() {
  190. let _this = this
  191. // if(!this.vuex_cityInfo.lat) {
  192. // location.getLocation(()=>{
  193. // _this.$store.dispatch('getCity')
  194. // uni.showModal({
  195. // content: '为了您更好的给您推荐附近的驾校数据,需要获取位置信息,app想要获取您的位权限',
  196. // confirmText: "确定",
  197. // success: function(res) {
  198. // if (res.confirm) {
  199. // _this.$store.dispatch('getCity')
  200. // } else if (res.cancel) {
  201. // console.log('用户点击取消');
  202. // }
  203. // }
  204. // });
  205. // });
  206. // }
  207. let token = this.$store.state.user.vuex_loginInfo.accessToken
  208. if(token) {
  209. this.$store.dispatch('getUserInfo')
  210. }
  211. if(!this.swiperInfo.length) {
  212. this.getBannerListFn()
  213. // this.getarticleListFn()
  214. }
  215. if(this.vuex_cityInfo.lat != this.lat) {
  216. this.recommendSchoolList()
  217. }
  218. },
  219. computed: {
  220. },
  221. methods: {
  222. async getLatLngFn() {
  223. uni.showLoading({
  224. title: '正在更新位置...'
  225. })
  226. await this.$store.dispatch('getCity')
  227. this.recommendSchoolList()
  228. },
  229. // 点击海报图
  230. bannerClick(item) {
  231. let link = item.jumpPath
  232. console.log(link)
  233. if(!link) return false
  234. this.$store.commit('updateWebVeiwUrl', link)
  235. this.$goPage('/pages/indexEntry/webView/webView')
  236. },
  237. async initApi() {
  238. try{
  239. uni.showLoading({
  240. title: '正在加载...'
  241. })
  242. await this.getarticleListFn()
  243. await this.getRecommendList()
  244. await this.recommendSchoolList()
  245. this.$nextTick(()=>{uni.hideLoading()})
  246. }catch(e){
  247. this.$nextTick(()=>{uni.hideLoading()})
  248. }
  249. },
  250. goCoachDetail(item) {
  251. let objStr = encodeURIComponent(JSON.stringify(item))
  252. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  253. },
  254. // 推荐教练
  255. async getRecommendList() {
  256. const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, })
  257. this.coachList = res
  258. // console.log(res)
  259. },
  260. // 推荐驾校
  261. async recommendSchoolList() {
  262. // if(!this.vuex_cityInfo.lat) {
  263. // await this.$store.dispatch('getCity')
  264. // }
  265. this.lat = this.vuex_cityInfo.lat
  266. const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 20, lat: this.vuex_cityInfo.lat||'34.682945', lng: this.vuex_cityInfo.lng||'112.477298'})
  267. res[8].schoolIntroduceDO.iconPath = ''
  268. res[9].schoolIntroduceDO.iconPath = ''
  269. this.recommendSchool = Object.freeze(res)
  270. // this.recommendSchool = res
  271. // console.log(res)
  272. },
  273. async getBannerListFn() {
  274. const {data: res} = await getBannerList()
  275. this.swiperInfo = res.list
  276. // console.log(this.swiperInfo)
  277. },
  278. async entrySectionClick(item) {
  279. if(item.text=='学车报名') {
  280. this.$store.commit('upDateSchoolCoach', {})
  281. this.$store.commit('upDateSchoolClass', {})
  282. this.$store.commit('updateSchool', {})
  283. return this.$u.utils.clickSignUp()
  284. }else if(item.text=='签到签退') {
  285. // if(this.vuex_userInfo.applyStep<6) return this.$u.toast('请先报名学员')
  286. }
  287. this.$goPage(item.url)
  288. },
  289. changeInforma(val) {
  290. if(this.informa == val) return
  291. this.informa = val
  292. this.getarticleListFn()
  293. },
  294. // 行业资讯
  295. async getarticleListFn() {
  296. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  297. this.informList = res.list
  298. },
  299. async refereshFn() {
  300. const res = await this.$store.dispatch('refreshToken')
  301. console.log(res)
  302. uni.$u.http.setConfig((config) => {
  303. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  304. console.log(111)
  305. return config
  306. })
  307. console.log(222)
  308. // this.$store.dispatch('getUserInfo')
  309. },
  310. close() {
  311. },
  312. goPageSection(item) {
  313. uni.navigateTo({
  314. url:item.url
  315. })
  316. },
  317. // 扫码
  318. scanCodeClick() {
  319. scanCodeFn(this)
  320. },
  321. clickItem(e) {
  322. this.swiperDotIndex = e
  323. },
  324. change(e) {
  325. this.current = e.detail.current
  326. },
  327. goPage() {
  328. uni.navigateTo({
  329. url: '/pages/userCenter/login/loginByPhone'
  330. })
  331. },
  332. }
  333. }
  334. </script>
  335. <style lang="scss" scoped>
  336. .h1_row {
  337. display: flex;
  338. align-items: center;
  339. justify-content: space-between;
  340. }
  341. .h1 {
  342. padding: 20rpx 0 20rpx 0;
  343. }
  344. .main {
  345. width: 100%;
  346. background: url('https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2024-02-27/1709013363812-0') #F6F7FA no-repeat;
  347. background-size: 100% 600rpx;
  348. .TopCon {
  349. width: 100%;
  350. // height: 120rpx;
  351. .flex-b {
  352. display: flex;
  353. height: 100%;
  354. height: 72rpx;
  355. margin-bottom: 20rpx;
  356. }
  357. .adrsCon {
  358. display: flex;
  359. align-items: center;
  360. // width: 180rpx;
  361. height: 88rpx;
  362. .adrsIcon {
  363. width: 17rpx;
  364. height: 17rpx;
  365. margin-top: 4rpx;
  366. }
  367. .adr {
  368. padding-right: 14rpx;
  369. font-size: 28rpx;
  370. color: #fff;
  371. }
  372. }
  373. .searchCon {
  374. flex:1;
  375. }
  376. .scan {
  377. width: 100rpx;
  378. height: 100%;
  379. display: flex;
  380. justify-content: flex-end;
  381. align-items: center;
  382. image {
  383. width: 52rpx;
  384. height: 52rpx;
  385. }
  386. }
  387. }
  388. .bannerCon {
  389. border-radius: 20rpx;
  390. margin-bottom: 20rpx;
  391. overflow: hidden;
  392. }
  393. .card {
  394. background: #FFFFFF;
  395. border-radius: 16rpx;
  396. margin-bottom: 20rpx;
  397. padding: 0 20rpx;
  398. .ul {
  399. height: 164rpx;
  400. display: flex;
  401. justify-content: space-between;
  402. align-items: center;
  403. .li {
  404. flex: 1;
  405. display: flex;
  406. align-items: center;
  407. flex-direction: column;
  408. .icon {
  409. width: 72rpx;
  410. height: 72rpx;
  411. }
  412. .name {
  413. font-size: 26rpx;
  414. color: #333;
  415. padding-top: 20rpx;
  416. text-align: center;
  417. }
  418. }
  419. }
  420. }
  421. }
  422. .tabs {
  423. display: flex;
  424. }
  425. .severCon {
  426. display: flex;
  427. align-items: center;
  428. justify-content: space-between;
  429. padding: 20rpx 0rpx 20rpx 0rpx;
  430. }
  431. .severItem {
  432. width: 320rpx;
  433. height: 186rpx;
  434. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  435. background-size: 100% 100%;
  436. padding: 30rpx 20rpx;
  437. font-size: 24rpx;
  438. color: #fff;
  439. &.tow {
  440. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  441. background-size: 100% 100%;
  442. .go {
  443. background: #2AB188;
  444. }
  445. }
  446. .tit {
  447. font-size: 32rpx;
  448. }
  449. .tps {
  450. opacity: 0.8;
  451. margin: 12rpx 0;
  452. }
  453. .go {
  454. width: 70rpx;
  455. height: 38rpx;
  456. background: #1A61FB;
  457. border-radius: 10rpx;
  458. display: flex;
  459. align-items: center;
  460. .goTxt {
  461. padding-left: 4rpx;
  462. }
  463. }
  464. }
  465. .ul3 {
  466. display: flex;
  467. margin: 20rpx 0;
  468. }
  469. .swiper-box {
  470. .swiper-item {
  471. .imgBox {
  472. width: 100%;
  473. height: 300rpx;
  474. display: block;
  475. border-radius: 20rpx;
  476. overflow: hidden;
  477. }
  478. }
  479. }
  480. </style>