rechargeHistory.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view>
  3. <view>
  4. <view>
  5. <u-list @scrolltolower="scrolltolower">
  6. <view class="hand">
  7. <uni-row>
  8. <uni-col :span="10">
  9. <u--text text="所属机构" size="22" bold color="#619f8a"></u--text>
  10. </uni-col>
  11. <uni-col :span="14">
  12. <u--text :text="data.organizationName" size="22" bold color="#757575">
  13. </u--text>
  14. </uni-col>
  15. </uni-row>
  16. </view>
  17. <view v-if="indexList.length === 0" style="padding: 0 50px;">
  18. <image style="margin: 0 auto; width: 100%;" src="../../static/img/page/empty_view.png">
  19. </image>
  20. </view>
  21. <u-list-item v-for="(item, index) in indexList" :key="index">
  22. <view class="listItemStyle">
  23. <u-row>
  24. <u-col v-if="item.moneyType === 1" class="orderFoodStyle orderFoodType0">[机构充值]
  25. </u-col>
  26. <u-col v-if="item.moneyType === 2">
  27. <view class="orderFoodStyle orderFoodType0">
  28. [个人充值]
  29. </view>
  30. </u-col>
  31. <u-col v-if="item.moneyType === 3">
  32. <view class="orderFoodStyle orderFoodType0">
  33. [记账额度]
  34. </view>
  35. </u-col>
  36. <u-col v-if="item.moneyType === 4">
  37. <view class="orderFoodStyle orderFoodType0">
  38. [押金充值]
  39. </view>
  40. </u-col>
  41. <u-col v-if="item.moneyType === 5">
  42. <view class="orderFoodStyle orderFoodType0">
  43. [因错退还]
  44. </view>
  45. </u-col>
  46. <u-col v-if="item.moneyType === 6">
  47. <view class="orderFoodStyle orderFoodType0">
  48. [余额退还]
  49. </view>
  50. </u-col>
  51. <u-col v-if="item.moneyType === 7">
  52. <view class="orderFoodStyle orderFoodType0">
  53. [押金退还]
  54. </view>
  55. </u-col>
  56. <u-col v-if="item.moneyType === 8">
  57. <view class="orderFoodStyle orderFoodType0">
  58. [额度调整]
  59. </view>
  60. </u-col>
  61. </u-row>
  62. <u-row>
  63. <u-col span="6" class="orderTimeText">{{item.rechargeTime}}</u-col>
  64. <u-col span="6" textAlign="right" class="moneyPlusText">
  65. {{item.rechargeIntegral+"¥"}}
  66. </u-col>
  67. <!-- <u-col span="6" v-if="item.moneyType === 4" textAlign="right" class="moneyMinusText">
  68. {{item.rechargeIntegral+"¥"}}
  69. </u-col> -->
  70. </u-row>
  71. </view>
  72. </u-list-item>
  73. </u-list>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. dateShow: false,
  83. changeDate: Number(new Date()),
  84. data: {
  85. organizationName: "梅陇卫生服务中心",
  86. },
  87. from: {},
  88. pageNum: 1,
  89. pageSize: 10,
  90. indexList: [],
  91. total: 1
  92. }
  93. },
  94. onLoad() {
  95. this.getRechargeHistoryList()
  96. },
  97. methods: {
  98. async getRechargeHistoryList() {
  99. if (this.indexList.length >= this.total) {
  100. return;
  101. }
  102. this.from.userName = uni.getStorageSync('userInfo').userName
  103. this.from.organizationCode = uni.getStorageSync('orgInfo').organizationCode
  104. this.data.organizationName = uni.getStorageSync('orgInfo').organizationName
  105. // 发送请求
  106. const {
  107. data: res
  108. } = await this.$httpRequest({
  109. url: '/app/getRecharge?' + "pageNum=" + this.pageNum + "&" + "pageSize=" + this.pageSize,
  110. method: 'post',
  111. data: this.from,
  112. urlType: this.$getUrlType()
  113. });
  114. if (res.code === 200) {
  115. this.total = res.total
  116. this.loadmore(res.rows)
  117. }
  118. },
  119. submitDate(e) {
  120. this.dateShow = false
  121. //使用change事件中的日期数据 防止用户快速滑动同时点击确定后数据丢失
  122. this.from.date = this.changeDate
  123. //获取消费信息
  124. this.indexList = this.getRechargeHistoryList()
  125. },
  126. change(e) {
  127. this.changeDate = this.result(e.value, e.mode)
  128. },
  129. scrolltolower() {
  130. this.getRechargeHistoryList()
  131. },
  132. loadmore(data) {
  133. if (data.length === 0) {
  134. return;
  135. }
  136. for (var i = 0; i < data.length; i++) {
  137. this.indexList.push(data[i])
  138. }
  139. },
  140. formatter(type, value) {
  141. if (type === 'year') {
  142. return `${value}年`
  143. }
  144. if (type === 'month') {
  145. return `${value}月`
  146. }
  147. if (type === 'day') {
  148. return `${value}日`
  149. }
  150. return value
  151. },
  152. result(time, mode) {
  153. const timeFormat = uni.$u.timeFormat
  154. switch (mode) {
  155. case 'datetime':
  156. return timeFormat(time, 'yyyy-mm-dd hh:MM')
  157. case 'date':
  158. return timeFormat(time, 'yyyy-mm-dd')
  159. case 'year-month':
  160. return timeFormat(time, 'yyyy-mm')
  161. case 'time':
  162. return time
  163. default:
  164. return ''
  165. }
  166. }
  167. }
  168. }
  169. </script>
  170. <style>
  171. .hand {
  172. padding: 5%;
  173. border-radius: 10px 10px 0 0;
  174. background: linear-gradient(to bottom right, #85c1bf, #f1fef9);
  175. }
  176. .orgTop {
  177. margin-bottom: 5px;
  178. }
  179. .sxButton {
  180. width: 100px;
  181. display: flex;
  182. flex-direction: column;
  183. align-items: center;
  184. }
  185. .listTermDate {
  186. padding: 10px 0;
  187. }
  188. .listItemStyle {
  189. padding: 10px;
  190. border-bottom: 1px solid #d8d8d8;
  191. border-top: 1px solid #d8d8d8;
  192. }
  193. .orderFoodStyle {
  194. font-size: 22px;
  195. }
  196. .orderFoodType0 {
  197. color: #1787ff;
  198. }
  199. .orderFoodType1 {
  200. color: #000000;
  201. }
  202. .moneyPlusText {
  203. font-size: 26px;
  204. color: #40a25d;
  205. }
  206. .moneyMinusText {
  207. font-size: 26px;
  208. color: #b30000;
  209. }
  210. .orderTimeText {
  211. position: relative;
  212. top: 5px;
  213. color: #bebebe;
  214. font-size: 14px;
  215. }
  216. </style>