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

418 lines
10 KiB

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
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 pageBg">
  3. <view class="status_bar"></view>
  4. <view class="TopCon pad" >
  5. <!-- 地址扫一扫 -->
  6. <view class="flex-b">
  7. <view class="adrsCon">
  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. <!-- 搜索 -->
  14. <view class="searchCon" @click.capture="$goPage('/pages/indexEntry/findShcool/searchShcool/searchShcool')">
  15. <searchRow placeholder="搜索驾校、教练…" :disable="true"></searchRow>
  16. </view>
  17. <view class="scan" @click="scanCodeFn">
  18. <image src="@/static/images/index/scan.png" mode="aspectFill"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 海报 -->
  23. <view class="banner">
  24. <uni-swiper-dot class="uni-swiper-dot-box" @clickItem=clickItem :info="swiperInfo" v-if="swiperInfo.length"
  25. :current="current" :mode="mode" :dots-styles="dotsStyles"
  26. field="content">
  27. <swiper class="swiper-box" @change="change" :current="swiperDotIndex" >
  28. <swiper-item v-for="(item, index) in swiperInfo" :key="index" @click="$goPage('/pages/indexEntry/iIndustryInfo/detail/detail?id='+ item.id)">
  29. <view class="swiper-item" :class="'swiper-item' + index">
  30. <view class="imgBox">
  31. <image :src="item.picture" mode="widthFix"></image>
  32. </view>
  33. </view>
  34. </swiper-item>
  35. </swiper>
  36. </uni-swiper-dot>
  37. </view>
  38. <view class="pad">
  39. <!-- 精钢区 -->
  40. <view class="card traTop">
  41. <view class="ul">
  42. <view class="li" v-for="(item,index) in entrySection" :key="index" @tap="entrySectionClick(item)">
  43. <view class="icon">
  44. <image :src="item.icon" mode=""></image>
  45. </view>
  46. <view class="name">{{ item.text }}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 优质驾校 -->
  51. <view class="schoolCon">
  52. <view class="h1" style="margin: 28rpx 0;">优质驾校</view>
  53. <view class="li" v-for="(item,index) in 3" :key="index">
  54. <schoolItem/>
  55. </view>
  56. </view>
  57. <!-- 行业资讯政策法规 -->
  58. <view class="information">
  59. <view class="tabs">
  60. <view class="tab active">行业资讯</view>
  61. <view class="tab">政策法规</view>
  62. </view>
  63. <view class="ul">
  64. <view class="li" v-for="(item,index) in 3" :key="index">
  65. <informaItem/>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <u-popup :show="showPrivacy" mode="center" :round="20" >
  71. <privacyPopup @disagree="showPrivacy=false" @agree="showPrivacy=false"></privacyPopup>
  72. </u-popup>
  73. </view>
  74. </template>
  75. <script>
  76. import { imgUrl } from '@/config/site.config'
  77. import { getarticleList } from '@/config/api.js'
  78. import schoolItem from './comp/schoolItem'
  79. import informaItem from './comp/informaItem'
  80. export default {
  81. components: { schoolItem, informaItem },
  82. data() {
  83. return {
  84. showPrivacy: false,
  85. imgUrl: imgUrl+'banner.png',
  86. backgroundSize: '100% 100%',
  87. keywords: '',
  88. entrySection: [{
  89. text: '学车报名',
  90. icon: require('../../../static/images/index/ic_baoming.png'),
  91. url: '/pages/indexEntry/enroll/enroll',
  92. goPage: function (){
  93. console.log(666)
  94. // this.$goPage(item.url)
  95. }
  96. },
  97. {
  98. text: '找驾校',
  99. icon: require('../../../static/images/index/ic_jiaxiao.png'),
  100. url: '/pages/indexEntry/findShcool/findShcool',
  101. goPage: (item)=>{
  102. this.$goPage(item.url)
  103. }
  104. },
  105. {
  106. text: '找教练',
  107. icon: require('../../../static/images/index/ic_kaochang.png'),
  108. url: '/pages/indexEntry/examines/examines',
  109. goPage: ((item)=>{
  110. this.$goPage(item.url)
  111. })
  112. },
  113. {
  114. text: '理论学习',
  115. icon: require('../../../static/images/index/ic_jsg.png'),
  116. url: '/pages/carEntry/simulateAppointment/simulateAppointment',
  117. goPage: ((item)=>{
  118. this.$goPage(item.url)
  119. })
  120. },
  121. {
  122. text: '签到签退',
  123. icon: require('../../../static/images/index/ic_peilian.png'),
  124. goPage: ((item)=>{
  125. this.$u.toast('正在开发中,敬请期待...')
  126. })
  127. }
  128. ],
  129. serviceSector: [{
  130. text: '学车指南',
  131. tps: '政府平台 一站服务',
  132. icon: require('../../../static/images/index/img_1@2x.png'),
  133. url: '/pages/indexEntry/parse/parse'
  134. },
  135. {
  136. text: '公益视频',
  137. tps: '立体呈现 学驾无忧',
  138. icon: require('../../../static/images/index/img_2@2x.png'),
  139. url: '/pages/indexEntry/publicVideo/publicVideo'
  140. },
  141. {
  142. text: '合格率排行',
  143. tps: '官方数据 阳光透明',
  144. icon: require('../../../static/images/index/img_3@2x.png'),
  145. url: '/pages/indexEntry/credit/credit?type=1'
  146. },
  147. {
  148. text: '行业政策',
  149. tps: '权威发布 精准解读',
  150. icon: require('../../../static/images/index/img_4@2x.png'),
  151. url: '/pages/indexEntry/industryPolicy/industryPolicy'
  152. },
  153. {
  154. text: '质量信誉排行',
  155. tps: '官方数据 阳光透明',
  156. icon: require('../../../static/images/index/img_5@2x.png'),
  157. url: '/pages/indexEntry/credit/credit'
  158. },
  159. {
  160. text: '咨询投诉',
  161. tps: '畅达沟通 听取民声',
  162. icon: require('../../../static/images/index/img_6@2x.png'),
  163. url: '/pages/indexEntry/consult/consult'
  164. },
  165. {
  166. text: '满分学习考试',
  167. tps: '网络教育 数据联网',
  168. icon: require('../../../static/images/index/img_7@2x.png'),
  169. url: ''
  170. },
  171. {
  172. text: '送考卷下乡',
  173. tps: '便民利民 就近考试',
  174. icon: require('../../../static/images/index/img_8@2x.png'),
  175. url: ''
  176. },
  177. ],
  178. swiperDotIndex: 0,
  179. current: 1,
  180. mode: 'default',
  181. swiperInfo: [],
  182. dotsStyles: {
  183. backgroundColor: '#E8E9EC',
  184. border: '1px #E8E9EC solid',
  185. color: '#fff',
  186. selectedBackgroundColor: '#1989FA',
  187. selectedBorder: '1px #1989FA solid'
  188. },
  189. bgColor: 'transparent'
  190. }
  191. },
  192. async onLoad() {
  193. // this.getarticleListFn()
  194. // uni.getLocation({
  195. // type: 'wgs84',
  196. // success: function (res) {
  197. // console.log('当前位置的经度:' + res.longitude);
  198. // console.log('当前位置的纬度:' + res.latitude);
  199. // },
  200. // fail(err) {
  201. // console.log(err)
  202. // }
  203. // });
  204. if(!this.$store.state.user.vuex_cityInfo.lat) {
  205. await this.$store.dispatch('getCity')
  206. }
  207. // console.log(this.$store.state.user.vuex_cityInfo)
  208. },
  209. onPullDownRefresh() {
  210. this.getarticleListFn()
  211. },
  212. onShow() {
  213. this.$store.dispatch('getUserInfo')
  214. if(!this.swiperInfo.length) {
  215. this.getarticleListFn()
  216. }
  217. },
  218. computed: {
  219. },
  220. methods: {
  221. async entrySectionClick(item) {
  222. if(item.text=='我要报名') {
  223. return this.$u.utils.clickSignUp()
  224. }
  225. if(item.text=='找驾驶馆') {
  226. const res = await this.$store.dispatch('checkLogin')
  227. if(!res) return
  228. if(!this.vuex_userInfo.schoolId) return this.$u.toast('您不是平台学员')
  229. }
  230. this.$goPage(item.url)
  231. },
  232. async getarticleListFn() {
  233. const {data: res} = await getarticleList(this.params)
  234. this.swiperInfo = res.list[0].articleManagementDO
  235. },
  236. async refereshFn() {
  237. const res = await this.$store.dispatch('refreshToken')
  238. console.log(res)
  239. uni.$u.http.setConfig((config) => {
  240. config.header.Authorization = 'Bearer ' + this.$store.state.user.vuex_loginInfo.accessToken
  241. console.log(111)
  242. return config
  243. })
  244. console.log(222)
  245. // this.$store.dispatch('getUserInfo')
  246. },
  247. close() {
  248. },
  249. goPageSection(item) {
  250. uni.navigateTo({
  251. url:item.url
  252. })
  253. },
  254. // 扫码
  255. scanCodeFn() {
  256. let _this = this
  257. uni.scanCode({
  258. success: function(res) {
  259. console.log('条码类型:' + res.scanType);
  260. console.log('条码内容6:' + res.result);
  261. let obj = JSON.parse(res.result)
  262. // 扫教练码去报名的
  263. if(obj.coachId) {
  264. obj.nickname = decodeURIComponent(obj.nickname)
  265. obj.schoolName = decodeURIComponent(obj.schoolName)
  266. let item = {
  267. schoolName: obj.schoolName,
  268. schoolId: obj.schoolId,
  269. name: obj.nickname,
  270. id: obj.coachId
  271. }
  272. console.log('***********')
  273. console.log(item)
  274. _this.$store.commit('upDateSchoolClass', {})
  275. _this.$store.commit('upDateSchoolCoach', item)
  276. _this.$goPage('/pages/indexEntry/enroll/enroll')
  277. }
  278. // _this.$store.commit('updateWebVeiwUrl', res.result)
  279. // uni.navigateTo({
  280. // url: '/pages/other/webView/webView'
  281. // })
  282. }
  283. });
  284. },
  285. clickItem(e) {
  286. this.swiperDotIndex = e
  287. },
  288. change(e) {
  289. this.current = e.detail.current
  290. },
  291. goPage() {
  292. uni.navigateTo({
  293. url: '/pages/userCenter/login/loginByPhone'
  294. })
  295. },
  296. initFn() {
  297. uni.requestSubscribeMessage({
  298. tmplIds: ['0yaIdyI9NlHvGYwb3IIaIQq6uBhulYGN-rGVnJk4hZ4'],
  299. success(res) {
  300. console.log('消息是否有权限呢')
  301. console.log(res)
  302. }
  303. })
  304. }
  305. }
  306. }
  307. </script>
  308. <style lang="scss" scoped>
  309. .main {
  310. width: 100%;
  311. .scan {
  312. width: 64rpx;
  313. height: 64rpx;
  314. }
  315. .TopCon {
  316. width: 100%;
  317. height: 120rpx;
  318. .flex-b {
  319. display: flex;
  320. height: 100%;
  321. }
  322. .adrsCon {
  323. display: flex;
  324. align-items: center;
  325. width: 180rpx;
  326. height: 100%;
  327. .adrsIcon {
  328. width: 26rpx;
  329. height: 38rpx;
  330. margin-top: 4rpx;
  331. }
  332. .adr {
  333. padding-left: 14rpx;
  334. font-size: 28rpx;
  335. color: #333;
  336. }
  337. }
  338. .searchCon {
  339. flex:1;
  340. }
  341. .scan {
  342. width: 100rpx;
  343. background-color: #ddd;
  344. height: 100%;
  345. display: flex;
  346. justify-content: flex-end;
  347. align-items: center;
  348. image {
  349. width: 90rpx;
  350. height: 90rpx;
  351. }
  352. }
  353. }
  354. .card {
  355. background: #FFFFFF;
  356. border-radius: 16rpx;
  357. margin-bottom: 20rpx;
  358. .ul {
  359. height: 236rpx;
  360. display: flex;
  361. justify-content: space-between;
  362. align-items: center;
  363. padding: 0 20rpx;
  364. .li {
  365. flex: 1;
  366. display: flex;
  367. align-items: center;
  368. flex-direction: column;
  369. .icon {
  370. width: 92rpx;
  371. height: 92rpx;
  372. }
  373. .name {
  374. font-size: 26rpx;
  375. color: #333;
  376. padding-top: 20rpx;
  377. text-align: center;
  378. }
  379. }
  380. }
  381. }
  382. }
  383. .tabs {
  384. display: flex;
  385. padding: 20rpx 0 10rpx 0;
  386. .tab {
  387. font-size: 30rpx;
  388. color: #333;
  389. margin-right: 20rpx;
  390. &.active {
  391. border-bottom: 4px solid $themC
  392. }
  393. }
  394. }
  395. </style>