index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="tab">
  5. <view :class="currentTab==0 ? 'active-tab':'tab-item'" @click="changeTab(0)">
  6. 当天收益
  7. </view>
  8. <view :class="currentTab==1 ? 'active-tab':'tab-item'" @click="changeTab(1)">
  9. 当月收益
  10. </view>
  11. </view>
  12. <view class="update-time">
  13. <image src="../static/upload.png" mode=""></image>
  14. <text class="">更新于: {{ currentIncome.time}}</text>
  15. </view>
  16. <view class="area">{{area_name}}</view>
  17. <view class="" v-if="currentTab==0">
  18. <view class="top_top">
  19. <view class="left">
  20. <view class="text">今日总收益</view>
  21. <view class="money1">
  22. <text style="font-size:30upx;margin-right:5upx">¥</text><text
  23. style="font-size: 50upx;">{{currentIncome.order_money}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="top-bt">
  28. <view class="right">
  29. <view class="text">订单笔数</view>
  30. <view class="money">
  31. <text>{{currentIncome.order_nums}}</text><text
  32. style="font-size:24upx;margin-left:5upx">笔</text>
  33. </view>
  34. </view>
  35. <view class="right">
  36. <view class="text">退款金额</view>
  37. <view class="money">
  38. <text
  39. style="font-size:30upx;margin-right:5upx">¥</text><text>{{currentIncome.refund_money}}</text>
  40. </view>
  41. </view>
  42. <view class="right">
  43. <view class="text">退款笔数</view>
  44. <view class="money">
  45. <text>{{currentIncome.refund_nums}}</text><text
  46. style="font-size:24upx;margin-left:5upx">笔</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="" v-if="currentTab==1">
  52. <view class="top_top">
  53. <view class="left">
  54. <view class="text">本月总收入</view>
  55. <view class="money1">
  56. <text style="font-size:30upx;margin-right:5upx">¥</text><text
  57. style="font-size: 50upx;">{{currentIncome.total_money}}</text>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="top-bt">
  62. <view class="left">
  63. <view class="text">本月订单收益</view>
  64. <view class="money">
  65. <text style="font-size:24upx;">¥</text><text>{{currentIncome.money}}</text>
  66. </view>
  67. </view>
  68. <view class="right">
  69. <view class="text">本月订单退款</view>
  70. <view class="money">
  71. <text
  72. style="font-size:30upx;margin-right:5upx">¥</text><text>{{currentIncome.refund_money}}</text>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="content">
  79. <!-- <view class="select">
  80. <picker mode="selector" :value="index" @change="bindDateChange" :range="time">
  81. <view class="picker">
  82. {{time[index]}}
  83. </view>
  84. <image src="../static/down-arrow.png" class="selectDate"></image>
  85. </picker>
  86. </view> -->
  87. <view v-for="(item,index) in incomeList" :key="index" @click="item.money!='0.00' ? bikeDayIncome(item):''"
  88. v-if="incomeList!=''">
  89. <view class="day">{{item.day}}</view>
  90. <view class="list-out">
  91. <view class="list">
  92. <view class="list-left">
  93. <view>
  94. <view class="totle-money">
  95. ¥{{item.money}}
  96. </view>
  97. </view>
  98. </view>
  99. <view class="list-right">
  100. <view class="tip-money">{{item.nums}}笔</view>
  101. <image class="image" src="../static/jiantou.png"></image>
  102. </view>
  103. </view>
  104. <view class="list-bt">
  105. <view class="tip-money">
  106. <view class="money-text">
  107. 总收入:¥{{item.total_money}},退款:¥{{item.refund_money}}
  108. </view>
  109. <view class="money-text">
  110. 充值金额:¥{{item.recharge_money}},充值人数:{{item.recharge_nums}}人
  111. </view>
  112. <view class="money-text">
  113. 骑行卡金额:¥{{item.ride_card_money}},骑行卡数量:{{item.ride_card_nums}}张
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view v-if="incomeList==''" class="none" style="height:260upx;">
  120. <!-- <image src="/image/none.png" style="width:128upx;height:128upx;"></image> -->
  121. <text style="font-size:26upx;">当前暂无收益</text>
  122. </view>
  123. </view>
  124. </view>
  125. </template>
  126. <script>
  127. var app = getApp()
  128. export default {
  129. data() {
  130. return {
  131. index: 0,
  132. type: 0, //日期类型0近30天 1近3个月 2近1年
  133. time: ['近30天', '近15周', '近12个月'],
  134. tab: ['按月查看', '按天查看'],
  135. incomeList: [], //收益列表
  136. profit: [],
  137. currentIncome: '',
  138. page: 1,
  139. currentTab: 0,
  140. area_name: uni.getStorageSync('area_name')
  141. }
  142. },
  143. onLoad() {
  144. this.incomeLists()
  145. this.dayIncomeList()
  146. },
  147. onReachBottom: function() {
  148. if (!this.links) {
  149. uni.showToast({
  150. title: '暂无数据',
  151. icon: 'none'
  152. })
  153. return;
  154. } else {
  155. let page = this.page
  156. page++
  157. this.page = page
  158. this.incomeLists()
  159. }
  160. },
  161. methods: {
  162. bindDateChange: function(e) {
  163. console.log('picker发送选择改变,携带值为', e.detail.value)
  164. this.index = e.detail.value
  165. this.incomeList = []
  166. this.incomeLists()
  167. },
  168. //切换按天查看或者按月查看
  169. changeTab(e) {
  170. this.currentTab = e
  171. if (e == 0) {
  172. this.dayIncomeList()
  173. } else {
  174. this.getCurrent()
  175. }
  176. },
  177. dayIncomeList: function() {
  178. app.request('/day', '', 'get').then(res => {
  179. console.log(res, '--------------')
  180. this.currentIncome = res.data.data
  181. })
  182. },
  183. incomeLists: function() {
  184. uni.showLoading()
  185. var that = this
  186. let date = {
  187. type: that.index,
  188. page: that.page
  189. }
  190. app.request('/earnings', date, 'GET').then(res => {
  191. uni.hideLoading()
  192. let arr = res.data.data.data
  193. this.incomeList = that.incomeList.concat(arr),
  194. this.links = res.data.data.meta.pagination.links.next
  195. console.log(res, "收益列表")
  196. })
  197. },
  198. getCurrent() {
  199. app.request('/earnings-statistics', '', 'get').then(res => {
  200. console.log(res, '--------------')
  201. this.currentIncome = res.data.data
  202. let date = new Date()
  203. let year = date.getFullYear(); //获取完整的年份(4位)
  204. let month = date.getMonth() + 1; //获取当前月份(0-11,0代表1月)
  205. month = month >= 10 ? month : '0' + month
  206. let day = date.getDate(); //获取当前日(1-31)
  207. day = day >= 10 ? day : '0' + day
  208. let time = year + '-' + month + '-' + day
  209. this.currentIncome.time = time
  210. })
  211. },
  212. //跳转收入页面
  213. bikeDayIncome(e) {
  214. console.log(e, 'ppppppppp')
  215. let data = e
  216. uni.navigateTo({
  217. url: './dayIncome?day=' + data.day
  218. })
  219. },
  220. }
  221. }
  222. </script>
  223. <style>
  224. /* pages/mineIncome/mineIncome.wxss */
  225. page {
  226. background-color: rgba(238, 238, 238, 1);
  227. }
  228. .area {
  229. color: #ffffff;
  230. font-size: 30upx;
  231. margin-bottom: 36upx;
  232. }
  233. .top {
  234. background: linear-gradient(52deg, #FF5B50 0%, #FF7D45 100%);
  235. padding: 0upx 0 37upx 0;
  236. text-align: center;
  237. }
  238. .tab {
  239. display: flex;
  240. height: 80upx;
  241. padding: 0 20upx;
  242. font-size: 30upx;
  243. line-height: 80upx;
  244. text-align: left;
  245. color: #FFFFFF;
  246. background-color: rgba(255, 231, 231, 0.3);
  247. /* opacity: 0.8; */
  248. }
  249. .tab-item,
  250. .active-tab {
  251. flex: 1;
  252. margin: 0 70upx;
  253. text-align: center;
  254. color: rgba(255, 255, 255, 0.9);
  255. }
  256. .active-tab {
  257. color: #FFFFFF;
  258. font-size: 34upx;
  259. font-weight: 500;
  260. border-bottom: solid 3upx #FFFFFF;
  261. }
  262. .update-time {
  263. text-align: left;
  264. height: 70upx;
  265. padding: 0 20upx;
  266. font-size: 26upx;
  267. line-height: 70upx;
  268. color: #FFFFFF;
  269. /* background-color: rgba(255, 231, 231, 0.3); */
  270. }
  271. .select-tab {
  272. height: 50upx;
  273. width: 50upx;
  274. display: inline-block;
  275. vertical-align: middle;
  276. }
  277. .update-time image {
  278. height: 26upx;
  279. width: 26upx;
  280. display: inline-block;
  281. vertical-align: middle;
  282. margin-right: 10upx;
  283. }
  284. .top_top {
  285. display: flex;
  286. align-items: center;
  287. margin-bottom: 60upx;
  288. }
  289. .text {
  290. font-size: 24upx;
  291. font-family: PingFang SC;
  292. font-weight: 500;
  293. color: #FFFFFF;
  294. opacity: 0.8;
  295. }
  296. .money1 {
  297. margin-top: 15upx;
  298. font-size: 40upx;
  299. font-family: PingFang SC;
  300. font-weight: 500;
  301. color: #FFFFFF;
  302. }
  303. .money {
  304. margin-top: 15upx;
  305. font-size: 40upx;
  306. font-family: PingFang SC;
  307. font-weight: 500;
  308. color: #FFFFFF;
  309. }
  310. .money image {
  311. display: inline-block;
  312. vertical-align: middle;
  313. height: 30upx;
  314. width: 30upx;
  315. margin-left: 15upx;
  316. }
  317. .money1 image {
  318. display: inline-block;
  319. vertical-align: middle;
  320. height: 30upx;
  321. width: 30upx;
  322. margin-left: 15upx;
  323. }
  324. .left {
  325. flex: 1;
  326. }
  327. .top-bt {
  328. display: flex;
  329. }
  330. .top-bt .left {
  331. flex: 1;
  332. border-right: solid 1upx rgba(238, 238, 238, 1);
  333. }
  334. .right {
  335. flex: 1;
  336. }
  337. .select {
  338. margin-top: 20upx;
  339. font-size: 24upx;
  340. font-family: PingFang SC;
  341. font-weight: 500;
  342. color: #202020;
  343. }
  344. .content {
  345. padding: 30upx;
  346. }
  347. .day {
  348. padding-left: 28upx;
  349. margin-top: 40upx;
  350. font-size: 24upx;
  351. color: #747474;
  352. margin-bottom: 20upx;
  353. }
  354. .list-out {
  355. background-color: #ffffff;
  356. border-radius: 10upx;
  357. padding: 20upx 20upx;
  358. }
  359. .list {
  360. display: flex;
  361. align-items: center;
  362. font-size: 32upx;
  363. font-family: PingFang SC;
  364. font-weight: 500;
  365. color: #202020;
  366. justify-content: space-between;
  367. padding-bottom: 15upx;
  368. border-bottom: solid 0.5upx #e8e8e8;
  369. }
  370. .list-left {
  371. display: flex;
  372. width: 90%;
  373. }
  374. .totle-money {
  375. font-size: 44upx;
  376. }
  377. .list-left {
  378. flex: 1;
  379. width: 80%;
  380. }
  381. .tip-money {
  382. flex: 1;
  383. color: #b3b3b3;
  384. /* text-align: center; */
  385. font-size: 24upx;
  386. margin: 20upx 0;
  387. }
  388. .money-text {
  389. margin-bottom: 15upx;
  390. }
  391. .list-right {
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. }
  396. .image {
  397. height: 30upx;
  398. width: 30upx;
  399. }
  400. .list-right .tip-money {
  401. display: inline-block;
  402. /* margin-top: -3upx; */
  403. vertical-align: top;
  404. }
  405. .none {
  406. display: flex;
  407. flex-direction: column;
  408. align-items: center;
  409. margin-top: 150upx;
  410. height: 500upx;
  411. justify-content: space-around;
  412. }
  413. .none view {
  414. width: 533upx;
  415. height: 76upx;
  416. background: #FC512E;
  417. border-radius: 8upx;
  418. display: flex;
  419. align-items: center;
  420. justify-content: center;
  421. font-size: 32upx;
  422. font-family: PingFang SC;
  423. font-weight: 400;
  424. color: #FFFFFF;
  425. }
  426. .picker {
  427. display: inline-block;
  428. vertical-align: middle;
  429. }
  430. .selectDate {
  431. margin-left: 25upx;
  432. display: inline-block;
  433. vertical-align: middle;
  434. height: 30upx;
  435. width: 30upx;
  436. }
  437. </style>