creditPoints.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <!--信用分-->
  2. <template>
  3. <view id="creditPoints">
  4. <view class="top-title-box">
  5. <picker @change="bindPickerChange" :value="pickerIndex" :range="pickerList" range-key="name">
  6. <view class="top-title-button-box">
  7. <view>{{pickerList[pickerIndex].name}}</view>
  8. <img src="@/images/basicsModules/icon_jlfmx_xl.png">
  9. </view>
  10. </picker>
  11. <view class="top-title-null-p"></view>
  12. <view class="top-title-get" v-if="pickerIndex == 0 || pickerIndex == 1">总获得:<span>{{obtainPoints}}</span></view>
  13. <view class="top-title-exchange" v-if="pickerIndex == 0 || pickerIndex == 2">总减扣:<span>{{deductPoints}}</span></view>
  14. <view class="top-title-img" @click="shadeTypeButton">
  15. <img src="@/images/basicsModules/icon_jlfmx_bz.png">
  16. </view>
  17. </view>
  18. <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
  19. <view class="for-min-box" v-for="(item,index) in infoList" :key="index">
  20. <view class="for-top-title">
  21. <view class="left-box">
  22. <picker mode="date" fields="month" @change="bindDateChange">
  23. <view class="for-top-title-time">{{item.yearMonth}}</view>
  24. </picker>
  25. </view>
  26. <view class="right-box" @click.stop="moonClick(item)">
  27. <img class="img-one" v-if="item.unfoldType" src="@/images/basicsModules/icon_06.png">
  28. <img class="img-two" v-if="!item.unfoldType" src="@/images/basicsModules/icon_04.png">
  29. <view class="for-top-title-null"></view>
  30. <view class="for-top-title-get" v-if="pickerIndex == 0 || pickerIndex == 1">获得:{{item.obtainPoints}}</view>
  31. <view class="for-top-title-border" v-if="pickerIndex == 0"></view>
  32. <view class="for-top-title-exchange" v-if="pickerIndex == 0 || pickerIndex == 2">减扣:{{item.deductPoints}}</view>
  33. </view>
  34. </view>
  35. <view class="for-list-min-box" v-for="(minItem,indexTwo) in item.elPointsLoginfoList" :key="indexTwo" v-if="item.unfoldType">
  36. <img src="@/pages_student/images/icon_wd_jlf.png">
  37. <view class="time-box">
  38. <view>{{minItem.messageContent}}</view>
  39. <view>{{minItem.createTime}}</view>
  40. </view>
  41. <view class="num-p" :class="minItem.points>0?'colorA':(minItem.points<0?'colorB':'')">{{minItem.points>0?'+'+minItem.points:minItem.points}}</view>
  42. </view>
  43. <view class="for-null-title" v-if="!item.elPointsLoginfoList[0]">暂无数据</view>
  44. </view>
  45. <img class="null-img" v-if="!infoList[0]" src="@/images/basicsModules/null-data-1.png">
  46. </scroll-view>
  47. <view class="shade-max-box" v-if="shadeType">
  48. <view class="shade-big-box">
  49. <view class="shade-title-box">
  50. <view class="img-box"></view>
  51. <view class="title-view">信用分规则</view>
  52. <view class="img-box" @click="shadeTypeButton">
  53. <img src="@/images/basicsModules/icon_jlfgz_gb.png">
  54. </view>
  55. </view>
  56. <view class="shade-text-max-box">
  57. <view class="shade-text-title title-colorA">获得</view>
  58. <view class="shade-text-p">满足信用合格分获取条件,获得信用合格分;完成违规处理恢复信用分。</view>
  59. <view class="shade-text-title title-colorB">减扣</view>
  60. <view class="shade-text-p">违规扣分;及时进行违规处理,通过在安全学习与考试一体机学习、考试、做题等方式恢复。</view>
  61. </view>
  62. <view class="shade-button" @click="shadeTypeButton">知道了</view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import { monthAllCount, monthCountPoints } from '@/api/apiDemo/index.js'
  69. export default {
  70. name: "creditPoints",
  71. data() {
  72. return {
  73. //遮罩层开关状态
  74. shadeType:false,
  75. //选项数据
  76. pickerList:[
  77. {
  78. name:"全部",
  79. value:"0",
  80. },
  81. {
  82. name:"获得",
  83. value:"1",
  84. },
  85. {
  86. name:"减扣",
  87. value:"2",
  88. },
  89. ],
  90. pickerIndex:0,
  91. //用户数据
  92. deductPoints:"",
  93. obtainPoints:"",
  94. //列表数据
  95. infoList:[],
  96. getData:{
  97. page:1,
  98. pageSize:20,
  99. getType:true,
  100. nullDataType:true,
  101. },
  102. //年月
  103. yearMonth:"",
  104. }
  105. },
  106. onPullDownRefresh(){
  107. this.page = 1;
  108. this.infoList = [];
  109. this.yearMonth = "";
  110. this.getList();
  111. },
  112. onLoad() {
  113. this.getMonthAllCount();
  114. this.getList();
  115. },
  116. methods: {
  117. //遮罩层开关
  118. shadeTypeButton(){
  119. this.shadeType = !this.shadeType;
  120. },
  121. //分类选择触发
  122. bindPickerChange(data){
  123. this.page = 1;
  124. this.infoList = [];
  125. this.pickerIndex = data.detail.value;
  126. this.getList();
  127. },
  128. //时间选择触发
  129. bindDateChange(data){
  130. this.page = 1;
  131. this.infoList = [];
  132. this.yearMonth = data.detail.value;
  133. this.getList();
  134. },
  135. //月数据展开关闭
  136. moonClick(item){
  137. item.unfoldType = !item.unfoldType;
  138. },
  139. //滚动事件
  140. scrollGet(){
  141. if(this.getData.getType){
  142. this.getData.page += 1;
  143. this.getList();
  144. }
  145. },
  146. //获取总值
  147. async getMonthAllCount(){
  148. let obj = {
  149. pointsType:"1"
  150. };
  151. const {data} = await monthAllCount(obj);
  152. if(data.code==200){
  153. this.deductPoints = data.data.deductPoints;
  154. this.obtainPoints = data.data.obtainPoints;
  155. }
  156. },
  157. //获取列表数据
  158. async getList(){
  159. let self = this;
  160. let obj = {
  161. bonusType:this.pickerIndex,
  162. pointsType:"1",
  163. yearMonth:this.yearMonth,
  164. pageNum:this.getData.page,
  165. pageSize:this.getData.pageSize,
  166. };
  167. const {data} = await monthCountPoints(obj);
  168. if(data.code==200){
  169. for(let i=0;i<data.rows.length;i++){
  170. data.rows[i].unfoldType = true
  171. }
  172. if(self.page==1){
  173. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  174. self.infoList = data.rows;
  175. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  176. self.infoList = data.rows;
  177. self.getData.getType = false;
  178. self.getData.nullDataType = true;
  179. }else{
  180. self.getData.getType = false;
  181. self.getData.nullDataType = true;
  182. }
  183. }else{
  184. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  185. self.infoList = self.infoList.concat(data.rows)
  186. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  187. self.infoList = self.infoList.concat(data.rows);
  188. self.getData.getType = false;
  189. self.getData.nullDataType = true;
  190. }else{
  191. self.getData.getType = false;
  192. self.getData.nullDataType = true;
  193. }
  194. }
  195. wx.stopPullDownRefresh();
  196. }
  197. },
  198. }
  199. }
  200. </script>
  201. <style lang="stylus" scoped>
  202. #creditPoints{
  203. height:100%;
  204. width:100%;
  205. display flex
  206. flex-direction column
  207. .top-title-box{
  208. height:100rpx;
  209. background #fff
  210. border-bottom:20rpx solid #f5f5f5;
  211. display flex
  212. .top-title-button-box{
  213. width:150rpx;
  214. height:60rpx;
  215. display flex
  216. border-radius:30rpx;
  217. background #0183fa
  218. margin:20rpx;
  219. view{
  220. flex:1;
  221. color:#fff;
  222. text-align center
  223. font-size:26rpx;
  224. line-height:60rpx;
  225. }
  226. img{
  227. width:24rpx;
  228. height:14rpx;
  229. margin:24rpx 25rpx 0 0;
  230. }
  231. }
  232. .top-title-null-p{
  233. flex:1;
  234. }
  235. .top-title-get{
  236. line-height:100rpx;
  237. font-size:26rpx;
  238. margin-right:20rpx;
  239. }
  240. .top-title-exchange{
  241. line-height:100rpx;
  242. font-size:26rpx;
  243. }
  244. .top-title-img{
  245. height:100rpx;
  246. width:100rpx;
  247. img{
  248. width:28rpx;
  249. height:28rpx;
  250. margin:38rpx 36rpx 0 36rpx;
  251. }
  252. }
  253. }
  254. .for-max-box{
  255. flex:1;
  256. overflow-y scroll
  257. .for-min-box{
  258. .for-top-title{
  259. background #e0e0e0
  260. line-height:80rpx;
  261. display: flex
  262. font-size:26rpx;
  263. color:#333;
  264. padding:0 20rpx;
  265. .left-box{
  266. .for-top-title-time{
  267. margin-right:20rpx;
  268. }
  269. }
  270. .right-box{
  271. display flex
  272. flex:1;
  273. .img-one{
  274. margin-top:36rpx;
  275. width:24rpx;
  276. height:12rpx;
  277. }
  278. .img-two{
  279. margin-top:28rpx;
  280. width:12rpx;
  281. height:24rpx;
  282. }
  283. .for-top-title-null{
  284. flex:1;
  285. }
  286. .for-top-title-get{
  287. }
  288. .for-top-title-border{
  289. height:26rpx;
  290. margin:28rpx 18rpx;
  291. width:1rpx;
  292. background #999
  293. }
  294. .for-top-title-exchange{
  295. }
  296. }
  297. }
  298. .for-list-min-box{
  299. // height:110rpx;
  300. display flex
  301. padding:0 20rpx;
  302. background #fff
  303. border-top:1rpx solid #e0e0e0;
  304. img{
  305. margin:42rpx 25rpx 0 0;
  306. height:26rpx;
  307. width:30rpx;
  308. }
  309. .time-box{
  310. flex:1;
  311. view:nth-child(1){
  312. padding-top:6px;
  313. line-height:30rpx;
  314. margin-top:13rpx;
  315. font-size:24rpx;
  316. color:#333;
  317. display: -webkit-box;
  318. -webkit-box-orient: vertical;
  319. -webkit-line-clamp: 3;
  320. overflow: hidden;
  321. }
  322. view:nth-child(2){
  323. line-height:39rpx;
  324. font-size:24rpx;
  325. color:#999;
  326. padding-bottom:6px;
  327. }
  328. }
  329. .num-p{
  330. margin-left:20rpx;
  331. line-height:110rpx;
  332. font-size:24rpx;
  333. font-weight:700;
  334. }
  335. .colorA{
  336. color:#0b8d0e;
  337. }
  338. .colorB{
  339. color:#ff9300;
  340. }
  341. }
  342. .for-null-title{
  343. text-align:center;
  344. line-height:110rpx;
  345. color:#999;
  346. font-size:24rpx;
  347. }
  348. }
  349. .null-img{
  350. display block
  351. width:276rpx;
  352. height:321rpx;
  353. position absolute
  354. top:100rpx;
  355. left:274rpx;
  356. }
  357. }
  358. .shade-max-box{
  359. width:100%;
  360. height:100%;
  361. position fixed
  362. top:0;
  363. left:0;
  364. background rgba(0,0,0,0.4)
  365. .shade-big-box{
  366. width:528rpx;
  367. height:560rpx;
  368. border-radius:10rpx;
  369. background #fff
  370. position absolute
  371. left:50%;
  372. top:50%;
  373. margin-left:-264rpx;
  374. margin-top:-280rpx;
  375. display flex
  376. flex-direction column
  377. .shade-title-box{
  378. height:88rpx;
  379. display flex
  380. .title-view{
  381. font-size:28rpx;
  382. color:#333;
  383. flex:1;
  384. text-align center;
  385. line-height:88rpx;
  386. }
  387. .img-box{
  388. width:68rpx;
  389. height:68rpx;
  390. img{
  391. height:28rpx;
  392. width:28rpx;
  393. margin:20rpx;
  394. }
  395. }
  396. }
  397. .shade-text-max-box{
  398. flex:1;
  399. margin:0 37rpx;
  400. .shade-text-title{
  401. line-height:28rpx;
  402. font-size:28rpx;
  403. margin-bottom:24rpx;
  404. }
  405. .shade-text-p{
  406. font-size:24rpx;
  407. margin-bottom:24rpx;
  408. overflow :hidden;
  409. }
  410. .title-colorA{
  411. color:#0B8D0E;
  412. }
  413. .title-colorB{
  414. color:#FF9300;
  415. }
  416. }
  417. .shade-button{
  418. width:300rpx;
  419. height:60rpx;
  420. text-align center;
  421. line-height:60rpx;
  422. color:#fff;
  423. font-size:28rpx;
  424. background #0183FA
  425. border-radius:10rpx;
  426. margin:0 auto 40rpx;
  427. }
  428. }
  429. }
  430. }
  431. </style>