order.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!-- 我的 -->
  2. <template>
  3. <view class="page">
  4. <ul class="user_list">
  5. <li v-for="(value,index) in orderlist" :key="index">
  6. <div >
  7. <span style="color: #666; ">类型:</span>{{recharge_type_arr[value.type]}}
  8. <span style="float: right;font-weight: 600" >
  9. <span style="color:#F73E54" v-if="value.money>0">+{{value.money}}元</span>
  10. <span style="color:green" v-else>{{value.money}}元</span>
  11. </span>
  12. </div>
  13. <div style="color: #666; ">
  14. 时间:{{$action.timestampToTime(value['time'])}}
  15. </div>
  16. <div style="color: #666; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; word-break: break-all;">
  17. 说明:{{value.content}}
  18. </div>
  19. </li>
  20. </ul>
  21. <view class="loading" v-if="loading && loadstatus=='loading'" >
  22. <view class="spinner">
  23. <view class="rect1"></view>
  24. <view class="rect2"></view>
  25. <view class="rect3"></view>
  26. <view class="rect4"></view>
  27. <view class="rect5"></view>
  28. </view>
  29. </view>
  30. <view v-if="loading && loadstatus=='nomore'" style="text-align: center;height: 30px;line-height: 30px;" >
  31. 亲爱的到底了
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import http from "../../library/http.js"
  37. export default {
  38. data(){
  39. return {
  40. recharge_type_arr:{recharge:"充值",plat:'提现',yongjin:'佣金',reward:'打赏',sign:'签到',task:'任务','redpacket':'红包','buy':'消费'},
  41. userid:uni.getStorageSync('access_token'),
  42. page:1,
  43. type:'',
  44. loading:true,
  45. loadstatus:'loading',
  46. orderlist:uni.getStorageSync('orderlist'),
  47. }
  48. },
  49. onShow() {
  50. this.getList()
  51. },
  52. methods:{
  53. getList(){
  54. this.loading=true;
  55. http.setWait(false).post('user.php?act=orderlist',{page:this.page,userid:this.userid}).then(res=>{
  56. this.loading=false;
  57. if(this.page==1){
  58. uni.setStorageSync('orderlist',this.orderlist);
  59. this.orderlist= res.data;
  60. }
  61. else{
  62. for(var i=0;i<res.data.length;i++){
  63. this.orderlist.push(res.data[i]);
  64. }
  65. if(res.data.length<20) {
  66. this.loading=true;
  67. this.loadstatus='nomore';
  68. }
  69. }
  70. })
  71. }
  72. },
  73. onReachBottom() {
  74. this.page++;
  75. this.getList();
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. ul,li,table,td,th{
  81. margin: 0px 0px;
  82. padding: 0px 0px;
  83. }
  84. .user_list{
  85. display: inline-block;
  86. width:100%;
  87. height: auto;
  88. line-height: 25px;
  89. }
  90. .user_list li{
  91. background-color: #fff;
  92. line-height: 25px;
  93. width: calc(100% - 20px);
  94. padding: 5px 10px;
  95. border-bottom: 1px #ddd dashed;
  96. border-top: 1px #ddd dashed;
  97. display: inline-block;
  98. margin-top: 10px;
  99. }
  100. .user_list li > div{
  101. display: inline-block;
  102. width: 100%;
  103. height: 25px;
  104. line-height: 25px;
  105. text-align: left;
  106. }
  107. .page{
  108. background-color: #fafafa;
  109. font-size: 14px;
  110. }
  111. .loading {
  112. //loading动画
  113. display: flex;
  114. justify-content: center;
  115. padding-bottom: 20px;
  116. @keyframes stretchdelay {
  117. 0%,
  118. 40%,
  119. 100% {
  120. transform: scaleY(0.6);
  121. }
  122. 20% {
  123. transform: scaleY(1.0);
  124. }
  125. }
  126. .spinner {
  127. margin: 20upx 0;
  128. width: 60upx;
  129. height: 25px;
  130. display: flex;
  131. align-items: center;
  132. justify-content: space-between;
  133. view {
  134. background-color: #ff9800;
  135. height: 25px;
  136. width: 3px;
  137. border-radius: 3px;
  138. animation: stretchdelay 1.2s infinite ease-in-out;
  139. }
  140. .rect2 {
  141. animation-delay: -1.1s;
  142. }
  143. .rect3 {
  144. animation-delay: -1.0s;
  145. }
  146. .rect4 {
  147. animation-delay: -0.9s;
  148. }
  149. .rect5 {
  150. animation-delay: -0.8s;
  151. }
  152. }
  153. }
  154. </style>