tab_exam.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="page_view">
  3. <!-- 统计 -->
  4. <view class="bg1">
  5. <top-info :timeStamp="timeStamp"></top-info>
  6. <scroll-view class="scroll_view" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
  7. <view class="view_box">
  8. <view class="scroll_view_item" v-for="(item,index) in cardList" :key="index"
  9. @click="navGradeList(index)">
  10. <view class="card_info">
  11. <view :class="item.icon"></view>
  12. <view class="title">{{item.title}}</view>
  13. </view>
  14. <view class="chart_box">
  15. <qiun-data-charts :type="item.type" :chartData="item.data" />
  16. </view>
  17. </view>
  18. </view>
  19. </scroll-view>
  20. </view>
  21. <!-- 统计卡片 -->
  22. <view class="card_view">
  23. <view class="total_card">
  24. <view class="flex_cloumn" style="justify-content: space-around;margin: 20rpx 0 20rpx 20rpx;">
  25. <view class="flex_baseline">
  26. <text class="_title">今日评测</text>
  27. <text class="_title" style="margin-left: 20rpx;">{{examData.length}}</text>
  28. <text class="_unit">例</text>
  29. </view>
  30. <view class="flex_baseline">
  31. <text class="_subtitle">已完成</text>
  32. <text class="_subtitle" style="margin-left: 20rpx;">{{finishData.length}}</text>
  33. <text class="_unit">例</text>
  34. </view>
  35. <view class="flex_baseline">
  36. <text class="_subtitle">完成情况</text>
  37. <text class="_subtitle" style="margin-left: 20rpx;font-weight: bold;">{{performance}}</text>
  38. </view>
  39. </view>
  40. <view class="image" :style="{backgroundImage:`url(${image})`}"></view>
  41. </view>
  42. <!-- 列表卡片 -->
  43. <view class="card_item" style="width: 100%;">
  44. <view class="card_title">
  45. <view class="front_tag"></view>
  46. <view class="title">今日评测</view>
  47. <view class="flex_row" style="margin: 0 0 0 auto;" @click="navExamList">
  48. <view class="t-icon t-icon-fenlei"></view>
  49. <view class="title" style="color: #4169E1;margin-left: 10rpx;">评测列表</view>
  50. </view>
  51. </view>
  52. <view class="class_list">
  53. <view class="class_item" v-for="(item,index) in examData" :key="index"
  54. style="linear-gradient(90deg, #f3f4f9, #FFF);" @click="navExamData(index)">
  55. <view class="flex_row" style="margin: 5rpx 20rpx;">
  56. <view class="t-icon t-icon-examicon" style="width: 60rpx; height: 60rpx;"></view>
  57. <view class="flex_cloumn" style="height:92rpx;justify-content: space-between;">
  58. <view class="flex_row" style="margin-left: 20rpx;">
  59. <view class="class_item_title">{{item.examInfo.name}}</view>
  60. </view>
  61. <view class="flex_row">
  62. <view class="tag_fill">
  63. <view class="tag_text">{{item.examInfo.subjects[0].name}}</view>
  64. </view>
  65. <view class="tag_fill">
  66. <view class="tag_text">{{item.examInfo.examType.name}}</view>
  67. </view>
  68. <view class="tag_fill"
  69. :style="{backgroundColor: item.examInfo.progress === 'finish'? '#23b46c':'#ff8caf'}">
  70. <view class="tag_text">{{item.examInfo.progress === 'finish' ? '已完成' : '进行中'}}
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="flex_cloumn" style="margin: 15rpx 0 10rpx 20rpx;">
  80. <view class="title" style="font-size: 32rpx;">评测练习</view>
  81. <view class="bottom_tag"></view>
  82. </view>
  83. <view class="flex_row" style="width: 70%;"></view>
  84. </view>
  85. <scroll-view class="scroll_view_bottom" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
  86. <view class="_item"></view>
  87. <view class="_item"></view>
  88. <view class="_item"></view>
  89. <view class="_item"></view>
  90. <view class="_item"></view>
  91. </scroll-view>
  92. </view>
  93. </template>
  94. <script>
  95. import {
  96. mapState
  97. } from 'vuex'
  98. export default {
  99. computed: {
  100. ...mapState('m_chart', ['examChartData']),
  101. ...mapState('m_children', ['examData'])
  102. },
  103. data() {
  104. return {
  105. cardList: [{
  106. icon: 't-icon t-icon-pingjia',
  107. title: '总成绩走势',
  108. type: 'mini-area',
  109. data: ''
  110. }, {
  111. icon: 't-icon t-icon-zhishi',
  112. title: '单次考试分析',
  113. type: 'mini-column',
  114. data: ''
  115. }, {
  116. icon: 't-icon t-icon-fengxianpinggu',
  117. title: '排行占比分析',
  118. type: 'mini-area',
  119. data: ''
  120. }, {
  121. icon: 't-icon t-icon-gaishuai',
  122. title: '优劣科目分析',
  123. type: 'mini-rose',
  124. data: ''
  125. }, {
  126. icon: 't-icon t-icon-tongji',
  127. title: '考试能力分析',
  128. type: 'mini-column',
  129. data: ''
  130. }],
  131. image: 'https://ouch-cdn2.icons8.com/yFl5NWU3aVehLBlQf9ctvnZPqtm5U0hqM3IzWvFDCaQ/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNzY5/LzY1ZTQxZmZjLTg1/YWQtNDYyMi1hYzU0/LWQ3NDEzZmY2NGI1/YS5wbmc.png',
  132. //完成情况
  133. performance: '',
  134. //完成数据
  135. finishData: '',
  136. timeStamp: ''
  137. };
  138. },
  139. onLoad() {
  140. this.init()
  141. },
  142. //刷新页面
  143. onPullDownRefresh() {
  144. this.init()
  145. setTimeout(function() {
  146. uni.stopPullDownRefresh();
  147. }, 1000);
  148. },
  149. methods: {
  150. //初始化
  151. init() {
  152. this.timeStamp = (new Date()).format("hh:mm")
  153. this.$initExam()
  154. this.getChartData()
  155. this.getPerformance()
  156. },
  157. //初始化cardList数据
  158. getChartData() {
  159. this.cardList[0].data = this.examChartData.totalChartData[0]
  160. this.cardList[1].data = this.examChartData.singleChartData[0]
  161. this.cardList[2].data = this.examChartData.rankingChartData[0]
  162. this.cardList[3].data = this.examChartData.subjectChartData[0]
  163. this.cardList[4].data = this.examChartData.levelChartData[0]
  164. },
  165. //获得评判信息
  166. getPerformance() {
  167. this.finishData = this.examData.filter(x => x.examInfo.progress === 'finish')
  168. this.performance = this.finishData.length / this.examData.length >= 0.4 ?
  169. (this.finishData.length / this.examData.length >= 0.7 ? '优秀' : '良好') : '较差'
  170. },
  171. //导航
  172. navGradeList(index) {
  173. if (index === 0) {
  174. uni.navigateTo({
  175. url: '/subpkg/gradelist/total'
  176. })
  177. }
  178. if (index === 1) {
  179. uni.navigateTo({
  180. url: '/subpkg/gradelist/single'
  181. })
  182. }
  183. if (index === 2) {
  184. uni.navigateTo({
  185. url: '/subpkg/gradelist/ranking'
  186. })
  187. }
  188. if (index === 3) {
  189. uni.navigateTo({
  190. url: '/subpkg/gradelist/subject'
  191. })
  192. }
  193. if (index === 4) {
  194. uni.navigateTo({
  195. url: '/subpkg/gradelist/level'
  196. })
  197. }
  198. },
  199. navExamList() {
  200. let value = this.performance
  201. uni.navigateTo({
  202. url: `/subpkg/datalist/examlist?value=${value}`
  203. })
  204. },
  205. navExamData(index){
  206. uni.navigateTo({
  207. url: `/subpkg/datalist/examdata?index=${index}`
  208. })
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss">
  214. @import '@/pages/style/tab_pages.scss';
  215. .bg1 {
  216. background-color: $color-pink;
  217. }
  218. .tag_fill {
  219. background-color: $color-pink;
  220. margin-left: 20rpx;
  221. }
  222. </style>