25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

193 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. // console.log(res)
  75. if (res == null || JSON.stringify(res) == '{}') {
  76. _this.flag = false;
  77. return;
  78. }
  79. _this.flag = true;
  80. _this.data = res;
  81. })
  82. }
  83. },
  84. created() {
  85. this.init()
  86. }
  87. };
  88. </script>
  89. <style lang="less" scoped>
  90. @import '~@/common/css/common.less';
  91. * {
  92. box-sizing: border-box;
  93. }
  94. /deep/ .picker {
  95. text-align: center;
  96. }
  97. /deep/ .cu-form-group {
  98. width: 84%;
  99. background: #fff;
  100. height: 28px;
  101. border-radius: 14px;
  102. line-height: 28px;
  103. text-align: center;
  104. font-size: 15px;
  105. color: #1a1a1a;
  106. position: relative;
  107. margin: 0 auto;
  108. min-height: 28px;
  109. }
  110. .loading{
  111. background-color: transparent;
  112. font-size: 26px;
  113. }
  114. .selectBox {
  115. background-color: @pubColor;
  116. height: 100px;
  117. }
  118. .studSeeSec2Top {
  119. padding: 0 12px;
  120. margin-top: -52px;
  121. }
  122. .studSeeSec2TopBox {
  123. background: #fff;
  124. padding: 20px 0;
  125. text-align: center;
  126. font-size: 0;
  127. border-radius: 4px;
  128. }
  129. .studSeeSec2TopBox > * {
  130. display: inline-block;
  131. vertical-align: middle;
  132. }
  133. .studSeeSec2Line {
  134. height: 25px;
  135. width: 1px;
  136. background: #d6dfe2;
  137. margin: 0 40px;
  138. }
  139. .studSeeSec2Txt {
  140. color: #8a8a8a;
  141. }
  142. .studSeeSec2Txt view:first-child {
  143. font-size: 12px;
  144. }
  145. .studSeeSec2Txt view:first-child text {
  146. font-size: 20px;
  147. color: #0089fe;
  148. margin-right: 5px;
  149. }
  150. .studSeeSec2Txt view:last-child {
  151. font-size: 15px;
  152. }
  153. .studSeeSec2List {
  154. margin-top: 10px;
  155. background: #fff;
  156. }
  157. .studSeeSec2List view {
  158. padding: 0 12px 0 30px;
  159. border-bottom: 1px solid #d6dfe2;
  160. line-height: 39px;
  161. font-size: 13px;
  162. color: #7a7a7a;
  163. position: relative;
  164. }
  165. .studSeeSec2List view:before {
  166. content: '';
  167. position: absolute;
  168. top: 0;
  169. bottom: 0;
  170. left: 12px;
  171. margin: auto;
  172. width: 6px;
  173. height: 6px;
  174. background: #8ac9ff;
  175. border-radius: 50%;
  176. }
  177. .studSeeSec2List text {
  178. float: right;
  179. }
  180. .studSeeSec2List image {
  181. width: 12px;
  182. margin-right: 5px;
  183. position: relative;
  184. top: 2px;
  185. }
  186. .studSeeSec2 .tips {
  187. text-align: center;
  188. }
  189. </style>