newfinance.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <image src="../../static/img/sybg.png" mode="" class="sybg"></image>
  5. <!-- <picker mode="date" :value="now_date" @change="bindDateChange" :fields="'month'" :end="date">
  6. <view class="uni-input choose-time">{{ now_date }} ></view>
  7. </picker> -->
  8. <view class="top-card">
  9. <view class="card-tit">
  10. <view class="tit-point"></view>
  11. 营业额总览
  12. </view>
  13. <view class="card-icon"><image src="../../static/icon/moneyget.png" mode=""></image></view>
  14. <view class="now-tit">店铺余额</view>
  15. <view class="now-money">{{ month_momey }}</view>
  16. <view class="btn" @click="navTo('/pages/merchant/withdrawal')">立即提现</view>
  17. <!-- <view class="card-btm flex">
  18. <view class="card-info flex">
  19. <image src="../../static/icon/dayget.png" mode=""></image>
  20. <view class="info-wrap">
  21. <view class="info-tit">今日营业额</view>
  22. <view class="info-val">¥{{ today_momey || 0 }}</view>
  23. </view>
  24. </view>
  25. <view class="card-info flex">
  26. <image src="../../static/icon/daydd.png" mode=""></image>
  27. <view class="info-wrap">
  28. <view class="info-tit">今日订单</view>
  29. <view class="info-val dan">{{ today_count }}</view>
  30. </view>
  31. </view>
  32. </view> -->
  33. </view>
  34. </view>
  35. <!-- <view class="mid-tit flex">
  36. <view class="mid-left flex">
  37. <image src="../../static/icon/time.png" mode=""></image>
  38. <view class="left-tit">本月订单数</view>
  39. </view>
  40. <view class="mid-right">{{ month_count }}单</view>
  41. </view> -->
  42. <view class="btm-tab">
  43. <!-- <view class="tab-tit flex">
  44. <view class="tab-top-left tab-content">订单类型</view>
  45. <view class="tab-top-center tab-content">订单数</view>
  46. <view class="tab-top-right tab-content">金额</view>
  47. </view> -->
  48. <scroll-view scroll-y="true" class="list-wrapper" :style="{ height: height }">
  49. <!-- 空白页 -->
  50. <empty v-if="loaded && monthList.length == 0"></empty>
  51. <view v-for="item in monthList" class="flex list" :key="item.time">
  52. <view class="tab-top-left ">{{ item.title }}</view>
  53. <!-- <view class="tab-top-center ">{{ item.count || 0 }}单</view> -->
  54. <view class="tab-top-right money">{{ item.pm == 0 ? '-' : '+' }}{{ item.number }}</view>
  55. </view>
  56. <uni-load-more :status="loadingType" v-if="loadingType == 'loading'"></uni-load-more>
  57. </scroll-view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import { bill, storeIndex } from '@/api/merchant.js';
  63. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  64. import empty from '@/components/empty';
  65. export default {
  66. components: {
  67. empty,
  68. uniLoadMore
  69. },
  70. data() {
  71. return {
  72. loadingType: 'more',
  73. page: 1,
  74. limit: 1000,
  75. monthList: {},
  76. loaded: false,
  77. month_momey: ''
  78. };
  79. },
  80. onReady(res) {
  81. var _this = this;
  82. uni.getSystemInfo({
  83. success: resu => {
  84. const query = uni.createSelectorQuery();
  85. query.select('.list-wrapper').boundingClientRect();
  86. query.exec(function(res) {
  87. console.log(res, 'ddddddddddddd');
  88. _this.height = resu.windowHeight - res[0].top + 'px';
  89. console.log('打印页面的剩余高度', _this.height);
  90. });
  91. },
  92. fail: res => {}
  93. });
  94. },
  95. onLoad() {
  96. console.log(this.tiday_start, 'start');
  97. console.log(this.now_date);
  98. this.loadData();
  99. },
  100. methods: {
  101. // 切换月份
  102. bindDateChange(e) {
  103. console.log(e.detail, 'dddddddddddd');
  104. this.now_date = e.detail.value;
  105. this.month_momey = 0;
  106. this.month_count = 0;
  107. this.loadData();
  108. },
  109. loadData() {
  110. const obj = this;
  111. storeIndex({}).then(({ data }) => {
  112. obj.month_momey = data.balance;
  113. console.log(data);
  114. });
  115. bill({ page: obj.pages, limit: obj.limit }).then(data => {
  116. console.log(data);
  117. obj.monthList = data.data.data;
  118. data.data.data.forEach(e => {
  119. console.log(e);
  120. obj.month_count += e.count;
  121. if (e.price != null) {
  122. obj.month_momey += e.price * 1;
  123. }
  124. });
  125. });
  126. },
  127. navTo(url) {
  128. uni.navigateTo({
  129. url
  130. });
  131. }
  132. }
  133. };
  134. </script>
  135. <style lang="scss" scoped>
  136. .top {
  137. height: 585rpx;
  138. // background-color: #f6f7f8;
  139. position: relative;
  140. .sybg {
  141. position: absolute;
  142. width: 100%;
  143. height: 265rpx;
  144. }
  145. .top-card {
  146. width: 688rpx;
  147. height: 398rpx;
  148. padding: 32rpx;
  149. background: #ffffff;
  150. box-shadow: -2rpx 4rpx 18rpx 0px rgba(0, 110, 238, 0.2);
  151. border-radius: 24rpx;
  152. position: absolute;
  153. right: 0;
  154. left: 0;
  155. bottom: 40rpx;
  156. margin: 0 auto;
  157. .now-tit {
  158. text-align: right;
  159. font-size: 24rpx;
  160. font-family: PingFang SC;
  161. font-weight: 500;
  162. color: #999999;
  163. }
  164. .now-money {
  165. padding-top: 10rpx;
  166. text-align: right;
  167. font-size: 72rpx;
  168. font-family: PingFang SC;
  169. font-weight: bold;
  170. color: #52c696;
  171. &::before {
  172. content: '¥';
  173. font-size: 44rpx;
  174. position: relative;
  175. bottom: 5rpx;
  176. }
  177. }
  178. .card-icon {
  179. position: absolute;
  180. top: 100rpx;
  181. left: 48rpx;
  182. width: 224rpx;
  183. height: 122rpx;
  184. image {
  185. width: 100%;
  186. height: 100%;
  187. }
  188. }
  189. .card-tit {
  190. display: flex;
  191. align-items: center;
  192. .tit-point {
  193. display: inline-block;
  194. width: 12rpx;
  195. height: 32rpx;
  196. background: #52c696;
  197. border-radius: 3rpx;
  198. margin-right: 17rpx;
  199. }
  200. font-size: 32rpx;
  201. font-family: PingFang SC;
  202. font-weight: 500;
  203. color: #333333;
  204. }
  205. .btn {
  206. margin: 60rpx auto 0;
  207. width: 622rpx;
  208. height: 85rpx;
  209. background: #24a17d;
  210. border-radius: 15rpx;
  211. text-align: center;
  212. line-height: 85rpx;
  213. font-size: 32rpx;
  214. font-family: PingFang SC;
  215. font-weight: bold;
  216. color: #ffffff;
  217. }
  218. }
  219. }
  220. .mid-tit {
  221. background-color: #fff;
  222. height: 80rpx;
  223. padding: 0 30rpx 0 33rpx;
  224. justify-content: space-between;
  225. align-items: center;
  226. margin-bottom: 12rpx;
  227. .mid-left {
  228. image {
  229. margin-right: 13rpx;
  230. width: 33rpx;
  231. height: 33rpx;
  232. }
  233. }
  234. }
  235. .btm-tab {
  236. background-color: #fff;
  237. // padding: 0 30rpx 0 35rpx;
  238. .tab-top-left {
  239. width: 100%;
  240. text-align: left;
  241. padding-left: 35rpx;
  242. }
  243. .tab-top-center {
  244. text-align: center;
  245. }
  246. .tab-top-right {
  247. flex-shrink: 0;
  248. text-align: right;
  249. padding-right: 30rpx;
  250. }
  251. .tab-tit {
  252. height: 72rpx;
  253. font-size: 24rpx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #999999;
  257. }
  258. }
  259. .list-wrapper {
  260. background-color: #fff;
  261. .list {
  262. margin: 20rpx 0 0;
  263. .money {
  264. color: #52c696;
  265. }
  266. }
  267. }
  268. .choose-time {
  269. position: absolute;
  270. top: 90rpx;
  271. line-height: 1.5;
  272. padding-left: 32rpx;
  273. font-size: 28rpx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #ffffff;
  277. }
  278. </style>