statistics.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="index">
  3. <view class="inde-top">
  4. <view class="item1">
  5. <view class="num">
  6. {{total_order_money}}
  7. </view>
  8. <view class="">
  9. 已发金额
  10. </view>
  11. </view>
  12. <view class="item">
  13. <view class="num">
  14. {{total_order_nums}}/{{total_nums}}
  15. </view>
  16. <view class="">
  17. 已发红包
  18. </view>
  19. </view>
  20. </view>
  21. <view class="list">
  22. <view class="list-item" v-for="(item,index) in list" :key='index'>
  23. <view class="left">
  24. ¥{{item.total_money}}
  25. </view>
  26. <view class="right">
  27. {{item.pay_time}}
  28. </view>
  29. <view class="right1">
  30. {{item.pay_status==0 ? '待支付' : item.pay_status==1 ? '成功' : '失败'}}
  31. </view>
  32. </view>
  33. </view>
  34. <view class="buttom">
  35. <view class="open" @click="getOpen">
  36. </view>
  37. <view class="close" @click="getClose">
  38. </view>
  39. <view class="ref" @click="getStatistical">
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. var app = getApp()
  46. let countTime
  47. export default {
  48. data() {
  49. return {
  50. list: [],
  51. total_nums: '',
  52. total_order_money: '',
  53. total_order_nums: ''
  54. }
  55. },
  56. onLoad(options) {
  57. this.getStatistical()
  58. },
  59. methods: {
  60. getStatistical() {
  61. uni.showLoading({
  62. title: '加载中...',
  63. icon: 'none'
  64. })
  65. app.request('/statistical').then(res => {
  66. console.log(res.data.orders, '2222')
  67. this.list = res.data.orders
  68. this.total_nums = res.data.total_nums
  69. this.total_order_money = res.data.total_order_money
  70. this.total_order_nums = res.data.total_order_nums
  71. uni.hideLoading()
  72. })
  73. },
  74. getOpen() {
  75. uni.showLoading({
  76. title: '加载中...',
  77. icon: 'none'
  78. })
  79. app.request('/open').then(res => {
  80. uni.hideLoading()
  81. console.log(res, 'getOpen')
  82. })
  83. },
  84. getClose() {
  85. uni.showLoading({
  86. title: '加载中...',
  87. icon: 'none'
  88. })
  89. app.request('/close').then(res => {
  90. console.log(res, 'getClose')
  91. uni.hideLoading()
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .index {
  99. .inde-top {
  100. position: fixed;
  101. top: 0;
  102. display: flex;
  103. width: 100%;
  104. padding: 20px 0;
  105. color: #FFFFFF;
  106. background-color: #aca1ff;
  107. .item1,
  108. .item {
  109. flex: 1;
  110. text-align: center;
  111. padding: 20px 10px;
  112. border-radius: 12px;
  113. font-size: 14px;
  114. }
  115. .item1 {
  116. margin-left: 10px;
  117. background-color: #ffb12a;
  118. margin-right: 20px;
  119. }
  120. .item {
  121. margin-right: 10px;
  122. background-color: #ff5f4a;
  123. }
  124. .num {
  125. font-size: 18px;
  126. margin-bottom: 10px;
  127. }
  128. }
  129. .buttom {
  130. position: fixed;
  131. right: 20px;
  132. bottom: 50px;
  133. // background-color: #4CD964;
  134. view {
  135. height: 40px;
  136. text-align: center;
  137. margin-top: 10px;
  138. border-radius: 50%;
  139. width: 40px;
  140. line-height: 40px;
  141. color: #FFFFFF;
  142. }
  143. .open {
  144. background-color: #1ecf1e;
  145. }
  146. .close {
  147. background-color: #fe6357;
  148. }
  149. .ref {
  150. background-color: #069cff;
  151. }
  152. }
  153. .list {
  154. padding: 0 10px;
  155. padding-top: 135px;
  156. // background-color: #9fd9ae;
  157. .list-item {
  158. display: flex;
  159. border-bottom: solid 1px #d5d5d5;
  160. // border-top: solid 1px #d5d5d5;
  161. height: 45px;
  162. line-height: 45px;
  163. font-size: 13px;
  164. .left {
  165. flex: 1;
  166. }
  167. .right {
  168. flex:0 0 50%;
  169. }
  170. .right1 {
  171. flex:1;
  172. }
  173. }
  174. }
  175. }
  176. </style>