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.

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