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.

446 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
3 weeks 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
3 months ago
1 month ago
3 months ago
1 week 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} from '@/config/api.js'
  84. import carStore from '@/store/modules/car.js'
  85. let usecarStore = carStore()
  86. const list1 = [
  87. new URL('@/static/images/bigImg/banner1.png', import.meta.url).href,
  88. new URL('@/static/images/bigImg/banner2.png', import.meta.url).href,
  89. ]
  90. function swiperClick(val) {
  91. let item = bannerList.value[val]
  92. if(!item.url) return
  93. usecarStore.webLink = item.url
  94. uni.navigateTo({
  95. url:'/pages/exercises/webView/webView'
  96. })
  97. }
  98. import {
  99. onPullDownRefresh,
  100. onShow
  101. } from "@dcloudio/uni-app"
  102. const currentTab = ref(1)
  103. const dotsStyles = ref({
  104. backgroundColor: '#E8E9EC',
  105. border: '1px #E8E9EC solid',
  106. color: '#fff',
  107. selectedBackgroundColor: '#1989FA',
  108. selectedBorder: '1px #1989FA solid'
  109. })
  110. const leftItem = ref([
  111. {name: '分类学习', icon: new URL('@/static/images/theory/theoryIcon1.png', import.meta.url).href, url: '/pages/exercises/categoryExercises/categoryExercises'},
  112. {name: '章节练习', icon: new URL('@/static/images/theory/theoryIcon7.png', import.meta.url).href, url: '/pages/exercises/chapter/chapter'},
  113. {name: '题型练习', icon: new URL('@/static/images/theory/theoryIcon6.png', import.meta.url).href, url: '/pages/exercises/queTypeExercises/queTypeExercises'},
  114. {name: '精选试题', icon: new URL('@/static/images/theory/theoryIcon9.png', import.meta.url).href, url: '/pages/exercises/brushQuestions/brushQuestions'},
  115. ])
  116. const rightItem = ref([
  117. {name: '错题收藏', icon: new URL('@/static/images/theory/theoryIcon8.png', import.meta.url).href, url: '/pages/exercises/wrongQuestion/wrongQuestion'},
  118. {name: '仿真考试', icon: new URL('@/static/images/theory/theoryIcon10.png', import.meta.url).href, url: '/pages/exercises/beforeExam/beforeExam'},
  119. {name: '我的学习', icon: new URL('@/static/images/theory/theoryIcon12.png', import.meta.url).href, url: '/pages/exercises/myStudy/myStudy'},
  120. {name: '考前密卷', icon: new URL('@/static/images/theory/theoryIcon11.png', import.meta.url).href, url: '/pages/vip/vipEntry/vipEntry'},
  121. ])
  122. const bottomItem = ref([
  123. {name: '考试简介', icon: new URL('@/static/images/theory/theoryIcon3.png', import.meta.url).href, url: ''},
  124. {name: '考试准备', icon: new URL('@/static/images/theory/theoryIcon2.png', import.meta.url).href, url: ''},
  125. {name: '考试流程', icon: new URL('@/static/images/theory/theoryIcon4.png', import.meta.url).href, url: ''},
  126. {name: '注意事项', icon: new URL('@/static/images/theory/theoryIcon5.png', import.meta.url).href, url: ''},
  127. ])
  128. function goPage(item) {
  129. let arr = ['密卷']
  130. if(arr.includes(item.name)) {
  131. return uni.$u.toast('正在开发,敬请期待')
  132. }
  133. if(item.name=='精选试题') {
  134. goAndSetCar({type: 'sift', value: '1'})
  135. return
  136. }
  137. uni.navigateTo({
  138. url: item.url
  139. })
  140. }
  141. function changeTab(num) {
  142. currentTab.value = num
  143. usecarStore.setCar('stepType', num)
  144. upDataFn()
  145. }
  146. // 顺序练题
  147. function goAndSetCar(item) {
  148. usecarStore.setCar(item.type, item.value)
  149. uni.navigateTo({
  150. url: '/pages/exercises/brushQuestions/brushQuestions'
  151. })
  152. }
  153. // 选择车型
  154. function confirmPicker(item) {
  155. let value = item.value[0]
  156. usecarStore.setCar('carType', value.carType)
  157. usecarStore.setCar('carTypeName', value.title)
  158. show.value = false
  159. }
  160. // 请求车类型
  161. let show = ref(false)
  162. let columns = ref([])
  163. async function questbanktypeFn() {
  164. const {data: res} = await questbanktypeApi()
  165. columns.value = [res]
  166. }
  167. questbanktypeFn()
  168. async function upDataFn() {
  169. try{
  170. uni.showLoading({
  171. title: '正在加载...'
  172. })
  173. await indexNotice()
  174. await indexAd()
  175. await indexAdCountFn()
  176. await idexExamFn()
  177. uni.hideLoading()
  178. }catch(e){
  179. uni.hideLoading()
  180. }
  181. }
  182. // 消息请求
  183. const nodes = ref('')
  184. async function indexNotice() {
  185. const {data: res} = await indexNoticeApi(usecarStore.carInfo.stepType)
  186. if(res.length) {
  187. nodes.value = res[0].content
  188. }
  189. // console.log(res)
  190. }
  191. indexNotice()
  192. // 轮播图
  193. let bannerList = ref([])
  194. async function indexAd() {
  195. const {data: res} = await indexAdApi(usecarStore.carInfo.stepType)
  196. if(res.length) bannerList.value = res
  197. console.log(res)
  198. }
  199. indexAd()
  200. // 统计多少题目
  201. let adCount = ref({})
  202. async function indexAdCountFn() {
  203. const {data:res} = await indexAdCount({subject: usecarStore.carInfo.stepType, carType: usecarStore.carInfo.carType, city: usecarStore.carInfo.city})
  204. adCount.value = res
  205. }
  206. // 模拟考试通过率
  207. let examInfo = ref({})
  208. async function idexExamFn() {
  209. const {data:res} = await idexExam({stepType: usecarStore.carInfo.stepType, carType: usecarStore.carInfo.carType})
  210. examInfo.value = res
  211. }
  212. idexExamFn()
  213. onShow(()=>{
  214. indexAdCountFn()
  215. })
  216. onPullDownRefresh(()=>{
  217. upDataFn()
  218. uni.stopPullDownRefresh()
  219. })
  220. </script>
  221. <style lang="scss" scoped>
  222. image {
  223. display: block;
  224. width: 100%;
  225. height: 100%;
  226. }
  227. .tabs {
  228. display: flex;
  229. height: 100rpx;
  230. width: 100%;
  231. justify-content: center;
  232. .tab {
  233. color: #333;
  234. position: relative;
  235. padding: 0 40rpx;
  236. font-weight: 400;
  237. flex: 1;
  238. text-align: center;
  239. &.active {
  240. width: 100%;
  241. &::before {
  242. content: '';
  243. position: absolute;
  244. left: 50%;
  245. bottom: -20rpx;
  246. width: 30rpx;
  247. height: 4rpx;
  248. background: #333;
  249. font-weight: 700;
  250. border-radius: 2rpx;
  251. transform: translateX(-50%);
  252. }
  253. }
  254. }
  255. }
  256. .content {
  257. padding: 100rpx 30rpx 30rpx 30rpx;
  258. .u-nav-slot {
  259. .txt {
  260. font-size: 28rpx;
  261. margin-right: 10rpx;
  262. }
  263. }
  264. .swiperBox {
  265. padding-top: 20rpx;
  266. }
  267. .notice {
  268. padding: 18rpx;
  269. background: #FEF9ED;
  270. border-radius: 8rpx;
  271. margin-top: 20rpx;
  272. font-size: 28rpx;
  273. display: flex;
  274. .yellowT {
  275. font-weight: 800;
  276. color: #F1AD40;
  277. font-style: italic;
  278. display: inline-block;
  279. white-space: nowrap;
  280. margin-right: 10rpx;
  281. }
  282. .txt {
  283. display: inline-block;
  284. }
  285. }
  286. .iconBox {
  287. display: flex;
  288. justify-content: space-between;
  289. padding: 60rpx 30rpx;
  290. .iconComl {
  291. display: flex;
  292. flex-direction: column;
  293. .item {
  294. text-align: center;
  295. margin-bottom: 40rpx;
  296. display: flex;
  297. flex-direction: column;
  298. justify-content: center;
  299. align-items: center;
  300. .icon {
  301. width: 72rpx;
  302. height: 72rpx;
  303. }
  304. .text {
  305. font-size: 28rpx;
  306. margin-top: 10rpx;
  307. }
  308. }
  309. }
  310. .centerComl {
  311. display: flex;
  312. flex-direction: column;
  313. justify-content: space-around;
  314. padding-bottom: 30rpx;
  315. .ctItem {
  316. width: 230rpx;
  317. height: 230rpx;
  318. background: url('../../../static/images/circular1.png') no-repeat;
  319. background-size: 100% 100%;
  320. border-radius: 50%;
  321. // border: 10px solid;
  322. // opacity: 0.1;
  323. // border-image: linear-gradient(0deg, #4FACFE, #00F2FE) 10 10;
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. flex-direction: column;
  328. &:last-child {
  329. background: url('../../../static/images/circular2.png') no-repeat;
  330. background-size: 100% 100%;
  331. }
  332. .txt {
  333. font-size: 32rpx;
  334. color: #fff;
  335. padding: 6rpx 0;
  336. }
  337. }
  338. }
  339. }
  340. .simulatedExam {
  341. background: #DFF6FF;
  342. border-radius: 20rpx;
  343. padding: 30rpx;
  344. // margin-top: 40rpx;
  345. .leftTxt {
  346. flex: 1;
  347. width: 0;
  348. .h8 {
  349. font-weight: bold;
  350. font-size: 44rpx;
  351. }
  352. .text {
  353. font-size: 28rpx;
  354. margin-top: 12rpx;
  355. }
  356. .btnBox {
  357. width: 188rpx;
  358. height: 66rpx;
  359. background: #3776FF;
  360. border-radius: 33rpx;
  361. display: flex;
  362. justify-content: center;
  363. margin-top: 30rpx;
  364. .btnTxt {
  365. font-size: 30rpx;
  366. color: #FFFFFF;
  367. }
  368. .btnIcon {
  369. width: 10rpx;
  370. height: 12rpx;
  371. margin-left: 12rpx;
  372. }
  373. }
  374. }
  375. .rightImg {
  376. width: 256rpx;
  377. height: 256rpx;
  378. img {
  379. }
  380. }
  381. }
  382. .ul {
  383. padding: 20rpx 0 0 0;
  384. justify-content: space-between;
  385. .li {
  386. width: 23%;
  387. height: 174rpx;
  388. background: linear-gradient(0deg, #FFFFFF 0%, #E5F7FF 100%);
  389. box-shadow: 0px 2px 2px 0px #E5F7FF;
  390. border-radius: 10px;
  391. display: flex;
  392. flex-direction: column;
  393. align-items: center;
  394. justify-content: center;
  395. .icon {
  396. width: 58rpx;
  397. height: 60rpx;
  398. margin: 0 auto;
  399. }
  400. .txt {
  401. font-weight: 500;
  402. font-size: 28rpx;
  403. margin-top: 24rpx;
  404. text-align: center;
  405. }
  406. }
  407. }
  408. }
  409. </style>