index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <view class="pagebox">
  3. <!-- #ifdef MP || APP-PLUS -->
  4. <NavBar titleText="工作台" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack></NavBar>
  5. <!-- #endif -->
  6. <view class="headerBg">
  7. <view :style="{ height: `${getHeight.barTop}px` }"></view>
  8. <view :style="{ height: `${getHeight.barHeight}px` }"></view>
  9. <view class="inner"></view>
  10. </view>
  11. <view class="page-content">
  12. <view class="header acea-row row-middle">
  13. <image :src="avatar" class="avatar"></image>
  14. <view class="text-box">
  15. <view class="name">{{ nickname }}</view>
  16. <view class="phone">{{ phone }}</view>
  17. </view>
  18. <!-- #ifdef MP-WEIXIN || APP-PLUS -->
  19. <!-- <navigator url="/pages/admin/order_cancellation/index" hover-class="none">
  20. <text class="iconfont icon-ic_Scan"></text>
  21. </navigator> -->
  22. <!-- #endif -->
  23. </view>
  24. <view class="today">
  25. <view class="title-box">
  26. <navigator class="link" url="/pages/admin/order/index" hover-class="none">
  27. 今日销售额(元)<text class="iconfont icon-ic_rightarrow"></text>
  28. </navigator>
  29. <view class="money">{{ after_price }}</view>
  30. </view>
  31. <view class="acea-row">
  32. <view class="item">
  33. <view class="num">{{ after_number }}</view>
  34. <view class="">今日订单数</view>
  35. </view>
  36. <view class="item">
  37. <view class="num">{{ after_pay_number }}</view>
  38. <view class="">今日支付人数</view>
  39. </view>
  40. <view class="item">
  41. <view class="num">{{ today_visits }}</view>
  42. <view class="">今日浏览量</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="goods acea-row">
  47. <navigator url="/pages/admin/orderList/index?types=1" hover-class="none" class="item">
  48. <view class="img-box">
  49. <view class="img">
  50. <view v-if="unshipped_count" class="num">{{ unshipped_count > 99 ? '99+' : unshipped_count }}</view>
  51. <image :src="imgHost+'/statics/images/admin-work-order1.png'" mode=""></image>
  52. </view>
  53. </view>
  54. <view class="">待发货</view>
  55. </navigator>
  56. <navigator url="/pages/admin/refundOrderList/index" hover-class="none" class="item">
  57. <view class="img-box">
  58. <view class="img">
  59. <view v-if="refunding_count" class="num">{{ refunding_count > 99 ? '99+' : refunding_count }}</view>
  60. <image :src="imgHost+'/statics/images/admin-work-order2.png'" mode=""></image>
  61. </view>
  62. </view>
  63. <view class="">待售后</view>
  64. </navigator>
  65. <navigator url="/pages/admin/goods/index?type=4" hover-class="none" class="item">
  66. <view class="img-box">
  67. <view class="img">
  68. <view v-if="outofstock" class="num">{{ outofstock > 99 ? '99+' : outofstock }}</view>
  69. <image :src="imgHost+'/statics/images/admin-work-order3.png'" mode=""></image>
  70. </view>
  71. </view>
  72. <view class="">待补货</view>
  73. </navigator>
  74. <navigator url="/pages/admin/goods/index?type=5" hover-class="none" class="item">
  75. <view class="img-box">
  76. <view class="img">
  77. <view v-if="policeforce" class="num">{{ policeforce > 99 ? '99+' : policeforce }}</view>
  78. <image :src="imgHost+'/statics/images/admin-work-order4.png'" mode=""></image>
  79. </view>
  80. </view>
  81. <view class="">库存预警</view>
  82. </navigator>
  83. </view>
  84. <view class="manage">
  85. <view class="title-box">店铺管理</view>
  86. <view class="list acea-row">
  87. <navigator class="item" url="/pages/admin/goods/index" hover-class="none">
  88. <view class="icon">
  89. <image :src="imgHost+'/statics/images/admin-work-menu1.png'" mode=""></image>
  90. </view>
  91. <view class="">商品管理</view>
  92. </navigator>
  93. <navigator class="item" url="/pages/admin/orderList/index" hover-class="none">
  94. <view class="icon">
  95. <image :src="imgHost+'/statics/images/admin-work-menu2.png'" mode=""></image>
  96. </view>
  97. <view class="">订单管理</view>
  98. </navigator>
  99. <!-- #ifdef MP-WEIXIN || APP-PLUS -->
  100. <!-- <navigator class="item" url="/pages/admin/order_cancellation/index" hover-class="none">
  101. <view class="icon">
  102. <image :src="imgHost+'/statics/images/admin-work-menu3.png'" mode=""></image>
  103. </view>
  104. <view class="">扫码核销</view>
  105. </navigator> -->
  106. <!-- #endif -->
  107. <navigator class="item" url="/pages/admin/refundOrderList/index" hover-class="none">
  108. <view class="icon">
  109. <image :src="imgHost+'/statics/images/admin-work-menu4.png'" mode=""></image>
  110. </view>
  111. <view class="">售后维权</view>
  112. </navigator>
  113. <navigator class="item" url="/pages/admin/user/list" hover-class="none">
  114. <view class="icon">
  115. <image :src="imgHost+'/statics/images/admin-work-menu5.png'" mode=""></image>
  116. </view>
  117. <view class="">用户管理</view>
  118. </navigator>
  119. <navigator class="item" url="/pages/behalf/user_list/index" hover-class="none">
  120. <view class="icon">
  121. <image :src="imgHost+'/statics/images/admin-work-menu6.png'" mode=""></image>
  122. </view>
  123. <view class="">代客下单</view>
  124. </navigator>
  125. </view>
  126. </view>
  127. </view>
  128. <footerPage :isWork='1'></footerPage>
  129. </view>
  130. </template>
  131. <script>
  132. // #ifdef MP || APP-PLUS
  133. import NavBar from '@/components/NavBar.vue';
  134. // #endif
  135. import footerPage from '../components/footerPage/index.vue';
  136. import {
  137. HTTP_REQUEST_URL
  138. } from '@/config/app';
  139. import {
  140. deliveryInfo,
  141. getOrderStaging,
  142. getOrderTime,
  143. } from '@/api/admin.js';
  144. import {
  145. getUserInfo,
  146. } from '@/api/user.js';
  147. export default {
  148. components: {
  149. // #ifdef MP || APP-PLUS
  150. NavBar,
  151. // #endif
  152. footerPage,
  153. },
  154. data() {
  155. return {
  156. imgHost: HTTP_REQUEST_URL,
  157. // #ifdef MP || APP-PLUS
  158. iconColor: '#FFFFFF',
  159. isScrolling: false,
  160. // #endif
  161. avatar: '',
  162. nickname: '',
  163. phone: '',
  164. outofstock: 0, // 待补货
  165. policeforce: 0, // 库存预警
  166. unshipped_count: 0, // 待发货
  167. refunding_count: 0, // 待售后
  168. after_price: 0, // 今日销售额
  169. after_number: 0, // 今日订单数
  170. after_pay_number: 0, // 今日支付人数
  171. today_visits: 0, // 今日浏览量
  172. getHeight: this.$util.getWXStatusHeight(),
  173. }
  174. },
  175. onLoad() {
  176. this.getUserInfo();
  177. this.getOrderTime();
  178. this.getOrderStaging();
  179. this.$store.commit('SET_STORE', 1);
  180. },
  181. methods: {
  182. getUserInfo() {
  183. getUserInfo().then(res => {
  184. const {
  185. avatar,
  186. nickname,
  187. phone,
  188. } = res.data;
  189. this.avatar = avatar;
  190. this.nickname = nickname;
  191. this.phone = phone;
  192. });
  193. },
  194. getOrderTime() {
  195. getOrderTime({
  196. type: 1,
  197. }).then(res => {
  198. const {
  199. after_number,
  200. after_pay_number,
  201. after_price,
  202. today_visits,
  203. } = res.data;
  204. this.after_number = after_number;
  205. this.after_pay_number = after_pay_number;
  206. this.after_price = after_price;
  207. this.today_visits = today_visits;
  208. });
  209. },
  210. getOrderStaging() {
  211. getOrderStaging().then(res => {
  212. const {
  213. outofstock,
  214. policeforce,
  215. unshipped_count,
  216. refunding_count,
  217. } = res.data;
  218. this.outofstock = outofstock;
  219. this.policeforce = policeforce;
  220. this.unshipped_count = Number(unshipped_count);
  221. this.refunding_count = Number(refunding_count);
  222. });
  223. },
  224. },
  225. }
  226. </script>
  227. <style lang="scss" scoped>
  228. .pagebox {
  229. position: relative;
  230. overflow: hidden;
  231. }
  232. .headerBg {
  233. position: absolute;
  234. top: 0;
  235. left: -25%;
  236. width: 150%;
  237. border-bottom-right-radius: 100%;
  238. border-bottom-left-radius: 100%;
  239. background: linear-gradient(270deg, #01ABF8 0%, #2A7EFB 100%);
  240. .inner {
  241. height: 356rpx;
  242. }
  243. }
  244. .page-content {
  245. position: relative;
  246. padding: 0 20rpx;
  247. .header {
  248. padding: 22rpx 20rpx 32rpx 12rpx;
  249. .avatar {
  250. width: 80rpx;
  251. height: 80rpx;
  252. border-radius: 50%;
  253. }
  254. .text-box {
  255. flex: 1;
  256. padding-left: 16rpx;
  257. color: #FFFFFF;
  258. }
  259. .name {
  260. font-weight: 500;
  261. font-size: 32rpx;
  262. line-height: 44rpx;
  263. }
  264. .phone {
  265. margin-top: 4rpx;
  266. font-size: 22rpx;
  267. line-height: 30rpx;
  268. }
  269. .iconfont {
  270. font-size: 40rpx;
  271. color: #FFFFFF;
  272. }
  273. }
  274. .today {
  275. border-radius: 24rpx;
  276. background: #FFFFFF;
  277. .title-box {
  278. padding: 40rpx 0 0 40rpx;
  279. }
  280. .link {
  281. display: inline-block;
  282. vertical-align: middle;
  283. font-size: 24rpx;
  284. line-height: 34rpx;
  285. color: #999999;
  286. }
  287. .iconfont {
  288. margin-left: 4rpx;
  289. font-size: 24rpx;
  290. }
  291. .money {
  292. margin-top: 16rpx;
  293. font-family: SemiBold;
  294. font-size: 56rpx;
  295. line-height: 56rpx;
  296. color: #FF7E00;
  297. }
  298. .item {
  299. flex: 1;
  300. padding: 54rpx 0 38rpx;
  301. text-align: center;
  302. font-size: 24rpx;
  303. line-height: 34rpx;
  304. color: #999999;
  305. }
  306. .num {
  307. margin-bottom: 12rpx;
  308. font-family: SemiBold;
  309. font-size: 36rpx;
  310. line-height: 36rpx;
  311. color: #333333;
  312. }
  313. }
  314. .goods {
  315. border-radius: 24rpx;
  316. margin-top: 20rpx;
  317. background: #FFFFFF;
  318. .item {
  319. flex: 1;
  320. padding: 30rpx 0 26rpx;
  321. text-align: center;
  322. font-size: 26rpx;
  323. line-height: 36rpx;
  324. color: #333333;
  325. }
  326. .img-box {
  327. position: relative;
  328. width: 76rpx;
  329. height: 76rpx;
  330. border-radius: 50%;
  331. margin: 0 auto 12rpx;
  332. // background: #F9A833;
  333. // text-align: center;
  334. // line-height: 76rpx;
  335. }
  336. .img {
  337. width: 100%;
  338. height: 100%;
  339. // border-radius: 50%;
  340. // background: rgba(255, 255, 255, 0.8);
  341. }
  342. .num {
  343. position: absolute;
  344. top: -6rpx;
  345. left: 58rpx;
  346. z-index: 2;
  347. min-width: 24rpx;
  348. height: 24rpx;
  349. padding: 0 8rpx;
  350. border-radius: 12rpx;
  351. background: #FF7E00;
  352. font-weight: 500;
  353. font-size: 18rpx;
  354. line-height: 24rpx;
  355. color: #FFFFFF;
  356. }
  357. image {
  358. width: 100%;
  359. height: 100%;
  360. // font-size: 38rpx;
  361. // color: #FF7E00;
  362. }
  363. }
  364. .manage {
  365. padding-bottom: 41rpx;
  366. border-radius: 24rpx;
  367. margin-top: 20rpx;
  368. background: #FFFFFF;
  369. .title-box {
  370. padding: 34rpx 0 11rpx 28rpx;
  371. font-weight: 500;
  372. font-size: 30rpx;
  373. line-height: 42rpx;
  374. color: #333333;
  375. }
  376. .item {
  377. flex: 0 0 25%;
  378. padding: 27rpx 0;
  379. text-align: center;
  380. font-size: 26rpx;
  381. line-height: 26rpx;
  382. color: #333333;
  383. .icon {
  384. width: 48rpx;
  385. height: 48rpx;
  386. margin: 0 auto 20rpx;
  387. }
  388. }
  389. image {
  390. width: 48rpx;
  391. height: 48rpx;
  392. }
  393. }
  394. }
  395. </style>