index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <view>
  3. <view class="order-index" ref="container">
  4. <view class="header acea-row" :style="{ 'background-image': `url(${domain}/static/images/order_header.png)`}">
  5. <navigator class="item" :url="`/pages/admin/orderList/index?types=1&merId=${mer_id}`" hover-class="none">
  6. <view class="num">{{ census.unpaid }}</view>
  7. <view>待付款</view>
  8. </navigator>
  9. <navigator class="item" :url="`/pages/admin/orderList/index?types=2&merId=${mer_id}`" hover-class="none">
  10. <view class="num">{{ census.unshipped }}</view>
  11. <view>待发货</view>
  12. </navigator>
  13. <navigator class="item" :url="`/pages/admin/orderList/index?types=3&merId=${mer_id}`" hover-class="none">
  14. <view class="num">{{ census.untake }}</view>
  15. <view>待收货</view>
  16. </navigator>
  17. <navigator class="item" :url="`/pages/admin/orderList/index?types=4&merId=${mer_id}`" hover-class="none">
  18. <view class="num">{{ census.unevaluate }}</view>
  19. <view>待评价</view>
  20. </navigator>
  21. <navigator class="item" :url="`/pages/admin/orderList/index?types=6&merId=${mer_id}`" hover-class="none">
  22. <view class="num">{{ census.refund }}</view>
  23. <view>退款</view>
  24. </navigator>
  25. </view>
  26. <view class="wrapper">
  27. <view class="title">
  28. <span class="iconfont icon-shujutongji"></span>数据统计
  29. </view>
  30. <view class="list acea-row" v-if="orderData">
  31. <navigator class="item" :url="`/pages/admin/statistics/index?type=price&time=today&merId=${mer_id}`" hover-class="none">
  32. <view class="num">{{ orderData.today.payPrice }}</view>
  33. <view>今日成交额</view>
  34. </navigator>
  35. <navigator class="item" :url="`/pages/admin/statistics/index?type=price&time=yesterday&merId=${mer_id}`" hover-class="none">
  36. <view class="num">{{ orderData.yesterday.payPrice }}</view>
  37. <view>昨日成交额</view>
  38. </navigator>
  39. <navigator class="item" :url="`/pages/admin/statistics/index?type=price&time=month&merId=${mer_id}`" hover-class="none">
  40. <view class="num">{{ orderData.month.payPrice }}</view>
  41. <view>本月成交额</view>
  42. </navigator>
  43. <navigator class="item" :url="`/pages/admin/statistics/index?type=order&time=today&merId=${mer_id}`" hover-class="none">
  44. <view class="num">{{ orderData.today.orderNum}}</view>
  45. <view>今日订单数</view>
  46. </navigator>
  47. <navigator class="item" :url="`/pages/admin/statistics/index?type=order&time=yesterday&merId=${mer_id}`" hover-class="none">
  48. <view class="num">{{ orderData.yesterday.orderNum }}</view>
  49. <view>昨日订单数</view>
  50. </navigator>
  51. <navigator class="item" :url="`/pages/admin/statistics/index?type=order&time=month&merId=${mer_id}`" hover-class="none">
  52. <view class="num">{{ orderData.month.orderNum}}</view>
  53. <view>本月订单数</view>
  54. </navigator>
  55. </view>
  56. </view>
  57. <view class="public-wrapper">
  58. <view class="title">
  59. <span class="iconfont icon-xiangxishuju"></span>详细数据
  60. </view>
  61. <view class="nav acea-row row-between-wrapper">
  62. <view class="data">日期</view>
  63. <view class="browse">订单数</view>
  64. <view class="turnover">成交额</view>
  65. </view>
  66. <view class="conter">
  67. <view class="item acea-row row-between-wrapper" v-for="(item, index) in list" :key="index">
  68. <view class="data">{{ item.day }}</view>
  69. <view class="browse">{{ item.total }}</view>
  70. <view class="turnover">{{ item.pay_price }}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <Loading :loaded="loaded" :loading="loading"></Loading>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. // +----------------------------------------------------------------------
  80. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  81. // +----------------------------------------------------------------------
  82. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  83. // +----------------------------------------------------------------------
  84. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  85. // +----------------------------------------------------------------------
  86. // | Author: CRMEB Team <admin@crmeb.com>
  87. // +----------------------------------------------------------------------
  88. import {
  89. getStatisticsInfo,
  90. getStatisticsMonth,
  91. orderStatistics,
  92. orderPrice
  93. } from "@/api/admin";
  94. import Loading from '@/components/Loading/index.vue'
  95. import { HTTP_REQUEST_URL } from '@/config/app';
  96. export default {
  97. name: 'adminOrder',
  98. components: {
  99. Loading
  100. },
  101. data() {
  102. return {
  103. domain: HTTP_REQUEST_URL,
  104. census: {},
  105. orderData: {
  106. today: {},
  107. yesterday: {},
  108. month: {}
  109. },
  110. list: [],
  111. where: {
  112. page: 1,
  113. limit: 15
  114. },
  115. loaded: false,
  116. loading: false,
  117. mer_id: '',
  118. }
  119. },
  120. onLoad(options) {
  121. this.mer_id = options.mer_id
  122. this.getOrderStatistics(this.mer_id);
  123. this.getList(this.mer_id)
  124. },
  125. methods: {
  126. getIndex: function() {
  127. var that = this;
  128. getStatisticsInfo().then(
  129. res => {
  130. that.census = res.data;
  131. },
  132. err => {
  133. that.$util.Tips({
  134. title: err.message
  135. })
  136. }
  137. );
  138. },
  139. getList: function(mer_id) {
  140. var that = this;
  141. if(that.loading || that.loaded) return;
  142. that.loading = true;
  143. orderPrice(that.where, mer_id).then(
  144. res => {
  145. that.loading = false;
  146. that.loaded = res.data.length < that.where.limit;
  147. that.list.push.apply(that.list, res.data);
  148. that.where.page = that.where.page + 1;
  149. },
  150. error => {
  151. that.$util.Tips({
  152. title: error.msg
  153. })
  154. },
  155. 300
  156. );
  157. },
  158. getOrderStatistics: function(mer_id) {
  159. let that = this;
  160. orderStatistics(mer_id).then(
  161. res => {
  162. that.census = res.data.order;
  163. that.orderData = res.data.data;
  164. },
  165. err => {
  166. that.$util.Tips({
  167. title: err.message
  168. })
  169. }
  170. );
  171. }
  172. },
  173. onReachBottom() {
  174. this.getList(this.mer_id)
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .popupn {
  180. position: fixed;
  181. width: 100%;
  182. text-align: center;
  183. top: 0;
  184. left: 0;
  185. background: transparent;
  186. height: 90rpx;
  187. line-height: 90rpx;
  188. z-index: 100;
  189. .spin {
  190. display: block;
  191. transform: rotate(180deg);
  192. font-size: 36rpx;
  193. }
  194. .title {
  195. max-width: 560rpx;
  196. margin: 0 auto;
  197. position: relative;
  198. display: inline;
  199. padding: 10rpx 30rpx 10rpx 50rpx;
  200. background-color: rgba(0, 0, 0, 0.15);
  201. border-radius: 30rpx;
  202. color: #fff;
  203. }
  204. .iconfont {
  205. display: inline-block;
  206. position: relative;
  207. top: 4rpx;
  208. right: 0;
  209. }
  210. .mer_logo {
  211. width: 34rpx;
  212. height: 34rpx;
  213. position: relative;
  214. top: 6rpx;
  215. right: 10px;
  216. }
  217. .mer_name {
  218. display: inline-block;
  219. max-width: 650rpx;
  220. }
  221. .invoice-content {
  222. background-color: #ffffff;
  223. }
  224. }
  225. /*订单首页*/
  226. .order-index .header {
  227. background-size: 100% 100%;
  228. width: 100%;
  229. height: 280upx;
  230. padding: 40upx 3upx 0 3upx;
  231. box-sizing: border-box;
  232. }
  233. .order-index .header .item {
  234. flex: 1;
  235. -webkit-flex: 1;
  236. -o-flex: 1;
  237. -ms-flex: 1;
  238. text-align: center;
  239. font-size: 24upx;
  240. color: #fff;
  241. }
  242. .order-index .header .item .num {
  243. font-size: 40upx;
  244. margin-bottom: 7upx;
  245. height: 60rpx;
  246. }
  247. .order-index .wrapper {
  248. width: 690upx;
  249. background-color: #fff;
  250. border-radius: 10upx;
  251. margin: -115upx auto 0 auto;
  252. padding-top: 25upx;
  253. }
  254. .order-index .wrapper .title {
  255. font-size: 30upx;
  256. color: #282828;
  257. padding: 0 30upx;
  258. margin-bottom: 40upx;
  259. }
  260. .order-index .wrapper .title .iconfont {
  261. color: #2291f8;
  262. font-size: 40upx;
  263. margin-right: 13upx;
  264. vertical-align: middle;
  265. }
  266. .order-index .wrapper .list .item {
  267. width: 33.33%;
  268. text-align: center;
  269. font-size: 24upx;
  270. color: #999;
  271. margin-bottom: 45upx;
  272. }
  273. .order-index .wrapper .list .item .num {
  274. font-size: 40upx;
  275. color: #333;
  276. }
  277. .public-wrapper .title {
  278. font-size: 30upx;
  279. color: #282828;
  280. padding: 0 30upx;
  281. margin-bottom: 20upx;
  282. }
  283. .public-wrapper .title .iconfont {
  284. color: #2291f8;
  285. font-size: 40upx;
  286. margin-right: 13upx;
  287. vertical-align: middle;
  288. }
  289. .public-wrapper {
  290. margin: 18upx auto 0 auto;
  291. width: 690upx;
  292. background-color: #fff;
  293. border-radius: 10upx;
  294. padding-top: 25upx;
  295. }
  296. .public-wrapper .nav {
  297. padding: 0 30upx;
  298. height: 70upx;
  299. line-height: 70upx;
  300. font-size: 24upx;
  301. color: #999;
  302. }
  303. .public-wrapper .data {
  304. width: 210upx;
  305. text-align: left;
  306. }
  307. .public-wrapper .browse {
  308. width: 192upx;
  309. text-align: right;
  310. }
  311. .public-wrapper .turnover {
  312. width: 227upx;
  313. text-align: right;
  314. }
  315. .public-wrapper .conter {
  316. padding: 0 30upx;
  317. }
  318. .public-wrapper .conter .item {
  319. border-bottom: 1px solid #f7f7f7;
  320. height: 70upx;
  321. font-size: 24upx;
  322. }
  323. .public-wrapper .conter .item .turnover {
  324. color: #d84242;
  325. }
  326. </style>