paylist.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="orderItem" v-for="(item, index) in list" :key="index">
  5. <image class="goodImg"
  6. :src="item.type==0?item.pimage:'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/846cd1a69879ec4f551d44e87c7500bf.png'">
  7. </image>
  8. <view class="orderInfo">
  9. <view class="info1">
  10. <view>{{ item.type==0?item.pname:'提现'}}</view>
  11. <view :class="item.type==0?'color1':''">{{ item.type==0?'+'+item.money:'-'+item.money}}</view>
  12. </view>
  13. <view class="info3" v-if="item.type==0">
  14. <view>实付:¥{{ item.order_price }}</view>
  15. <view :class="true?'color1':''" v-if="item.score">+{{ item.score }}积分</view>
  16. </view>
  17. <view class="info2" v-if="item.type==0">
  18. <view>二级分销</view>
  19. </view>
  20. <view class="info2">
  21. <!-- <view>{{ parse.filterTime(item.create) }}</view> -->
  22. <view class="">
  23. {{ parse.filterTime(item.createtime) }}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view v-if="!list.length" style='color:#999;text-align:center;margin:150rpx 0;font-size:30rpx'>暂无数据</view>
  29. </view>
  30. </view>
  31. </template>
  32. <script module="parse" lang="wxs">
  33. module.exports = {
  34. filterTime: function(time) {
  35. console.log(time)
  36. var nowDate = getDate(time * 1000);
  37. var year = nowDate.getFullYear();
  38. var month = nowDate.getMonth() + 1;
  39. var date = nowDate.getDate();
  40. var hours = nowDate.getHours();
  41. var minutes = nowDate.getMinutes();
  42. var seconds = nowDate.getSeconds();
  43. month = month > 9 ? month : '0' + month;
  44. date = date > 9 ? date : '0' + date;
  45. hours = hours > 9 ? hours : '0' + hours;
  46. minutes = minutes > 9 ? minutes : '0' + minutes;
  47. seconds = seconds > 9 ? seconds : '0' + seconds;
  48. return year + '-' + month + '-' + date + " " + hours + ":" + minutes + ":" + seconds;
  49. }
  50. }
  51. </script>
  52. <script>
  53. // pages/backstage/index/index.js
  54. var app = getApp();
  55. // import { request } from '../../../utils/request.js';
  56. export default {
  57. data() {
  58. return {
  59. page: 1,
  60. pageSize: 10,
  61. list: [],
  62. loaded: false,
  63. };
  64. }
  65. /**
  66. * 生命周期函数--监听页面加载
  67. */
  68. ,
  69. onLoad: function(options) {
  70. // this.getlist();
  71. },
  72. /**
  73. * 生命周期函数--监听页面初次渲染完成
  74. */
  75. onReady: function() {},
  76. /**
  77. * 生命周期函数--监听页面显示
  78. */
  79. onShow: function() {},
  80. /**
  81. * 生命周期函数--监听页面隐藏
  82. */
  83. onHide: function() {},
  84. /**
  85. * 生命周期函数--监听页面卸载
  86. */
  87. onUnload: function() {},
  88. /**
  89. * 页面相关事件处理函数--监听用户下拉动作
  90. */
  91. onPullDownRefresh: function() {
  92. this.init();
  93. this.getlist();
  94. uni.stopPullDownRefresh();
  95. },
  96. /**
  97. * 页面上拉触底事件的处理函数
  98. */
  99. onReachBottom: function() {
  100. this.loaded || this.getlist();
  101. },
  102. /**
  103. * 用户点击右上角分享
  104. */
  105. onShareAppMessage: function() {},
  106. methods: {
  107. async getlist() {
  108. var that = this;
  109. let res = await this.$api.request('/wallet/money_log', 'GET', {
  110. page: this.page,
  111. limit: this.pageSize
  112. });
  113. console.log(res)
  114. if (res) {
  115. if (res.data.length > 0) {
  116. this.list = this.list.concat(res.data);
  117. this.page++;
  118. } else {
  119. this.loaded = true
  120. this.$api.msg('没有更多数据');
  121. }
  122. }
  123. },
  124. init() {
  125. this.page = 1
  126. this.loaded = false
  127. this.list = []
  128. }
  129. }
  130. };
  131. </script>
  132. <style>
  133. page {
  134. background: #f4f5f9;
  135. }
  136. .content {
  137. margin: 26rpx;
  138. background: #fff;
  139. border-radius: 20rpx;
  140. }
  141. .orderItem {
  142. display: flex;
  143. align-items: center;
  144. padding: 30rpx 20rpx;
  145. border-bottom: 1px solid #e4e5ee;
  146. box-sizing: border-box;
  147. }
  148. .orderItem>image {
  149. width: 116rpx;
  150. height: 116rpx;
  151. border-radius: 12rpx;
  152. }
  153. .orderInfo {
  154. display: flex;
  155. flex-direction: column;
  156. flex: 1;
  157. justify-content: space-between;
  158. margin-left: 18rpx;
  159. }
  160. .info1 {
  161. display: flex;
  162. align-items: center;
  163. justify-content: space-between;
  164. margin-bottom: 8rpx;
  165. }
  166. .info1>view:nth-child(1) {
  167. font-size: 28rpx;
  168. width: 300rpx;
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. white-space: nowrap;
  172. color: #010101;
  173. }
  174. .info1>view:nth-child(2) {
  175. font-size: 28rpx;
  176. }
  177. .info2 {
  178. display: flex;
  179. align-items: center;
  180. justify-content: space-between;
  181. margin-top: 6rpx;
  182. }
  183. .info2>view:nth-child(1) {
  184. color: #9194a6;
  185. }
  186. .info3 {
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. }
  191. .info3>view:nth-child(1) {
  192. font-size: 24rpx;
  193. color: #9194a6;
  194. }
  195. .info3>view:nth-child(2) {
  196. font-size: 28rpx;
  197. }
  198. .color1 {
  199. color: #EC8E02 !important;
  200. }
  201. view {
  202. font-size: 24rpx;
  203. }
  204. .goodImg {
  205. width: 100rpx;
  206. height: 100rpx;
  207. border-radius: 12rpx;
  208. }
  209. </style>