tab_exam.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view class="page_view">
  3. <!-- 统计 -->
  4. <view class="bg1">
  5. <view class="circle_line1"></view>
  6. <view class="circle_line2"></view>
  7. <view class="circle_line3"></view>
  8. <top-info :timeStamp="timeStamp"></top-info>
  9. <scroll-view class="scroll_view" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
  10. <view class="view_box">
  11. <view class="scroll_view_item" v-for="(item,index) in cardList" :key="index"
  12. @click="navGradeList(index)">
  13. <view class="card_info">
  14. <view :class="item.icon"></view>
  15. <view class="title">{{item.title}}</view>
  16. </view>
  17. <view class="chart_box">
  18. <qiun-data-charts :type="item.type" :chartData="item.data" />
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. <!-- 统计卡片 -->
  25. <view class="card_view">
  26. <view class="total_card">
  27. <view class="flex_cloumn" style="justify-content: space-around;margin: 20rpx 0 20rpx 20rpx;">
  28. <view class="flex_baseline">
  29. <text class="_title">今日评测</text>
  30. <text class="_title" style="margin-left: 20rpx;">{{examData.length}}</text>
  31. <text class="_unit">例</text>
  32. </view>
  33. <view class="flex_baseline">
  34. <text class="_subtitle">已完成</text>
  35. <text class="_subtitle" style="margin-left: 20rpx;">{{finishData.length}}</text>
  36. <text class="_unit">例</text>
  37. </view>
  38. <view class="flex_baseline">
  39. <text class="_subtitle">完成情况</text>
  40. <text class="_subtitle" style="margin-left: 20rpx;">{{performance}}</text>
  41. </view>
  42. </view>
  43. <view class="image" :style="{backgroundImage:`url(${image})`}"></view>
  44. </view>
  45. <!-- 列表卡片 -->
  46. <view class="card_item" style="width: 100%;">
  47. <view class="card_title">
  48. <view class="front_tag"></view>
  49. <view class="title">今日评测</view>
  50. <view class="flex_row" style="margin: 0 0 0 auto;" @click="navExamList" v-if="examData.length != 0">
  51. <view class="t-icon t-icon-fenlei"></view>
  52. <view class="title" style="color: #4169E1;margin-left: 10rpx;">评测列表</view>
  53. </view>
  54. </view>
  55. <view class="class_list">
  56. <view class="class_item"
  57. :style="{borderImage: none}"
  58. v-for="(item,index) in examData" :key="index" @click="navExamData(index)"
  59. v-if="examData.length != 0">
  60. <view class="flex_row" style="margin: 0 20rpx;">
  61. <view class="t-icon t-icon-examicon" style="width: 60rpx; height: 60rpx;"></view>
  62. <view class="flex_cloumn" style="height:92rpx;justify-content: space-between;">
  63. <view class="flex_row" style="margin-left: 20rpx;">
  64. <view class="class_item_title">{{item.examInfo.name}}</view>
  65. </view>
  66. <view class="flex_row">
  67. <view class="tag_fill">
  68. <view class="tag_text">{{item.examInfo.subjects[0].name}}</view>
  69. </view>
  70. <view class="tag_fill">
  71. <view class="tag_text">{{item.examInfo.examType.name}}</view>
  72. </view>
  73. <view class="tag_fill"
  74. :style="{backgroundColor: item.examInfo.progress === 'finish'? '#23b46c':'#ff5959'}">
  75. <view class="tag_text">{{item.examInfo.progress === 'finish' ? '已完成' : '进行中'}}
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="image_box" v-if="examData.length === 0">
  83. <view class="detail_image_none" :style="{backgroundImage:`url(${image1})`}"></view>
  84. <view class="subtitle">今日孩子暂无评测活动</view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="flex_cloumn" style="margin: 15rpx 0 10rpx 20rpx;">
  89. <view class="title" style="font-size: 32rpx;">评测练习</view>
  90. <view class="bottom_tag"></view>
  91. </view>
  92. <view class="flex_row" style="width: 70%;"></view>
  93. </view>
  94. <scroll-view class="scroll_view_bottom" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
  95. <view class="_item" v-for="(item,index) in examPractice" :key="index" @click="navExercisesInfo(index)">
  96. <view class="flex_cloumn" style="height: 320rpx;">
  97. <view class="flex_row" style="margin: 10rpx;">
  98. <view class="t-icon t-icon-yuwen" v-if="item.subject === '语文'"></view>
  99. <view class="t-icon t-icon-shuxue" v-if="item.subject === '数学'"></view>
  100. <view class="t-icon t-icon-yingyu" v-if="item.subject === '英语'"></view>
  101. <view class="t-icon t-icon-tiyu" v-if="item.subject === '体育'"></view>
  102. <view class="t-icon t-icon-tianwen" v-if="item.subject === '科学'"></view>
  103. <view class="t-icon t-icon-zuixinkecheng" v-if="item.subject === '思品'"></view>
  104. <view class="t-icon t-icon-wuli" v-if="item.subject === '物理'"></view>
  105. <view class="t-icon t-icon-huaxue" v-if="item.subject === '化学'"></view>
  106. <view class="t-icon t-icon-meishu" v-if="item.subject === '美术'"></view>
  107. <view class="t-icon t-icon-yinle" v-if="item.subject === '音乐'"></view>
  108. <view class="t-icon t-icon-dili" v-if="item.subject === '地理'"></view>
  109. <view class="t-icon t-icon-lishi" v-if="item.subject === '历史'"></view>
  110. <view class="flex_cloumn" style="height: 100rpx;justify-content: space-around;">
  111. <view class="YS_title" style="font-size: 40rpx;">{{item.subject}}</view>
  112. <view class="tag_fill"
  113. style="background-color: #d8deff;width:fit-content;margin-left: 0;padding: 5rpx 10rpx;">
  114. <view class="t-icon t-icon-zhengceguizhang"
  115. style="width: 30rpx;height: 30rpx;margin-right: 5rpx;"></view>
  116. <view class="tag_text" style="color: #4169E1;">{{item.type}}</view>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="flex_cloumn" style="height: 100%;justify-content: space-around;margin: 0 30rpx 20rpx 30rpx;">
  121. <view class="YS_title">{{item.title}}</view>
  122. <view class="YS_title" style="font-size: 30rpx;">「 {{item.modality}} 」</view>
  123. <view class="flex_baseline">
  124. <view class="subtitle" style="font-weight: 400;font-size: 28rpx;">评测题量,共</view>
  125. <view class="subtitle" style="font-weight: 400;font-size: 40rpx;margin-left: 4rpx;">{{item.amount}}</view>
  126. <view class="subtitle" style="font-weight: 400;font-size: 28rpx;margin-left: 4rpx;">题</view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </scroll-view>
  132. </view>
  133. </template>
  134. <script>
  135. import {
  136. mapState
  137. } from 'vuex'
  138. export default {
  139. computed: {
  140. ...mapState('m_chart', ['examChartData']),
  141. ...mapState('m_children', ['examData', 'examPractice'])
  142. },
  143. data() {
  144. return {
  145. cardList: [{
  146. icon: 't-icon t-icon-zoushi',
  147. title: '总成绩走势',
  148. type: 'mini-area',
  149. data: ''
  150. }, {
  151. icon: 't-icon t-icon-shuju',
  152. title: '单次考试分析',
  153. type: 'mini-column',
  154. data: ''
  155. }, {
  156. icon: 't-icon t-icon-jiangzhang',
  157. title: '排行占比分析',
  158. type: 'mini-area',
  159. data: ''
  160. }, {
  161. icon: 't-icon t-icon-yingyong',
  162. title: '优劣科目分析',
  163. type: 'mini-rose',
  164. data: ''
  165. }, {
  166. icon: 't-icon t-icon-yunwei',
  167. title: '考试能力分析',
  168. type: 'mini-column',
  169. data: ''
  170. }],
  171. image: 'https://ouch-cdn2.icons8.com/yFl5NWU3aVehLBlQf9ctvnZPqtm5U0hqM3IzWvFDCaQ/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNzY5/LzY1ZTQxZmZjLTg1/YWQtNDYyMi1hYzU0/LWQ3NDEzZmY2NGI1/YS5wbmc.png',
  172. //完成情况
  173. performance: '',
  174. //完成数据
  175. finishData: '',
  176. finishRate: '',
  177. timeStamp: '',
  178. image1: 'https://image.meiye.art/pic_1631411821365LA63Wc70BLbmyHhj2XjiL',
  179. };
  180. },
  181. onLoad() {
  182. this.init()
  183. },
  184. //刷新页面
  185. onPullDownRefresh() {
  186. this.init()
  187. setTimeout(function() {
  188. uni.stopPullDownRefresh();
  189. }, 1000);
  190. },
  191. methods: {
  192. //初始化
  193. init() {
  194. this.timeStamp = (new Date()).format("hh:mm")
  195. this.$initExam()
  196. this.getChartData()
  197. this.getPerformance()
  198. },
  199. //初始化cardList数据
  200. getChartData() {
  201. this.cardList[0].data = this.examChartData.totalChartData[0]
  202. this.cardList[1].data = this.examChartData.singleChartData[0]
  203. this.cardList[2].data = this.examChartData.rankingChartData[0]
  204. this.cardList[3].data = this.examChartData.subjectChartData[0]
  205. this.cardList[4].data = this.examChartData.levelChartData[0]
  206. },
  207. //获得评判信息
  208. getPerformance() {
  209. if (this.examData.length != 0) {
  210. this.finishData = this.examData.filter(x => x.examInfo.progress === 'finish')
  211. this.finishRate = (this.finishData.length * 100 / this.examData.length).toFixed(0)
  212. this.performance = this.finishData.length / this.examData.length >= 0.4 ?
  213. (this.finishData.length / this.examData.length >= 0.7 ? '优秀' : '良好') : '较差'
  214. } else {
  215. this.finishData = []
  216. this.finishRate = 0
  217. this.performance = '无评测'
  218. }
  219. },
  220. //导航
  221. navGradeList(index) {
  222. if (index === 0) {
  223. uni.navigateTo({
  224. url: '/subpkg/gradelist/total'
  225. })
  226. }
  227. if (index === 1) {
  228. uni.navigateTo({
  229. url: '/subpkg/gradelist/single'
  230. })
  231. }
  232. if (index === 2) {
  233. uni.navigateTo({
  234. url: '/subpkg/gradelist/ranking'
  235. })
  236. }
  237. if (index === 3) {
  238. uni.navigateTo({
  239. url: '/subpkg/gradelist/subject'
  240. })
  241. }
  242. if (index === 4) {
  243. uni.navigateTo({
  244. url: '/subpkg/gradelist/level'
  245. })
  246. }
  247. },
  248. navExamList() {
  249. let value = this.finishRate
  250. uni.navigateTo({
  251. url: `/subpkg/datalist/examlist?value=${value}`
  252. })
  253. },
  254. navExamData(index) {
  255. uni.navigateTo({
  256. url: `/subpkg/datalist/examdata?index=${index}`
  257. })
  258. },
  259. navExercisesInfo(index){
  260. uni.navigateTo({
  261. url: `/subpkg/exam/exercisesinfo?index=${index}`
  262. })
  263. }
  264. }
  265. }
  266. </script>
  267. <style lang="scss">
  268. @import '@/pages/style/tab_pages.scss';
  269. .bg1 {
  270. background-color: $color-pink;
  271. }
  272. .tag_fill {
  273. background-color: $color-pink;
  274. margin-left: 20rpx;
  275. }
  276. .circle_line1 {
  277. background-image: linear-gradient(to right, #ff8caf, #ff8caf), linear-gradient(90deg, #FFF -50%, rgba(255, 255, 255, 0.0));
  278. }
  279. .circle_line2 {
  280. background-image: linear-gradient(to right, #ff8caf, #ff8caf), linear-gradient(180deg, #FFF -50%, rgba(255, 255, 255, 0.0));
  281. }
  282. .circle_line3 {
  283. background-image: linear-gradient(to right, #ff8caf, #ff8caf), linear-gradient(0deg, #FFF -50%, rgba(255, 255, 255, 0.0));
  284. }
  285. </style>