detailed.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <!--wallet/detailed/detailed.wxml-->
  4. <!-- <view class="ssbox bgfff dflex">
  5. <view class="search dflex">
  6. <image src="/pages/images/ssico.png"></image>
  7. <input placeholder="流水查询" class="flex" value="{{searchTitle}}" bindinput="search" bindconfirm="confirm"
  8. confirm-type="search"></input>
  9. <image src="/pages/images/clear.png" bindtap="clearInput" wx:if="{{searchTitle!=''}}"></image>
  10. </view>
  11. </view> -->
  12. <view v-for="(item, index) in pageList" :key="index" class="pintuan">
  13. <view class="li">
  14. <view class="dflex item">
  15. <view class="pinimgs">
  16. <image src="/wallet/static/wallet/images/purchase.png" mode="aspectFit" class="pinimg" v-if="item.logType==3||item.logType==31">
  17. </image>
  18. <image src="/wallet/static/wallet/images/recharge.png" mode="aspectFit" class="pinimg" v-if="item.logType==6||item.logType==5||item.logType==32||item.logType==7">
  19. </image>
  20. <image src="/wallet/static/wallet/images/commission.png" mode="aspectFit" class="pinimg" v-if="item.logType==1"></image>
  21. <image src="/wallet/static/wallet/images/service.png" mode="aspectFit" class="pinimg" v-if="item.logType==2"></image>
  22. </view>
  23. <view class="pininfo ">
  24. <view class="proname">
  25. <!-- {{item.source==1?item.note:item.sourceStr}} -->
  26. <!-- <text>充值赠送-{{item.changeMoney}}</text> -->
  27. <text>{{item.logTypeName}} </text>
  28. <text class="orderId">NO:{{item.orderId}}</text>
  29. </view>
  30. <view class="operate">
  31. <view class="introduce">
  32. {{item.createDate}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="price">
  37. <view class="give" v-if="item.logType==5">赠送:{{item.giveMenoy}}</view>
  38. <view>
  39. <text v-if="item.logType!=5" :class="item.changeMoney>0?'prc':'prc1'">{{item.changeMoney>0?'+':''}}{{item.changeMoney}}</text>
  40. <text v-if="item.logType==5" :class="item.actuallyMenoy>0?'prc':'prc1'">{{item.actuallyMenoy>0?'+':''}}{{item.actuallyMenoy}}</text>
  41. </view>
  42. <view><text class="num">余额:{{item.currentMoney?item.currentMoney:'0'}}</text></view>
  43. <!-- <view class="btn file" >积分不足</view> -->
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="nodata" v-if="ishow">
  49. <image :src="picUrlss+'empty_dd.png'"></image>
  50. <text>暂无明细</text>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. // wallet/detailed/detailed.js
  56. const route = require("../../utils/route.js");
  57. const req = require("../../utils/request");
  58. export default {
  59. data() {
  60. return {
  61. picUrlss: req.public.picUrls,
  62. searchTitle: '',
  63. isLoad: true,
  64. page: 1,
  65. pageList: "",
  66. ishow: false
  67. };
  68. },
  69. components: {},
  70. props: {},
  71. /**
  72. * 生命周期函数--监听页面加载
  73. */
  74. onLoad: function (options) {},
  75. /**
  76. * 生命周期函数--监听页面显示
  77. */
  78. onShow: function () {
  79. this.balanceLogs();
  80. },
  81. /**
  82. * 生命周期函数--监听页面隐藏
  83. */
  84. onHide: function () {},
  85. /**
  86. * 生命周期函数--监听页面卸载
  87. */
  88. onUnload: function () {},
  89. /**
  90. * 页面相关事件处理函数--监听用户下拉动作
  91. */
  92. onPullDownRefresh: function () {},
  93. /**
  94. * 页面上拉触底事件的处理函数
  95. */
  96. onReachBottom: function () {
  97. this.page++;
  98. this.balanceLogs();
  99. },
  100. methods: {
  101. //搜索
  102. search(e) {
  103. console.log(e.detail.value);
  104. this.searchTitle = e.detail.value;
  105. this.setData({
  106. searchTitle: e.detail.value
  107. }); // return e.detail.value.replace(/\s+/g, '').replace(/[^\u4e00-\u9fa5a-zA-Z0-9\w]/g, '');
  108. },
  109. //清除输入框
  110. clearInput() {
  111. this.setData({
  112. searchTitle: ''
  113. });
  114. },
  115. confirm() {
  116. let value = this.searchTitle;
  117. this.toSearch(value, true);
  118. },
  119. // 查询余额明细
  120. balanceLogs() {
  121. let that = this;
  122. let from = {
  123. logType: -1,
  124. page: that.page,
  125. limit: 10
  126. };
  127. let isShowLoading = false;
  128. if (that.page == 1 && !isShowLoading) {
  129. console.log('一直在加载');
  130. req.loadIng('加载中');
  131. isShowLoading = true;
  132. }
  133. if (!that.isLoad) return false;
  134. that.isLoad = false;
  135. route.balanceLogs(from, res => {
  136. if (res && res.length >= 10) that.isLoad = true;
  137. if (that.page > 1) res = that.pageList.concat(res);
  138. console.log(res);
  139. res.map(it => {
  140. it.orderId = it.orderId.substring(it.orderId.length - 6);
  141. });
  142. this.setData({
  143. pageList: res
  144. });
  145. if (this.pageList && this.pageList.length <= 0) {
  146. that.setData({
  147. ishow: true
  148. });
  149. } else {
  150. that.setData({
  151. ishow: false
  152. });
  153. }
  154. if (isShowLoading) {
  155. uni.hideLoading();
  156. isShowLoading = false;
  157. }
  158. });
  159. }
  160. }
  161. };
  162. </script>
  163. <style>
  164. @import "./detailed.css";
  165. </style>