index.vue 18 KB

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