addList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 1rpx;"></view>
  4. <empty v-if="loaded === true && list.length === 0"></empty>
  5. <view v-for="(item, index) in list" :key="index" class="order-item flex">
  6. <view class="title-box flex_item">
  7. <view class="title-avatar">
  8. <image src="../../static/icon/jl-na.png"></image>
  9. </view>
  10. <view class="list-tpl">
  11. <view class="title">
  12. <view class="title-name clamp">{{ item.name }}</view>
  13. </view>
  14. <view class="time">
  15. <text>{{item.create_time}}</text>
  16. </view>
  17. </view>
  18. <view class="list-right">
  19. <view class="je">
  20. 金额:{{item.money || '0'}}
  21. </view>
  22. <view class="">
  23. {{item.status == 0?'进行中': (item.status == 1?'待核销':(item.status == 2?'已核销':'失败'))}}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <uni-load-more :status="loadingType"></uni-load-more>
  29. </view>
  30. </template>
  31. <script>
  32. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  33. import empty from '@/components/empty';
  34. import {getActionList,getAddList} from '@/api/index.js'
  35. export default {
  36. components: {
  37. uniLoadMore,
  38. empty
  39. },
  40. data() {
  41. return {
  42. page: 1,
  43. limit: 10,
  44. loadingType: 'more',
  45. loaded: false,
  46. list: []
  47. }
  48. },
  49. onLoad(opt) {
  50. },
  51. onShow() {
  52. this.getList()
  53. },
  54. onReachBottom() {
  55. },
  56. onReady() {
  57. },
  58. methods: {
  59. getList() {
  60. let that = this
  61. getAddList({
  62. page: that.page,
  63. limit: that.limit
  64. }).then(res => {
  65. that.list = res.data
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. .order-item {
  73. padding: 20rpx 30rpx;
  74. line-height: 1.5;
  75. background-color: #fff;
  76. .title-box {
  77. width: 100%;
  78. .title-avatar {
  79. flex-shrink: 0;
  80. width: 54rpx;
  81. height: 54rpx;
  82. margin-right: 25rpx;
  83. border-radius: 100%;
  84. image {
  85. width: 100%;
  86. height: 100%;
  87. border-radius: 100%;
  88. }
  89. }
  90. .list-right {
  91. text-align: right;
  92. flex-shrink: 0;
  93. font-size: 22rpx;
  94. font-weight: 400;
  95. color: #999999;
  96. .je {
  97. font-size: 28rpx;
  98. font-weight: bold;
  99. color: #FF4C4C;
  100. }
  101. }
  102. .list-tpl {
  103. // width: 85%;
  104. flex-grow: 1;
  105. .title {
  106. display: flex;
  107. justify-content: flex-start;
  108. font-size: $font-lg;
  109. color: $font-color-base;
  110. overflow: hidden; //超出的文本隐藏
  111. text-overflow: ellipsis; //溢出用省略号显示
  112. white-space: nowrap;
  113. line-height: 1;
  114. text-align: center;
  115. .title-name {
  116. max-width: 40%;
  117. }
  118. .dl {
  119. margin-left: 10rpx;
  120. width: 93rpx;
  121. height: 32rpx;
  122. border-radius: 16rpx;
  123. image {
  124. width: 93rpx;
  125. height: 32rpx;
  126. border-radius: 16rpx;
  127. }
  128. }
  129. .class {
  130. display: inline-block;
  131. margin-left: 10rpx;
  132. padding: 6rpx;
  133. text-align: center;
  134. border: 1px solid #2e58ff;
  135. border-radius: 16rpx;
  136. font-size: 20rpx;
  137. font-family: PingFang SC;
  138. font-weight: 500;
  139. color: #2e58ff;
  140. }
  141. }
  142. .time {
  143. font-size: $font-lg;
  144. color: $font-color-light;
  145. }
  146. }
  147. }
  148. .money {
  149. width: 50%;
  150. text-align: right;
  151. color: #db1935;
  152. font-size: $font-lg;
  153. }
  154. }
  155. </style>