index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false">
  4. <view class="navbar">
  5. <view class="navbar-tit">收益明细</view>
  6. <view class="navbar-screen" @click="popupShow = true"><span>筛选</span><u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon></view>
  7. </view>
  8. </u-navbar>
  9. <u-popup v-model="popupShow" mode="top">
  10. <view class="popup-screen">
  11. <view class="screen">
  12. <view class="screen-item">
  13. <view class="screen-head">查询日期</view>
  14. <view class="screen-main">
  15. <u-input v-model="value" :type="type" :border="border" @click="show = true" />
  16. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  17. </view>
  18. </view>
  19. <view class="screen-item">
  20. <view class="screen-head">充电桩类型</view>
  21. <view class="screen-main">
  22. <view class="screen-entry active">全部</view>
  23. <view class="screen-entry">自行车充电</view>
  24. <view class="screen-entry">交流慢充</view>
  25. <view class="screen-entry">直流快充</view>
  26. </view>
  27. </view>
  28. <view class="screen-item">
  29. <view class="screen-head">站点</view>
  30. <view class="screen-main">
  31. <view class="screen-entry active">全部</view>
  32. <view class="screen-entry">荆鹏</view>
  33. <view class="screen-entry">长大</view>
  34. </view>
  35. </view>
  36. <view class="screen-item">
  37. <view class="screen-head">桩号</view>
  38. <view class="screen-main">
  39. <view class="screen-entry active">全部</view>
  40. <view class="screen-entry">A0001</view>
  41. <view class="screen-entry">B0001</view>
  42. <view class="screen-entry">A0003</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="screen-foot">
  47. <view class="screen-btn-l">重置</view>
  48. <view class="screen-btn-r">确定</view>
  49. </view>
  50. </view>
  51. </u-popup>
  52. <view class="detailed">
  53. <template v-for="(item ,index) in list" >
  54. <view class="detailed-time" :key="item.id" v-if="false">
  55. <p>2020年5月1日</p>
  56. <p>共收入 178.00</p>
  57. </view>
  58. <view class="detailed-list"
  59. @click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
  60. :key="item.id">
  61. <view class="detailed-item">
  62. <view class="detailed-item-name">
  63. <h4>{{item.stationName}}/{{item.deviceNo}}</h4>
  64. <p>{{item.createTime}}</p>
  65. </view>
  66. <view class="detailed-item-num">
  67. <h2>{{item.shareProfitAmount}}</h2>
  68. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. </view>
  74. <Tabbar :current="1"></Tabbar>
  75. </view>
  76. </template>
  77. <script>
  78. import Tabbar from '@/components/TabbarFinance.vue'
  79. import * as API from '@/apis/finance.js'
  80. export default {
  81. data() {
  82. return {
  83. form:{
  84. },
  85. startDate:'',
  86. endDate:'',
  87. pageIndex: 1,
  88. recordsTotal: 0,
  89. list: [],
  90. popupShow: false,
  91. tabbarList: [{
  92. iconPath: "bar-chart-box-fill",
  93. selectedIconPath: "bar-chart-box-fill",
  94. text: '统计',
  95. count: 0,
  96. isDot: true,
  97. customIcon: true,
  98. },
  99. {
  100. iconPath: "article-fill",
  101. selectedIconPath: "article-fill",
  102. text: '明细',
  103. midButton: true,
  104. customIcon: true,
  105. },
  106. {
  107. iconPath: "account-pin-box-fill",
  108. selectedIconPath: "account-pin-box-fill",
  109. text: '我的',
  110. count: 0,
  111. isDot: false,
  112. customIcon: true,
  113. },
  114. ],
  115. current: 0,
  116. value: '',
  117. type: 'select',
  118. show: false,
  119. border: true,
  120. actionSheetList: [
  121. {
  122. text: '男'
  123. },
  124. {
  125. text: '女'
  126. },
  127. {
  128. text: '保密'
  129. }
  130. ],
  131. }
  132. },
  133. components: {
  134. Tabbar
  135. },
  136. onReachBottom() {
  137. if (this.list.length < this.recordsTotal) {
  138. this.myLoadmore();
  139. }
  140. },
  141. onReady() {
  142. // this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
  143. // this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  144. this.getList()
  145. },
  146. methods: {
  147. getList(bl) {
  148. uni.showLoading({
  149. title: "加载中",
  150. mask: true,
  151. })
  152. if (bl) {
  153. this.list = [];
  154. this.pageIndex = 1;
  155. }
  156. var data = {
  157. // startDate:this.startDate,
  158. // endDate:this.endDate,
  159. pageIndex: this.pageIndex
  160. };
  161. API.incomeList(data).then((res) => {
  162. this.list = [
  163. ...this.list,
  164. ...res.data.data
  165. ];
  166. this.recordsTotal = res.data.recordsTotal
  167. uni.hideLoading()
  168. }).catch(error => {
  169. uni.showToast({
  170. title: error
  171. })
  172. })
  173. },
  174. myLoadmore() {
  175. this.pageIndex += 1;
  176. this.getList()
  177. },
  178. // 点击actionSheet回调
  179. actionSheetCallback(index) {
  180. this.value = this.actionSheetList[index].text;
  181. }
  182. }
  183. }
  184. </script>
  185. <style>
  186. page{
  187. background-color: #F7F7F7;
  188. }
  189. </style>
  190. <style lang="scss" scoped>
  191. .popup-screen{
  192. padding: 20px;
  193. position: relative;
  194. .screen{
  195. padding-bottom: 30px;
  196. }
  197. .screen-item{
  198. margin-bottom: 20px;
  199. .screen-head{
  200. margin-bottom: 8px;
  201. font-size: 16px;
  202. }
  203. .screen-main{
  204. display: flex;
  205. flex-wrap: wrap;
  206. justify-content: space-between;
  207. }
  208. .screen-entry{
  209. width: 31%;
  210. padding:6px 0;
  211. background-color: #F2F5FA ;
  212. text-align: center;
  213. margin-bottom: 10px;
  214. border-radius: 3px;
  215. }
  216. .screen-entry.active{
  217. background-color: #185AC6;
  218. color:#fff;
  219. }
  220. }
  221. .screen-foot{
  222. position: fixed;
  223. left: 0;
  224. right: 0;
  225. bottom: 0;
  226. display: flex;
  227. height:50px;
  228. border-top: 1px solid #ededed;
  229. .screen-btn-l{
  230. flex: 0.2;
  231. text-align: center;
  232. line-height: 50px;
  233. }
  234. .screen-btn-r{
  235. flex: 0.8;
  236. text-align: center;
  237. line-height: 50px;
  238. background-color: #185AC6;
  239. color:#fff;
  240. }
  241. }
  242. }
  243. .navbar{
  244. display: flex;
  245. justify-content: space-between;
  246. flex: 1;
  247. padding: 0 15px;
  248. }
  249. .navbar-tit{
  250. font-size: 20px;
  251. }
  252. .navbar-screen{
  253. display: flex;
  254. align-items: center;
  255. span{
  256. margin-right: 2px;
  257. color:#999;
  258. }
  259. }
  260. .detailed-time{
  261. display: flex;
  262. justify-content: space-between;
  263. align-items: center;
  264. padding: 10px 20px;
  265. p{
  266. color:#666;
  267. }
  268. }
  269. .detailed-item{
  270. background-color: #fff;
  271. display: flex;
  272. justify-content: space-between;
  273. padding: 10px 20px;
  274. border-bottom: 1px solid #ededed;
  275. .detailed-item-name{
  276. h4{
  277. font-weight: normal;
  278. }
  279. p{
  280. font-size: 12px;
  281. margin-top: 4px;
  282. color:#A2A9B5;
  283. }
  284. }
  285. .detailed-item-num{
  286. display: flex;
  287. align-items: center;
  288. h2{
  289. margin-right: 4px;
  290. }
  291. }
  292. }
  293. </style>