index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. <template>
  2. <view class="pagebox">
  3. <!-- #ifdef MP || APP-PLUS -->
  4. <workNavBar titleText="工作台" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack>
  5. <view class="word_header_text">
  6. <view class="text-box line1 wx-text-box">
  7. {{popupName}}
  8. </view>
  9. <view class="icon-box" v-if="merchantEmployeeList.length>1" @click="toggle('bottom')">
  10. <text class="iconfont icon-xiangxia"></text>
  11. </view>
  12. </view>
  13. </workNavBar>
  14. <!-- #endif -->
  15. <view class="headerBg">
  16. <view :style="{ height: `${getHeight.barTop}px` }"></view>
  17. <view :style="{ height: `${getHeight.barHeight}px` }"></view>
  18. <view class="inner">
  19. </view>
  20. </view>
  21. <view class="page-content">
  22. <!-- #ifdef H5 -->
  23. <view class="word_header_text">
  24. <view class="popup-box">
  25. {{popupName}}
  26. </view>
  27. <view class="icon-box" v-if="merchantEmployeeList.length>1" @click="toggle('bottom')">
  28. <text class="iconfont icon-xiangxia"></text>
  29. </view>
  30. </view>
  31. <!-- #endif -->
  32. <view class="header acea-row row-middle">
  33. <image :src="merchantSelected.avatar" class="avatar"></image>
  34. <view class="text-box">
  35. <view class="name">{{ merchantSelected.name }}</view>
  36. <view class="phone">{{ merchantSelected.phone }}</view>
  37. </view>
  38. <navigator url="/pages/admin/cancel/index" hover-class="none"
  39. v-if="selectMerchantRole.split(',').includes('5')">
  40. <text class="iconfont icon-ic_Scan"></text>
  41. </navigator>
  42. </view>
  43. <!-- 销售统计 -->
  44. <view class="today" v-if="selectMerchantRole.split(',').includes('6')">
  45. <view class="title-box">
  46. <navigator class="link" hover-class="none">
  47. 今日销售额(元)
  48. </navigator>
  49. <view class="money semiBold">{{homeData.sales?homeData.sales:0}}</view>
  50. </view>
  51. <view class="acea-row">
  52. <view class="item">
  53. <view class="num semiBold">{{homeData.yesterdaySales?homeData.yesterdaySales:0}} </view>
  54. <view class="">昨日销售额(元)</view>
  55. </view>
  56. <view class="item semiBold">
  57. <view class="num">{{ homeData.orderNum?homeData.orderNum:0 }}</view>
  58. <view class="">今日订单量</view>
  59. </view>
  60. <view class="item semiBold">
  61. <view class="num">{{ homeData.yesterdayOrderNum?homeData.yesterdayOrderNum:0 }}</view>
  62. <view class="">昨日订单量</view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 订单 -->
  67. <view class="goods acea-row" v-if="selectMerchantRole.split(',').includes('6')">
  68. <navigator url="/pages/admin/order/index?type=notShipped" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  69. <view class="img-box">
  70. <view class="img positionImg">
  71. <image class="positionImg" :src="urlDomain+'crmebimage/presets/adminImg/daifahuo.png'"
  72. mode="">
  73. </image>
  74. <view :class="operatingData.notShippingOrderNum<10?'positonsNum':'positonsNumBig'">
  75. {{operatingData.notShippingOrderNum>99?'99+':operatingData.notShippingOrderNum}}
  76. </view>
  77. </view>
  78. </view>
  79. <view class="">待发货</view>
  80. </navigator>
  81. <navigator url="/pages/admin/order/index?type=awaitVerification" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('1')">
  82. <view class="img-box">
  83. <view class="img positionImg">
  84. <image :src="urlDomain+'crmebimage/presets/adminImg/daihexiao.png'" mode=""></image>
  85. <view :class="operatingData.awaitVerificationOrderNum<10?'positonsNum':'positonsNumBig'">
  86. {{operatingData.awaitVerificationOrderNum>99?'99+':operatingData.awaitVerificationOrderNum}}
  87. </view>
  88. </view>
  89. </view>
  90. <view class="">待核销</view>
  91. </navigator>
  92. <navigator url="/pages/admin/after_sale/index?type=0" hover-class="none" class="item" v-if="selectMerchantRole.split(',').includes('2')">
  93. <view class="img-box">
  94. <view class="img positionImg">
  95. <image :src="urlDomain+'crmebimage/presets/adminImg/daishenhe.png'" mode=""></image>
  96. <view :class="operatingData.refundingOrderNum<10?'positonsNum':'positonsNumBig'">
  97. {{operatingData.refundingOrderNum>99?'99+':operatingData.refundingOrderNum}}
  98. </view>
  99. </view>
  100. </view>
  101. <view class="">审核中</view>
  102. </navigator>
  103. </view>
  104. <!-- 商品 -->
  105. <view class="product" v-if="selectMerchantRole.split(',').includes('2')">
  106. <view class="acea-row titleBottom">
  107. <image class="ddImg" :src="urlDomain+'crmebimage/presets/adminImg/ic_shangpin.png'" mode=""></image>
  108. <view class="title-box bottom-line">商品统计</view>
  109. </view>
  110. <view class="acea-row product-box">
  111. <view class="">
  112. <view class="num semiBold">{{productStatusNum?productStatusNum[0]['count']:0}}</view>
  113. <view class="special list-text">出售中</view>
  114. </view>
  115. <view class="">
  116. <view class="num semiBold">{{productStatusNum?productStatusNum[1]['count']:0}}</view>
  117. <view class="special list-text">仓库中</view>
  118. </view>
  119. <view class="">
  120. <view class="num semiBold">{{productStatusNum?productStatusNum[2]['count']:0}}</view>
  121. <view class="special list-text">已售罄</view>
  122. </view>
  123. <view class="">
  124. <view class="num semiBold">{{productStatusNum?productStatusNum[3]['count']:0}}</view>
  125. <view class="special list-text">警戒库存</view>
  126. </view>
  127. <view class="">
  128. <view class="num semiBold">{{productStatusNum?productStatusNum[7]['count']:0}}</view>
  129. <view class="special list-text">待提审</view>
  130. </view>
  131. <view class="">
  132. <view class="num semiBold">{{productStatusNum?productStatusNum[5]['count']:0}}</view>
  133. <view class="special list-text">待审核</view>
  134. </view>
  135. <view class="">
  136. <view class="num semiBold">{{productStatusNum?productStatusNum[6]['count']:0}}</view>
  137. <view class="special list-text">审核失败</view>
  138. </view>
  139. <view class="">
  140. <view class="num semiBold">{{productStatusNum?productStatusNum[4]['count']:0}}</view>
  141. <view class="special list-text">回收站</view>
  142. </view>
  143. </view>
  144. </view>
  145. <view class="manage" v-if="selectMerchantRole.split(',').includes('6')">
  146. <view class="acea-row ddImg-box titleBottom">
  147. <image class="ddImg" :src="urlDomain+'crmebimage/presets/adminImg/ic_user.png'" mode="">
  148. </image>
  149. <view class="title-box bottom-line">用户统计</view>
  150. </view>
  151. <view class="list acea-row">
  152. <view class="gz-box">
  153. <view class="num semiBold">{{homeData.followNum?homeData.followNum:0}}</view>
  154. <view class="list-text">累计关注量</view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <footerPage></footerPage>
  160. <uni-popup ref="popup" type="bottom" background-color="rgba(0,0,0,0)" border-radius="10px 10px 0 0">
  161. <view class="popup-content">
  162. <view class="item" v-for="(item,index) in merchantEmployeeList" :key="index"
  163. :class="{bottom_border:index!=merchantEmployeeList.length-1}">
  164. <view class="item_main">
  165. <image :src="item.currentMerchant.avatar" mode="" class="item_img"></image>
  166. <view class="item_name" :class="{nameColor:item.merId==merId}">{{item.currentMerchant.name}}</view>
  167. </view>
  168. <text v-if="item.merId==merId" class="iconfont icon-xuanzhong11 icon-size icon_color"></text>
  169. <text v-else class="iconfont icon-weixuan icon-size" @click="radioChange(item)"></text>
  170. </view>
  171. </view>
  172. </uni-popup>
  173. </view>
  174. </template>
  175. <script>
  176. import {
  177. mapGetters
  178. } from "vuex";
  179. import {
  180. HTTP_REQUEST_URL
  181. } from '@/config/app';
  182. import Cache from '@/utils/cache';
  183. import {
  184. getMerIndexInfoApi
  185. } from '@/api/merchant.js';
  186. import {
  187. merchantActive,
  188. statisticsIndex,
  189. statisticsOperatingData,
  190. productTabsHeaders
  191. } from '@/api/work.js';
  192. // #ifdef MP || APP-PLUS
  193. import workNavBar from '../components/workNavBar.vue';
  194. // #endif
  195. import footerPage from '../components/footerPage/index.vue';
  196. export default {
  197. components: {
  198. // #ifdef MP || APP-PLUS
  199. workNavBar,
  200. // #endif
  201. footerPage,
  202. },
  203. computed: {
  204. ...mapGetters(['merchantEmployeeList', 'selectMerId', 'selectMerchantRole']),
  205. },
  206. created() {
  207. //防止中途关闭权限
  208. this.merId = this.selectMerId
  209. this.role=this.selectMerchantRole
  210. this.selectMerchantList()
  211. },
  212. mounted() {
  213. this.toActive(this.merId)
  214. this.geiHomeData()
  215. },
  216. data() {
  217. return {
  218. urlDomain: this.$Cache.get("imgHost"),
  219. role: null,
  220. popupName: null,
  221. merId: null,
  222. merchantSelected: {},
  223. imgHost: HTTP_REQUEST_URL,
  224. // #ifdef MP || APP-PLUS
  225. iconColor: '#FFFFFF',
  226. isScrolling: false,
  227. // #endif
  228. avatar: '',
  229. getHeight: this.$util.getWXStatusHeight(),
  230. homeData: {},
  231. operatingData: {},
  232. productStatusNum: '',
  233. }
  234. },
  235. methods: {
  236. geiHomeData() {
  237. statisticsIndex().then(res => {
  238. this.homeData = res.data
  239. }).catch(err=>{})
  240. statisticsOperatingData().then(res => {
  241. this.operatingData = res.data
  242. }).catch(err=>{})
  243. productTabsHeaders().then(res => {
  244. this.productStatusNum = res.data
  245. }).catch(err=>{})
  246. },
  247. //商铺激活
  248. toActive(merId) {
  249. let that = this
  250. merchantActive(merId).then(res => {
  251. if (res.code == 200) {
  252. that.$store.commit('SET_MANAGER_TOKEN', {
  253. managerToken: res.data.token
  254. });
  255. Cache.set('electrPrintingSwitch', res.data.electrPrintingSwitch);
  256. this.geiHomeData()
  257. }
  258. })
  259. },
  260. selectMerchantList() {
  261. let arr = JSON.parse(JSON.stringify(this.merchantEmployeeList))
  262. this.merchantSelected = arr.find(value => value.merId == this.merId)
  263. this.popupName = this.merchantSelected.currentMerchant.name
  264. },
  265. toggle(type) {
  266. this.type = type
  267. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  268. this.$refs.popup.open(type)
  269. },
  270. radioChange(item) {
  271. this.popupName = item.currentMerchant.name
  272. this.merId = item.merId
  273. this.role = item.role
  274. this.$store.commit('SetSelectMerId', this.merId);
  275. this.$store.commit('SetSelectMerchantRole', this.role);
  276. this.toActive(this.merId)
  277. this.selectMerchantList()
  278. this.$refs.popup.close()
  279. this.geiHomeData()
  280. }
  281. }
  282. }
  283. </script>
  284. <style lang="scss" scoped>
  285. .pagebox {
  286. position: relative;
  287. overflow: hidden;
  288. padding-bottom: 200rpx;
  289. }
  290. .headerBg {
  291. position: absolute;
  292. top: 0;
  293. left: -25%;
  294. width: 150%;
  295. border-bottom-right-radius: 100%;
  296. border-bottom-left-radius: 100%;
  297. background: linear-gradient(270deg, #01ABF8 0%, #2A7EFB 100%);
  298. .inner {
  299. height: 356rpx;
  300. }
  301. }
  302. .page-content {
  303. position: relative;
  304. padding: 0 20rpx;
  305. .header {
  306. padding: 22rpx 20rpx 32rpx 12rpx;
  307. .avatar {
  308. width: 80rpx;
  309. height: 80rpx;
  310. border-radius: 50%;
  311. }
  312. .text-box {
  313. flex: 1;
  314. padding-left: 16rpx;
  315. color: #FFFFFF;
  316. }
  317. .name {
  318. font-weight: 500;
  319. font-size: 32rpx;
  320. line-height: 44rpx;
  321. }
  322. .phone {
  323. margin-top: 4rpx;
  324. font-size: 22rpx;
  325. line-height: 30rpx;
  326. }
  327. .iconfont {
  328. font-size: 40rpx;
  329. color: #FFFFFF;
  330. }
  331. }
  332. .today {
  333. border-radius: 24rpx;
  334. background: #FFFFFF;
  335. .title-box {
  336. padding: 40rpx 0 0 40rpx;
  337. }
  338. .link {
  339. display: inline-block;
  340. vertical-align: middle;
  341. font-size: 24rpx;
  342. line-height: 34rpx;
  343. color: #999999;
  344. }
  345. .iconfont {
  346. margin-left: 4rpx;
  347. font-size: 24rpx;
  348. }
  349. .money {
  350. margin-top: 16rpx;
  351. font-size: 56rpx;
  352. line-height: 56rpx;
  353. color: #FF7E00;
  354. }
  355. .item {
  356. flex: 1;
  357. padding: 54rpx 0 38rpx;
  358. text-align: center;
  359. font-size: 24rpx;
  360. line-height: 34rpx;
  361. color: #999999;
  362. }
  363. .num {
  364. margin-bottom: 12rpx;
  365. font-size: 36rpx;
  366. line-height: 36rpx;
  367. color: #333333;
  368. }
  369. }
  370. .goods {
  371. border-radius: 24rpx;
  372. margin-top: 20rpx;
  373. background: #FFFFFF;
  374. justify-content: space-between;
  375. .item {
  376. width: 175rpx;
  377. padding: 30rpx 0 26rpx;
  378. text-align: center;
  379. font-size: 26rpx;
  380. line-height: 36rpx;
  381. color: #333333;
  382. }
  383. .img-box {
  384. position: relative;
  385. width: 76rpx;
  386. height: 76rpx;
  387. border-radius: 50%;
  388. margin: 0 auto 12rpx;
  389. // background: #F9A833;
  390. // text-align: center;
  391. // line-height: 76rpx;
  392. }
  393. .img {
  394. width: 100%;
  395. height: 100%;
  396. // border-radius: 50%;
  397. // background: rgba(255, 255, 255, 0.8);
  398. }
  399. .num {
  400. position: absolute;
  401. top: -6rpx;
  402. left: 58rpx;
  403. z-index: 2;
  404. min-width: 24rpx;
  405. height: 24rpx;
  406. padding: 0 8rpx;
  407. border-radius: 12rpx;
  408. background: #FF7E00;
  409. font-weight: 500;
  410. font-size: 18rpx;
  411. line-height: 24rpx;
  412. color: #FFFFFF;
  413. }
  414. image {
  415. width: 100%;
  416. height: 100%;
  417. // font-size: 38rpx;
  418. // color: #FF7E00;
  419. }
  420. }
  421. .manage {
  422. padding-bottom: 41rpx;
  423. border-radius: 24rpx;
  424. margin-top: 20rpx;
  425. background: #FFFFFF;
  426. padding: 40rpx;
  427. .title-box {
  428. font-weight: 500;
  429. font-size: 30rpx;
  430. color: #333333;
  431. }
  432. .num {
  433. margin-bottom: 12rpx;
  434. font-size: 32rpx;
  435. line-height: 36rpx;
  436. color: #333333;
  437. font-weight: 600;
  438. }
  439. .list {
  440. justify-content: space-between;
  441. margin-top: 30rpx;
  442. }
  443. }
  444. .product {
  445. padding-bottom: 41rpx;
  446. border-radius: 24rpx;
  447. margin-top: 20rpx;
  448. background: #FFFFFF;
  449. padding: 40rpx;
  450. .title-box {
  451. font-weight: 500;
  452. font-size: 30rpx;
  453. color: #333333;
  454. }
  455. .num {
  456. margin-bottom: 12rpx;
  457. font-size: 32rpx;
  458. line-height: 36rpx;
  459. color: #333333;
  460. font-weight: 600;
  461. }
  462. .product-box {
  463. flex-wrap: wrap;
  464. justify-content: space-between;
  465. &>view {
  466. margin-top: 40rpx;
  467. }
  468. .special {
  469. width: 140rpx;
  470. }
  471. .num{
  472. text-align: center;
  473. }
  474. }
  475. }
  476. }
  477. .word_header_text {
  478. /* #ifdef H5 */
  479. margin-top: 20rpx;
  480. /* #endif */
  481. color: #fff;
  482. text-align: center;
  483. display: flex;
  484. align-items: center;
  485. justify-content: center;
  486. .popup-box {
  487. text-align: right;
  488. width: 180rpx;
  489. overflow: hidden;
  490. white-space: nowrap;
  491. text-overflow: ellipsis;
  492. }
  493. .icon-xiangxia {
  494. font-size: 18rpx;
  495. }
  496. }
  497. .popup-content {
  498. border-radius: 16rpx 16rpx 0px 0px;
  499. .bottom_border {
  500. border-bottom: 1px solid #F5F5F5;
  501. }
  502. .item {
  503. display: flex;
  504. align-items: center;
  505. justify-content: space-between;
  506. padding: 20rpx;
  507. .icon_color {
  508. color: #2A7EFB;
  509. }
  510. .item_main {
  511. display: flex;
  512. align-items: center;
  513. .item_name {
  514. margin-left: 20rpx;
  515. font-weight: 500;
  516. font-size: 28rpx;
  517. }
  518. }
  519. .item_img {
  520. width: 60rpx;
  521. height: 60rpx;
  522. border-radius: 60rpx;
  523. }
  524. }
  525. }
  526. .icon-box {
  527. width: 30rpx;
  528. height: 30rpx;
  529. background: rgba(255, 255, 255, 0.3);
  530. border-radius: 15rpx;
  531. line-height: 20rpx;
  532. text-align: center;
  533. margin-right: 20rpx;
  534. margin-left: 10rpx;
  535. .icon-xiangxia {
  536. font-size: 12rpx;
  537. }
  538. }
  539. .ddImg {
  540. width: 36rpx;
  541. height: 36rpx;
  542. margin-right: 12rpx;
  543. margin-top: 2rpx;
  544. }
  545. .positionImg {
  546. position: relative;
  547. .positonsNum {
  548. position: absolute;
  549. right: -5rpx;
  550. top: 0;
  551. background: #FF7E00;
  552. border-radius: 40rpx;
  553. color: #fff;
  554. font-size: 18rpx;
  555. width: 24rpx;
  556. height: 24rpx;
  557. text-align: center;
  558. line-height: 24rpx;
  559. }
  560. .positonsNumBig{
  561. position: absolute;
  562. left: 50rpx;
  563. top: 0;
  564. background: #FF7E00;
  565. border-radius: 40rpx;
  566. color: #fff;
  567. font-size: 18rpx;
  568. // width: 34rpx;
  569. height: 24rpx;
  570. text-align: center;
  571. line-height: 24rpx;
  572. padding: 0 6rpx;
  573. }
  574. }
  575. .list-text {
  576. font-size: 24rpx;
  577. color: #999999;
  578. text-align: center;
  579. }
  580. .gz-box {
  581. // width: 100%;
  582. text-align: center;
  583. }
  584. .titleBottom{
  585. vertical-align: top;
  586. padding-bottom: 24rpx;
  587. border-bottom: 2rpx solid #f5f5f5;
  588. }
  589. .icon-size{
  590. width: 40rpx;
  591. height: 40rpx;
  592. }
  593. .nameColor{
  594. color: #2A7EFB;
  595. }
  596. .wx-text-box{
  597. max-width: 240rpx;
  598. }
  599. </style>