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.
 
 
 
 
 
 

192 lines
3.7 KiB

  1. <template>
  2. <view class="page">
  3. <view class="selectBox">
  4. <l-select :range="selectArr1" :placeholder="placeholder" @change="bindDateChange" valueField="value" textField="text" v-model="value" />
  5. </view>
  6. <view class="studSeeSec2">
  7. <view class="tips" v-show="!flag">暂无数据!</view>
  8. <view class="studSeeSec2Top" v-show="flag">
  9. <view class="studSeeSec2TopBox">
  10. <view class="studSeeSec2Txt">
  11. <view><text>{{ data.Rank }}</text>名</view><view>班级排名</view>
  12. </view>
  13. <view class="studSeeSec2Line"></view>
  14. <view class="studSeeSec2Txt">
  15. <view><text>{{data.TotalScore}}</text>分</view><view>综合成绩</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="studSeeSec2List" v-show="flag">
  20. <view v-for="n in data.ScoreList" :key="n.LessonName">
  21. <image mode="widthFix" src="~@/common/images/book.png"></image>
  22. {{ n.LessonName }}
  23. <text>{{ n.Score }}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. // import get from 'lodash/get'
  31. export default {
  32. data() {
  33. return {
  34. value: 0,
  35. flag:false,
  36. selectArr1: [],
  37. placeholder: '请选择学期',
  38. data: {}
  39. };
  40. },
  41. methods: {
  42. async init() {
  43. let _this = this;
  44. _this.LOADING('加载数据中…')
  45. _this.HTTP_GET(
  46. 'scoreSearch/academicAndSemesterList',
  47. {},
  48. '加载数据时出错'
  49. ).then( res => {
  50. this.HIDE_LOADING()
  51. // console.log(res)
  52. if (res == null || res.length <= 0) {
  53. return;
  54. }
  55. _this.selectArr1 = res;
  56. _this.placeholder = res[0].text;
  57. _this.studentSeeAjax(res[0].value);
  58. })
  59. },
  60. bindDateChange: function(e) {
  61. console.log(e);
  62. this.LOADING('加载数据中…')
  63. this.studentSeeAjax(e)
  64. },
  65. studentSeeAjax(id) {
  66. let param = { value: id };
  67. let _this = this;
  68. this.HTTP_GET(
  69. 'scoreSearch/scoreList',
  70. param,
  71. '加载数据时出错'
  72. ).then( res => {
  73. this.HIDE_LOADING()
  74. if (res == null || JSON.stringify(res) == '{}') {
  75. _this.flag = false;
  76. return;
  77. }
  78. _this.flag = true;
  79. _this.data = res;
  80. })
  81. }
  82. },
  83. created() {
  84. this.init()
  85. }
  86. };
  87. </script>
  88. <style lang="less" scoped>
  89. @import '~@/common/css/common.less';
  90. * {
  91. box-sizing: border-box;
  92. }
  93. /deep/ .picker {
  94. text-align: center;
  95. }
  96. /deep/ .cu-form-group {
  97. width: 84%;
  98. background: #fff;
  99. height: 28px;
  100. border-radius: 14px;
  101. line-height: 28px;
  102. text-align: center;
  103. font-size: 15px;
  104. color: #1a1a1a;
  105. position: relative;
  106. margin: 0 auto;
  107. min-height: 28px;
  108. }
  109. .loading{
  110. background-color: transparent;
  111. font-size: 26px;
  112. }
  113. .selectBox {
  114. background-color: @pubColor;
  115. height: 100px;
  116. }
  117. .studSeeSec2Top {
  118. padding: 0 12px;
  119. margin-top: -52px;
  120. }
  121. .studSeeSec2TopBox {
  122. background: #fff;
  123. padding: 20px 0;
  124. text-align: center;
  125. font-size: 0;
  126. border-radius: 4px;
  127. }
  128. .studSeeSec2TopBox > * {
  129. display: inline-block;
  130. vertical-align: middle;
  131. }
  132. .studSeeSec2Line {
  133. height: 25px;
  134. width: 1px;
  135. background: #d6dfe2;
  136. margin: 0 40px;
  137. }
  138. .studSeeSec2Txt {
  139. color: #8a8a8a;
  140. }
  141. .studSeeSec2Txt view:first-child {
  142. font-size: 12px;
  143. }
  144. .studSeeSec2Txt view:first-child text {
  145. font-size: 20px;
  146. color: #0089fe;
  147. margin-right: 5px;
  148. }
  149. .studSeeSec2Txt view:last-child {
  150. font-size: 15px;
  151. }
  152. .studSeeSec2List {
  153. margin-top: 10px;
  154. background: #fff;
  155. }
  156. .studSeeSec2List view {
  157. padding: 0 12px 0 30px;
  158. border-bottom: 1px solid #d6dfe2;
  159. line-height: 39px;
  160. font-size: 13px;
  161. color: #7a7a7a;
  162. position: relative;
  163. }
  164. .studSeeSec2List view:before {
  165. content: '';
  166. position: absolute;
  167. top: 0;
  168. bottom: 0;
  169. left: 12px;
  170. margin: auto;
  171. width: 6px;
  172. height: 6px;
  173. background: #8ac9ff;
  174. border-radius: 50%;
  175. }
  176. .studSeeSec2List text {
  177. float: right;
  178. }
  179. .studSeeSec2List image {
  180. width: 12px;
  181. margin-right: 5px;
  182. position: relative;
  183. top: 2px;
  184. }
  185. .studSeeSec2 .tips {
  186. text-align: center;
  187. }
  188. </style>