detail.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view style="padding: 24rpx;">
  3. <view class="Detailbox" v-for="(item,index) in list" :key="index">
  4. <view class="Detailbox_top">
  5. <view class="left">
  6. <view class="title">
  7. {{ item.title }}
  8. </view>
  9. <text>{{ item.created_at }}</text>
  10. <view class="text">第{{ item.season }}季</view>
  11. </view>
  12. <view :class="item.type? 'right jia': 'right'">
  13. {{ item.bonus }}
  14. </view>
  15. </view>
  16. <view class="Detailbox_bottom">
  17. {{ item.remark }}
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import { GetBonusLog } from '../../api.js'
  24. export default {
  25. data() {
  26. return {
  27. list: []
  28. }
  29. },
  30. onLoad() {
  31. this.getBound()
  32. },
  33. methods: {
  34. getBound(){
  35. this.$ajax.get(GetBonusLog).then(([, { data: res }]) => {
  36. //获取奖学金明细
  37. if(res.data.list.length > 0) {
  38. this.list = res.data.list
  39. console.log(this.list)
  40. res.data.list.forEach(function(value,index,arr){
  41. if(value.bonus> 0) {
  42. value.bonus = '+' + value.bonus
  43. value.type = 1
  44. } else {
  45. value.type = 0
  46. }
  47. })
  48. } else {
  49. uni.showModal({
  50. content: '暂无明细',
  51. showCancel: false,
  52. success:function(){
  53. uni.navigateBack({
  54. delta:1
  55. })
  56. }
  57. })
  58. }
  59. })
  60. },
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. page {
  66. background-color: #F5F5F5;
  67. }
  68. .Detailbox {
  69. background-color: #fff;
  70. padding: 24rpx;
  71. border-radius: 16rpx;
  72. margin-bottom: 24rpx;
  73. &_top {
  74. display: flex;
  75. justify-content: space-between;
  76. align-items: center;
  77. padding-bottom: 20rpx;
  78. .left {
  79. .title {
  80. font-size: 34rpx;
  81. font-weight: bold;
  82. margin-bottom: 16rpx;
  83. }
  84. text{
  85. font-size: 28rpx;
  86. color: #999999;
  87. }
  88. .text {
  89. font-size: 28rpx;
  90. color: #999999;
  91. margin-top: 10rpx;
  92. }
  93. }
  94. .right {
  95. font-size: 40rpx;
  96. // font-weight: bold;
  97. font-weight: 500;
  98. color: #FB231F;
  99. }
  100. .jia {
  101. color: #00A54B;
  102. }
  103. }
  104. &_bottom {
  105. font-size: 30rpx;
  106. color: #333333;
  107. font-weight: 400;
  108. padding-top: 20rpx;
  109. border-top: 2rpx solid #EEEEEE;
  110. }
  111. }
  112. </style>