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

497 lines
13 KiB

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