dlcenter.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <image src="../../static/img/sybg.png" mode="" class="sybg"></image>
  5. <view class="top-card">
  6. <view class="card-tit">
  7. <view class="tit-point"></view>
  8. 代理收益总览
  9. </view>
  10. <view class="card-icon">
  11. <image src="../../static/icon/moneyget.png" mode=""></image>
  12. </view>
  13. <view class="now-tit">
  14. 本月收益
  15. </view>
  16. <view class="now-money">
  17. {{month_momey}}
  18. </view>
  19. <view class="card-btm flex">
  20. <view class="card-info flex">
  21. <image src="../../static/icon/dayget.png" mode=""></image>
  22. <view class="info-wrap">
  23. <view class="info-tit">
  24. 今日收益
  25. </view>
  26. <view class="info-val">
  27. ¥{{today_momey}}
  28. </view>
  29. </view>
  30. </view>
  31. <view class="card-info flex">
  32. <image src="../../static/icon/daydd.png" mode=""></image>
  33. <view class="info-wrap">
  34. <view class="info-tit">
  35. 今日订单
  36. </view>
  37. <view class="info-val dan">
  38. {{today_count }}
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="mid-tit flex">
  46. <view class="mid-left flex">
  47. <image src="../../static/icon/time.png" mode=""></image>
  48. <view class="left-tit">
  49. 本月订单数
  50. </view>
  51. </view>
  52. <view class="mid-right">
  53. {{month_count}}单
  54. </view>
  55. </view>
  56. <view class="btm-tab">
  57. <view class="tab-tit flex">
  58. <view class="tab-top-left tab-content">
  59. 每月营业额
  60. </view>
  61. <view class="tab-top-center tab-content">
  62. 订单数
  63. </view>
  64. <view class="tab-top-right tab-content">
  65. 金额
  66. </view>
  67. </view>
  68. <scroll-view scroll-y="true" class="list-wrapper" :style="{'height':height}">
  69. <!-- 空白页 -->
  70. <empty v-if=" loaded && monthList.length == 0"></empty>
  71. <view v-for="item in monthList" class="flex list" :key="item.time">
  72. <view class="tab-top-left tab-content ">
  73. {{item.time | time}}
  74. </view>
  75. <view class="tab-top-center tab-content">
  76. {{item.frontNumber}}单
  77. </view>
  78. <view class="tab-top-right tab-content money">
  79. ¥{{item.frontPrice}}
  80. </view>
  81. </view>
  82. <uni-load-more :status="loadingType" v-if="loadingType == 'loading'"></uni-load-more>
  83. </scroll-view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import {
  89. getOrderTime,
  90. getOrderData,
  91. getOrderMonth,
  92. getAreaOrderMonth,
  93. getAreaOrderDay
  94. } from '@/api/wallet.js'
  95. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  96. import empty from '@/components/empty';
  97. export default {
  98. components: {
  99. empty,
  100. uniLoadMore
  101. },
  102. data() {
  103. let start = new Date(new Date().toLocaleDateString()).getTime()
  104. return {
  105. height: '',
  106. list: [],
  107. loadingType: 'more',
  108. page: 1,
  109. limit: 10,
  110. monthList: {},
  111. loaded: false,
  112. month_momey: '',//月营业额
  113. today_momey: '',//日营业额
  114. tiday_start: start/1000,//今日零点时间戳
  115. today_count: '',//今日订单数
  116. }
  117. },
  118. computed: {
  119. month_count() {
  120. if(this.monthList.length > 0) {
  121. return this.monthList[0].frontNumber
  122. }else {
  123. return 0
  124. }
  125. }
  126. },
  127. filters: {
  128. time(val) {
  129. let str = ''
  130. if (val) {
  131. val = val + ''
  132. let str1 = val.slice(0, 4)
  133. let str2 = val.slice(4, )
  134. return str = str1 + '年' + str2 + '月'
  135. }
  136. return str
  137. }
  138. },
  139. onReady(res) {
  140. var _this = this;
  141. uni.getSystemInfo({
  142. success: resu => {
  143. const query = uni.createSelectorQuery();
  144. query.select('.list-wrapper').boundingClientRect();
  145. query.exec(function(res) {
  146. console.log(res, 'ddddddddddddd');
  147. _this.height = resu.windowHeight - res[0].top + 'px';
  148. console.log('打印页面的剩余高度', _this.height);
  149. });
  150. },
  151. fail: res => {}
  152. });
  153. },
  154. onLoad() {
  155. console.log(this.tiday_start,'start')
  156. this.getOrderMonth()
  157. this.getMonth()
  158. this.getTaday()
  159. this.getTadayCount()
  160. },
  161. methods: {
  162. // 获取每月数据
  163. getOrderMonth() {
  164. this.loadingType = 'loading'
  165. getAreaOrderMonth().then(({
  166. data
  167. }) => {
  168. console.log(data,'// 获取每月数据')
  169. this.loadingType = 'noMore'
  170. let arr = []
  171. for (let val in data) {
  172. arr.push({
  173. time: +val.replace(/-/, ''),
  174. frontPrice: data[val].frontPrice,
  175. frontNumber: data[val].frontNumber
  176. })
  177. }
  178. this.monthList = arr.sort(function(a, b) {
  179. return b.time - a.time
  180. })
  181. })
  182. },
  183. // 获取本月营业额
  184. getMonth() {
  185. getAreaOrderDay({
  186. type: 1
  187. }).then(({
  188. data
  189. }) => {
  190. console.log(data, '本月营业额')
  191. this.month_momey = data.time
  192. })
  193. },
  194. // 获取本日营业额
  195. getTaday() {
  196. getAreaOrderDay({
  197. start: this.tiday_start,
  198. type: 1
  199. }).then(({data}) => {
  200. console.log(data, '本日收益')
  201. this.today_momey = data.time
  202. })
  203. },
  204. //获取本日订单数
  205. getTadayCount() {
  206. getAreaOrderDay({
  207. start: this.tiday_start,
  208. type: 0
  209. }).then(({data}) => {
  210. console.log(data, '本日单数')
  211. this.today_count= data.time
  212. })
  213. },
  214. }
  215. }
  216. </script>
  217. <style lang="scss" scoped>
  218. .top {
  219. height: 585rpx;
  220. // background-color: #f6f7f8;
  221. position: relative;
  222. .sybg {
  223. position: absolute;
  224. width: 100%;
  225. height: 265rpx;
  226. }
  227. .top-card {
  228. width: 688rpx;
  229. height: 398rpx;
  230. padding: 32rpx;
  231. background: #FFFFFF;
  232. box-shadow: -2rpx 4rpx 18rpx 0px rgba(0, 110, 238, 0.2);
  233. border-radius: 24rpx;
  234. position: absolute;
  235. right: 0;
  236. left: 0;
  237. bottom: 40rpx;
  238. margin: 0 auto;
  239. .now-tit {
  240. text-align: right;
  241. font-size: 24rpx;
  242. font-family: PingFang SC;
  243. font-weight: 500;
  244. color: #999999;
  245. }
  246. .now-money {
  247. padding-top: 10rpx;
  248. text-align: right;
  249. font-size: 72rpx;
  250. font-family: PingFang SC;
  251. font-weight: bold;
  252. color: #901B21;
  253. &::before {
  254. content: '¥';
  255. font-size: 44rpx;
  256. position: relative;
  257. bottom: 5rpx;
  258. }
  259. }
  260. .card-icon {
  261. position: absolute;
  262. top: 100rpx;
  263. left: 48rpx;
  264. width: 224rpx;
  265. height: 122rpx;
  266. image {
  267. width: 100%;
  268. height: 100%;
  269. }
  270. }
  271. .card-tit {
  272. display: flex;
  273. align-items: center;
  274. .tit-point {
  275. display: inline-block;
  276. width: 12rpx;
  277. height: 32rpx;
  278. background: #901B21;
  279. border-radius: 3rpx;
  280. margin-right: 17rpx;
  281. }
  282. font-size: 32rpx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. color: #333333;
  286. }
  287. .card-btm {
  288. position: absolute;
  289. bottom: 32rpx;
  290. width: 624rpx;
  291. height: 122rpx;
  292. background: linear-gradient(180deg, rgba(220, 184, 118, 0.12) 0%, rgba(220, 184, 118, 0) 100%);
  293. border-radius: 12rpx;
  294. .card-info {
  295. width: 50%;
  296. flex-shrink: 0;
  297. padding-left: 30rpx;
  298. justify-content: flex-start;
  299. align-items: center;
  300. image {
  301. width: 48rpx;
  302. height: 48rpx;
  303. }
  304. .info-wrap {
  305. padding-left: 20rpx;
  306. .info-tit {
  307. font-size: 28rpx;
  308. font-family: PingFang SC;
  309. font-weight: 500;
  310. color: #999999;
  311. }
  312. .info-val {
  313. // padding-top: 15rpx;
  314. font-size: 36rpx;
  315. font-family: PingFang SC;
  316. font-weight: bold;
  317. color: #DCB876;
  318. text-align: center;
  319. }
  320. .dan {
  321. &::after {
  322. content: '单';
  323. font-size: 32rpx;
  324. position: relative;
  325. bottom: 3rpx;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. .mid-tit {
  334. background-color: #fff;
  335. height: 80rpx;
  336. padding: 0 30rpx 0 33rpx;
  337. justify-content: space-between;
  338. align-items: center;
  339. margin-bottom: 12rpx;
  340. .mid-left {
  341. image {
  342. margin-right: 13rpx;
  343. width: 33rpx;
  344. height: 33rpx;
  345. }
  346. }
  347. }
  348. .btm-tab {
  349. background-color: #fff;
  350. // padding: 0 30rpx 0 35rpx;
  351. .tab-top-left {
  352. text-align: left;
  353. padding-left: 35rpx;
  354. }
  355. .tab-top-center {
  356. text-align: center;
  357. }
  358. .tab-top-right {
  359. text-align: right;
  360. padding-right: 30rpx;
  361. }
  362. .tab-tit {
  363. height: 72rpx;
  364. font-size: 24rpx;
  365. font-family: PingFang SC;
  366. font-weight: 500;
  367. color: #999999;
  368. .tab-content {
  369. width: 33%;
  370. }
  371. }
  372. }
  373. .list-wrapper {
  374. background-color: #fff;
  375. .list {
  376. height: 70rpx;
  377. view {
  378. width: 33.3%;
  379. flex-shrink: 0;
  380. font-size: 28rpx;
  381. font-family: PingFang SC;
  382. font-weight: 500;
  383. color: #333333;
  384. }
  385. .money {
  386. color: #901B21;
  387. }
  388. }
  389. }
  390. </style>