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.

478 lines
12 KiB

4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
1 week ago
4 months ago
1 week ago
4 months ago
2 weeks ago
4 months ago
1 week ago
4 months ago
2 weeks ago
4 months ago
1 week ago
4 months ago
3 weeks ago
4 months ago
4 weeks ago
4 months ago
4 months ago
4 months ago
5 days ago
5 days ago
4 months ago
3 months ago
4 months ago
4 months ago
1 week ago
4 months ago
3 months ago
4 months ago
3 months ago
1 month ago
3 months ago
1 month ago
4 months ago
3 months ago
1 week ago
4 months ago
1 week ago
5 days ago
1 week ago
5 days ago
1 week ago
3 months ago
1 month ago
3 months ago
5 days ago
1 week ago
5 days ago
1 week ago
5 days ago
1 month ago
1 week ago
1 month ago
3 weeks ago
2 weeks ago
1 month ago
3 weeks ago
1 week ago
3 weeks ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
  1. <template>
  2. <view class="content">
  3. <up-navbar title="理论学习" :leftIconColor="'#333'" :safeAreaInsetTop="true" :autoBack="true" >
  4. <template #right>
  5. <view class="u-nav-slot flex" @click="show = true">
  6. <view class="txt">{{ usecarStore.carInfo.carTypeName }}</view>
  7. <u-icon name="arrow-down-fill" color="#333" size="12"></u-icon>
  8. </view>
  9. </template>
  10. </up-navbar>
  11. <view class="tabs flex">
  12. <view class="tab" @click="changeTab(1)" :class="{active: currentTab==1}">科目一</view>
  13. <view class="tab" @click="changeTab(4)" :class="{active: currentTab==4}">科目四</view>
  14. </view>
  15. <view class="swiperBox">
  16. <u-swiper :list="bannerList" @click="swiperClick" :dots-styles="dotsStyles" indicatorMode="dot" keyName="cover" height="160rpx"></u-swiper>
  17. </view>
  18. <view class="notice" v-if="nodes">
  19. <view class="yellowT">通知/</view>
  20. <rich-text :nodes="nodes"></rich-text>
  21. </view>
  22. <view class="iconBox">
  23. <view class="iconComl">
  24. <!-- @click="$goPage(item.url)" -->
  25. <view class="item" v-for="(item,index) in leftItem" :key="index" @click="goPage(item)">
  26. <view class="icon">
  27. <image :src="item.icon" mode=""></image>
  28. </view>
  29. <view class="text">{{item.name}}</view>
  30. </view>
  31. </view>
  32. <view class="centerComl">
  33. <view class="ctItem" @click="goAndSetCar({type: 'types', value: ''})">
  34. <view class="txt">顺序练习</view>
  35. <view class="txt">{{adCount.orderAlready }} <text>/</text> {{ adCount.orderTotal }}</view>
  36. </view>
  37. <!-- $goPage('/pages/vip/vipEntry/vipEntry') -->
  38. <view class="ctItem" @click="goAndSetCar({type: 'sift', value: '1'})">
  39. <view class="txt">精选试题</view>
  40. <view class="txt">{{adCount.siftAlready }}<text>/</text>{{ adCount.siftTotal }}</view>
  41. </view>
  42. </view>
  43. <view class="iconComl">
  44. <!-- @click="$goPage(item.url)" $noDoFn -->
  45. <view class="item" v-for="(item,index) in rightItem" :key="index" @click="goPage(item)">
  46. <view class="icon">
  47. <image :src="item.icon" mode=""></image>
  48. </view>
  49. <view class="text">{{ item.name }}</view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="simulatedExam flex-b">
  54. <view class="leftTxt">
  55. <view class="h8">{{ usecarStore.carInfo.stepType==1? '一': '四'}}模拟考试</view>
  56. <view class="text">考试次数{{ examInfo.accumulate }}</view>
  57. <view class="text">预测通过率{{ examInfo.exampassRate}}%</view>
  58. <view class="btnBox flex">
  59. <!-- @click="$goPage('/pages/exercises/examSubjiect1/examSubjiect1')" -->
  60. <view class="btnTxt" @click="$goPage('/pages/exercises/examSubjiect1/examSubjiect1')">开始考试</view>
  61. <view class="btnIcon">
  62. <image src="@/static/images/theory/sanjx.png" mode=""></image>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="rightImg">
  67. <image src="@/static/images/theory/computed.png" mode=""></image>
  68. </view>
  69. </view>
  70. <view class="ul flex">
  71. <view class="li" v-for="(item,index) in bottomItem" :key="index" @click="$goPage('pages/exercises/examIntroduction/examIntroduction?tab='+index)">
  72. <view class="icon">
  73. <image :src="item.icon" mode=""></image>
  74. </view>
  75. <view class="txt">{{ item.name }}</view>
  76. </view>
  77. </view>
  78. <u-picker :show="show" :columns="columns" keyName="title" @close="show=false" @cancel="show=false" @confirm="confirmPicker"></u-picker>
  79. </view>
  80. </template>
  81. <script setup>
  82. import { ref } from 'vue'
  83. import { questbanktypeApi, indexNoticeApi, indexAdApi, indexAdCount, examProcessInfo, idexExam, myVip} from '@/config/api.js'
  84. import carStore from '@/store/modules/car.js'
  85. let usecarStore = carStore()
  86. usecarStore.getVipInfo().then(()=>{
  87. console.log(usecarStore.vipInfo)
  88. })
  89. const list1 = [
  90. new URL('@/static/images/bigImg/banner1.png', import.meta.url).href,
  91. new URL('@/static/images/bigImg/banner2.png', import.meta.url).href,
  92. ]
  93. function swiperClick(val) {
  94. let item = bannerList.value[val]
  95. if(!item.url) return
  96. usecarStore.webLink = item.url
  97. uni.navigateTo({
  98. url:'/pages/exercises/webView/webView'
  99. })
  100. }
  101. import {
  102. onPullDownRefresh,
  103. onShow
  104. } from "@dcloudio/uni-app"
  105. const currentTab = ref(1)
  106. const dotsStyles = ref({
  107. backgroundColor: '#E8E9EC',
  108. border: '1px #E8E9EC solid',
  109. color: '#fff',
  110. selectedBackgroundColor: '#1989FA',
  111. selectedBorder: '1px #1989FA solid'
  112. })
  113. const leftItem = ref([
  114. {name: '分类学习', icon: new URL('@/static/images/theory/theoryIcon1.png', import.meta.url).href, url: '/pages/exercises/categoryExercises/categoryExercises'},
  115. {name: '章节练习', icon: new URL('@/static/images/theory/theoryIcon7.png', import.meta.url).href, url: '/pages/exercises/chapter/chapter'},
  116. {name: '题型练习', icon: new URL('@/static/images/theory/theoryIcon6.png', import.meta.url).href, url: '/pages/exercises/queTypeExercises/queTypeExercises'},
  117. {name: '精选试题', icon: new URL('@/static/images/theory/theoryIcon9.png', import.meta.url).href, url: '/pages/exercises/brushQuestions/brushQuestions'},
  118. ])
  119. const rightItem = ref([
  120. {name: '错题收藏', icon: new URL('@/static/images/theory/theoryIcon8.png', import.meta.url).href, url: '/pages/exercises/wrongQuestion/wrongQuestion'},
  121. {name: '仿真考试', icon: new URL('@/static/images/theory/theoryIcon10.png', import.meta.url).href, url: '/pages/exercises/beforeExam/beforeExam'},
  122. {name: '我的学习', icon: new URL('@/static/images/theory/theoryIcon12.png', import.meta.url).href, url: '/pages/exercises/myStudy/myStudy'},
  123. {name: '考前密卷', icon: new URL('@/static/images/theory/theoryIcon11.png', import.meta.url).href, url: '/pages/vip/vipEntry/vipEntry'},
  124. ])
  125. const bottomItem = ref([
  126. {name: '考试简介', icon: new URL('@/static/images/theory/theoryIcon3.png', import.meta.url).href, url: ''},
  127. {name: '考试准备', icon: new URL('@/static/images/theory/theoryIcon2.png', import.meta.url).href, url: ''},
  128. {name: '考试流程', icon: new URL('@/static/images/theory/theoryIcon4.png', import.meta.url).href, url: ''},
  129. {name: '注意事项', icon: new URL('@/static/images/theory/theoryIcon5.png', import.meta.url).href, url: ''},
  130. ])
  131. function goPage(item) {
  132. let arr = ['精选试题', '错题收藏', '仿真考试', '我的学习', '考前密卷']
  133. // let arr = ['密卷']
  134. if(arr.includes(item.name)) {
  135. if(!usecarStore.isVip) {
  136. uni.$u.toast('此功能为VIP功能')
  137. setTimeout(()=>{
  138. uni.navigateTo({
  139. url: '/pages/vip/vipEntry/vipEntry'
  140. })
  141. },1500)
  142. return false
  143. }
  144. }
  145. if(item.name=='精选试题') {
  146. goAndSetCar({type: 'sift', value: '1'})
  147. return
  148. }
  149. uni.navigateTo({
  150. url: item.url
  151. })
  152. }
  153. function changeTab(num) {
  154. currentTab.value = num
  155. usecarStore.setCar('stepType', num)
  156. upDataFn()
  157. }
  158. // 顺序练题
  159. function goAndSetCar(item) {
  160. if(item.type=='sift') {
  161. if(!usecarStore.isVip) {
  162. uni.$u.toast('此功能为VIP功能')
  163. setTimeout(()=>{
  164. uni.navigateTo({
  165. url: '/pages/vip/vipEntry/vipEntry'
  166. })
  167. },1500)
  168. return false
  169. }
  170. }
  171. usecarStore.setCar(item.type, item.value)
  172. uni.navigateTo({
  173. url: '/pages/exercises/brushQuestions/brushQuestions'
  174. })
  175. }
  176. // 选择车型
  177. function confirmPicker(item) {
  178. let value = item.value[0]
  179. usecarStore.setCar('carType', value.carType)
  180. usecarStore.setCar('carTypeName', value.title)
  181. show.value = false
  182. }
  183. // 请求车类型
  184. let show = ref(false)
  185. let columns = ref([])
  186. async function questbanktypeFn() {
  187. const {data: res} = await questbanktypeApi()
  188. columns.value = [res]
  189. }
  190. questbanktypeFn()
  191. // 请求我的信息
  192. // async function myVipFn() {
  193. // const {data: res} = await myVip(usecarStore.carInfo.carType)
  194. // console.log('我的信息', res)
  195. // }
  196. // myVipFn()
  197. async function upDataFn() {
  198. try{
  199. uni.showLoading({
  200. title: '正在加载...'
  201. })
  202. await indexNotice()
  203. await indexAd()
  204. await indexAdCountFn()
  205. await idexExamFn()
  206. uni.hideLoading()
  207. }catch(e){
  208. uni.hideLoading()
  209. }
  210. }
  211. // 消息请求
  212. const nodes = ref('')
  213. async function indexNotice() {
  214. const {data: res} = await indexNoticeApi(usecarStore.carInfo.stepType)
  215. if(res.length) {
  216. nodes.value = res[0].content
  217. }
  218. // console.log(res)
  219. }
  220. indexNotice()
  221. // 轮播图
  222. let bannerList = ref([])
  223. async function indexAd() {
  224. const {data: res} = await indexAdApi(usecarStore.carInfo.stepType)
  225. if(res.length) bannerList.value = res
  226. console.log(res)
  227. }
  228. indexAd()
  229. // 统计多少题目
  230. let adCount = ref({})
  231. async function indexAdCountFn() {
  232. const {data:res} = await indexAdCount({subject: usecarStore.carInfo.stepType, carType: usecarStore.carInfo.carType, city: usecarStore.carInfo.city})
  233. adCount.value = res
  234. }
  235. // 模拟考试通过率
  236. let examInfo = ref({})
  237. async function idexExamFn() {
  238. const {data:res} = await idexExam({stepType: usecarStore.carInfo.stepType, carType: usecarStore.carInfo.carType})
  239. examInfo.value = res
  240. }
  241. idexExamFn()
  242. onShow(()=>{
  243. indexAdCountFn()
  244. })
  245. onPullDownRefresh(()=>{
  246. upDataFn()
  247. uni.stopPullDownRefresh()
  248. })
  249. </script>
  250. <style lang="scss" scoped>
  251. image {
  252. display: block;
  253. width: 100%;
  254. height: 100%;
  255. }
  256. .tabs {
  257. display: flex;
  258. height: 100rpx;
  259. width: 100%;
  260. justify-content: center;
  261. .tab {
  262. color: #333;
  263. position: relative;
  264. padding: 0 40rpx;
  265. font-weight: 400;
  266. flex: 1;
  267. text-align: center;
  268. &.active {
  269. width: 100%;
  270. &::before {
  271. content: '';
  272. position: absolute;
  273. left: 50%;
  274. bottom: -20rpx;
  275. width: 30rpx;
  276. height: 4rpx;
  277. background: #333;
  278. font-weight: 700;
  279. border-radius: 2rpx;
  280. transform: translateX(-50%);
  281. }
  282. }
  283. }
  284. }
  285. .content {
  286. padding: 100rpx 30rpx 30rpx 30rpx;
  287. .u-nav-slot {
  288. .txt {
  289. font-size: 28rpx;
  290. margin-right: 10rpx;
  291. }
  292. }
  293. .swiperBox {
  294. padding-top: 20rpx;
  295. }
  296. .notice {
  297. padding: 18rpx;
  298. background: #FEF9ED;
  299. border-radius: 8rpx;
  300. margin-top: 20rpx;
  301. font-size: 28rpx;
  302. display: flex;
  303. .yellowT {
  304. font-weight: 800;
  305. color: #F1AD40;
  306. font-style: italic;
  307. display: inline-block;
  308. white-space: nowrap;
  309. margin-right: 10rpx;
  310. }
  311. .txt {
  312. display: inline-block;
  313. }
  314. }
  315. .iconBox {
  316. display: flex;
  317. justify-content: space-between;
  318. padding: 60rpx 30rpx;
  319. .iconComl {
  320. display: flex;
  321. flex-direction: column;
  322. .item {
  323. text-align: center;
  324. margin-bottom: 40rpx;
  325. display: flex;
  326. flex-direction: column;
  327. justify-content: center;
  328. align-items: center;
  329. .icon {
  330. width: 72rpx;
  331. height: 72rpx;
  332. }
  333. .text {
  334. font-size: 28rpx;
  335. margin-top: 10rpx;
  336. }
  337. }
  338. }
  339. .centerComl {
  340. display: flex;
  341. flex-direction: column;
  342. justify-content: space-around;
  343. padding-bottom: 30rpx;
  344. .ctItem {
  345. width: 230rpx;
  346. height: 230rpx;
  347. background: url('../../../static/images/circular1.png') no-repeat;
  348. background-size: 100% 100%;
  349. border-radius: 50%;
  350. // border: 10px solid;
  351. // opacity: 0.1;
  352. // border-image: linear-gradient(0deg, #4FACFE, #00F2FE) 10 10;
  353. display: flex;
  354. align-items: center;
  355. justify-content: center;
  356. flex-direction: column;
  357. &:last-child {
  358. background: url('../../../static/images/circular2.png') no-repeat;
  359. background-size: 100% 100%;
  360. }
  361. .txt {
  362. font-size: 32rpx;
  363. color: #fff;
  364. padding: 6rpx 0;
  365. }
  366. }
  367. }
  368. }
  369. .simulatedExam {
  370. background: #DFF6FF;
  371. border-radius: 20rpx;
  372. padding: 30rpx;
  373. // margin-top: 40rpx;
  374. .leftTxt {
  375. flex: 1;
  376. width: 0;
  377. .h8 {
  378. font-weight: bold;
  379. font-size: 44rpx;
  380. }
  381. .text {
  382. font-size: 28rpx;
  383. margin-top: 12rpx;
  384. }
  385. .btnBox {
  386. width: 188rpx;
  387. height: 66rpx;
  388. background: #3776FF;
  389. border-radius: 33rpx;
  390. display: flex;
  391. justify-content: center;
  392. margin-top: 30rpx;
  393. .btnTxt {
  394. font-size: 30rpx;
  395. color: #FFFFFF;
  396. }
  397. .btnIcon {
  398. width: 10rpx;
  399. height: 12rpx;
  400. margin-left: 12rpx;
  401. }
  402. }
  403. }
  404. .rightImg {
  405. width: 256rpx;
  406. height: 256rpx;
  407. img {
  408. }
  409. }
  410. }
  411. .ul {
  412. padding: 20rpx 0 0 0;
  413. justify-content: space-between;
  414. .li {
  415. width: 23%;
  416. height: 174rpx;
  417. background: linear-gradient(0deg, #FFFFFF 0%, #E5F7FF 100%);
  418. box-shadow: 0px 2px 2px 0px #E5F7FF;
  419. border-radius: 10px;
  420. display: flex;
  421. flex-direction: column;
  422. align-items: center;
  423. justify-content: center;
  424. .icon {
  425. width: 58rpx;
  426. height: 60rpx;
  427. margin: 0 auto;
  428. }
  429. .txt {
  430. font-weight: 500;
  431. font-size: 28rpx;
  432. margin-top: 24rpx;
  433. text-align: center;
  434. }
  435. }
  436. }
  437. }
  438. </style>