bill.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="bill-box flex-common-css box-sizing-border iPhone-bottom">
  3. <Nav title='账单' titleColor='#333'></Nav>
  4. <view class="box-head">
  5. <view class="box-head-1">
  6. <view class="sys-size-32 view-box" :class="navId === item.id?'sys-color-black-3 sys-weight-600':'sys-color-gray-9'"
  7. v-for="(item,i) in navList" :key="i" @click="selectTo(1,item,i)">{{item.name}}</view>
  8. <view class="xian" :class="navIndex === 0?'left-1':'left-2'"></view>
  9. </view>
  10. <view class="box-head-2 box-sizing-border">
  11. <view class="date-view sys-size-28 sys-color-gray-3" @click="selectTo(2)">
  12. {{fromData.time}}
  13. <uni-icons class='ml-4' type="bottom" size="12" color="#333"></uni-icons>
  14. </view>
  15. <view class="sys-size-28 sys-color-gray-9">仅展示当月订单</view>
  16. </view>
  17. </view>
  18. <view v-if="false" class="no-view sys-size-40 sys-color-gray-9">暂无数据</view>
  19. <scroll-view v-else scroll-y="true" class="box-sizing-border list-scroll">
  20. <view class="list-box" v-for="(item,i) in list" :key="i">
  21. <image v-if="navIndex===0" src="@/static/img/wallet/j.png" mode=""></image>
  22. <image v-else src="@/static/img/wallet/bb.png" mode=""></image>
  23. <view class="box-right">
  24. <view class="box-right-1 mb-4">
  25. <view class="sys-size-32 sys-color-gray-3">收益</view>
  26. <view class="sys-size-36 sys-color-4BC285 sys-weight-600">{{item.side===1?'+':''}}{{item.amount}}</view>
  27. <!-- <view class="sys-size-36 sys-color-gray-3 sys-weight-600">-100</view> -->
  28. </view>
  29. <view class="sys-size-24 sys-color-gray-9">{{item.time}}</view>
  30. </view>
  31. </view>
  32. </scroll-view>
  33. <view class="pop-view" v-if="isPop">
  34. <view class="pop-1"></view>
  35. <view class="pop-title sys-size-32 sys-color-gray-3 sys-weight-600 sys-background-gray-f">
  36. 选择时间
  37. <uni-icons class='close-icon' type="closeempty" size="14" color="#333" @click="selectTo(2)"></uni-icons>
  38. </view>
  39. <view class="pop-list sys-background-gray-f">
  40. <view class="list-box sys-size-26" v-for="(item,i) in dateList" @click="selectTo(2,item)">{{item}}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import tools from "@/service/tools";
  47. import {getCashFlowHistoryPage, getDailyEarnings, getMyLikeMoments} from "@/api/my";
  48. export default {
  49. data(){
  50. return{
  51. isPop:false,
  52. page:1,
  53. total:0,
  54. list:[],
  55. navId:1,
  56. navIndex:0,
  57. navList:[{name:'JM币',id:1},{name:'波点',id:2},],
  58. dateList:[],
  59. endTime:'',
  60. fromData:{
  61. time:'',
  62. },
  63. }
  64. },
  65. mounted() {
  66. this.endTime = tools.getDateYM();
  67. this.fromData.time = this.endTime;
  68. this.dateList = tools.getCustomTimeList('2020-01',this.endTime,'y-m')
  69. this.startList()
  70. },
  71. methods:{
  72. startList(){
  73. if(this.userId<=0){
  74. // return false
  75. }
  76. this.list=[]
  77. this.isAjax=false
  78. this.total=undefined
  79. this.page=1
  80. this.getCashFlowHistoryPage()
  81. },
  82. getCashFlowHistoryPage(){
  83. if(this.isAjax){
  84. return
  85. }
  86. this.isAjax=true
  87. let that=this
  88. getCashFlowHistoryPage({'pageNo':this.page,'pageSize':20,'type':this.navId,'month':this.fromData.time}).then((res)=>{
  89. this.isAjax=false
  90. if(res.code===0){
  91. res.data.data.forEach((item)=>{
  92. that.list.push(item )
  93. })
  94. ++that.page
  95. that.total=res.data.total
  96. }
  97. })
  98. },
  99. selectTo(type,item,i){
  100. if(type === 1){
  101. if(this.navId !== item.id){
  102. this.navId = item.id;
  103. this.navIndex = i;
  104. this.fromData.time = this.endTime;
  105. this.startList()
  106. }
  107. }else if(type === 2){
  108. if(item){
  109. this.fromData.time = item;
  110. this.startList()
  111. }
  112. this.isPop = !this.isPop;
  113. }
  114. },
  115. },
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .bill-box{
  120. .ml-4{
  121. margin-left: 4rpx;
  122. }
  123. .mb-4{
  124. margin-bottom: 4rpx;
  125. }
  126. .pop-view{
  127. width: 100%;
  128. height: 100vh;
  129. background-color: rgba(0, 0, 0, 0.5);
  130. position: absolute;
  131. top: 0;
  132. left: 0;
  133. z-index: 201;
  134. display: flex;
  135. flex-direction: column;
  136. .pop-1{
  137. height: 30%;
  138. }
  139. .pop-title{
  140. height: 90rpx;
  141. line-height: 90rpx;
  142. text-align: center;
  143. border-bottom: 1px solid #e3e3e3;
  144. position: relative;
  145. border-radius: 16rpx 16rpx 0 0;
  146. .close-icon{
  147. position: absolute;
  148. right: 32rpx;
  149. }
  150. }
  151. .pop-list{
  152. flex: 1;
  153. overflow: auto;
  154. .list-box{
  155. height: 90rpx;
  156. line-height: 90rpx;
  157. text-align: center;
  158. border-bottom: 1px solid #e3e3e3;
  159. }
  160. }
  161. }
  162. .no-view{
  163. text-align: center;
  164. margin-top: 200rpx;
  165. }
  166. .list-scroll{
  167. flex: 1;
  168. overflow: auto;
  169. padding: 8rpx 32rpx;
  170. .list-box{
  171. box-sizing: border-box;
  172. padding: 32rpx 0;
  173. border-bottom: 1rpx solid #EEEEEE;
  174. display: flex;
  175. image{
  176. width: 96rpx;
  177. height: 96rpx;
  178. margin-right: 20rpx;
  179. }
  180. .box-right{
  181. flex: 1;
  182. .box-right-1{
  183. display: flex;
  184. justify-content: space-between;
  185. }
  186. }
  187. }
  188. }
  189. .box-head{
  190. .box-head-1{
  191. width: 100%;
  192. height: 94rpx;
  193. display: flex;
  194. position: relative;
  195. border-bottom: 1rpx solid #EEEEEE;
  196. .view-box{
  197. flex: 1;
  198. line-height: 94rpx;
  199. text-align: center;
  200. }
  201. .xian{
  202. width: 40rpx;
  203. height: 4rpx;
  204. background-color: #333;
  205. position: absolute;
  206. bottom: 0;
  207. }
  208. .left-1{
  209. left: 168rpx;
  210. transition: all 0.5s;
  211. }
  212. .left-2{
  213. left: 545rpx;
  214. transition: all 0.5s;
  215. }
  216. }
  217. .box-head-2{
  218. display: flex;
  219. justify-content: space-between;
  220. align-items: center;
  221. padding: 38rpx 32rpx 0 32rpx;
  222. .date-view{
  223. width: 200rpx;
  224. height: 56rpx;
  225. line-height: 56rpx;
  226. text-align: center;
  227. background: #F2F2F2;
  228. border-radius: 200rpx;
  229. }
  230. }
  231. }
  232. }
  233. </style>