workbench.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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-6.png`,
  203. url: '/admin/shop/list'
  204. },
  205. {
  206. name: '开店邀请',
  207. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-7.png`,
  208. url: '/admin/interest/my-invite'
  209. },
  210. {
  211. name: '设置',
  212. img: `${this.$constant.imgUrl}/retail/admin/tab-icon-8.png`,
  213. url: '/admin/setting/list'
  214. }
  215. ],
  216. // 总览
  217. totalData: [
  218. {
  219. name: '客户数',
  220. value: 0
  221. },
  222. {
  223. name: '粉丝数',
  224. value: 0
  225. },
  226. {
  227. name: '会员数',
  228. value: 0
  229. },
  230. {
  231. name: '总收入(元)',
  232. value: 0
  233. },
  234. {
  235. name: '总访问量',
  236. value: 0
  237. },
  238. {
  239. name: '剩余短信',
  240. value: 0
  241. }
  242. ]
  243. }
  244. },
  245. computed: {
  246. ...mapGetters({ userInfo: 'getUser' }),
  247. avatarImg() {
  248. return this.$util.isEmpty(this.userInfo) ? '' : this.userInfo.logoUrl
  249. }
  250. },
  251. onLoad(option) {
  252. // if (this.$util.getCheckLogin()) return
  253. // this.init()
  254. },
  255. methods: {
  256. init() {
  257. getUser().then(res => {
  258. let nowTime = getDataTimestamp(new Date(), true)
  259. if (nowTime > res.setDeadline) {
  260. this.renewMask = true
  261. }
  262. })
  263. consoleIndex().then(res => {
  264. this.data = res.data
  265. const { asset } = res.data
  266. if (!this.$util.isEmpty(asset)) {
  267. // 订单总览
  268. this.orderData[0].value = asset.unPayOrder
  269. this.orderData[1].value = asset.unSendOrder
  270. this.orderData[2].value = asset.sendingOrder
  271. this.orderData[3].value = asset.unNoticeOrder
  272. this.orderData[4].value = asset.finishOrder
  273. this.orderData[5].value = asset.totalOrder
  274. // 总览数据
  275. this.totalData[0].value = asset.totalMember
  276. this.totalData[1].value = asset.totalFans
  277. this.totalData[2].value = asset.totalUser
  278. this.totalData[3].value = asset.totalIncome
  279. this.totalData[4].value = asset.totalVisit
  280. this.totalData[5].value = asset.remainSmsNum
  281. }
  282. })
  283. },
  284. // 跳转
  285. pageToFn(item) {
  286. // #ifdef H5
  287. location.href = item.url
  288. // #endif
  289. // #ifndef H5
  290. // #endif
  291. },
  292. // 续费
  293. renewFn() {
  294. // #ifdef H5
  295. location.href = `${window.location.protocol}//www.${this.$constant.firstHost}.com/#/?merchantId=${this.userInfo.extend.merchantId}&pay=1`
  296. // #endif
  297. }
  298. }
  299. }
  300. </script>
  301. <style lang="scss" scoped>
  302. .app-content {
  303. padding-bottom: 10px;
  304. }
  305. // 公共
  306. .module-com {
  307. margin-bottom: 20px;
  308. // padding: 20px;
  309. background-color: #fff;
  310. // box-shadow: 0px 6px 16px #ddd;
  311. // border-radius: 10px;
  312. }
  313. // 用户信息
  314. .user-wrap {
  315. padding: 20px 40px 40px 30px;
  316. color: #fff;
  317. text-align: center;
  318. background-image: url('../../static/images/admin/bg.png');
  319. background-size: 100% 380px;
  320. background-repeat: no-repeat;
  321. .user-top {
  322. // padding-top: 20px;
  323. @include disFlex(center, space-between);
  324. }
  325. .income-amount {
  326. margin-top: 14px;
  327. margin-bottom: 40px;
  328. .price {
  329. font-size: 50px;
  330. font-weight: bold;
  331. margin-top: 4px;
  332. }
  333. }
  334. .user-bottom {
  335. @include disFlex(center, space-around);
  336. // padding-bottom: 40px;
  337. .info-list-name {
  338. color: #bfd4ff;
  339. }
  340. .info-list-value {
  341. font-size: 36px;
  342. font-weight: bold;
  343. margin-top: 4px;
  344. }
  345. }
  346. }
  347. // 消息
  348. .news-wrap {
  349. .news-list {
  350. @include disFlex(center, space-between);
  351. padding: 30px 24px 30px 30px;
  352. border-bottom: 1px solid $borderColor;
  353. font-size: 26px;
  354. color: $fontColor2;
  355. &:active {
  356. background-color: $backColor;
  357. }
  358. & > div {
  359. @include disFlex(center, flex-start);
  360. }
  361. .news-left {
  362. .iconfont {
  363. color: $mainColor;
  364. margin-right: 10px;
  365. }
  366. }
  367. .news-right {
  368. font-size: 24px;
  369. color: $mainColor;
  370. transform: scale(0.9);
  371. @include disFlex(flex-end, flex-start);
  372. .iconfont {
  373. font-size: 24px;
  374. margin-left: 10px;
  375. }
  376. }
  377. }
  378. }
  379. // 总览
  380. .total-wrap,
  381. .order-wrap {
  382. .total-tit {
  383. padding: 18px 0 18px 20px;
  384. border-bottom: 1px solid $borderColor;
  385. font-weight: 600;
  386. }
  387. .total-blo {
  388. @include disFlex(center, space-between);
  389. flex-wrap: wrap;
  390. padding: 30px 0 40px;
  391. .total-list {
  392. width: 33%;
  393. text-align: center;
  394. padding-bottom: 54px;
  395. border-right: 1px solid $borderColor;
  396. .list-num {
  397. margin-bottom: 8px;
  398. font-size: 36px;
  399. font-weight: bold;
  400. }
  401. }
  402. .total-list:nth-child(3n) {
  403. border-right: none;
  404. }
  405. .total-list:nth-child(n + 4) {
  406. padding-bottom: 0;
  407. }
  408. }
  409. }
  410. // tabs
  411. .tabs-wrap {
  412. padding: 40px 10px;
  413. @include disFlex(center, flex-start);
  414. flex-wrap: wrap;
  415. .tabs-list {
  416. width: 25%;
  417. margin-top: 50px;
  418. text-align: center;
  419. .tabs-img {
  420. width: 100px;
  421. height: 100px;
  422. margin: 0 auto;
  423. img {
  424. height: 100%;
  425. }
  426. }
  427. .tabs-name {
  428. color: $fontColor2;
  429. }
  430. &:nth-child(-n + 4) {
  431. margin-top: 0;
  432. }
  433. }
  434. }
  435. // 遮罩层
  436. .renew-wrap {
  437. text-align: center;
  438. .renew-wrap-text {
  439. margin-top: 30px;
  440. margin-bottom: 60px;
  441. font-size: 34px;
  442. }
  443. }
  444. </style>