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

513 lines
13 KiB

10 months ago
10 months ago
3 weeks ago
3 weeks 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
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
3 weeks ago
3 weeks 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
9 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
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
3 weeks ago
10 months ago
9 months ago
10 months ago
5 months ago
9 months ago
10 months ago
10 months ago
10 months ago
3 weeks ago
10 months ago
5 months ago
5 months ago
8 months ago
3 weeks ago
9 months ago
8 months ago
3 weeks ago
5 months ago
3 weeks ago
10 months ago
8 months ago
3 weeks 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
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
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. await this.$store.dispatch('getCity')
  224. this.recommendSchoolList()
  225. },
  226. // 点击海报图
  227. bannerClick(item) {
  228. let link = item.jumpPath
  229. console.log(link)
  230. if(!link) return false
  231. this.$store.commit('updateWebVeiwUrl', link)
  232. this.$goPage('/pages/indexEntry/webView/webView')
  233. },
  234. async initApi() {
  235. try{
  236. uni.showLoading({
  237. title: '正在加载...'
  238. })
  239. await this.getarticleListFn()
  240. await this.getRecommendList()
  241. await this.recommendSchoolList()
  242. uni.hideLoading()
  243. }catch(e){
  244. uni.hideLoading()
  245. }
  246. },
  247. goCoachDetail(item) {
  248. let objStr = encodeURIComponent(JSON.stringify(item))
  249. this.$goPage('/pages/indexEntry/findShcool/coachComment/coachComment?item='+ objStr)
  250. },
  251. // 推荐教练
  252. async getRecommendList() {
  253. const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, })
  254. this.coachList = res
  255. // console.log(res)
  256. },
  257. // 推荐驾校
  258. async recommendSchoolList() {
  259. // if(!this.vuex_cityInfo.lat) {
  260. // await this.$store.dispatch('getCity')
  261. // }
  262. this.lat = this.vuex_cityInfo.lat
  263. const {data: res} = await recommendSchoolList({pageNo:1,pageSize: 20, lat: this.vuex_cityInfo.lat||'34.682945', lng: this.vuex_cityInfo.lng||'112.477298'})
  264. this.recommendSchool = Object.freeze(res)
  265. // this.recommendSchool = res
  266. // console.log(res)
  267. },
  268. async getBannerListFn() {
  269. const {data: res} = await getBannerList()
  270. this.swiperInfo = res.list
  271. // console.log(this.swiperInfo)
  272. },
  273. async entrySectionClick(item) {
  274. if(item.text=='学车报名') {
  275. this.$store.commit('upDateSchoolCoach', {})
  276. this.$store.commit('upDateSchoolClass', {})
  277. this.$store.commit('updateSchool', {})
  278. return this.$u.utils.clickSignUp()
  279. }else if(item.text=='签到签退') {
  280. if(this.vuex_userInfo.applyStep<6) return this.$u.toast('请先报名学员')
  281. }
  282. this.$goPage(item.url)
  283. },
  284. changeInforma(val) {
  285. if(this.informa == val) return
  286. this.informa = val
  287. this.getarticleListFn()
  288. },
  289. // 行业资讯
  290. async getarticleListFn() {
  291. const {data: res} = await getarticlezcList({pageSize: 3, type: this.informa})
  292. this.informList = res.list
  293. },
  294. async refereshFn() {
  295. const res = await this.$store.dispatch('refreshToken')
  296. console.log(res)
  297. uni.$u.http.setConfig((config) => {
  298. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  299. console.log(111)
  300. return config
  301. })
  302. console.log(222)
  303. // this.$store.dispatch('getUserInfo')
  304. },
  305. close() {
  306. },
  307. goPageSection(item) {
  308. uni.navigateTo({
  309. url:item.url
  310. })
  311. },
  312. // 扫码
  313. scanCodeClick() {
  314. scanCodeFn(this)
  315. },
  316. clickItem(e) {
  317. this.swiperDotIndex = e
  318. },
  319. change(e) {
  320. this.current = e.detail.current
  321. },
  322. goPage() {
  323. uni.navigateTo({
  324. url: '/pages/userCenter/login/loginByPhone'
  325. })
  326. },
  327. }
  328. }
  329. </script>
  330. <style lang="scss" scoped>
  331. .h1_row {
  332. display: flex;
  333. align-items: center;
  334. justify-content: space-between;
  335. }
  336. .h1 {
  337. padding: 20rpx 0 20rpx 0;
  338. }
  339. .main {
  340. width: 100%;
  341. background: url('https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2024-02-27/1709013363812-0') #F6F7FA no-repeat;
  342. background-size: 100% 600rpx;
  343. .TopCon {
  344. width: 100%;
  345. // height: 120rpx;
  346. .flex-b {
  347. display: flex;
  348. height: 100%;
  349. height: 72rpx;
  350. margin-bottom: 20rpx;
  351. }
  352. .adrsCon {
  353. display: flex;
  354. align-items: center;
  355. // width: 180rpx;
  356. height: 88rpx;
  357. .adrsIcon {
  358. width: 17rpx;
  359. height: 17rpx;
  360. margin-top: 4rpx;
  361. }
  362. .adr {
  363. padding-right: 14rpx;
  364. font-size: 28rpx;
  365. color: #fff;
  366. }
  367. }
  368. .searchCon {
  369. flex:1;
  370. }
  371. .scan {
  372. width: 100rpx;
  373. height: 100%;
  374. display: flex;
  375. justify-content: flex-end;
  376. align-items: center;
  377. image {
  378. width: 52rpx;
  379. height: 52rpx;
  380. }
  381. }
  382. }
  383. .bannerCon {
  384. border-radius: 20rpx;
  385. margin-bottom: 20rpx;
  386. overflow: hidden;
  387. }
  388. .card {
  389. background: #FFFFFF;
  390. border-radius: 16rpx;
  391. margin-bottom: 20rpx;
  392. padding: 0 20rpx;
  393. .ul {
  394. height: 164rpx;
  395. display: flex;
  396. justify-content: space-between;
  397. align-items: center;
  398. .li {
  399. flex: 1;
  400. display: flex;
  401. align-items: center;
  402. flex-direction: column;
  403. .icon {
  404. width: 72rpx;
  405. height: 72rpx;
  406. }
  407. .name {
  408. font-size: 26rpx;
  409. color: #333;
  410. padding-top: 20rpx;
  411. text-align: center;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. .tabs {
  418. display: flex;
  419. }
  420. .severCon {
  421. display: flex;
  422. align-items: center;
  423. justify-content: space-between;
  424. padding: 20rpx 0rpx 20rpx 0rpx;
  425. }
  426. .severItem {
  427. width: 320rpx;
  428. height: 186rpx;
  429. background: url('../../../static/images/indexIcon/xccard.png') no-repeat;
  430. background-size: 100% 100%;
  431. padding: 30rpx 20rpx;
  432. font-size: 24rpx;
  433. color: #fff;
  434. &.tow {
  435. background: url('../../../static/images/indexIcon/zxcard.png') no-repeat;
  436. background-size: 100% 100%;
  437. .go {
  438. background: #2AB188;
  439. }
  440. }
  441. .tit {
  442. font-size: 32rpx;
  443. }
  444. .tps {
  445. opacity: 0.8;
  446. margin: 12rpx 0;
  447. }
  448. .go {
  449. width: 70rpx;
  450. height: 38rpx;
  451. background: #1A61FB;
  452. border-radius: 10rpx;
  453. display: flex;
  454. align-items: center;
  455. .goTxt {
  456. padding-left: 4rpx;
  457. }
  458. }
  459. }
  460. .ul3 {
  461. display: flex;
  462. margin: 20rpx 0;
  463. }
  464. .swiper-box {
  465. .swiper-item {
  466. .imgBox {
  467. width: 100%;
  468. height: 300rpx;
  469. display: block;
  470. border-radius: 20rpx;
  471. overflow: hidden;
  472. }
  473. }
  474. }
  475. </style>