workbench.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div class="app-main app-content">
  3. <!-- 用户信息 -->
  4. <div class="user-wrap">
  5. <div class="user-top">
  6. <div class="app-size-28">今日概况</div>
  7. <div @click="$util.pageTo('/pages/setting/password')">
  8. <app-avatar-module :src="avatarImg | default_avatar" :width="80" />
  9. </div>
  10. </div>
  11. <div class="income-amount">
  12. <div>收入金额</div>
  13. <div class="price">{{ data.todayData.income }}</div>
  14. </div>
  15. <div class="user-bottom">
  16. <div class="info-list">
  17. <div class="info-list-name">浏览量</div>
  18. <div class="info-list-value">{{ data.todayData.visit || 0 }}</div>
  19. </div>
  20. <div class="info-list">
  21. <div class="info-list-name">新粉丝</div>
  22. <div class="info-list-value">{{ data.todayData.fans || 0 }}</div>
  23. </div>
  24. <div class="info-list">
  25. <div class="info-list-name">新客户</div>
  26. <div class="info-list-value">{{ data.todayData.user || 0 }}</div>
  27. </div>
  28. </div>
  29. </div>
  30. <!-- 订单总览 -->
  31. <div class="module-com order-wrap">
  32. <div class="total-blo">
  33. <div class="total-list" v-for="(item, index) in orderData" :key="index">
  34. <div class="list-num">{{ item.value }}</div>
  35. <div class="app-color-3">{{ item.name }}</div>
  36. </div>
  37. </div>
  38. </div>
  39. <!-- 消息 -->
  40. <div class="module-com news-wrap">
  41. <div class="news-list" v-for="(item, index) in data.notice" :key="index" @click="pageToFn(item)">
  42. <div class="news-left">
  43. <i class="iconfont iconxiaoxi2"></i>
  44. <span>{{ item.title }}</span>
  45. </div>
  46. <div class="news-right">
  47. <span>立即授权绑定</span>
  48. <i class="iconfont iconxiangyou"></i>
  49. </div>
  50. </div>
  51. </div>
  52. <!-- 客户按钮 -->
  53. <div class="module-com tabs-wrap">
  54. <div class="tabs-list" v-for="(item, index) in tabsData" :key="index" @click="$util.pageTo(item)">
  55. <div class="tabs-img">
  56. <img :src="item.img" alt mode="widthFix" />
  57. </div>
  58. <div class="tabs-name">{{ item.name }}</div>
  59. </div>
  60. </div>
  61. <!-- 总览 -->
  62. <div class="module-com total-wrap">
  63. <div class="total-tit">总览</div>
  64. <div class="total-blo">
  65. <div class="total-list" v-for="(item, index) in totalData" :key="index">
  66. <div class="list-num">{{ item.value }}</div>
  67. <div class="app-color-3">{{ item.name }}</div>
  68. </div>
  69. </div>
  70. </div>
  71. <fab-module />
  72. </div>
  73. </template>
  74. <script>
  75. import FabModule from '@/components/plugin/fab'
  76. import AppAvatarModule from '@/components/module/app-avatar'
  77. // api
  78. import { consoleIndex } from '@/api/workbench'
  79. // img
  80. import tabIcon1 from '@/static/images/admin/tab-icon-1.png'
  81. import tabIcon2 from '@/static/images/admin/tab-icon-2.png'
  82. import tabIcon3 from '@/static/images/admin/tab-icon-3.png'
  83. import tabIcon4 from '@/static/images/admin/tab-icon-4.png'
  84. import tabIcon5 from '@/static/images/admin/tab-icon-5.png'
  85. import tabIcon6 from '@/static/images/admin/tab-icon-6.png'
  86. import tabIcon7 from '@/static/images/admin/tab-icon-7.png'
  87. import tabIcon8 from '@/static/images/admin/tab-icon-8.png'
  88. export default {
  89. name: 'admin-workbench',
  90. components: {
  91. FabModule,
  92. AppAvatarModule
  93. },
  94. data() {
  95. return {
  96. data: {
  97. admin: {},
  98. asset: {},
  99. notice: {},
  100. todayData: {}
  101. },
  102. // 订单总览
  103. orderData: [
  104. {
  105. name: '待付款',
  106. value: 0
  107. },
  108. {
  109. name: '待配送',
  110. value: 0
  111. },
  112. {
  113. name: '配送中',
  114. value: 0
  115. },
  116. {
  117. name: '待通知',
  118. value: 0
  119. },
  120. {
  121. name: '已完结',
  122. value: 0
  123. },
  124. {
  125. name: '待退款',
  126. value: 0
  127. }
  128. ],
  129. // tab按钮
  130. tabsData: [
  131. {
  132. name: '商品管理',
  133. img: tabIcon1,
  134. url: '/pages/goodsManage/list'
  135. },
  136. {
  137. name: '邀请有礼',
  138. img: tabIcon2,
  139. url: '/pages/interest/admin/invite'
  140. },
  141. {
  142. name: '优惠券',
  143. img: tabIcon3,
  144. url: '/pages/coupon/admin/list'
  145. },
  146. {
  147. name: '广告管理',
  148. img: tabIcon4,
  149. url: '/pages/ad/list'
  150. },
  151. {
  152. name: '促销',
  153. img: tabIcon5,
  154. funtion: () => {
  155. this.$msg('该功能开发中...')
  156. }
  157. },
  158. {
  159. name: '员工管理',
  160. img: tabIcon6,
  161. url: '/pages/staff/list'
  162. },
  163. {
  164. name: '我的邀请',
  165. img: tabIcon7,
  166. url: '/pages/interest/admin/my-invite'
  167. },
  168. {
  169. name: '设置',
  170. img: tabIcon8,
  171. url: '/pages/setting/list'
  172. }
  173. ],
  174. // 总览
  175. totalData: [
  176. {
  177. name: '客户数',
  178. value: 0
  179. },
  180. {
  181. name: '粉丝数',
  182. value: 0
  183. },
  184. {
  185. name: '会员数',
  186. value: 0
  187. },
  188. {
  189. name: '总收入(元)',
  190. value: 0
  191. },
  192. {
  193. name: '总访问量',
  194. value: 0
  195. },
  196. {
  197. name: '剩余短信',
  198. value: 0
  199. }
  200. ]
  201. }
  202. },
  203. computed: {
  204. avatarImg() {
  205. return this.$util.isEmpty(this.userInfo) ? '' : this.userInfo.logoUrl
  206. }
  207. },
  208. onLoad(option) {
  209. // if (this.$util.getCheckLogin()) return
  210. this.init()
  211. },
  212. methods: {
  213. init() {
  214. consoleIndex().then(res => {
  215. this.data = res.data
  216. const { asset } = res.data
  217. if (!this.$util.isEmpty(asset)) {
  218. // 订单总览
  219. this.orderData[0].value = asset.unPayOrder
  220. this.orderData[1].value = asset.unSendOrder
  221. this.orderData[2].value = asset.sendingOrder
  222. this.orderData[3].value = asset.unNoticeOrder
  223. this.orderData[4].value = asset.finishOrder
  224. this.orderData[5].value = asset.cancelOrder
  225. // 总览数据
  226. this.totalData[0].value = asset.totalMember
  227. this.totalData[1].value = asset.totalFans
  228. this.totalData[2].value = asset.totalUser
  229. this.totalData[3].value = asset.totalIncome
  230. this.totalData[4].value = asset.totalVisit
  231. this.totalData[5].value = asset.remainSmsNum
  232. }
  233. })
  234. },
  235. // 跳转
  236. pageToFn(item) {
  237. location.href = item.url
  238. }
  239. }
  240. }
  241. </script>
  242. <style lang="scss" scoped>
  243. .app-content {
  244. padding-bottom: 10px;
  245. }
  246. // 公共
  247. .module-com {
  248. margin-bottom: 20px;
  249. // padding: 20px;
  250. background-color: #fff;
  251. // box-shadow: 0px 6px 16px #ddd;
  252. // border-radius: 10px;
  253. }
  254. // 用户信息
  255. .user-wrap {
  256. padding: 20px 40px 40px 30px;
  257. color: #fff;
  258. text-align: center;
  259. background-image: url('../../static/images/admin/bg.png');
  260. background-size: 100% 380px;
  261. background-repeat: no-repeat;
  262. .user-top {
  263. // padding-top: 20px;
  264. @include disFlex(center, space-between);
  265. }
  266. .income-amount {
  267. margin-top: 14px;
  268. margin-bottom: 40px;
  269. .price {
  270. font-size: 50px;
  271. font-weight: bold;
  272. margin-top: 4px;
  273. }
  274. }
  275. .user-bottom {
  276. @include disFlex(center, space-around);
  277. // padding-bottom: 40px;
  278. .info-list-name {
  279. color: #BFD4FF;
  280. }
  281. .info-list-value {
  282. font-size: 36px;
  283. font-weight: bold;
  284. margin-top: 4px;
  285. }
  286. }
  287. }
  288. // 消息
  289. .news-wrap {
  290. .news-list {
  291. @include disFlex(center, space-between);
  292. padding: 30px 24px 30px 30px;
  293. border-bottom: 1px solid $borderColor;
  294. font-size: 26px;
  295. color: $fontColor2;
  296. &:active {
  297. background-color: $backColor;
  298. }
  299. & > div {
  300. @include disFlex(center, flex-start);
  301. }
  302. .news-left {
  303. .iconfont {
  304. color: $mainColor;
  305. margin-right: 10px;
  306. }
  307. }
  308. .news-right {
  309. font-size: 24px;
  310. color: $mainColor;
  311. transform: scale(0.9);
  312. @include disFlex(flex-end, flex-start);
  313. .iconfont {
  314. font-size: 24px;
  315. margin-left: 10px;
  316. }
  317. }
  318. }
  319. }
  320. // 总览
  321. .total-wrap, .order-wrap {
  322. .total-tit {
  323. padding: 18px 0 18px 20px;
  324. border-bottom: 1px solid $borderColor;
  325. font-weight: 600;
  326. }
  327. .total-blo {
  328. @include disFlex(center, space-between);
  329. flex-wrap: wrap;
  330. padding: 30px 0 40px;
  331. .total-list {
  332. width: 33%;
  333. text-align: center;
  334. padding-bottom: 54px;
  335. border-right: 1px solid $borderColor;
  336. .list-num {
  337. margin-bottom: 8px;
  338. font-size: 36px;
  339. font-weight: bold;
  340. }
  341. }
  342. .total-list:nth-child(3n) {
  343. border-right: none;
  344. }
  345. .total-list:nth-child(n + 4) {
  346. padding-bottom: 0;
  347. }
  348. }
  349. }
  350. // tabs
  351. .tabs-wrap {
  352. padding: 40px 10px;
  353. @include disFlex(center, center);
  354. flex-wrap: wrap;
  355. .tabs-list {
  356. width: 25%;
  357. margin-bottom: 50px;
  358. text-align: center;
  359. .tabs-img {
  360. width: 100px;
  361. height: 100px;
  362. margin: 0 auto;
  363. img {
  364. height: 100%;
  365. }
  366. }
  367. .tabs-name {
  368. color: $fontColor2;
  369. }
  370. &:nth-child(n + 5) {
  371. margin-bottom: 0;
  372. }
  373. }
  374. }
  375. </style>