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.

408 lines
11 KiB

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