workbench.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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="pageTo('/admin/setting/password')">
  8. <app-avatar-module :src="avatarImg | default_avatar" :width="80" />
  9. </div>
  10. </div>
  11. <div class="income-amount" @click="pageTo('/admin/assets/list')">
  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" @click="pageTo(item)">
  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="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. <!-- 续费遮罩层 -->
  73. <modal-module :show="renewMask" :custom="true" :maskClosable="false" padding="30rpx 30rpx">
  74. <template>
  75. <div class="renew-wrap">
  76. <div class="renew-wrap-text">你的账号已到期</div>
  77. <!-- <button class="admin-button-com middle" @click="pageTo('/admin/renew/index')">立即续费</button> -->
  78. <button class="admin-button-com middle" @click="renewFn()">立即续费</button>
  79. </div>
  80. </template>
  81. </modal-module>
  82. </div>
  83. </template>
  84. <script>
  85. import { mapGetters, mapState } from 'vuex'
  86. import FabModule from '@/components/plugin/fab'
  87. import AppAvatarModule from '@/components/module/app-avatar'
  88. import ModalModule from '@/components/plugin/modal'
  89. import { getDataTimestamp } from '@/utils/common'
  90. // api
  91. import { getUser } from '@/utils/auth'
  92. import { consoleIndex } from '@/api/workbench'
  93. export default {
  94. name: 'admin-workbench',
  95. components: {
  96. ModalModule,
  97. FabModule,
  98. AppAvatarModule
  99. },
  100. data() {
  101. return {
  102. constant: this.$constant,
  103. // 遮罩层
  104. renewMask: false,
  105. data: {
  106. admin: {},
  107. asset: {},
  108. notice: {},
  109. todayData: {}
  110. },
  111. // 订单总览
  112. orderData: [
  113. {
  114. name: '待付款',
  115. value: 0,
  116. url: '/admin/home/order',
  117. type: 4,
  118. query: {
  119. tabIndex: 1
  120. }
  121. },
  122. {
  123. name: '待配送',
  124. value: 0,
  125. url: '/admin/home/order',
  126. type: 4,
  127. query: {
  128. tabIndex: 2
  129. }
  130. },
  131. {
  132. name: '配送中',
  133. value: 0,
  134. url: '/admin/home/order',
  135. type: 4,
  136. query: {
  137. tabIndex: 3
  138. }
  139. },
  140. {
  141. name: '待通知',
  142. value: 0
  143. },
  144. {
  145. name: '已完结',
  146. url: '/admin/home/order',
  147. type: 4,
  148. query: {
  149. tabIndex: 4
  150. },
  151. value: 0
  152. },
  153. {
  154. name: '全部',
  155. url: '/admin/home/order',
  156. type: 4,
  157. query: {
  158. tabIndex: 0
  159. },
  160. value: 0
  161. }
  162. ],
  163. // tab按钮
  164. tabsData: [
  165. {
  166. name: '商品管理',
  167. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-1.png`,
  168. url: '/admin/goodsManage/list'
  169. },
  170. {
  171. name: '邀请有礼',
  172. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-2.png`,
  173. url: '/admin/interest/invite'
  174. },
  175. {
  176. name: '图库管理',
  177. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-1.png`,
  178. url: '/admin/goodsManage/img-store'
  179. },
  180. {
  181. name: '优惠券',
  182. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-3.png`,
  183. url: '/admin/coupon/list'
  184. },
  185. {
  186. name: '广告管理',
  187. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-4.png`,
  188. url: '/admin/ad/list'
  189. },
  190. {
  191. name: '数据统计',
  192. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-5.png`,
  193. url: '/admin/statistics/index'
  194. },
  195. {
  196. name: '员工管理',
  197. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-6.png`,
  198. url: '/admin/staff/list'
  199. },
  200. {
  201. name: '我的代理',
  202. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-7.png`,
  203. url: '/admin/interest/my-invite'
  204. },
  205. {
  206. name: '设置',
  207. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-8.png`,
  208. url: '/admin/setting/list'
  209. }
  210. ],
  211. // 总览
  212. totalData: [
  213. {
  214. name: '客户数',
  215. value: 0
  216. },
  217. {
  218. name: '粉丝数',
  219. value: 0
  220. },
  221. {
  222. name: '会员数',
  223. value: 0
  224. },
  225. {
  226. name: '总收入(元)',
  227. value: 0
  228. },
  229. {
  230. name: '总访问量',
  231. value: 0
  232. },
  233. {
  234. name: '剩余短信',
  235. value: 0
  236. }
  237. ]
  238. }
  239. },
  240. computed: {
  241. ...mapGetters({ userInfo: 'getUser' }),
  242. avatarImg() {
  243. return this.$util.isEmpty(this.userInfo) ? '' : this.userInfo.logoUrl
  244. }
  245. },
  246. onLoad(option) {
  247. // if (this.$util.getCheckLogin()) return
  248. // this.init()
  249. },
  250. methods: {
  251. init() {
  252. getUser().then(res => {
  253. let nowTime = getDataTimestamp(new Date(), true)
  254. if (nowTime > res.setDeadline) {
  255. this.renewMask = true
  256. }
  257. })
  258. consoleIndex().then(res => {
  259. this.data = res.data
  260. const { asset } = res.data
  261. if (!this.$util.isEmpty(asset)) {
  262. // 订单总览
  263. this.orderData[0].value = asset.unPayOrder
  264. this.orderData[1].value = asset.unSendOrder
  265. this.orderData[2].value = asset.sendingOrder
  266. this.orderData[3].value = asset.unNoticeOrder
  267. this.orderData[4].value = asset.finishOrder
  268. this.orderData[5].value = asset.totalOrder
  269. // 总览数据
  270. this.totalData[0].value = asset.totalMember
  271. this.totalData[1].value = asset.totalFans
  272. this.totalData[2].value = asset.totalUser
  273. this.totalData[3].value = asset.totalIncome
  274. this.totalData[4].value = asset.totalVisit
  275. this.totalData[5].value = asset.remainSmsNum
  276. }
  277. })
  278. },
  279. // 跳转
  280. pageToFn(item) {
  281. // #ifdef H5
  282. location.href = item.url
  283. // #endif
  284. // #ifndef H5
  285. // #endif
  286. },
  287. // 续费
  288. renewFn() {
  289. location.href = `${window.location.protocol}//www.${this.$constant.firstHost}.com/#/?payMerchantId=${this.userInfo.extend.merchantId}&pay=1`
  290. }
  291. }
  292. }
  293. </script>
  294. <style lang="scss" scoped>
  295. .app-content {
  296. padding-bottom: 10px;
  297. }
  298. // 公共
  299. .module-com {
  300. margin-bottom: 20px;
  301. // padding: 20px;
  302. background-color: #fff;
  303. // box-shadow: 0px 6px 16px #ddd;
  304. // border-radius: 10px;
  305. }
  306. // 用户信息
  307. .user-wrap {
  308. padding: 20px 40px 40px 30px;
  309. color: #fff;
  310. text-align: center;
  311. background-image: url('../../static/images/admin/bg.png');
  312. background-size: 100% 380px;
  313. background-repeat: no-repeat;
  314. .user-top {
  315. // padding-top: 20px;
  316. @include disFlex(center, space-between);
  317. }
  318. .income-amount {
  319. margin-top: 14px;
  320. margin-bottom: 40px;
  321. .price {
  322. font-size: 50px;
  323. font-weight: bold;
  324. margin-top: 4px;
  325. }
  326. }
  327. .user-bottom {
  328. @include disFlex(center, space-around);
  329. // padding-bottom: 40px;
  330. .info-list-name {
  331. color: #bfd4ff;
  332. }
  333. .info-list-value {
  334. font-size: 36px;
  335. font-weight: bold;
  336. margin-top: 4px;
  337. }
  338. }
  339. }
  340. // 消息
  341. .news-wrap {
  342. .news-list {
  343. @include disFlex(center, space-between);
  344. padding: 30px 24px 30px 30px;
  345. border-bottom: 1px solid $borderColor;
  346. font-size: 26px;
  347. color: $fontColor2;
  348. &:active {
  349. background-color: $backColor;
  350. }
  351. & > div {
  352. @include disFlex(center, flex-start);
  353. }
  354. .news-left {
  355. .iconfont {
  356. color: $mainColor;
  357. margin-right: 10px;
  358. }
  359. }
  360. .news-right {
  361. font-size: 24px;
  362. color: $mainColor;
  363. transform: scale(0.9);
  364. @include disFlex(flex-end, flex-start);
  365. .iconfont {
  366. font-size: 24px;
  367. margin-left: 10px;
  368. }
  369. }
  370. }
  371. }
  372. // 总览
  373. .total-wrap,
  374. .order-wrap {
  375. .total-tit {
  376. padding: 18px 0 18px 20px;
  377. border-bottom: 1px solid $borderColor;
  378. font-weight: 600;
  379. }
  380. .total-blo {
  381. @include disFlex(center, space-between);
  382. flex-wrap: wrap;
  383. padding: 30px 0 40px;
  384. .total-list {
  385. width: 33%;
  386. text-align: center;
  387. padding-bottom: 54px;
  388. border-right: 1px solid $borderColor;
  389. .list-num {
  390. margin-bottom: 8px;
  391. font-size: 36px;
  392. font-weight: bold;
  393. }
  394. }
  395. .total-list:nth-child(3n) {
  396. border-right: none;
  397. }
  398. .total-list:nth-child(n + 4) {
  399. padding-bottom: 0;
  400. }
  401. }
  402. }
  403. // tabs
  404. .tabs-wrap {
  405. padding: 40px 10px;
  406. @include disFlex(center, flex-start);
  407. flex-wrap: wrap;
  408. .tabs-list {
  409. width: 25%;
  410. margin-top: 50px;
  411. text-align: center;
  412. .tabs-img {
  413. width: 100px;
  414. height: 100px;
  415. margin: 0 auto;
  416. img {
  417. height: 100%;
  418. }
  419. }
  420. .tabs-name {
  421. color: $fontColor2;
  422. }
  423. &:nth-child(-n + 4) {
  424. margin-top: 0;
  425. }
  426. }
  427. }
  428. // 遮罩层
  429. .renew-wrap {
  430. text-align: center;
  431. .renew-wrap-text {
  432. margin-top: 30px;
  433. margin-bottom: 60px;
  434. font-size: 34px;
  435. }
  436. }
  437. </style>